Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split ad_pulsar.c into two separate drivers? #2312

Open
dlech opened this issue Oct 30, 2023 · 0 comments
Open

Split ad_pulsar.c into two separate drivers? #2312

dlech opened this issue Oct 30, 2023 · 0 comments

Comments

@dlech
Copy link
Collaborator

dlech commented Oct 30, 2023

While working on #2280, I noticed that the drivers/iio/adc/ad_pulsar.c currently supports two quite different types of chips. This makes the driver harder to understand and more prone to bugs. It seems like it would be better to split this up into two drivers.

The first type of chip are the multichannel ADCs like AD7682. These chips also have configuration registers. Chips like AD7685 on the, on the other hand, are single channel and don't have configuration registers. The AD7682-like chips can be configured to be single-ended or differential while the AD7685-like chips are always differential. Also, it is not clear which of the 3 conversion timing modes is being used on the AD7682-like chips, but it looks like it could be "read/write during conversion (RDC)" which is different from the AD7685-like chips as well.

As it is, it looks like there are quite a few places in this driver where it is attempting to write to configuration registers whether or not the ADC chip actually has any.

@pamolloy pamolloy changed the title splt ad_pulsar.c into two separate drivers? Split ad_pulsar.c into two separate drivers? Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant