Skip to content
Permalink
Browse files

soc: nxp: ke1xf: add ADC12 support

Add support for the three ADC12 modules present in the NXP Kinetis
KE1xF SoC series.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed May 16, 2019
1 parent 683ca77 commit ca38f0a21de439797d082f417bcae506dcae9619
@@ -28,6 +28,9 @@
gpio-c = &gpioc;
gpio-d = &gpiod;
gpio-e = &gpioe;
adc-0 = &adc0;
adc-1 = &adc1;
adc-2 = &adc2;
};

cpus {
@@ -239,6 +242,39 @@
gpio-controller;
#gpio-cells = <2>;
};

adc0: adc@4003b000 {
compatible = "nxp,kinetis-adc12";
reg = <0x4003b000 0x1000>;
interrupts = <39 0>;
clocks = <&pcc 0xec>;
label = "ADC_0";
clk-source = <0>;
clk-divider = <1>;
status = "disabled";
};

adc1: adc@40027000 {
compatible = "nxp,kinetis-adc12";
reg = <0x40027000 0x1000>;
interrupts = <73 0>;
clocks = <&pcc 0x9c>;
label = "ADC_1";
clk-source = <0>;
clk-divider = <1>;
status = "disabled";
};

adc2: adc@4003c000 {
compatible = "nxp,kinetis-adc12";
reg = <0x4003c000 0x1000>;
interrupts = <74 0>;
clocks = <&pcc 0xf0>;
label = "ADC_2";
clk-source = <0>;
clk-divider = <1>;
status = "disabled";
};
};
};

@@ -84,6 +84,13 @@ config SPI_MCUX_LPSPI

endif # SPI

if ADC

config ADC_MCUX_ADC12
default y

endif # ADC

source "soc/arm/nxp_kinetis/ke1xf/Kconfig.defconfig.mke*"

endif # SOC_SERIES_KINETIS_KE1XF
@@ -21,5 +21,6 @@ config SOC_SERIES_KINETIS_KE1XF
select HAS_MCUX_PCC
select HAS_MCUX_RTC
select HAS_MCUX_SIM
select HAS_MCUX_ADC12
help
Enable support for Kinetis KE1xF MCU series
@@ -74,3 +74,7 @@
#define DT_I2C_MCUX_LPI2C_1_BITRATE DT_NXP_IMX_LPI2C_40067000_CLOCK_FREQUENCY
#define DT_I2C_MCUX_LPI2C_1_CLOCK_NAME DT_NXP_IMX_LPI2C_40067000_CLOCK_CONTROLLER
#define DT_I2C_MCUX_LPI2C_1_CLOCK_SUBSYS DT_NXP_IMX_LPI2C_40067000_CLOCK_NAME

#define DT_ADC_0_NAME DT_NXP_KINETIS_ADC12_4003B000_LABEL
#define DT_ADC_1_NAME DT_NXP_KINETIS_ADC12_40027000_LABEL
#define DT_ADC_2_NAME DT_NXP_KINETIS_ADC12_4003C000_LABEL
@@ -214,6 +214,15 @@ static ALWAYS_INLINE void clk_init(void)
#ifdef CONFIG_SPI_1
CLOCK_SetIpSrc(kCLOCK_Lpspi1, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_ADC_0
CLOCK_SetIpSrc(kCLOCK_Adc0, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_ADC_1
CLOCK_SetIpSrc(kCLOCK_Adc1, kCLOCK_IpSrcFircAsync);
#endif
#ifdef CONFIG_ADC_2
CLOCK_SetIpSrc(kCLOCK_Adc2, kCLOCK_IpSrcFircAsync);
#endif
#ifdef DT_NXP_KINETIS_SCG_0_CLKOUT_SOURCE
CLOCK_SetClkOutSel(DT_NXP_KINETIS_SCG_0_CLKOUT_SOURCE);
#endif

0 comments on commit ca38f0a

Please sign in to comment.
You can’t perform that action at this time.