From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 09/10] video i.MX: Use regular clk_[en|dis]able functions
Date: Mon, 8 Oct 2012 21:44:18 +0200 [thread overview]
Message-ID: <1349725459-20226-10-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1349725459-20226-1-git-send-email-s.hauer@pengutronix.de>
This controller has no enable bit. It is always on once the
pixel clock is provided. This patch switches the driver to use
regular clk functions instead of SoC specific register hacking.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/video/imx.c | 44 +++++---------------------------------------
1 file changed, 5 insertions(+), 39 deletions(-)
diff --git a/drivers/video/imx.c b/drivers/video/imx.c
index 9406b36..ae4c671 100644
--- a/drivers/video/imx.c
+++ b/drivers/video/imx.c
@@ -252,19 +252,9 @@ static void imxfb_enable_controller(struct fb_info *info)
struct imxfb_info *fbi = info->priv;
writel(RMCR_LCDC_EN, fbi->regs + LCDC_RMCR);
-#ifdef CONFIG_ARCH_IMX21
- PCCR0 |= PCCR0_PERCLK3_EN | PCCR0_HCLK_LCDC_EN;
-#endif
-#ifdef CONFIG_ARCH_IMX27
- PCCR0 |= PCCR0_LCDC_EN;
- PCCR1 |= PCCR1_HCLK_LCDC;
-#endif
-#ifdef CONFIG_ARCH_IMX25
- writel(readl(IMX_CCM_BASE + CCM_CGCR0) | (1 << 24) | (1 << 7),
- IMX_CCM_BASE + CCM_CGCR0);
- writel(readl(IMX_CCM_BASE + CCM_CGCR1) | (1 << 29),
- IMX_CCM_BASE + CCM_CGCR1);
-#endif
+
+ clk_enable(fbi->clk);
+
if (fbi->enable)
fbi->enable(1);
}
@@ -277,19 +267,8 @@ static void imxfb_disable_controller(struct fb_info *info)
fbi->enable(0);
writel(0, fbi->regs + LCDC_RMCR);
-#ifdef CONFIG_ARCH_IMX21
- PCCR0 &= ~(PCCR0_PERCLK3_EN | PCCR0_HCLK_LCDC_EN);
-#endif
-#ifdef CONFIG_ARCH_IMX27
- PCCR0 &= ~PCCR0_LCDC_EN;
- PCCR1 &= ~PCCR1_HCLK_LCDC;
-#endif
-#ifdef CONFIG_ARCH_IMX25
- writel(readl(IMX_CCM_BASE + CCM_CGCR0) & ~((1 << 24) | (1 << 7)),
- IMX_CCM_BASE + CCM_CGCR0);
- writel(readl(IMX_CCM_BASE + CCM_CGCR1) & ~(1 << 29),
- IMX_CCM_BASE + CCM_CGCR1);
-#endif
+
+ clk_disable(fbi->clk);
}
/*
@@ -541,19 +520,6 @@ static int imxfb_probe(struct device_d *dev)
if (!pdata)
return -ENODEV;
-#ifdef CONFIG_ARCH_IMX21
- PCCR0 &= ~(PCCR0_PERCLK3_EN | PCCR0_HCLK_LCDC_EN);
-#endif
-#ifdef CONFIG_ARCH_IMX27
- PCCR0 &= ~PCCR0_LCDC_EN;
- PCCR1 &= ~PCCR1_HCLK_LCDC;
-#endif
-#ifdef CONFIG_ARCH_IMX25
- writel(readl(IMX_CCM_BASE + CCM_CGCR0) & ~((1 << 24) | (1 << 7)),
- IMX_CCM_BASE + CCM_CGCR0);
- writel(readl(IMX_CCM_BASE + CCM_CGCR1) & ~(1 << 29),
- IMX_CCM_BASE + CCM_CGCR1);
-#endif
if (!pdata->num_modes) {
dev_err(dev, "no modes. bailing out\n");
return -EINVAL;
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-10-08 19:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 19:44 [PATCH] i.MX clk Sascha Hauer
2012-10-08 19:44 ` [PATCH 01/10] clk: Add clk gate support Sascha Hauer
2012-10-08 19:44 ` [PATCH 02/10] ARM i.MX: Add clk_gate inline function Sascha Hauer
2012-10-08 19:44 ` [PATCH 03/10] ARM i.MX21: Fix CSPI parent clock Sascha Hauer
2012-10-08 19:44 ` [PATCH 04/10] ARM i.MX21: Enable all needed clocks during startup Sascha Hauer
2012-10-08 19:44 ` [PATCH 05/10] ARM i.MX25: " Sascha Hauer
2012-10-08 20:49 ` Roberto Nibali
2012-10-08 20:58 ` Sascha Hauer
2012-10-08 21:18 ` Roberto Nibali
2012-10-10 7:49 ` Sascha Hauer
2012-10-08 19:44 ` [PATCH 06/10] ARM i.MX21: Add lcdc per gate Sascha Hauer
2012-10-08 19:44 ` [PATCH 07/10] ARM i.MX27: " Sascha Hauer
2012-10-08 19:44 ` [PATCH 08/10] ARM i.MX25: " Sascha Hauer
2012-10-08 19:44 ` Sascha Hauer [this message]
2012-10-08 19:44 ` [PATCH 10/10] ARM i.MX: Enable clocks in common place Sascha Hauer
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=1349725459-20226-10-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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