[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a83c2a6d-655a-45c1-87fd-a233fabbea82@gmail.com>
Date: Mon, 30 Dec 2024 14:13:39 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>,
Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 4/4] iio: veml3235: fix scale to conform to ABI
On 30/12/2024 12:01, Javier Carrasco wrote:
> On Sun Dec 29, 2024 at 7:53 AM CET, Matti Vaittinen wrote:
>> On 24/12/2024 12:59, Javier Carrasco wrote:
>>> The current scale is not ABI-compliant as it is just the sensor gain
>>> instead of the value that acts as a multiplier to be applied to the raw
>>> value (there is no offset).
>>>
>>> Use the iio-gts helpers to obtain the proper scale values according to
>>> the gain and integration time to match the resolution tables from the
>>> datasheet. When at it, use 'scale' instead of 'gain' consistently for
>>> the get/set functions to avoid misunderstandings.
>>>
>>> Fixes: c5a23f80c164 ("iio: light: add support for veml3235")
>>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
>>> ---
>>
>> This looks good to me, although I now think we made a mistake with the
>> naming of the iio_gts_find_gain_sel_in_times().
>>
>> The intended use is finding the gain and time (selector) for the new
>> scale (while preferring keeping the time unchanged if possible), right?
>>
>> So, in this regard it'd be better to use name which reflects the fact
>> that the function finds gain and time for given scale.
>>
>> I would now (after having to look the doc of this new function while
>> reviewing the code 2 weeks after reviewing this new function :rolleyes:)
>> name it something like:
>>
>> iio_gts_find_gain_time_sel_for_scale()
>>
>> Well, it's not really in the scope of the review anymore, but I'd love
>> to see a renaming patch while we have only one user... :)
>>
>> Anyways:
>>
>> Reviewed-by: Matti Vaittinen <mazziesaccount@...il.com>
>>
> Thank you for your suggestion, I will add it to v3 as this patch and the
> one that introduced the helper functions have not been applied yet, so
> we don't need an extra patch to rename the function.
Great, Thanks!
> I will add your
> tag too because I will only change what you suggested.
Sure!
Yours,
-- Matti
Powered by blists - more mailing lists