From: Tomasz Figa <tf...@chromium.org>

This patch adds a function that master driver can call at shutdown time
in case there is some cleanup work to do. The function will then call
back to platform_data .cleanup() callback to let the master driver do
the platform-specific work.

Cc: Kristian H. Kristensen <hoegsb...@chromium.org>
Cc: Brian Norris <briannor...@chromium.org>
Signed-off-by: Tomasz Figa <tf...@chromium.org>
Signed-off-by: Sean Paul <seanp...@chromium.org>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 9 +++++++++
 include/drm/bridge/analogix_dp.h                   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 6391f5da7643..1454075bce9a 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1665,6 +1665,15 @@ void analogix_dp_unbind(struct device *dev, struct 
device *master,
 }
 EXPORT_SYMBOL_GPL(analogix_dp_unbind);
 
+void analogix_dp_shutdown(struct device *dev)
+{
+       struct analogix_dp_device *dp = dev_get_drvdata(dev);
+
+       if (dp->plat_data->cleanup)
+               dp->plat_data->cleanup(dp->plat_data);
+}
+EXPORT_SYMBOL_GPL(analogix_dp_shutdown);
+
 #ifdef CONFIG_PM
 int analogix_dp_suspend(struct device *dev)
 {
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 414e9a7f362e..c079ca1ffc76 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -49,6 +49,7 @@ int analogix_dp_suspend(struct device *dev);
 int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
                     struct analogix_dp_plat_data *plat_data);
 void analogix_dp_unbind(struct device *dev, struct device *master, void *data);
+void analogix_dp_shutdown(struct device *dev);
 
 int analogix_dp_start_crc(struct drm_connector *connector);
 int analogix_dp_stop_crc(struct drm_connector *connector);
-- 
2.12.0.246.ga2ecc84866-goog

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to