linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: dts: imx6qdl: use DT macro for clock ID
Date: Mon, 16 Jun 2014 09:44:16 +0800	[thread overview]
Message-ID: <20140616014415.GC8860@dragon> (raw)
In-Reply-To: <539DF957.5080603@gmail.com>

On Sun, Jun 15, 2014 at 08:51:51PM +0100, Iain Paton wrote:
> On 15/06/14 13:42, Shawn Guo wrote:
> > Switch to use DT macro for clock ID, so that device tree source is more
> > readable.
> 
> [...]
> >  		aips1: aips-bus at 02000000 {
> > @@ -87,7 +90,8 @@
> >  				compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
> >  				reg = <0x021f8000 0x4000>;
> >  				interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
> > -				clocks = <&clks 116>;
> > +				/* Same clock as i.MX6Q ECSPI5 */
> > +				clocks = <&clks IMX6QDL_CLK_ECSPI5>;
> >  				status = "disabled";
> >  			};
> >  		};
> 
> Do you think it would it be worthwhile to define
> 
> +#define IMX6Q_CLK_ECSPI5	116
> +#define IMX6DL_CLK_I2C4	116
> 
> in imx6qdl-clock.h from the first patch and use it here ?
> 
> I'm not particularly bothered either way, I just remember thinking the 
> name in the enum could become a cause of confusion when I was looking 
> at the changes for i2c4.

Yeah, point taken.  Here is the change what I'm amending.

Shawn

--8<---------

diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
index 74e978841d77..b453e0e28aee 100644
--- a/arch/arm/boot/dts/imx6dl.dtsi
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -90,8 +90,7 @@
 				compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
 				reg = <0x021f8000 0x4000>;
 				interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
-				/* Same clock as i.MX6Q ECSPI5 */
-				clocks = <&clks IMX6QDL_CLK_ECSPI5>;
+				clocks = <&clks IMX6DL_CLK_I2C4>;
 				status = "disabled";
 			};
 		};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 4a6cbd086da9..e9f3646d1760 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -92,8 +92,8 @@
 					compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
 					reg = <0x02018000 0x4000>;
 					interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
-					clocks = <&clks IMX6QDL_CLK_ECSPI5>,
-						 <&clks IMX6QDL_CLK_ECSPI5>;
+					clocks = <&clks IMX6Q_CLK_ECSPI5>,
+						 <&clks IMX6Q_CLK_ECSPI5>;
 					clock-names = "ipg", "per";
 					status = "disabled";
 				};
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 84101911f1e3..e3cc1c8a1b4c 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -321,10 +321,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	clk[IMX6QDL_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",        "ecspi_root",        base + 0x6c, 4);
 	clk[IMX6QDL_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",        "ecspi_root",        base + 0x6c, 6);
 	if (cpu_is_imx6dl())
-		/* ecspi5 is replaced with i2c4 on imx6dl & imx6s */
-		clk[IMX6QDL_CLK_ECSPI5] = imx_clk_gate2("i2c4",        "ipg_per",           base + 0x6c, 8);
+		clk[IMX6DL_CLK_I2C4]  = imx_clk_gate2("i2c4",          "ipg_per",           base + 0x6c, 8);
 	else
-		clk[IMX6QDL_CLK_ECSPI5] = imx_clk_gate2("ecspi5",      "ecspi_root",        base + 0x6c, 8);
+		clk[IMX6Q_CLK_ECSPI5] = imx_clk_gate2("ecspi5",        "ecspi_root",        base + 0x6c, 8);
 	clk[IMX6QDL_CLK_ENET]         = imx_clk_gate2("enet",          "ipg",               base + 0x6c, 10);
 	clk[IMX6QDL_CLK_ESAI]         = imx_clk_gate2_shared("esai",   "esai_podf",         base + 0x6c, 16, &share_count_esai);
 	clk[IMX6QDL_CLK_ESAI_AHB]     = imx_clk_gate2_shared("esai_ahb", "ahb",             base + 0x6c, 16, &share_count_esai);
diff --git a/include/dt-bindings/clock/imx6qdl-clock.h b/include/dt-bindings/clock/imx6qdl-clock.h
index 94700a773fe3..654151e24288 100644
--- a/include/dt-bindings/clock/imx6qdl-clock.h
+++ b/include/dt-bindings/clock/imx6qdl-clock.h
@@ -125,7 +125,8 @@
 #define IMX6QDL_CLK_ECSPI2			113
 #define IMX6QDL_CLK_ECSPI3			114
 #define IMX6QDL_CLK_ECSPI4			115
-#define IMX6QDL_CLK_ECSPI5			116
+#define IMX6Q_CLK_ECSPI5			116
+#define IMX6DL_CLK_I2C4				116
 #define IMX6QDL_CLK_ENET			117
 #define IMX6QDL_CLK_ESAI			118
 #define IMX6QDL_CLK_GPT_IPG			119

      reply	other threads:[~2014-06-16  1:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 12:42 [PATCH 1/2] ARM: imx6qdl: switch to use macro for clock ID Shawn Guo
2014-06-15 12:42 ` [PATCH 2/2] ARM: dts: imx6qdl: use DT " Shawn Guo
2014-06-15 19:51   ` Iain Paton
2014-06-16  1:44     ` Shawn Guo [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=20140616014415.GC8860@dragon \
    --to=shawn.guo@freescale.com \
    --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).