Re: [PATCH v3 2/2] iio: dac: dac8163: Add driver for DAC8163

From: Jonathan Cameron

Date: Tue Aug 04 2026 - 19:46:44 EST


On Mon, 03 Aug 2026 08:28:51 +0000
"Siratul Islam" <siratul.islam@xxxxxxxxx> wrote:

> August 2, 2026 at 11:19 PM, "David Lechner" <dlechner@xxxxxxxxxxxx> wrote:
>
>
> >
> > On 8/2/26 11:07 AM, Lukas Metz wrote:
> ...
> > > +#define LDAC_CHANNEL_A_MASK BIT(0)
> > > +#define LDAC_CHANNEL_B_MASK BIT(1)
> > > +#define VREF_MASK BIT(0)
> > > +
> > > +#define DAC8163_INTERNAL_REF_mV 2500
> > > +#define DAC8163_RES_12_BIT 12
> > > +#define DAC8163_RES_14_BIT 14
> > > +#define DAC8163_RES_16_BIT 16
> > >
> > Macros that just map to a number that is part of the macro name
> > aren't that helpful. We can just use the number directly.
> >
> Each of them repeats 4 times. I think typing a number that many times
> is more error prone than having a macro.

These only go into DAC8163_CHAN() as the resolution.
Sure we might end up with 13 due to a typo, but on same
basis the channel numbers might end up as 42 rather than 2
but we don't define a macro for those.

So I agree with David; use the numbers.

Thanks,

Jonathan


> > >
> > >
> >
>
> --
> Best regards,
> Sirat
>