[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1404393762-858019-10-git-send-email-manuel.lauss@gmail.com>
Date: Thu, 3 Jul 2014 15:22:40 +0200
From: Manuel Lauss <manuel.lauss@...il.com>
To: Linux-MIPS <linux-mips@...ux-mips.org>,
Mike Turquette <mturquette@...aro.org>
Cc: linux-kernel@...r.kernel.org, Manuel Lauss <manuel.lauss@...il.com>
Subject: [RFC PATCH v2 09/11] MIPS: Alchemy: au1200fb: use clk framework
minimal patch to replace direct clock register hackery with clock
framework calls.
Signed-off-by: Manuel Lauss <manuel.lauss@...il.com>
---
v2: initial version, new
drivers/video/fbdev/au1200fb.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 230cfa8..3c8cf71 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -30,6 +30,7 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/clk.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/kernel.h>
@@ -829,11 +830,19 @@ static void au1200_setpanel(struct panel_settings *newpanel,
*/
if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
{
- uint32 sys_clksrc;
- AU1X_WRSYS(panel->mode_auxpll, AU1000_SYS_AUXPLL);
- sys_clksrc = AU1X_RDSYS(AU1000_SYS_CLKSRC) & ~0x0000001f;
- sys_clksrc |= panel->mode_toyclksrc;
- AU1X_WRSYS(sys_clksrc, AU1000_SYS_CLKSRC);
+ struct clk *a, *c = clk_get(NULL, "lcd_intclk");
+
+ if (!IS_ERR(c)) {
+ if ((panel->mode_toyclksrc & 7) == 4) {
+ a = clk_get(NULL, ALCHEMY_AUXPLL_CLK);
+ if (!IS_ERR(a)) {
+ clk_set_parent(c, a);
+ clk_put(a);
+ }
+ }
+ clk_prepare_enable(c);
+ clk_put(c);
+ }
}
/*
--
2.0.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists