aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c16
2 files changed, 2 insertions, 16 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 8afcf08eba98..ca330b1b3653 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1866,7 +1866,7 @@ config FB_W100
1866 1866
1867config FB_SH_MOBILE_LCDC 1867config FB_SH_MOBILE_LCDC
1868 tristate "SuperH Mobile LCDC framebuffer support" 1868 tristate "SuperH Mobile LCDC framebuffer support"
1869 depends on FB && SUPERH 1869 depends on FB && SUPERH && HAVE_CLK
1870 select FB_SYS_FILLRECT 1870 select FB_SYS_FILLRECT
1871 select FB_SYS_COPYAREA 1871 select FB_SYS_COPYAREA
1872 select FB_SYS_IMAGEBLIT 1872 select FB_SYS_IMAGEBLIT
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index da983b720f08..65806ec3313b 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -42,11 +42,9 @@ struct sh_mobile_lcdc_chan {
42struct sh_mobile_lcdc_priv { 42struct sh_mobile_lcdc_priv {
43 void __iomem *base; 43 void __iomem *base;
44 int irq; 44 int irq;
45#ifdef CONFIG_HAVE_CLK
46 atomic_t clk_usecnt; 45 atomic_t clk_usecnt;
47 struct clk *dot_clk; 46 struct clk *dot_clk;
48 struct clk *clk; 47 struct clk *clk;
49#endif
50 unsigned long lddckr; 48 unsigned long lddckr;
51 struct sh_mobile_lcdc_chan ch[2]; 49 struct sh_mobile_lcdc_chan ch[2];
52 int started; 50 int started;
@@ -185,7 +183,6 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
185 lcdc_sys_read_data, 183 lcdc_sys_read_data,
186}; 184};
187 185
188#ifdef CONFIG_HAVE_CLK
189static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) 186static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
190{ 187{
191 if (atomic_inc_and_test(&priv->clk_usecnt)) { 188 if (atomic_inc_and_test(&priv->clk_usecnt)) {
@@ -203,10 +200,6 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
203 clk_disable(priv->clk); 200 clk_disable(priv->clk);
204 } 201 }
205} 202}
206#else
207static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) {}
208static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) {}
209#endif
210 203
211static int sh_mobile_lcdc_sginit(struct fb_info *info, 204static int sh_mobile_lcdc_sginit(struct fb_info *info,
212 struct list_head *pagelist) 205 struct list_head *pagelist)
@@ -515,7 +508,6 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
515 board_cfg = &ch->cfg.board_cfg; 508 board_cfg = &ch->cfg.board_cfg;
516 if (board_cfg->display_off) 509 if (board_cfg->display_off)
517 board_cfg->display_off(board_cfg->board_data); 510 board_cfg->display_off(board_cfg->board_data);
518
519 } 511 }
520 512
521 /* stop the lcdc */ 513 /* stop the lcdc */
@@ -574,9 +566,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
574 int clock_source, 566 int clock_source,
575 struct sh_mobile_lcdc_priv *priv) 567 struct sh_mobile_lcdc_priv *priv)
576{ 568{
577#ifdef CONFIG_HAVE_CLK
578 char clk_name[8]; 569 char clk_name[8];
579#endif
580 char *str; 570 char *str;
581 int icksel; 571 int icksel;
582 572
@@ -590,7 +580,6 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
590 580
591 priv->lddckr = icksel << 16; 581 priv->lddckr = icksel << 16;
592 582
593#ifdef CONFIG_HAVE_CLK
594 atomic_set(&priv->clk_usecnt, -1); 583 atomic_set(&priv->clk_usecnt, -1);
595 snprintf(clk_name, sizeof(clk_name), "lcdc%d", pdev->id); 584 snprintf(clk_name, sizeof(clk_name), "lcdc%d", pdev->id);
596 priv->clk = clk_get(&pdev->dev, clk_name); 585 priv->clk = clk_get(&pdev->dev, clk_name);
@@ -598,7 +587,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
598 dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name); 587 dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name);
599 return PTR_ERR(priv->clk); 588 return PTR_ERR(priv->clk);
600 } 589 }
601 590
602 if (str) { 591 if (str) {
603 priv->dot_clk = clk_get(&pdev->dev, str); 592 priv->dot_clk = clk_get(&pdev->dev, str);
604 if (IS_ERR(priv->dot_clk)) { 593 if (IS_ERR(priv->dot_clk)) {
@@ -607,7 +596,6 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
607 return PTR_ERR(priv->dot_clk); 596 return PTR_ERR(priv->dot_clk);
608 } 597 }
609 } 598 }
610#endif
611 599
612 return 0; 600 return 0;
613} 601}
@@ -934,11 +922,9 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
934 fb_dealloc_cmap(&info->cmap); 922 fb_dealloc_cmap(&info->cmap);
935 } 923 }
936 924
937#ifdef CONFIG_HAVE_CLK
938 if (priv->dot_clk) 925 if (priv->dot_clk)
939 clk_put(priv->dot_clk); 926 clk_put(priv->dot_clk);
940 clk_put(priv->clk); 927 clk_put(priv->clk);
941#endif
942 928
943 if (priv->base) 929 if (priv->base)
944 iounmap(priv->base); 930 iounmap(priv->base);