linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mkl@pengutronix.de (Marc Kleine-Budde)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: i.MX28: define external RTC crystal frequency in DT
Date: Fri,  8 Nov 2013 14:48:41 +0100	[thread overview]
Message-ID: <1383918521-4668-3-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1383918521-4668-1-git-send-email-mkl@pengutronix.de>

From: Juergen Beisert <jbe@pengutronix.de>

The RTC in the i.MX28 may be clocked with different crystals. Get the rate of
the connected one from the DT.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 Documentation/devicetree/bindings/clock/imx28-clock.txt | 1 +
 arch/arm/boot/dts/imx28.dtsi                            | 5 +++++
 drivers/clk/mxs/clk-imx28.c                             | 4 +++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/imx28-clock.txt b/Documentation/devicetree/bindings/clock/imx28-clock.txt
index e6587af..c3a9d94 100644
--- a/Documentation/devicetree/bindings/clock/imx28-clock.txt
+++ b/Documentation/devicetree/bindings/clock/imx28-clock.txt
@@ -76,6 +76,7 @@ clocks and IDs.
 	usb0_phy	62
 	usb1_phy	63
 	enet_out	64
+	rtc_32k		65
 
 Examples:
 
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 979c37d..6af9094 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -47,6 +47,11 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		xtal-32k {
+			compatible = "fsl,mxs-xtal-32k", "fixed-clock";
+			clock-frequency = <0>;
+		};
+
 		xtal-24m {
 			compatible = "fsl,mxs-xtal-24m", "fixed-clock";
 			clock-frequency = <24000000>;
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index 874ca4e..b6afeb1 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -144,7 +144,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];
@@ -178,6 +178,8 @@ int __init mx28_clocks_init(void)
 
 		if (of_device_is_compatible(np_tmp, "fsl,mxs-xtal-24m"))
 			clks[ref_xtal] = mxs_clk_fixed("ref_xtal", rate);
+		else if (of_device_is_compatible(np_tmp, "fsl,mxs-xtal-32k"))
+			clks[rtc_32k] = mxs_clk_fixed("rtc_32k", rate);
 	}
 
 	/* if not set, use default frequency */
-- 
1.8.4.rc3

      parent reply	other threads:[~2013-11-08 13:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 13:48 [PATCH 0/2] ARM: i.MX28: define various external xtal frequencies in DT Marc Kleine-Budde
2013-11-08 13:48 ` [PATCH 1/2] ARM: i.MX28: define ref_xtal frequency " Marc Kleine-Budde
2013-11-11  7:42   ` Shawn Guo
2013-11-11  7:47   ` Shawn Guo
2013-11-08 13:48 ` Marc Kleine-Budde [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383918521-4668-3-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).