lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 3/3] iio: magnetometer: add ti tmag5273 driver
From


Am 29.11.2022 um 17:37 schrieb Andy Shevchenko:
> On Tue, Nov 29, 2022 at 07:45:40AM +0100, Gerald Loacker wrote:
>> Add support for TI TMAG5273 Low-Power Linear 3D Hall-Effect Sensor.
>> Additionally to temperature and magnetic X, Y and Z-axes the angle and
>> magnitude are reported.
>> The sensor is operating in continuous measurement mode and changes to sleep
>> mode if not used for 5 seconds.
>
> ...
>
>> + snprintf(data->name, sizeof(data->name), "tmag5273x%1u", data->version);
>
> Thinking more about this format, perhaps
>
> snprintf(data->name, sizeof(data->name), "tmag5273x-v%1u", data->version);
>
> ?

I'd prefer to keep this as it's related to the orderable part number,
e.g. TMAG5273A1 / TMAG5273A2.

>
> ...
>
>> +static int tmag5273_runtime_resume(struct device *dev)
>> +{
>> + struct iio_dev *indio_dev = dev_get_drvdata(dev);
>> + struct tmag5273_data *data = iio_priv(indio_dev);
>> + int ret;
>
>> + /*
>> + * Time to go to stand-by mode from sleep mode is 50us
>> + * typically. During this time no I2C access is possible.
>> + */
>
> Shouldn't be this comment closer to usleep_range()?
>

Ok, I'll clarify this and also introduce a wake-up function, as this is
used two times in a similar way.

>> + tmag5273_set_operating_mode(data, TMAG5273_OP_MODE_CONT);
>> + usleep_range(80, 200);
>> + ret = tmag5273_set_operating_mode(data, TMAG5273_OP_MODE_CONT);
>> + if (ret)
>> + dev_err(dev, "failed to power on device (%pe)\n", ERR_PTR(ret));
>> +
>> + return ret;
>> +}

Regards,
Gerald

\
 
 \ /
  Last update: 2022-11-30 10:06    [W:0.065 / U:1.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site