linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/3] arm64: dts: mt8173: add reference clock for usb
@ 2017-02-07  6:13 Chunfeng Yun
  2017-02-07  6:13 ` [PATCH -next 2/3] usb: mtu3: make the reference clock optional Chunfeng Yun
  2017-02-07  6:13 ` [PATCH -next 3/3] usb: xhci-mtk: " Chunfeng Yun
  0 siblings, 2 replies; 3+ messages in thread
From: Chunfeng Yun @ 2017-02-07  6:13 UTC (permalink / raw)
  To: linux-arm-kernel

Due to the reference clock comes from 26M oscillator directly
on mt8173, and it is a fixed-clock in DTS which always turned
on, we ignore it before. But on some platforms, it comes
from PLL, and need be controlled, so here add it, no matter
it is a fixed-clock or not.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 07fd2eb..e2862b6 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -729,9 +729,11 @@
 			       <&u2port1 PHY_TYPE_USB2>;
 			power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
 			clocks = <&topckgen CLK_TOP_USB30_SEL>,
+				 <&clk26m>,
 				 <&pericfg CLK_PERI_USB0>,
 				 <&pericfg CLK_PERI_USB1>;
 			clock-names = "sys_ck",
+				      "ref_ck",
 				      "wakeup_deb_p0",
 				      "wakeup_deb_p1";
 			mediatek,syscon-wakeup = <&pericfg>;
@@ -746,8 +748,8 @@
 				reg-names = "mac";
 				interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
 				power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
-				clocks = <&topckgen CLK_TOP_USB30_SEL>;
-				clock-names = "sys_ck";
+				clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
+				clock-names = "sys_ck", "ref_ck";
 				status = "disabled";
 			};
 		};
-- 
1.7.9.5

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

* [PATCH -next 2/3] usb: mtu3: make the reference clock optional
  2017-02-07  6:13 [PATCH -next 1/3] arm64: dts: mt8173: add reference clock for usb Chunfeng Yun
@ 2017-02-07  6:13 ` Chunfeng Yun
  2017-02-07  6:13 ` [PATCH -next 3/3] usb: xhci-mtk: " Chunfeng Yun
  1 sibling, 0 replies; 3+ messages in thread
From: Chunfeng Yun @ 2017-02-07  6:13 UTC (permalink / raw)
  To: linux-arm-kernel

Make the reference clock optional for DTS backward compatibility
and ignore the error if it does not exist.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/mtu3/mtu3_plat.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 19a345d..c3125da 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -225,10 +225,17 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
 		return PTR_ERR(ssusb->sys_clk);
 	}
 
+	/*
+	 * reference clock is usually a "fixed-clock", make it optional
+	 * for backward compatibility and ignore the error if it does
+	 * not exist.
+	 */
 	ssusb->ref_clk = devm_clk_get(dev, "ref_ck");
 	if (IS_ERR(ssusb->ref_clk)) {
-		dev_err(dev, "failed to get ref clock\n");
-		return PTR_ERR(ssusb->ref_clk);
+		if (PTR_ERR(ssusb->ref_clk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
+		ssusb->ref_clk = NULL;
 	}
 
 	ssusb->num_phys = of_count_phandle_with_args(node,
-- 
1.7.9.5

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

* [PATCH -next 3/3] usb: xhci-mtk: make the reference clock optional
  2017-02-07  6:13 [PATCH -next 1/3] arm64: dts: mt8173: add reference clock for usb Chunfeng Yun
  2017-02-07  6:13 ` [PATCH -next 2/3] usb: mtu3: make the reference clock optional Chunfeng Yun
@ 2017-02-07  6:13 ` Chunfeng Yun
  1 sibling, 0 replies; 3+ messages in thread
From: Chunfeng Yun @ 2017-02-07  6:13 UTC (permalink / raw)
  To: linux-arm-kernel

Make the reference clock optional for DTS backward compatibility
and ignore the error if it does not exist.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 4d75ac5..75bae8e 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -559,10 +559,17 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 		return PTR_ERR(mtk->sys_clk);
 	}
 
+	/*
+	 * reference clock is usually a "fixed-clock", make it optional
+	 * for backward compatibility and ignore the error if it does
+	 * not exist.
+	 */
 	mtk->ref_clk = devm_clk_get(dev, "ref_ck");
 	if (IS_ERR(mtk->ref_clk)) {
-		dev_err(dev, "fail to get ref_ck\n");
-		return PTR_ERR(mtk->ref_clk);
+		if (PTR_ERR(mtk->ref_clk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
+		mtk->ref_clk = NULL;
 	}
 
 	mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
-- 
1.7.9.5

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

end of thread, other threads:[~2017-02-07  6:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07  6:13 [PATCH -next 1/3] arm64: dts: mt8173: add reference clock for usb Chunfeng Yun
2017-02-07  6:13 ` [PATCH -next 2/3] usb: mtu3: make the reference clock optional Chunfeng Yun
2017-02-07  6:13 ` [PATCH -next 3/3] usb: xhci-mtk: " Chunfeng Yun

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