imx-drm: imx-drm-core: add basic suspend/resume support
authorShawn Guo <shawn.guo@freescale.com>
Wed, 10 Sep 2014 14:43:51 +0000 (22:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 06:36:27 +0000 (23:36 -0700)
commitbfe945c8e1260e405a7a257719c9e2cf77cafa4e
treee074e1dcf745b9a1967a02df7efd05a5d273f488
parentb46355f0f77f6553ad6079ffd6ee5adfb8ca7a8b
imx-drm: imx-drm-core: add basic suspend/resume support

HDMI currently stops working after a system suspend/resume cycle.  The
cause is that the mode setting states in hardware gets lost and isn't
restored across the suspend/resume cycle.

The patch adds a very basic suspend/resume support to imx-drm driver,
and calls drm_helper_resume_force_mode() in .resume hook to restore the
mode setting states, so that HDMI can continue working after a system
suspend/resume cycle.

Since the suspend/resume hook can be called with drm_device pointer
being NULL from driver data, we need a check on the pointer in the
hooks.  And to avoid using a stale pointer from driver data, it also
clears driver data in .unload hook.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/imx-drm-core.c