Re: [PATCH v2 2/2] iio: dac: dac8163: Add driver for DAC8163
From: Jonathan Cameron
Date: Sun Jul 26 2026 - 20:52:38 EST
On Mon, 27 Jul 2026 00:52:23 +0600
Siratul Islam <siratul.islam@xxxxxxxxx> wrote:
> On July 27, 2026 12:46:23 AM GMT+06:00, Lukas <lukas.metz@xxxxxxx> wrote:
> >On Sun, Jul 26, 2026 at 07:18:33PM +0100, Jonathan Cameron wrote:
> >>
> >> As this has come up, I'd favour just having two static const regmap_config structures
> >> and picking between them. Obviously I haven't checked but I'd guess that any
> >> overhead of extra text data for those is not that different to the extra code of the current
> >> approach. Generally if you can make this sort of thing data rather than code it
> >> is a net gain.
> >>
> >> Jonathan
> >
> >I actually misspoke before. Since all dacxxx3 devices have different
> >default values (mid-scale varies for different resolutions), 4
> >different reg_defaults are needed to cover all the devices. I could
> >define 4 static const regmap_configs and pick between them or go with
> >Siratul Islams approach.
> >
> >Best regards
> >
> >Lukas
>
> If you need 4 of them then it's a bit too much I think. I don't know if it would be acceptable duplication at that point.
It's still not massive. They are sub 400 bytes each. At this level I'll leave
decision to the author on what is reasonable.
If it were me I'd still go for picking between static const structure instances
when there are 4. Gets more dubious when there are 20+!
Jonathan
>
> --
> Best regards,
> Sirat
>
>