aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_lcdcfb.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-07-06 21:30:02 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-07-06 21:30:02 -0400
commit727dc3fde82969609e1e69f1f12de83c2fe41238 (patch)
tree7354b8c2aced2124af0cd21ea33fb03175ba7329 /drivers/video/sh_mobile_lcdcfb.c
parent7119888df1fd115573616ae43747b2e823b0663e (diff)
video: sh_mobile_lcdcfb: depends on HAVE_CLK.
This deifdefs the driver and adds an explicit HAVE_CLK dependency. Given that all SH platforms provide it, there is no reason to keep this as an ifdef. Other architectures that implement support for this driver will already have to provide clock framework support for timers and so on already, so adding this as an additional dependency is not terribly probematic. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c16
1 files changed, 1 insertions, 15 deletions
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);