[v3,09/26] video: bridge: Add check_timing interface

Message ID 20261202102716.572884-10-dario.binacchi@amarulasolutions.com
State New
Headers
Series Support display on the BSH SMM S2/PRO boards |

Commit Message

Dario Binacchi Dec. 2, 2026, 10:26 a.m. UTC
From: Michael Trimarchi <michael@amarulasolutions.com>

Add new interface check_timing to video bridge uclass. For bridge device
who may update timing needs to implement the callback. So host device can
sync the timing with the bridge.

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>
---

(no changes since v1)

 drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++
 include/video_bridge.h                     | 20 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
  

Patch

diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c
index 1b8aa12b9e88..599090141e4d 100644
--- a/drivers/video/bridge/video-bridge-uclass.c
+++ b/drivers/video/bridge/video-bridge-uclass.c
@@ -59,6 +59,16 @@  int video_bridge_check_attached(struct udevice *dev)
 	return ops->check_attached(dev);
 }
 
+int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing)
+{
+	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+	if (ops->check_timing)
+		return ops->check_timing(dev, timing);
+
+	return 0;
+}
+
 int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
 {
 	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
diff --git a/include/video_bridge.h b/include/video_bridge.h
index 00e9804565c2..132de740706c 100644
--- a/include/video_bridge.h
+++ b/include/video_bridge.h
@@ -44,6 +44,17 @@  struct video_bridge_ops {
 	 */
 	int (*check_attached)(struct udevice *dev);
 
+	/**
+	 * check_timing() - check if the timing need update after the bridge device attached
+	 *
+	 * This method is optional - if not provided then return 0
+	 *
+	 * @dev:	Device to check
+	 * @active:	The timing to be checked and updated
+	 * Return: 0 if OK, -ve on error
+	 */
+	int (*check_timing)(struct udevice *dev, struct display_timing *timing);
+
 	/**
 	 * set_backlight() - Set the backlight brightness
 	 *
@@ -112,6 +123,15 @@  int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * check_timing() - check if the timing need update after the bridge device attached
+ *
+ * @dev:	Device to check
+ * @active:	The timing to be checked and updated
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing);
+
 /**
  * video_bridge_get_display_timing() - Get display timings from bridge.
  *