lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Nov 2022 10:04:41 +0100
From:   Gerald Loacker <gerald.loacker@...fvision.net>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Jakob Hauser <jahau@...ketmail.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Nikita Yushchenko <nikita.yoush@...entembedded.com>,
        Michael Riesch <michael.riesch@...fvision.net>
Subject: Re: [PATCH v4 3/3] iio: magnetometer: add ti tmag5273 driver



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ