Re: [PATCH v6 2/2] iio: pressure: add Sensirion SDP31 driver
From: Jonathan Cameron
Date: Sun Oct 18 2026 - 14:32:24 EST
On Thu, 15 Oct 2026 00:45:44 +0500
Muhammad Abu Bakar <m.abubakar365@xxxxxxxxx> wrote:
> On Mon, 12 Oct 2026 12:09:47 -0300
> Marcelo Schmitt <marcelo.schmitt1@xxxxxxxxx> wrote:
>
> > > + indio_dev->name = "sdp31";
> > Hmm, I'm not sure whether it is a big deal or not but, the hardcoded name might
> > cause confusion if the part connected is sdp32 or sdp33. [...]
> > The full disambiguation solution would probably be to read the product
> > identifier bits and match those against a table of supported devices.
>
> Hi Marcelo,
>
> Thanks for taking a look, and good point.
>
> I kept the name hardcoded because, after Conor's comment on v4, the SDP32
> and SDP33 use sensirion,sdp31 as a fallback compatible, the way the sdp510
> does with the sdp500 driver. You're right that it isn't quite the same
> situation, though: the sdp500 and sdp510 are identical, while the SDP3x
> parts differ in range. The readings are still correct, since the scale is
> read from the sensor at probe, but the name would always say "sdp31".
>
> Reading the product identifier at probe and taking the name from a small
> chip_info table would fix that, and I'm happy to do it in a v7. Jonathan,
> would you prefer that, or is the current approach fine?
A question that is more 'interesting' than it would initially seem.
Normally I'd agree with Marcelo that we should be as user friendly as
possible, but there is a problem..
Given how well behaved and discoverable these parts are, the driver will
work fine for new parts that we don't know about (which is sadly rather
unusual!) That is why we can just use a single compatible.
If we were to use the right name and saw an unknown part, what would call
it? spd31 or something odd like spd31-compat. Then we would want to
add the new part name but run into a problem. Doing so would be potential
ABI breakage if anyone happened to be matching on spd31-compat :(
So let's go the easy way and just call them all spd31 as you have it today.
Good question though. My first reply that I typed out was to what Marcelo
was suggesting then I changed my mind!
Jonathan
>
> Thanks,
> Muhammad