linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: dw_mmc-rockchip: add default drv phase support
@ 2016-05-06  9:40 Shawn Lin
  2016-05-06  9:41 ` [PATCH 2/2] dt-bindings: rockchip-dw-mshc: add rockchip,default-drv-phase Shawn Lin
  2016-05-06 17:28 ` [PATCH 1/2] mmc: dw_mmc-rockchip: add default drv phase support Doug Anderson
  0 siblings, 2 replies; 13+ messages in thread
From: Shawn Lin @ 2016-05-06  9:40 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Ulf Hansson, Rob Herring, linux-mmc, linux-kernel, Doug Anderson,
	Brian Norris, Heiko Stuebner, linux-rockchip, devicetree,
	Shawn Lin

This patch introduces default drv phase exposed to dts for
users to set drv phase. If default-drv-phase is not assigned,
let's set it to 180 degrees.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/host/dw_mmc-rockchip.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index 8c20b81..482eff1 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -24,6 +24,7 @@ struct dw_mci_rockchip_priv_data {
 	struct clk		*drv_clk;
 	struct clk		*sample_clk;
 	int			default_sample_phase;
+	int			default_drv_phase;
 };
 
 static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
@@ -66,6 +67,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
 	/* Make sure we use phases which we can enumerate with */
 	if (!IS_ERR(priv->sample_clk))
 		clk_set_phase(priv->sample_clk, priv->default_sample_phase);
+
+	if (!IS_ERR(priv->drv_clk))
+		clk_set_phase(priv->drv_clk, priv->default_drv_phase);
 }
 
 #define NUM_PHASES			360
@@ -203,6 +207,10 @@ static int dw_mci_rk3288_parse_dt(struct dw_mci *host)
 					&priv->default_sample_phase))
 		priv->default_sample_phase = 0;
 
+	if (of_property_read_u32(np, "rockchip,default-drv-phase",
+					&priv->default_drv_phase))
+		priv->default_drv_phase = 180;
+
 	priv->drv_clk = devm_clk_get(host->dev, "ciu-drive");
 	if (IS_ERR(priv->drv_clk))
 		dev_dbg(host->dev, "ciu_drv not available\n");
-- 
2.3.7

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

end of thread, other threads:[~2016-05-12  3:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06  9:40 [PATCH 1/2] mmc: dw_mmc-rockchip: add default drv phase support Shawn Lin
2016-05-06  9:41 ` [PATCH 2/2] dt-bindings: rockchip-dw-mshc: add rockchip,default-drv-phase Shawn Lin
2016-05-06 17:26   ` Doug Anderson
2016-05-09 11:12     ` Shawn Lin
2016-05-09 16:31       ` Doug Anderson
2016-05-10 10:19         ` Shawn Lin
2016-05-10 15:57           ` Doug Anderson
2016-05-11  2:50             ` Shawn Lin
2016-05-11  3:50               ` Doug Anderson
2016-05-11  8:25                 ` Shawn Lin
2016-05-11 21:42                   ` Doug Anderson
2016-05-12  3:03                     ` Shawn Lin
2016-05-06 17:28 ` [PATCH 1/2] mmc: dw_mmc-rockchip: add default drv phase support Doug Anderson

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