Re: [PATCH v2 6/6] iio: imu: bmi270: Add scale and sampling frequency to BMI270 IMU

From: Justin Weiss
Date: Sat Oct 19 2024 - 16:52:59 EST


Jonathan Cameron <jic23@xxxxxxxxxx> writes:

> On Fri, 18 Oct 2024 16:36:12 -0700
> Justin Weiss <justin@xxxxxxxxxxxxxxx> wrote:
>
>> Add read and write functions and create _available entries.
>>
>> Signed-off-by: Justin Weiss <justin@xxxxxxxxxxxxxxx>
> Hi Justin,
>
> Just one trivial comment from me.
>
> Jonathan
>
>
>
>> +
>> +static int bmi270_write_raw(struct iio_dev *indio_dev,
>> + struct iio_chan_spec const *chan,
>> + int val, int val2, long mask)
>> +{
>> + struct bmi270_data *data = iio_priv(indio_dev);
>> +
>> + switch (mask) {
>> + case IIO_CHAN_INFO_SCALE:
>> + return bmi270_set_scale(data, chan->type, val2);
>> + case IIO_CHAN_INFO_SAMP_FREQ:
>> + return bmi270_set_odr(data, chan->type, val, val2);
>> + default:
>> + return -EINVAL;
>> + }
>> +
> Unreachable code, so drop this return.

Will remove in v3.

Justin

>> + return 0;
>> +}
>>