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

From: Manuel Lauss
Date: Thu Jul 03 2014 - 09:23:39 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/