public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabien Parent <fparent@baylibre.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/7] mmc: mtk-sd: add source_cg clock support
Date: Sun, 24 Mar 2019 16:46:32 +0100	[thread overview]
Message-ID: <20190324154638.29800-2-fparent@baylibre.com> (raw)
In-Reply-To: <20190324154638.29800-1-fparent@baylibre.com>

Some MediaTek SoC need an additional clock "source_cg". Enable
this new clock. We reuse the same clock name as in the kernel.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
Acked-by: Ryder Lee <ryder.lee@mediatek.com>
---

v3:
	* No change

v2:
	* Get rid of variable has_src_clk_cg

---
 drivers/mmc/mtk-sd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
index d3f0778368..eed98b769c 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -247,6 +247,7 @@ struct msdc_host {
 	struct msdc_compatible *dev_comp;
 
 	struct clk src_clk;	/* for SD/MMC bus clock */
+	struct clk src_clk_cg;	/* optional, MSDC source clock control gate */
 	struct clk h_clk;	/* MSDC core clock */
 
 	u32 src_clk_freq;	/* source clock */
@@ -1269,6 +1270,8 @@ static void msdc_ungate_clock(struct msdc_host *host)
 {
 	clk_enable(&host->src_clk);
 	clk_enable(&host->h_clk);
+	if (host->src_clk_cg.dev)
+		clk_enable(&host->src_clk_cg);
 }
 
 static int msdc_drv_probe(struct udevice *dev)
@@ -1332,6 +1335,8 @@ static int msdc_ofdata_to_platdata(struct udevice *dev)
 	if (ret < 0)
 		return ret;
 
+	clk_get_by_name(dev, "source_cg", &host->src_clk_cg); /* optional */
+
 #if IS_ENABLED(DM_GPIO)
 	gpio_request_by_name(dev, "wp-gpios", 0, &host->gpio_wp, GPIOD_IS_IN);
 	gpio_request_by_name(dev, "cd-gpios", 0, &host->gpio_cd, GPIOD_IS_IN);
-- 
2.20.1

  reply	other threads:[~2019-03-24 15:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 15:46 [U-Boot] [PATCH v3 0/7] Add support for MT8516 SoC Fabien Parent
2019-03-24 15:46 ` Fabien Parent [this message]
2019-04-24 13:29   ` [U-Boot] [U-Boot, v3, 1/7] mmc: mtk-sd: add source_cg clock support Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 2/7] mmc: mtk-sd: add support for MT8516 Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot,v3,2/7] " Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 3/7] mmc: mtk-sd: fix configuration option check Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 4/7] clk: mediatek: add support for SETCLR_INV and NO_SETCLR flags Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 5/7] clk: mediatek: add driver for MT8516 Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot,v3,5/7] " Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 6/7] pinctrl: " Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot,v3,6/7] " Tom Rini
2019-03-24 15:46 ` [U-Boot] [PATCH v3 7/7] ARM: MediaTek: Add support for MT8516 SoC Fabien Parent
2019-04-24 13:30   ` [U-Boot] [U-Boot, v3, " Tom Rini

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=20190324154638.29800-2-fparent@baylibre.com \
    --to=fparent@baylibre.com \
    --cc=u-boot@lists.denx.de \
    /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