Skip to contentSkip to conversation

: Getting ADIS16203 out of staging

RFC Saalim Quadri 3 participants 3 messages Mar 6, 2025 – Mar 8, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

ADIS16203 and ADIS16201 are very similar in functionality whilst the major difference between the accuracy in ADIS16201, I wonder if they can be merged together into single driver, whilst also implementing platform_device support in them.

I want to work on this, provided some opinions for me to work with or to have a separate driver for both of them.

I see that there has been some discussion regarding the same at [1].

[1]: https://lore.kernel.org/linux-iio/[email protected]

Sincerely,
Saalim Quadri

#1 lore raw

Hi Saalim,

Quoted 5 lines · Saalim Quadri

ADIS16203 and ADIS16201 are very similar in functionality whilst the major difference between the accuracy in ADIS16201, I wonder if they can be merged together into single driver, whilst also implementing platform_device support in them.

From quick datasheet comparison, yes, I think the drivers could be merged.

Quoted 2 lines

I want to work on this, provided some opinions for me to work with or to have a separate driver for both of them.

I often look at two things when assessing if two or more devices can be supported by the same driver, the protocol and internal register structure. For IIO devices, the protocol is usually I2C or SPI. Though, even between devices of same protocol, there may be differences on how the data is structured in read/write commands. Also, if internal registers have very different addresses or meanings, it makes it harder to reuse code because the configuration procedure for each distinct design/device will tend to require specific handling.

That said, ADIS16201 and ADIS16203 SPI read/write commands seem to be the same, and ADIS16203 registers seem to be a subset of ADIS16201's. That's why I think it may be worth merging the drivers. I didn't read the datasheets thoroughly, though.

Quoted 4 lines

I see that there has been some discussion regarding the same at [1].

[1]: https://lore.kernel.org/linux-iio/[email protected]

Git tends to rename/move files when we move a file from one directory to another. IIRC, Jonathan prefers the drivers to be completely removed from staging to then be added under iio directory to sort of make it clearer that something is being added to official (not staging) IIO drivers. To accomplish that, we use --no-renames flag (e.g. git format-patch --no-renames ...).

Quoted 4 lines

Sincerely,
Saalim Quadri

maintainer
#2 lore raw
Quoted 22 lines · On Fri, 7 Mar 2025 00:32:30 -0300 Marcelo Schmitt <[email protected]>…

Hi Saalim,

Quoted 5 lines · Saalim Quadri

ADIS16203 and ADIS16201 are very similar in functionality whilst the major difference between the accuracy in ADIS16201, I wonder if they can be merged together into single driver, whilst also implementing platform_device support in them.

From quick datasheet comparison, yes, I think the drivers could be merged.

Quoted 2 lines

I want to work on this, provided some opinions for me to work with or to have a separate driver for both of them.

I often look at two things when assessing if two or more devices can be supported by the same driver, the protocol and internal register structure. For IIO devices, the protocol is usually I2C or SPI. Though, even between devices of same protocol, there may be differences on how the data is structured in read/write commands. Also, if internal registers have very different addresses or meanings, it makes it harder to reuse code because the configuration procedure for each distinct design/device will tend to require specific handling.

Quoted 11 lines

That said, ADIS16201 and ADIS16203 SPI read/write commands seem to be the same, and ADIS16203 registers seem to be a subset of ADIS16201's. That's why I think it may be worth merging the drivers. I didn't read the datasheets thoroughly, though.

Quoted 4 lines

I see that there has been some discussion regarding the same at [1].

[1]: https://lore.kernel.org/linux-iio/[email protected]

Yes. I never did get around to merging them after that was pretty much the conclusion of the reviews of that attempt to get the driver out of staging.

So if you are willing go ahead. One challenge is testing where you need one of:
1. Test devices.
2. Someone willing to test who has them.
3. Emulation of enough to verify that nothing broke. Assumption more or less being that current driver is 'correct' so it's a case of emulating the device then tracking forwards that it continues to function as you modify the driver.
4. Really simple changes where we rely on review alone.

Jonathan

Quoted 5 lines

Git tends to rename/move files when we move a file from one directory to another. IIRC, Jonathan prefers the drivers to be completely removed from staging to then be added under iio directory to sort of make it clearer that something is being added to official (not staging) IIO drivers. To accomplish that, we use --no-renames flag (e.g. git format-patch --no-renames ...).

Kind of more about providing a convenient place to check that we are happy with the state of the driver as part of the series that moves it. That move patch results in a full driver review, similar to what we'd do for a new driver. Good to point this out though, thanks

Jonathan

Quoted 5 lines
Quoted 5 lines

Sincerely,
Saalim Quadri