drm: mxsfb: Shutdown the display on system shutdown
authorMarek Vasut <marex@denx.de>
Sat, 1 Jan 2022 21:37:55 +0000 (22:37 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 27 Jan 2022 08:27:20 +0000 (09:27 +0100)
When the system shuts down or warm reboots, the display may be active.
Implement the platform_driver .shutdown() operation and shut down the
display.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220101213755.506404-1-marex@denx.de
drivers/gpu/drm/mxsfb/mxsfb_drv.c

index 6d7a3aeff50b04dbe46f586e56244929b4e9fa47..375f26d4a4172dbe472f8c4f95cc2232984376bf 100644 (file)
@@ -381,6 +381,13 @@ static int mxsfb_remove(struct platform_device *pdev)
        return 0;
 }
 
+static void mxsfb_shutdown(struct platform_device *pdev)
+{
+       struct drm_device *drm = platform_get_drvdata(pdev);
+
+       drm_atomic_helper_shutdown(drm);
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int mxsfb_suspend(struct device *dev)
 {
@@ -404,6 +411,7 @@ static const struct dev_pm_ops mxsfb_pm_ops = {
 static struct platform_driver mxsfb_platform_driver = {
        .probe          = mxsfb_probe,
        .remove         = mxsfb_remove,
+       .shutdown       = mxsfb_shutdown,
        .driver = {
                .name           = "mxsfb",
                .of_match_table = mxsfb_dt_ids,