drm: Convert drm class driver from legacy pm ops to dev_pm_ops
authorShuah Khan <shuah.kh@samsung.com>
Mon, 1 Jul 2013 22:06:02 +0000 (16:06 -0600)
committerDave Airlie <airlied@redhat.com>
Thu, 4 Jul 2013 00:50:26 +0000 (10:50 +1000)
commitcf4b91f2d9de7ccc7ca0fb0931d55aaf8569fbc0
tree4a9abea83ec038b1a401279f16576ec888b20aa3
parentd0aaa2836aa3f12b4ebf3e21811616a083c8c91b
drm: Convert drm class driver from legacy pm ops to dev_pm_ops

Convert drivers/gpu/drm class to use dev_pm_ops for power management and
remove Legacy PM ops hooks. With this change, drm class registers
suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy
class->suspend/resume. When __device_suspend() runs call-backs, it will
find class->pm ops for the drm class.

drm_class_suspend() hook calls driver legacy ops with the state information.
e.g: drm_class_suspend() calls into driver suspend routines
via drm_dev->driver->suspend(drm_dev, state).

Once drm_class_suspend() is converted to dev_pm_ops, it will no longer
have access to pm_transition which it has to pass into driver legacy
suspend calls. A new freeze and suspend hooks are added to address the not
having access to the state information. The new freeze and suspend hooks
simply call __drm_class_suspend() with the appropriate pm state information.
__drm_class_suspend() is the original suspend hook with a new name.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_sysfs.c