]> git.karo-electronics.de Git - linux-beck.git/commitdiff
fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDC
authorDamian Hobson-Garcia <dhobsong@igel.co.jp>
Mon, 4 Jul 2011 06:06:47 +0000 (08:06 +0200)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 19 Aug 2011 06:11:12 +0000 (08:11 +0200)
The MERAM reference counts should be tied to the two LCDC devices (LCD/HDMI)
so that when they are enable/disabled, the MERAM is as well.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
drivers/video/sh_mobile_lcdcfb.c

index b048417247e8f1e54268871932d68e23cdb3a9dd..2f921ad18559ee5692fea05fac9ebce09d5e0be6 100644 (file)
@@ -259,6 +259,8 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
                pm_runtime_get_sync(priv->dev);
                if (priv->dot_clk)
                        clk_enable(priv->dot_clk);
+               if (priv->meram_dev && priv->meram_dev->pdev)
+                       pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
        }
 }
 
@@ -267,6 +269,8 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
        if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
                if (priv->dot_clk)
                        clk_disable(priv->dot_clk);
+               if (priv->meram_dev && priv->meram_dev->pdev)
+                       pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
                pm_runtime_put(priv->dev);
        }
 }