fbdev: gxfb: use generic power management
authorVaibhav Gupta <vaibhavgupta40@gmail.com>
Wed, 19 Aug 2020 18:56:43 +0000 (00:26 +0530)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 8 Sep 2020 11:33:09 +0000 (13:33 +0200)
commitfa41f2877429646ce062a034a6d5bfc4f8f04b8c
treed7ed9942c3fe26fcd9bac289a47ab60201815c40
parentad6f93e9cd56f0b10e9b22e3e137d17a1a035242
fbdev: gxfb: use generic power management

Switch to the new generic framework by updating function signatures and
define a "struct dev_pm_ops" variable to bind PM callbacks. This way we can
remove the legacy .suspend & .resume bindings from "gxfb_driver".

The gxfb_suspend() is designed to function only in the case of Suspend.
Thus, the code was kept inside "if (state.event == PM_EVENT_SUSPEND)"
container. This is because, in the legacy framework, this callback was
invoked even in the event of Freeze and Hibernate. Hence, added the load of
unnecessary function-calls.

The goal can be achieved by binding the callback with only
"gxfb_pm_ops.suspend" in the new framework. This also avoids the step of
checking "if (state.event == PM_EVENT_SUSPEND)" every time the callback is
invoked.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Bjorn Helgaas <bjorn@helgaas.com>
Cc: Vaibhav Gupta <vaibhav.varodek@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Andres Salomon <dilinger@queued.net>
CC: Antonino Daplas <adaplas@gmail.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200819185654.151170-2-vaibhavgupta40@gmail.com
drivers/video/fbdev/geode/gxfb.h
drivers/video/fbdev/geode/gxfb_core.c
drivers/video/fbdev/geode/suspend_gx.c