Re: [PATCH v2 1/5] iio: pressure: bmp280: Add enumeration to handle chip variants

From: Angel Iglesias
Date: Sun Jan 01 2023 - 06:04:50 EST


On Tue, 2022-12-27 at 23:37 +0200, Andy Shevchenko wrote:
> On Mon, Dec 26, 2022 at 03:29:20PM +0100, Angel Iglesias wrote:
> > Adds enumeration to improve handling the different supported sensors
> > on driver initialization. This avoid collisions if different variants
> > share the same device idetifier on ID register.
>
> As per v1, use pointers in the ID tables.
>

Taking your suggestion and Jonathan's remarks into account seems to me like the
best approach here is using chip_info pointer for each driver as the pointer set
on the id tables. As in the i2c and spi drivers, the enum is used to fetch the
correct regmap configuration, and later in the shared probe, the chip_info. The
logical follow-up would be adding the regmap configuration to the chip_info,
right?
Or is there a better solution I'm not seeing right now?

Thanks for your time,
Angel