Re: [PATCH v5 12/14] iio: magnetometer: yas530: Add temperature calculation to "chip_info"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On 08.08.22 13:36, Andy Shevchenko wrote:
> On Mon, Aug 8, 2022 at 1:07 AM Jakob Hauser <jahau@xxxxxxxxxxxxxx> wrote:
>>
>> Add temperature calculation to the "chip_info" structure to ease the handling
>> of different YAS variants.
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

...

Due to C11 standard 6.6.7 considering array calls not as constant
expression (discussion on patch 9), the temperature values need to be
moved directly into the chip_info table as well.

I would move the comments in a reduced way into the kernel doc. It would
look like this:

/**
 * struct yas5xx_chip_info - device-specific data and function pointers
   ...
 * @t_ref: number of counts at reference temperature 20 °C
 * @min_temp_x10: starting point of temperature counting in 1/10:s
 * degrees Celsius
   ...
 *
 * The "t_ref" value for YAS532/533 is known from the Android driver.
 * For YAS530 it was approximately measured.
 *
 * The temperatures "min_temp_x10" are derived from the temperature
 * resolutions given in the data sheets.
 */
struct yas5xx_chip_info {
        ...
        u16 t_ref;
        s16 min_temp_x10;
        ...
};

static const struct yas5xx_chip_info yas5xx_chip_info_tbl[] = {
        [yas530] = {
                ...
                .t_ref = 182, /* counts */
                .min_temp_x10 = -620, /* 1/10:s degrees Celsius */
                ...
        },
        [yas532] = {
                ...
                .t_ref = 390, /* counts */
                .min_temp_x10 = -500, /* 1/10:s degrees Celsius */
                ...
        },
        [yas533] = {
                ...
                .t_ref = 390, /* counts */
                .min_temp_x10 = -500, /* 1/10:s degrees Celsius */
                ...
        },
};

As this is quite some change on that patch, I'd skip your "Reviewed-by:"
tag and you would need to review it again in v6.

Kind regards,
Jakob




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux