Skip to content

Commit

Permalink
video: stop sh_mobile_lcdcfb only if started
Browse files Browse the repository at this point in the history
This patch fixes the LCDC driver to avoid calling the
function sh_mobile_lcdc_start_stop(priv, 0) unless the
same function has been called before to start the LCDC
hardware.

Triggered when sh_mobile_lcdcfb.c failed to probe() due to
missing MSTP clocks.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 22, 2009
1 parent 37869fa commit 8e9bb19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct sh_mobile_lcdc_priv {
#endif
unsigned long lddckr;
struct sh_mobile_lcdc_chan ch[2];
int started;
};

/* shared registers */
Expand Down Expand Up @@ -451,6 +452,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)

/* start the lcdc */
sh_mobile_lcdc_start_stop(priv, 1);
priv->started = 1;

/* tell the board code to enable the panel */
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
Expand Down Expand Up @@ -493,7 +495,10 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
}

/* stop the lcdc */
sh_mobile_lcdc_start_stop(priv, 0);
if (priv->started) {
sh_mobile_lcdc_start_stop(priv, 0);
priv->started = 0;
}

/* stop clocks */
for (k = 0; k < ARRAY_SIZE(priv->ch); k++)
Expand Down

0 comments on commit 8e9bb19

Please sign in to comment.