fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM

Resuming from runtime PM restores all LCDC registers. If the dot clock
is off at that time display panning information will be corrupted.

Turn the dot clock on before resuming from runtime PM. Similarly,
turn the clock off after suspending the LCDC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
This commit is contained in:
Laurent Pinchart 2011-07-11 11:05:49 +02:00
Родитель 91142bfe98
Коммит f1ad90da5c
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -256,9 +256,9 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv) static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
{ {
if (atomic_inc_and_test(&priv->hw_usecnt)) { if (atomic_inc_and_test(&priv->hw_usecnt)) {
pm_runtime_get_sync(priv->dev);
if (priv->dot_clk) if (priv->dot_clk)
clk_enable(priv->dot_clk); clk_enable(priv->dot_clk);
pm_runtime_get_sync(priv->dev);
if (priv->meram_dev && priv->meram_dev->pdev) if (priv->meram_dev && priv->meram_dev->pdev)
pm_runtime_get_sync(&priv->meram_dev->pdev->dev); pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
} }
@ -267,11 +267,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
{ {
if (atomic_sub_return(1, &priv->hw_usecnt) == -1) { 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) if (priv->meram_dev && priv->meram_dev->pdev)
pm_runtime_put_sync(&priv->meram_dev->pdev->dev); pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
pm_runtime_put(priv->dev); pm_runtime_put(priv->dev);
if (priv->dot_clk)
clk_disable(priv->dot_clk);
} }
} }