diff mbox series

[11/26] video: dsi_host: add disable host interface

Message ID 20240913095622.72377-12-dario.binacchi@amarulasolutions.com
State Changes Requested
Delegated to: Fabio Estevam
Headers show
Series Support display (and even more) on the BSH SMM S2/PRO boards | expand

Commit Message

Dario Binacchi Sept. 13, 2024, 9:55 a.m. UTC
From: Michael Trimarchi <michael@amarulasolutions.com>

Current operations structure has provided disable callback, but
there is no API from dsi_host uclass to use it.

Add this disable host interface, so that dsi bridge can call it
to disable host

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 drivers/video/dsi-host-uclass.c | 10 ++++++++++
 include/dsi_host.h              |  8 ++++++++
 2 files changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/drivers/video/dsi-host-uclass.c b/drivers/video/dsi-host-uclass.c
index fde275ad7e2e..745991f8dd94 100644
--- a/drivers/video/dsi-host-uclass.c
+++ b/drivers/video/dsi-host-uclass.c
@@ -34,6 +34,16 @@  int dsi_host_enable(struct udevice *dev)
 	return ops->enable(dev);
 }
 
+int dsi_host_disable(struct udevice *dev)
+{
+	struct dsi_host_ops *ops = dsi_host_get_ops(dev);
+
+	if (!ops->disable)
+		return -ENOSYS;
+
+	return ops->disable(dev);
+}
+
 UCLASS_DRIVER(dsi_host) = {
 	.id		= UCLASS_DSI_HOST,
 	.name		= "dsi_host",
diff --git a/include/dsi_host.h b/include/dsi_host.h
index 83f8839db68d..5873ab698d9e 100644
--- a/include/dsi_host.h
+++ b/include/dsi_host.h
@@ -70,4 +70,12 @@  int dsi_host_init(struct udevice *dev,
  */
 int dsi_host_enable(struct udevice *dev);
 
+/**
+ * dsi_host_disable
+ *
+ * @dev:	dsi host device
+ * @return 0 if OK, -ve on error
+ */
+int dsi_host_disable(struct udevice *dev);
+
 #endif