diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index d9f394e3c216..75f613b024bf 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -191,6 +191,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev, | |||
191 | int clock_source, | 191 | int clock_source, |
192 | struct sh_mobile_lcdc_priv *priv) | 192 | struct sh_mobile_lcdc_priv *priv) |
193 | { | 193 | { |
194 | struct clk *clk; | ||
194 | char *str; | 195 | char *str; |
195 | 196 | ||
196 | switch (clock_source) { | 197 | switch (clock_source) { |
@@ -210,21 +211,16 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev, | |||
210 | return -EINVAL; | 211 | return -EINVAL; |
211 | } | 212 | } |
212 | 213 | ||
213 | if (str) { | 214 | if (str == NULL) |
214 | priv->dot_clk = clk_get(&pdev->dev, str); | 215 | return 0; |
215 | if (IS_ERR(priv->dot_clk)) { | 216 | |
216 | dev_err(&pdev->dev, "cannot get dot clock %s\n", str); | 217 | clk = clk_get(&pdev->dev, str); |
217 | return PTR_ERR(priv->dot_clk); | 218 | if (IS_ERR(clk)) { |
218 | } | 219 | dev_err(&pdev->dev, "cannot get dot clock %s\n", str); |
220 | return PTR_ERR(clk); | ||
219 | } | 221 | } |
220 | 222 | ||
221 | /* Runtime PM support involves two step for this driver: | 223 | priv->dot_clk = clk; |
222 | * 1) Enable Runtime PM | ||
223 | * 2) Force Runtime PM Resume since hardware is accessed from probe() | ||
224 | */ | ||
225 | priv->dev = &pdev->dev; | ||
226 | pm_runtime_enable(priv->dev); | ||
227 | pm_runtime_resume(priv->dev); | ||
228 | return 0; | 224 | return 0; |
229 | } | 225 | } |
230 | 226 | ||
@@ -1513,11 +1509,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1513 | sh_mobile_lcdc_bl_remove(priv->ch[i].bl); | 1509 | sh_mobile_lcdc_bl_remove(priv->ch[i].bl); |
1514 | } | 1510 | } |
1515 | 1511 | ||
1516 | if (priv->dot_clk) | 1512 | if (priv->dot_clk) { |
1513 | pm_runtime_disable(&pdev->dev); | ||
1517 | clk_put(priv->dot_clk); | 1514 | clk_put(priv->dot_clk); |
1518 | 1515 | } | |
1519 | if (priv->dev) | ||
1520 | pm_runtime_disable(priv->dev); | ||
1521 | 1516 | ||
1522 | if (priv->base) | 1517 | if (priv->base) |
1523 | iounmap(priv->base); | 1518 | iounmap(priv->base); |
@@ -1739,6 +1734,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1739 | return -ENOMEM; | 1734 | return -ENOMEM; |
1740 | } | 1735 | } |
1741 | 1736 | ||
1737 | priv->dev = &pdev->dev; | ||
1738 | priv->meram_dev = pdata->meram_dev; | ||
1742 | platform_set_drvdata(pdev, priv); | 1739 | platform_set_drvdata(pdev, priv); |
1743 | 1740 | ||
1744 | error = request_irq(i, sh_mobile_lcdc_irq, 0, | 1741 | error = request_irq(i, sh_mobile_lcdc_irq, 0, |
@@ -1804,7 +1801,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1804 | goto err1; | 1801 | goto err1; |
1805 | } | 1802 | } |
1806 | 1803 | ||
1807 | priv->meram_dev = pdata->meram_dev; | 1804 | /* Enable runtime PM. */ |
1805 | pm_runtime_enable(&pdev->dev); | ||
1808 | 1806 | ||
1809 | for (i = 0; i < num_channels; i++) { | 1807 | for (i = 0; i < num_channels; i++) { |
1810 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; | 1808 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; |