devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anson Huang <Anson.Huang@nxp.com>
To: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, fabio.estevam@nxp.com, robh+dt@kernel.org,
	mark.rutland@arm.com, linux@armlinux.org.uk,
	mturquette@baylibre.com, sboyd@kernel.org,
	colin.didier@devialet.com, clement.peron@devialet.com,
	ping.bai@nxp.com, aisheng.dong@nxp.com, shengjiu.wang@nxp.com,
	matteo.lisi@engicam.com, michael@amarulasolutions.com,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Cc: Linux-imx@nxp.com
Subject: [PATCH 1/7] ARM: imx: add mmdc ipg clock operation for mmdc
Date: Fri, 31 Aug 2018 15:53:12 +0800	[thread overview]
Message-ID: <1535701998-20443-2-git-send-email-Anson.Huang@nxp.com> (raw)
In-Reply-To: <1535701998-20443-1-git-send-email-Anson.Huang@nxp.com>

i.MX6 SoCs have MMDC ipg clock for registers access, to make
sure MMDC registers access successfully, add optional clock
enable for MMDC driver.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 arch/arm/mach-imx/mmdc.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c
index 04b3bf7..e49e068 100644
--- a/arch/arm/mach-imx/mmdc.c
+++ b/arch/arm/mach-imx/mmdc.c
@@ -11,6 +11,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+#include <linux/clk.h>
 #include <linux/hrtimer.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -546,7 +547,20 @@ static int imx_mmdc_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	void __iomem *mmdc_base, *reg;
+	struct clk *mmdc_ipg_clk;
 	u32 val;
+	int err;
+
+	/* the ipg clock is optional */
+	mmdc_ipg_clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(mmdc_ipg_clk))
+		mmdc_ipg_clk = NULL;
+
+	err = clk_prepare_enable(mmdc_ipg_clk);
+	if (err) {
+		dev_err(&pdev->dev, "Unable to enable mmdc ipg clock.\n");
+		return err;
+	}
 
 	mmdc_base = of_iomap(np, 0);
 	WARN_ON(!mmdc_base);
-- 
2.7.4

  reply	other threads:[~2018-08-31  7:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  7:53 [PATCH 0/7] Add i.MX6 SoCs mmdc ipg clocks management Anson Huang
2018-08-31  7:53 ` Anson Huang [this message]
2018-09-10  0:17   ` [PATCH 1/7] ARM: imx: add mmdc ipg clock operation for mmdc Shawn Guo
2018-08-31  7:53 ` [PATCH 2/7] clk: imx6ul: add mmdc1 ipg clock Anson Huang
2018-09-04 13:36   ` Rob Herring
2018-10-17 18:16   ` Stephen Boyd
2018-08-31  7:53 ` [PATCH 3/7] clk: imx6sx: " Anson Huang
2018-09-04 13:36   ` Rob Herring
2018-10-17 18:16   ` Stephen Boyd
2018-08-31  7:53 ` [PATCH 4/7] clk: imx6sll: " Anson Huang
2018-09-04 13:36   ` Rob Herring
2018-10-17 18:16   ` Stephen Boyd
2018-08-31  7:53 ` [PATCH 5/7] clk: imx6sl: add mmdc ipg clocks Anson Huang
2018-09-04 13:36   ` Rob Herring
2018-10-17 18:16   ` Stephen Boyd
2018-08-31  7:53 ` [PATCH 6/7] clk: imx6q: add mmdc0 ipg clock Anson Huang
2018-09-04 13:36   ` Rob Herring
2018-10-17 18:16   ` Stephen Boyd
2018-08-31  7:53 ` [PATCH 7/7] ARM: dts: imx6: add mmdc " Anson Huang
2018-11-05  2:20   ` Shawn Guo

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=1535701998-20443-2-git-send-email-Anson.Huang@nxp.com \
    --to=anson.huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=clement.peron@devialet.com \
    --cc=colin.didier@devialet.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=matteo.lisi@engicam.com \
    --cc=michael@amarulasolutions.com \
    --cc=mturquette@baylibre.com \
    --cc=ping.bai@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    /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).