-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Remove QMSI sensor subsystem ADC driver and use Designware driver for ARC. #9605
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
Conversation
983312e to
e9f7b17
Compare
Codecov Report
@@ Coverage Diff @@
## master #9605 +/- ##
=======================================
Coverage 52.17% 52.17%
=======================================
Files 212 212
Lines 25914 25914
Branches 5583 5583
=======================================
Hits 13520 13520
Misses 10145 10145
Partials 2249 2249Continue to review full report at Codecov.
|
|
@nashif @MaureenHelm Your review comments are addressed given on #8857. Please let me know if you feel I should provide any updates. |
e9f7b17 to
641e225
Compare
MaureenHelm
left a comment
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.
Thank you for fixing all the direct references to adc_info_dev, that part looks good now. There are additional comments in #9602 that still need to be addressed. Please also start running sanitycheck locally and fix the failures. You can do it like this:
$ sanitycheck -T tests/drivers/adc -T samples/sensor/grove_light -l
Please run gitlint on all of your commits, there is an issue with this one:
Commit b538745b9a:
1: UC3 Title does not follow [subsystem]: [subject]: "boards:quark_se_c1000_ss_devboard: Enable ADC node"
c5605c0 to
3ebe054
Compare
|
@MaureenHelm I have addressed all your comments from #9602 and #8857 |
MaureenHelm
left a comment
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.
Please fix the CI failures. Instructions to run them locally are here: #9605 (review)
drivers/adc/adc_dw.c
Outdated
| #endif | ||
|
|
||
| /* TODO: Enable ADC power down capability */ | ||
| #ifdef CONFIG_ADC_DW_POWER_DOWN |
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.
Where is this defined? I don't see a Kconfig for it. If there's no way to use the power down functionality, you should remove it so we don't have dead code lying around.
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.
ok. Removed.
drivers/adc/adc_dw.c
Outdated
| sys_out32(ADC_INT_DSB|ADC_SEQ_PTR_RST, adc_base + ADC_CTRL); | ||
| /* There is no provision in the IP to set | ||
| * gain and reference voltage settings. So | ||
| * ignoring these settings. |
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.
You need to return an error for unsupported settings
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.
ok
drivers/adc/adc_dw.c
Outdated
| info->active_channels |= 1 << channel_id; | ||
|
|
||
| info->state = ADC_STATE_DISABLED; | ||
| adc_dw_enable(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.
This should be in adc_dw_init instead
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.
drivers/adc/adc_dw.c
Outdated
| (BIT(i) & info->active_channels)) { | ||
| info->channels |= BIT(i); | ||
| } | ||
| } |
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.
You can replace the for loop with info->channels = seq_tbl->channels & info->active_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.
ok
drivers/adc/adc_dw.c
Outdated
| }; | ||
| }; | ||
|
|
||
| static struct adc_config adc_config_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.
This should be const
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.
ok. Done
| #define ADC_1ST_CHANNEL_ID 0 | ||
| #define ADC_1ST_CHANNEL_INPUT 0 | ||
|
|
||
| #elif defined(CONFIG_ARC) |
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.
This should be a board name. Same throughout this file
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.
This still needs to be fixed
|
|
||
| endchoice | ||
|
|
||
| config ADC_DW_SAMPLE_WIDTH |
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.
Please also remove the related testcases in tests/drivers/adc/adc_api/testcase.yaml
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
| CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X=y | ||
| CONFIG_GROVE_LCD_RGB=y | ||
|
|
||
| #CONFIG_GROVE_LCD_RGB=y |
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.
Just remove it
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.
c633e4c to
73f4c4a
Compare
This commit adds ADC nodes to DTS files for nRF SoCs and introduces corresponding bindings for these nodes. Signed-off-by: Andrzej Głąbek <[email protected]>
ADC nodes are enabled in DTS for the following nRF development kits: - nrf51_pca10028 - nrf52_pca10040 - nrf52_pca20020 - nrf52810_pca10040 - nrf52840_pca10056 Signed-off-by: Andrzej Głąbek <[email protected]>
This commit replaces the API for ADC drivers with a reworked one. As requested in the issue zephyrproject-rtos#3980, the adc_enable/adc_disable functions are removed. Additionaly, some new features are introduced, like: - asynchronous calls - configuration of channels - multi-channel sampling Common parts of code that are supposed to appear in each implementation of the driver (like locking, synchronization, triggering of consecutive samplings) are provided in the "adc_context.h" file to keep consistency with the SPI driver. Syscalls are no longer present in the API because the functions starting read requests cannot use them, since they can be provided with a callback that is executed in the ISR context, and there is no point in supporting syscalls only for the channels configuration. "adc_api" test is updated and extended with additional test cases, with intention to show how the API is supposed to be used. "adc_simple" test is removed as it does not seem to add much value. Signed-off-by: Andrzej Głąbek <[email protected]>
To require relevant DTS entries on all platforms providing the ADC driver. Signed-off-by: Andrzej Głąbek <[email protected]>
Major rework of the mcux adc16 driver to convert it to the new adc api. Currently supports a subset of the api features including synchronous and asynchronous reads, and consecutive reads triggered by the kernel timer. Does not yet support some of the channel configuration options such as gain and reference voltage because the hardware only allows these options to be configured by peripheral instance rather than by channel. The values are currently hardcoded in the driver, but in the future we could introduce some flexibility per instance via device tree attributes. Does not yet support consecutive reads triggered by a hardware timer. Signed-off-by: Maureen Helm <[email protected]>
Adds board-specific macros to enable the adc_api test to run on kinetis boards. This restores the test to support all the nxp boards that were supported before the new adc api was introduced. Signed-off-by: Maureen Helm <[email protected]>
Updated to work with new ADC API. Signed-off-by: Justin Watson <[email protected]>
Remove adc_qmsi_ss to use designware driver for sensor subsystem Signed-off-by: Punit Vara <[email protected]>
Get required data from dts tree. Signed-off-by: Punit Vara <[email protected]>
Enable ADC node in dts. Signed-off-by: Punit Vara <[email protected]>
Replace new ADC apis for designware driver Signed-off-by: Punit Vara <[email protected]>
Remove Kconfig which are replaced by dts and unnecessary macros which is not useful anymore. Signed-off-by: Punit Vara <[email protected]>
Replace old ADC apis with new ones. Signed-off-by: Punit Vara <[email protected]>
Replace old ADC driver APIs with new ones. Signed-off-by: Punit Vara <[email protected]>
04cff66 to
6f75b49
Compare
|
@MaureenHelm Thanks for review. I addressed all your comments and also tested changes with grove sensors. Everything is working fine. Please have a look once. |
MaureenHelm
left a comment
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.
This is much better, thank you. Just a couple of minor issues left.
| #define ADC_1ST_CHANNEL_ID 0 | ||
| #define ADC_1ST_CHANNEL_INPUT 0 | ||
|
|
||
| #elif defined(CONFIG_ARC) |
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.
This still needs to be fixed
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.
Typo
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.
please provide a meaningful message here, SAMPLE seems like a leftover debug message.
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.
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.
Instead of a filter, remove the adc line from boards/x86/quark_d2000_crb/quark_d2000_crb.yaml
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
Add ARC related parameters and modified test case to work this test case on arc sensor subsystem. Signed-off-by: Punit Vara <[email protected]>
check return value for sample fetch. Conditional printk added to print adc value. Signed-off-by: Punit Vara <[email protected]>
6f75b49 to
6db4ead
Compare
|
@nashif Done. Please let me know if anything need to be addressed. |
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 is this being removed? isn't that part of the sample to display the sensor data on the LCD?
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.
@nashif, Arduino 101 board was hanging when we enabled RGB initially so we disabled it and continued our debugging and verified the ADC completely.
Today we spent more time on this LCD issue and looks like there is platform/HW related issue with arduino_101 and Groove RGB LCD. Arduino 101 pin voltage measurements:
VCC = 5.0v
SCL = 0v
SDA = 0v
So clearly something is not hooked up properly at HW level on arduino 101 with Grove LCD.
To further root cause the issue, we then connected the LCD to D2000 board and ran the test and able to see the LCD up and showing the values we programmed. D2000 pin measurements:
VCC = 5.0v
SCL = 3.3v
SDA = 3.3v
Out of the three whitelisted boards, Arduino Due build fails and only D2000 works fine with Grove LCD.
So, we can enable Grove LCD only for D2000 when we push the changes for D2000 QMSI ADC in separate PR.
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.
On some boards you will need to use 2 pull-up resistors (10k Ohm) between the
SCL/SDA lines and 3.3V
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.
@nashif After connecting two resistors of 10k connecting to SCA and SDA lines , I can see output temperature value on LCD. I am going to push it now.
Use Kconfig to get device name. Make LIBC conditional to get output. Signed-off-by: Punit Vara <[email protected]>
Remove ADC support from d2000 as it is not migrated to new ADC apis. Signed-off-by: Punit Vara <[email protected]>
Remove unnecessary sample width scenario. Signed-off-by: Punit Vara <[email protected]>
6db4ead to
5432989
Compare
6f75b49 to
5432989
Compare
|
Looks good. I pulled your commits into #7691 |
Uh oh!
There was an error while loading. Please reload this page.