Skip to contentSkip to conversation

sh: skip disabled LCDC channels

PATCH Applied Magnus Damm 1 participant 1 message Aug 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 sh: skip disabled LCDC channels

From: Magnus Damm <[email protected]>

This patch updates the SuperH Mobile LCDC driver to skip over disabled channels. Without this patch suspend-to-ram operation will crash if deferred io is enabled.

---

 drivers/video/sh_mobile_lcdcfb.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/video/sh_mobile_lcdcfb.c +5 -0
@@ -477,6 +477,9 @@ static int sh_mobile_lcdc_start(struct s
 	/* tell the board code to enable the panel */
 	for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
 		ch = &priv->ch[k];
+		if (!ch->enabled)
+			continue;
+
 		board_cfg = &ch->cfg.board_cfg;
 		if (board_cfg->display_on)
 			board_cfg->display_on(board_cfg->board_data);
@@ -494,6 +497,8 @@ static void sh_mobile_lcdc_stop(struct s
 	/* clean up deferred io and ask board code to disable panel */
 	for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
 		ch = &priv->ch[k];
+		if (!ch->enabled)
+			continue;
 
 		/* deferred io mode:
 		 * flush frame, and wait for frame end interrupt