Re: [PATCH v3 3/7] iio: adc: add RZ/T2H / RZ/N2H ADC driver
From: Jonathan Cameron
Date: Sat Oct 04 2025 - 09:30:52 EST
> > --- /dev/null
> > +++ b/drivers/iio/adc/rzt2h_adc.c
> > @@ -0,0 +1,309 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +
> > +#include <linux/bitfield.h>
> > +#include <linux/cleanup.h>
> > +#include <linux/completion.h>
> > +#include <linux/delay.h>
> > +#include <linux/iio/adc-helpers.h>
> > +#include <linux/iio/iio.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/io.h>
> > +#include <linux/iopoll.h>
> > +#include <linux/mod_devicetable.h>
> > +#include <linux/module.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/pm_runtime.h>
> > +#include <linux/property.h>
> > +
> > +#define RZT2H_NAME "rzt2h-adc"
> > +
> > +#define RZT2H_ADCSR_REG 0x00
>
> I would drop the "_REG"-suffix from register definitions...
>
> > +#define RZT2H_ADCSR_ADIE_MASK BIT(12)
>
> ... and the "_MASK"-suffix from single-bit definitions. But this is
> my personal preference/taste. Perhaps IIO uses a different convention?
Problem with dropping _REG is we regularly see registers with complex
multi part names and it can be come confusing at point of use wrt to
whether a given define is a register address, or field.
I don't mind dropping MASK for single bits though as there inherently can't
be confusion between those and field values as the 'mask' defines the value
as well.
Jonathan
>
> > +#define RZT2H_ADCSR_ADCS_MASK GENMASK(14, 13)
> > +#define RZT2H_ADCSR_ADCS_SINGLE 0b00
> > +#define RZT2H_ADCSR_ADST_MASK BIT(15)
>
> Gr{oetje,eeting}s,
>
> Geert
>