linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/4] ARM i.MX6: use reserved bit for mxs phy clock gate
@ 2013-01-15  6:08 Peter Chen
  2013-01-15  6:08 ` [PATCH v2 2/4] usb: mxs-phy: change clock usage for i.mx6q Peter Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Peter Chen @ 2013-01-15  6:08 UTC (permalink / raw)
  To: linux-arm-kernel

For mxs-phy user i.mx6q, the PHY's clock is controlled by
hardware automatically, the software only needs to enable it
at probe, disable it at remove. During the runtime,
we don't need to control it. So for the usbphy clk policy:

- Keep refcount for usbphy as clk framework needs to know if
it is off or on.
- Use reserved bit, in that case, clk_enable/disable will
only update refcount, but without any hardware effects.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
Changes for v2:
- Use reserved bit for usb phy clk control

 arch/arm/mach-imx/clk-imx6q.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 7f2c10c..85dcc89 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -208,8 +208,14 @@ int __init mx6q_clocks_init(void)
 	clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB,	"pll7_usb_host","osc", base + 0x20, 0x3);
 	clk[pll8_mlb]      = imx_clk_pllv3(IMX_PLLV3_MLB,	"pll8_mlb",	"osc", base + 0xd0, 0x0);
 
-	clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6);
-	clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6);
+	/*
+	 * Bit 20 is the reserved and read-only bit, we do this only for:
+	 * - Do nothing for usbphy clk_enable/disable
+	 * - Keep refcount when do usbphy clk_enable/disable, in that case,
+	 * the clk framework can know the USB phy clk is on or off
+	 */
+	clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
+	clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
 
 	clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
 	clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-16  2:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15  6:08 [PATCH v2 1/4] ARM i.MX6: use reserved bit for mxs phy clock gate Peter Chen
2013-01-15  6:08 ` [PATCH v2 2/4] usb: mxs-phy: change clock usage for i.mx6q Peter Chen
2013-01-15  6:08 ` [PATCH v2 3/4] usb: mxs-phy: add set_suspend API Peter Chen
2013-01-15  6:08 ` [PATCH v2 4/4] usb: chipidea: imx: Add system suspend/resume API Peter Chen
2013-01-15 11:33 ` [PATCH v2 1/4] ARM i.MX6: use reserved bit for mxs phy clock gate Shawn Guo
2013-01-16  1:18   ` Peter Chen
2013-01-16  1:48     ` Shawn Guo
2013-01-16  2:10       ` Peter Chen

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).