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
Add ADC family MAX11102-MAX11117 #60328
Add ADC family MAX11102-MAX11117 #60328
Conversation
c8f7da9
to
ea87f35
Compare
a463310
to
92156db
Compare
92156db
to
bb71651
Compare
I've tested this driver with a MAX11102. The other ones are untested, but as they are fairly similar I'm confident enough to push them as well. |
6de5b01
to
be461bf
Compare
4335e24
to
f6a6a1c
Compare
c05fe1b
to
74b29d6
Compare
74b29d6
to
c17d547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but needs to be rebased
c17d547
to
19f5814
Compare
Rebased to resolve merge conflicts. |
19f5814
to
0529deb
Compare
Rebased to resolve CI issues. |
drivers/adc/adc_max11102_17.c
Outdated
#endif | ||
|
||
#if CONFIG_ADC_ASYNC | ||
static void max11102_17_acquisition_thread(struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static void max11102_17_acquisition_thread(struct device *dev) | |
static void max11102_17_acquisition_thread(const struct device *dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, BUT: Looking into this I realized that k_thread_entry_t is actually defined as (void)(void*, void*, void*). At this point I am not sure if it might fuck up the stack if the signature of the actual function and the function pointer through which the call happens do not match?
Anyway, this seems to be the common approach, so at least it is now consistently dangerous ;-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outsourced my concerns to #62637
0529deb
to
aa72da6
Compare
Add bindings for the following ADCs: - MAX11102 - MAX11103 - MAX11105 - MAX11106 - MAX11110 - MAX11111 - MAX11115 - MAX11116 - MAX11117 Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Add a driver for the following ADCs: - MAX11102 - MAX11103 - MAX11105 - MAX11106 - MAX11110 - MAX11111 - MAX11115 - MAX11116 - MAX11117 Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Add all available instances of the ADC series MAX11102-MAX11117 to the ADC shell. Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Add instances of the ADC family MAX11102-MAX11117 to the build all tests. Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Increase the rodata section for build_all/adc to successfully build on the platform atsame54_xpro. Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Add myself as codeowner of the previously committed ADC driver for the MAX11102-17 series. Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
aa72da6
to
950b6cd
Compare
if (sequence_channel_count > 1) { | ||
LOG_ERR("multiple channels selected"); | ||
return -EINVAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Would it be that hard to support sequences with multiple channels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this feature was intended for ADCs which can actually read out multiple channels at once, which this IC definitely cannot. Of course I could simulate this via multiple reads in a row.
Add support for devices of the ADC family MAX11102-MAX11117.
Unfortunately these ADCs require to select the channel a GPIO change within a SPI transaction. Therefore, I had to extend the SPI subsystem with an intermediate callback which is triggered after a SPI buffer has been transferred.
The naming of the driver files themselves is also a little bit unfortunate with max11102_17, but max111xx would be problematic as there are also exist the devices MAX11120-MAX11128 which will require a totally different driver implementation.