imx93: add ADC support
Subsystems (2)
v2 cover imx93: add ADC support
Add ADC support for NXP iMX93
Changes for v2:
- add "static" to functions
- enable ADC in iMX93 EVK
Luca Ellero (2):
dm: adc: add iMX93 ADC support
imx93_evk: enable ADC
arch/arm/dts/imx93-11x11-evk.dts | 4 + configs/imx93_11x11_evk_defconfig | 1 + drivers/adc/Kconfig | 8 + drivers/adc/Makefile | 1 + drivers/adc/imx93-adc.c | 284 ++++++++++++++++++++++++++++++ 5 files changed, 298 insertions(+) create mode 100644 drivers/adc/imx93-adc.c
Signature · 1 line
2.25.1
PATCH v2 1/2 dm: adc: add iMX93 ADC support
This commit adds driver for iMX93 ADC.
The driver is implemented using driver model and provides ADC uclass's methods for ADC single channel operations:
- adc_start_channel()
- adc_channel_data()
- adc_stop()
ADC features:
- channels: 4
- resolution: 12-bit
--- drivers/adc/Kconfig | 8 ++ drivers/adc/Makefile | 1 + drivers/adc/imx93-adc.c | 284 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 293 insertions(+) create mode 100644 drivers/adc/imx93-adc.c
drivers/adc/Kconfig +8 -0
@@ -63,3 +63,11 @@ config STM32_ADC - core driver to deal with common resources - child driver to deal with individual ADC resources (declare ADC device and associated channels, start/stop conversions) + +config ADC_IMX93 + bool "Enable NXP IMX93 ADC driver" + help + This enables basic driver for NXP IMX93 ADC. + It provides: + - 4 analog input channels + - 12-bit resolution
drivers/adc/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-$(CONFIG_ADC_SANDBOX) += sandbox.o obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o obj-$(CONFIG_SARADC_MESON) += meson-saradc.o obj-$(CONFIG_STM32_ADC) += stm32-adc.o stm32-adc-core.o +obj-$(CONFIG_ADC_IMX93) += imx93-adc.o
drivers/adc/imx93-adc.c new file +284 -0
284 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH 1/2] dm: adc: add iMX93 ADC support
Quoted 9 lines · Luca Ellero
This commit adds driver for iMX93 ADC.
The driver is implemented using driver model and provides ADC uclass's methods for ADC single channel operations:
-adc_start_channel()
-adc_channel_data()
-adc_stop()
Quoted 5 lines
ADC features:
- channels: 4
- resolution: 12-bitSigned-off-by Luca Ellero <[email protected]>
PATCH v2 2/2 imx93_evk: enable ADC
In reply to Luca Ellero--- arch/arm/dts/imx93-11x11-evk.dts | 4 ++++ configs/imx93_11x11_evk_defconfig | 1 + 2 files changed, 5 insertions(+)
arch/arm/dts/imx93-11x11-evk.dts +4 -0
@@ -525,3 +525,7 @@ &wdog3 { status = "okay"; }; + +&adc1 { + status = "okay"; +};
configs/imx93_11x11_evk_defconfig +1 -0
@@ -82,6 +82,7 @@ CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM=y CONFIG_REGMAP=y CONFIG_SYSCON=y +CONFIG_ADC_IMX93=y CONFIG_IMX_RGPIO2P=y CONFIG_DM_PCA953X=y CONFIG_DM_I2C=y
Signature · 1 line
2.25.1
Fabio Estevam
reviewerRe: [PATCH 2/2] imx93_evk: enable ADC
Hi Luca,
On Thu, Feb 23, 2023 at 9:52 AM Luca Ellero <[email protected]> wrote:
Please write a commit log.
Quoted 11 lines
Signed-off-by Luca Ellero <[email protected]>--- arch/arm/dts/imx93-11x11-evk.dts | 4 ++++ configs/imx93_11x11_evk_defconfig | 1 + 2 files changed, 5 insertions(+)arch/arm/dts/imx93-11x11-evk.dts +0
-0
arch/arm/dts/imx93-11x11-evk.dts line 531
Quoted 7 lines
arch/arm/dts/imx93-11x11-evk.dts +4
-0@@ -525,3 +525,7 @@ &wdog3 { status = "okay"; }; + +&adc1 { + status = "okay"; +};
The nodes should be kept in alphabetical order.
Actually, it would be better if you could sync imx93-11x11-evk.dts with linux-next, which already contains the adc1 node:
We want to keep U-Boot and Linux devicetree in sync as much as possible.
Thanks
Re: [PATCH 2/2] imx93_evk: enable ADC
Quoted 27 lines · Fabio Estevam
Hi Luca,
On Thu, Feb 23, 2023 at 9:52 AM Luca Ellero <[email protected]> wrote:
Please write a commit log.
Quoted 11 lines
Signed-off-by Luca Ellero <[email protected]>--- arch/arm/dts/imx93-11x11-evk.dts | 4 ++++ configs/imx93_11x11_evk_defconfig | 1 + 2 files changed, 5 insertions(+)arch/arm/dts/imx93-11x11-evk.dts +0
-0arch/arm/dts/imx93-11x11-evk.dts line 531
Quoted 7 lines
arch/arm/dts/imx93-11x11-evk.dts +4
-0@@ -525,3 +525,7 @@ &wdog3 { status = "okay"; }; + +&adc1 { + status = "okay"; +};The nodes should be kept in alphabetical order.
Quoted 8 lines
Actually, it would be better if you could sync
imx93-11x11-evk.dtswith linux-next, which already contains the adc1 node:We want to keep U-Boot and Linux devicetree in sync as much as possible.
Thanks
Hi Fabio,
thank you for your reply.
Ok, I will add a comment to the patch and fix DT node. Should I resend only this patch or both? Regards
Signature · 4 lines
Luca Ellero E-mail: [email protected] Internet: www.brickedbrain.com
Fabio Estevam
reviewerRe: [PATCH 2/2] imx93_evk: enable ADC
Hi Luca,
Quoted 4 lines · Luca Ellero
Hi Fabio,
thank you for your reply.
Ok, I will add a comment to the patch and fix DT node. Should I resend only this patch or both?
Please resend the whole series.
My suggestion:
1/3 - ADC driver
2/3 - Sync U-Boot imx93 evk dts with the one from linux-next 20230224 3/3 - Enable the ADC driver in the imx93 evk defconfig
Re: [PATCH 2/2] imx93_evk: enable ADC
Quoted 10 lines · Fabio Estevam
Hi Luca,
Quoted 4 lines · Luca Ellero
Hi Fabio,
thank you for your reply.
Ok, I will add a comment to the patch and fix DT node. Should I resend only this patch or both?
Quoted 7 lines
Please resend the whole series.
My suggestion:
1/3 - ADC driver
2/3 - Sync U-Boot imx93 evk dts with the one from linux-next 20230224 3/3 - Enable the ADC driver in the imx93 evk defconfig
Hi Fabio,
ok, thanks for your suggestions.
Regards
Signature · 4 lines
Luca Ellero E-mail: [email protected] Internet: www.brickedbrain.com