[PATCH 04/15] iio: adc: at91-sama5d2_adc: update calibration index, validation condition
Andy Shevchenko
andy.shevchenko at gmail.com
Mon Aug 4 06:11:31 PDT 2025
On Mon, Aug 4, 2025 at 12:03 PM Varshini Rajendran
<varshini.rajendran at microchip.com> wrote:
>
> Add additional condition for validating the calibration data read from
> the OTP through nvmem device interface. Adjust the calibration indexes
> of sama7g5 according to the buffer received from the OTP memory.
> +/*
> + * The calibration data has a TAG to recognize the packet
> + * The tag has a constant value "ACST" with the ASCII
> + * equivalent 0x41435354. This is used to validate the
> + * calibration data obtained from the OTP.
> + */
> +#define AT91_TEMP_CALIB_TAG 0x41435354
Just add the ASCII representation into the definition name.
For example,
AT91_TAG_ACST
or
AT91_CALIB_TAG_ACST
or choose the better one, but with an ACST token in it.
...
> enum at91_adc_ts_clb_idx {
> - AT91_ADC_TS_CLB_IDX_P1 = 2,
> - AT91_ADC_TS_CLB_IDX_P4 = 5,
> - AT91_ADC_TS_CLB_IDX_P6 = 7,
> - AT91_ADC_TS_CLB_IDX_MAX = 19,
> + AT91_ADC_TS_CLB_IDX_P1 = 1,
> + AT91_ADC_TS_CLB_IDX_P4 = 4,
> + AT91_ADC_TS_CLB_IDX_P6 = 6,
> + AT91_ADC_TS_CLB_IDX_MAX = 18,
This MAX naming with the trailing comma is odd. Either remove MAX, or
remove trailing comma, or explain why moving from 19 to 18 has no side
effects here.
> };
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list