aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-10-25 09:28:47 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-11-06 09:41:36 -0500
commitd301a5ac1688bf99039adb10b4516b465f1f7a83 (patch)
treeba54319c32d263441ba38d461b90528b5da9e7e3 /drivers/video
parent0df1f2487d2f0d04703f142813d53615d62a1da4 (diff)
fbdev: mxsfb: Add support for mx6sl and mx6sx
mx6sl and mx6sx share the same LCD controller as mx23 and mx28. Add support for it. The basic difference is the number of clocks that are required: - mx23/mx28: only one clock - mx6sl: two clocks - mx6sx: three clocks Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/Kconfig2
-rw-r--r--drivers/video/fbdev/mxsfb.c19
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index c7bf606a8706..025b439d4fe1 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -2425,7 +2425,7 @@ config FB_JZ4740
2425 2425
2426config FB_MXS 2426config FB_MXS
2427 tristate "MXS LCD framebuffer support" 2427 tristate "MXS LCD framebuffer support"
2428 depends on FB && ARCH_MXS 2428 depends on FB && (ARCH_MXS || ARCH_MXC)
2429 select FB_CFB_FILLRECT 2429 select FB_CFB_FILLRECT
2430 select FB_CFB_COPYAREA 2430 select FB_CFB_COPYAREA
2431 select FB_CFB_IMAGEBLIT 2431 select FB_CFB_IMAGEBLIT
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index accf48a2cce4..f8ac4a452f26 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -172,6 +172,8 @@ struct mxsfb_info {
172 struct fb_info fb_info; 172 struct fb_info fb_info;
173 struct platform_device *pdev; 173 struct platform_device *pdev;
174 struct clk *clk; 174 struct clk *clk;
175 struct clk *clk_axi;
176 struct clk *clk_disp_axi;
175 void __iomem *base; /* registers */ 177 void __iomem *base; /* registers */
176 unsigned allocated_size; 178 unsigned allocated_size;
177 int enabled; 179 int enabled;
@@ -331,6 +333,11 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
331 } 333 }
332 } 334 }
333 335
336 if (host->clk_axi)
337 clk_prepare_enable(host->clk_axi);
338
339 if (host->clk_disp_axi)
340 clk_prepare_enable(host->clk_disp_axi);
334 clk_prepare_enable(host->clk); 341 clk_prepare_enable(host->clk);
335 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); 342 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
336 343
@@ -374,6 +381,10 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
374 writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4); 381 writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
375 382
376 clk_disable_unprepare(host->clk); 383 clk_disable_unprepare(host->clk);
384 if (host->clk_disp_axi)
385 clk_disable_unprepare(host->clk_disp_axi);
386 if (host->clk_axi)
387 clk_disable_unprepare(host->clk_axi);
377 388
378 host->enabled = 0; 389 host->enabled = 0;
379 390
@@ -867,6 +878,14 @@ static int mxsfb_probe(struct platform_device *pdev)
867 goto fb_release; 878 goto fb_release;
868 } 879 }
869 880
881 host->clk_axi = devm_clk_get(&host->pdev->dev, "axi");
882 if (IS_ERR(host->clk_axi))
883 host->clk_axi = NULL;
884
885 host->clk_disp_axi = devm_clk_get(&host->pdev->dev, "disp_axi");
886 if (IS_ERR(host->clk_disp_axi))
887 host->clk_disp_axi = NULL;
888
870 host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd"); 889 host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
871 if (IS_ERR(host->reg_lcd)) 890 if (IS_ERR(host->reg_lcd))
872 host->reg_lcd = NULL; 891 host->reg_lcd = NULL;