Re: [PATCH v2 3/8] iio: adc: stm32-adc: add stm32mp13 support

From: Andy Shevchenko
Date: Wed Oct 05 2022 - 10:57:00 EST


On Wed, Oct 5, 2022 at 4:36 PM Olivier Moysan
<olivier.moysan@xxxxxxxxxxx> wrote:
>
> Add STM32 ADC support for STM32MP13x SOCs family.
>
> On STM32MP13x, each ADC peripheral has a single ADC block.
> These ADC peripherals, ADC1 and ADC2, are fully independent.
> This introduces changes in common registers handling.
>
> Some features such as boost mode, channel preselection and
> linear calibration are not supported by the STM32MP13x ADC.
> Add diversity management for these features.
>
> The STM32MP13x ADC introduces registers and bitfield variants
> on existing features such as calibration factors and internal
> channels. Add register diversity management.
>
> Add also support of new internal channels VDDCPU and VDDQ_DDR.

for new

I have a déjà-vu that I have pointed out all these...

...

> struct stm32_adc *adc = iio_priv(indio_dev);
> int ret;
> - u32 val;
> + u32 val, msk = STM32H7_ADCALDIF;

It's better to split and reorder like

struct stm32_adc *adc = iio_priv(indio_dev);
u32 msk = STM32H7_ADCALDIF;
u32 val;
int ret;

...

> static const struct of_device_id stm32_adc_of_match[] = {
> { .compatible = "st,stm32f4-adc", .data = (void *)&stm32f4_adc_cfg },
> { .compatible = "st,stm32h7-adc", .data = (void *)&stm32h7_adc_cfg },
> { .compatible = "st,stm32mp1-adc", .data = (void *)&stm32mp1_adc_cfg },

> + { .compatible = "st,stm32mp13-adc",
> + .data = (void *)&stm32mp13_adc_cfg },

For the sake of consistent style I would put this on a single line.

> {},
> };


--
With Best Regards,
Andy Shevchenko