aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_lcdcfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 4c32c06579a0..efff672fd7b8 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -16,7 +16,7 @@
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <asm/sh_mobile_lcdc.h> 19#include <video/sh_mobile_lcdc.h>
20 20
21#define PALETTE_NR 16 21#define PALETTE_NR 16
22 22
@@ -34,7 +34,9 @@ struct sh_mobile_lcdc_chan {
34 34
35struct sh_mobile_lcdc_priv { 35struct sh_mobile_lcdc_priv {
36 void __iomem *base; 36 void __iomem *base;
37#ifdef CONFIG_HAVE_CLK
37 struct clk *clk; 38 struct clk *clk;
39#endif
38 unsigned long lddckr; 40 unsigned long lddckr;
39 struct sh_mobile_lcdc_chan ch[2]; 41 struct sh_mobile_lcdc_chan ch[2];
40}; 42};
@@ -260,6 +262,11 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
260 tmp = ch->ldmt1r_value; 262 tmp = ch->ldmt1r_value;
261 tmp |= (lcd_cfg->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 1 << 28; 263 tmp |= (lcd_cfg->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 1 << 28;
262 tmp |= (lcd_cfg->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 1 << 27; 264 tmp |= (lcd_cfg->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 1 << 27;
265 tmp |= (ch->cfg.flags & LCDC_FLAGS_DWPOL) ? 1 << 26 : 0;
266 tmp |= (ch->cfg.flags & LCDC_FLAGS_DIPOL) ? 1 << 25 : 0;
267 tmp |= (ch->cfg.flags & LCDC_FLAGS_DAPOL) ? 1 << 24 : 0;
268 tmp |= (ch->cfg.flags & LCDC_FLAGS_HSCNT) ? 1 << 17 : 0;
269 tmp |= (ch->cfg.flags & LCDC_FLAGS_DWCNT) ? 1 << 16 : 0;
263 lcdc_write_chan(ch, LDMT1R, tmp); 270 lcdc_write_chan(ch, LDMT1R, tmp);
264 271
265 /* setup SYS bus */ 272 /* setup SYS bus */
@@ -422,6 +429,7 @@ static int sh_mobile_lcdc_setup_clocks(struct device *dev, int clock_source,
422 429
423 priv->lddckr = icksel << 16; 430 priv->lddckr = icksel << 16;
424 431
432#ifdef CONFIG_HAVE_CLK
425 if (str) { 433 if (str) {
426 priv->clk = clk_get(dev, str); 434 priv->clk = clk_get(dev, str);
427 if (IS_ERR(priv->clk)) { 435 if (IS_ERR(priv->clk)) {
@@ -431,6 +439,7 @@ static int sh_mobile_lcdc_setup_clocks(struct device *dev, int clock_source,
431 439
432 clk_enable(priv->clk); 440 clk_enable(priv->clk);
433 } 441 }
442#endif
434 443
435 return 0; 444 return 0;
436} 445}
@@ -585,7 +594,6 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev)
585 goto err1; 594 goto err1;
586 } 595 }
587 596
588 priv->lddckr = pdata->lddckr;
589 priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); 597 priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1);
590 598
591 for (i = 0; i < j; i++) { 599 for (i = 0; i < j; i++) {
@@ -688,10 +696,12 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
688 fb_dealloc_cmap(&info->cmap); 696 fb_dealloc_cmap(&info->cmap);
689 } 697 }
690 698
699#ifdef CONFIG_HAVE_CLK
691 if (priv->clk) { 700 if (priv->clk) {
692 clk_disable(priv->clk); 701 clk_disable(priv->clk);
693 clk_put(priv->clk); 702 clk_put(priv->clk);
694 } 703 }
704#endif
695 705
696 if (priv->base) 706 if (priv->base)
697 iounmap(priv->base); 707 iounmap(priv->base);