[RFC PATCH v2 09/11] MIPS: Alchemy: au1200fb: use clk framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



minimal patch to replace direct clock register hackery with clock
framework calls.

Signed-off-by: Manuel Lauss <manuel.lauss@xxxxxxxxx>
---
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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux