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

Jonathan Cameron
2023-01-08T12:27:43Z

On Sun, 01 Jan 2023 12:04:40 +0100
Angel Iglesias <ang.iglesiasg@gmail.com> wrote:

> 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.

Yes.

> 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?

Makes sense.

> Or is there a better solution I'm not seeing right now?

If I'm understanding what you have above, then this is exactly what we would
want to do here.

Thanks,

Jonathan

>
> Thanks for your time,
> Angel