Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gma500: Prevent endless loop in panel power up sequence

Some devices don't have a panel connected to LVDS and thus will never power up.
This patch checks the power sequence progress bits in PP_STATUS to prevent an
endless loop on such devices.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Alan Cox and committed by
Dave Airlie
ac0a5dd6 3299de95

+9 -3
+9 -3
drivers/gpu/drm/gma500/psb_lid.c
··· 40 40 REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) | POWER_TARGET_ON); 41 41 do { 42 42 pp_status = REG_READ(PP_STATUS); 43 - } while ((pp_status & PP_ON) == 0); 43 + } while ((pp_status & PP_ON) == 0 && 44 + (pp_status & PP_SEQUENCE_MASK) != 0); 44 45 45 - /*FIXME: should be backlight level before*/ 46 - psb_intel_lvds_set_brightness(dev, 100); 46 + if (REG_READ(PP_STATUS) & PP_ON) { 47 + /*FIXME: should be backlight level before*/ 48 + psb_intel_lvds_set_brightness(dev, 100); 49 + } else { 50 + DRM_DEBUG("LVDS panel never powered up"); 51 + return; 52 + } 47 53 } else { 48 54 psb_intel_lvds_set_brightness(dev, 0); 49 55