-
Notifications
You must be signed in to change notification settings - Fork 8.3k
soc: nxp: imxrt11xx: select CONFIG_HAS_MCUX_ADC_ETC #81467
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
soc: nxp: imxrt11xx: select CONFIG_HAS_MCUX_ADC_ETC #81467
Conversation
49d082e to
cdc916c
Compare
cdc916c to
0618c63
Compare
drivers/adc/Kconfig.mcux
Outdated
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 this depend on the LPADC? Parts like the RT1064 which do not have an LPADC have the ADC_ETC IP.
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.
thanks for pointing that out. You are right , RT10xx did not use LPADC IP, it seems ADC_MCUX_12B1MSPS_SAR is used.
why I put dependency here it that I had a talk with some experts about ETC IP, it is an IP which can not be used standalone, which means in app , it must be combined with other "ADC" IPs. I had a look at the Kconfig.mcux for adc, 4 "ADC" IPs are listed: ADC_MCUX_ADC12 , ADC_MCUX_ADC16 , ADC_MCUX_12B1MSPS_SAR , ADC_MCUX_LPADC. I am thinking maybe we should only define ETC when any one of these IP defined. How do you think about 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.
What about depends on ADC? That needs the ADC driver included, but does not depend on specific IP.
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 think that is ok. I'll also note that the ADC_ETC IP isn't really supported in Zephyr right now- all this Kconfig does is enables a user to include the HAL driver in their application. So we should generally be less restrictive with dependencies, because a user enabling this Kconfig is using the HAL driver directly.
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 updated the dependency. if any ADC IP is defined, ETC is defined.
DerekSnell
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.
Hi @Raymond0225 ,
This is minor feedback, but if you push an update, you could improve the commit message subject. "driver: adc: kconfig" is very generic, and does not convey the change here. I think a better subject is
soc: nxp: imxrt11xx: select CONFIG_HAS_MCUX_ADC_ETC
thanks, done |
0618c63 to
39b3fbb
Compare
drivers/adc/Kconfig.mcux
Outdated
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.
For the time been, only ADC_MCUX_12B1MSPS_SAR (for RT10xx devices) and ADC_MCUX_LPADC (for RT11xx devices) use with ADC_MCUX_ETC.
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.
yes, I know. Anyway, ADC_MUCX_ETC also depends on HAS_MCUX_ADC_ETC
mmahadevan108
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.
Delete the HAS_MCUX_ADC_ETC config
decsny
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.
the proper fix would be to make a DT binding and depend on that, do not use this legacy config
On NXP RT1170 SOC, ADC ETC exists but it can not be enabled because of dependency on HAS_MCUX_ADC_ETC. Also, ADC ETC should only work with ADC together, there is no use case to run it standalone. Fixes:zephyrproject-rtos#81466 Signed-off-by: Raymond Lei <[email protected]>
fc6ce5b
39b3fbb to
fc6ce5b
Compare
To my understanding, What I am doing is to fix the bug because of which adc etc driver can not be included. when it comes to how to remove legacy config, it is another issue, you can make a proposal in another PR. |
This config is used not only for RT11xx but also RT10xx SOCs. What I do here is to fix the bug: etc driver can not be included on RT11xx SOCs. you can create another PR on how to delete this config. |
| if ADC_MCUX_12B1MSPS_SAR || ADC_MCUX_LPADC | ||
| config ADC_MCUX_ETC | ||
| bool "MCUX ADC ETC driver" | ||
| depends on HAS_MCUX_ADC_ETC | ||
| help | ||
| Enable the MCUX ADC ETC driver. | ||
| endif |
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.
| if ADC_MCUX_12B1MSPS_SAR || ADC_MCUX_LPADC | |
| config ADC_MCUX_ETC | |
| bool "MCUX ADC ETC driver" | |
| depends on HAS_MCUX_ADC_ETC | |
| help | |
| Enable the MCUX ADC ETC driver. | |
| endif | |
| config ADC_MCUX_ETC | |
| bool "MCUX ADC ETC driver" | |
| depends on DT_HAS_NXP_ADC_ETC_ENABLED | |
| help | |
| Enable the MCUX ADC ETC driver. |
and then just make a one-line binding file with the compat string, and add a small node to rt11xx.dtsi and rt10xx.dtsi that just looks like this basically:
adc_etc@deadbeef {
compatible = "nxp,adc-etc";
};
can just leave status okay in soc level since the kconfig is n by default, if dont want to change all the board dts
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 remove "if ADC_MCUX_12B1MSPS_SAR || ADC_MCUX_LPAD"? ETC can not work standalone
On NXP RT1170 SOC, ADC ETC exists but it can not be enabled because of dependency on HAS_MCUX_ADC_ETC. The expectation is when CONFIG_ADC=y, ADC ETC should be enabled automatically if it exists. Fixes:#81466