[PATCH 2/9] MXS/i.MX28: add the possibility to define the external RTC crystal

Steffen Trumtrar s.trumtrar at pengutronix.de
Tue Mar 5 01:05:41 EST 2013


From: Juergen Beisert <jbe at pengutronix.de>

Signed-off-by: Juergen Beisert <jbe at pengutronix.de>
---
 arch/arm/boot/dts/imx28.dtsi |    6 ++++++
 drivers/clk/mxs/clk-imx28.c  |    4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 958bd10..dcd0844 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -41,6 +41,12 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		osc32k: rtc_oscillator {
+			compatible = "fsl,mxs-rtc", "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <0>;
+		};
+
 		osc24m: system_oscillator {
 			compatible = "fsl,mxs-system", "fixed-clock";
 			#clock-cells = <0>;
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index 01048b5..a910d72 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -141,7 +141,7 @@ enum imx28_clk {
 	clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
 	ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
 	fec, can0, can1, usb0, usb1, usb0_phy, usb1_phy, enet_out,
-	clk_max
+	rtc_32k, clk_max
 };
 
 static struct clk *clks[clk_max];
@@ -167,6 +167,8 @@ int __init mx28_clocks_init(void)
 
 		if (of_device_is_compatible(np, "fsl,mxs-system"))
 			clks[ref_xtal] = mxs_clk_fixed("ref_xtal", rate);
+		else if (of_device_is_compatible(np, "fsl,mxs-rtc"))
+			clks[rtc_32k] = mxs_clk_fixed("rtc32k", rate);
 	}
 
 	/* if not set, guess their frequency */
-- 
1.7.10.4



More information about the devicetree-discuss mailing list