From 8a104729c471333de9bcffe3db624ef185cdc7ee Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Wed, 25 Sep 2024 16:23:06 -0500 Subject: [PATCH] soc: nxp: mcxw71: Add LPI2C node and clocking Add LPI2C node and default clocking in soc.c Signed-off-by: Declan Snyder --- dts/arm/nxp/nxp_mcxw71.dtsi | 22 ++++++++++++++++++++++ soc/nxp/mcx/mcxw/soc.c | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/dts/arm/nxp/nxp_mcxw71.dtsi b/dts/arm/nxp/nxp_mcxw71.dtsi index 0ca30b04a0b..d5a684d08e4 100644 --- a/dts/arm/nxp/nxp_mcxw71.dtsi +++ b/dts/arm/nxp/nxp_mcxw71.dtsi @@ -170,6 +170,28 @@ status = "disabled"; }; + lpi2c0: i2c@33000 { + compatible = "nxp,imx-lpi2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x33000 0x200>; + interrupts = <39 0>; + clocks = <&scg SCG_K4_FIRC_CLK 0xe0>; + status = "disabled"; + }; + + lpi2c1: i2c@34000 { + compatible = "nxp,imx-lpi2c"; + clock-frequency = ; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x34000 0x200>; + interrupts = <40 0>; + clocks = <&scg SCG_K4_FIRC_CLK 0xe4>; + status = "disabled"; + }; + gpiod: gpio@46000{ compatible = "nxp,kinetis-gpio"; status = "disabled"; diff --git a/soc/nxp/mcx/mcxw/soc.c b/soc/nxp/mcx/mcxw/soc.c index 9251af68f8b..18d9e4c5f2b 100644 --- a/soc/nxp/mcx/mcxw/soc.c +++ b/soc/nxp/mcx/mcxw/soc.c @@ -136,6 +136,14 @@ static ALWAYS_INLINE void clock_init(void) if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(tpm1), nxp_kinetis_tpm, okay)) { CLOCK_EnableClock(kCLOCK_Tpm1); } + + if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpi2c0), nxp_imx_lpi2c, okay)) { + CLOCK_EnableClock(kCLOCK_Lpi2c0); + } + + if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpi2c1), nxp_imx_lpi2c, okay)) { + CLOCK_EnableClock(kCLOCK_Lpi2c1); + } } static void vbat_init(void)