Works with Rockchip DW MIPI DSI bridge (drivers/video/rockchip/
dw_mipi_dsi_rockchip.c) after I add ops to the driver.

Tested-by: Dang Huynh <danc...@riseup.net> (PineTab 2)

On Thursday, February 20, 2025 5:06:27 PM UTC Svyatoslav Ryhel wrote:
> Add get_display_timing ops for internal bridges linked to
> panels that do not support EDID (MIPI-DSI panels for example)
> or have EDID not routed.
> 
> Signed-off-by: Svyatoslav Ryhel <clamo...@gmail.com>
> ---
>  drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
>  include/video_bridge.h                     | 21 +++++++++++++++++++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/video/bridge/video-bridge-uclass.c
> b/drivers/video/bridge/video-bridge-uclass.c index 2084a2e03ee..1b8aa12b9e8
> 100644
> --- a/drivers/video/bridge/video-bridge-uclass.c
> +++ b/drivers/video/bridge/video-bridge-uclass.c
> @@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
>       return ops->attach(dev);
>  }
> 
> +int video_bridge_get_display_timing(struct udevice *dev,
> +                                 struct display_timing 
*timings)
> +{
> +     struct video_bridge_ops *ops = video_bridge_get_ops(dev);
> +
> +     if (!ops->get_display_timing)
> +             return -ENOSYS;
> +
> +     return ops->get_display_timing(dev, timings);
> +}
> +
>  int video_bridge_check_attached(struct udevice *dev)
>  {
>       struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
> diff --git a/include/video_bridge.h b/include/video_bridge.h
> index 3b429eac578..7158deb299a 100644
> --- a/include/video_bridge.h
> +++ b/include/video_bridge.h
> @@ -53,6 +53,19 @@ struct video_bridge_ops {
>        */
>       int (*set_backlight)(struct udevice *dev, int percent);
> 
> +     /**
> +      * get_display_timing() - Get display timings from bridge.
> +      *
> +      * @dev:        Bridge device containing the linked display timings
> +      * @tim:        Place to put timings
> +      * @return 0 if OK, -ve on error
> +      *
> +      * This call it totally optional and useful mainly for integrated
> +      * bridges with fixed output device.
> +      */
> +     int (*get_display_timing)(struct udevice *dev,
> +                               struct display_timing *timing);
> +
>       /**
>        * read_edid() - Read information from EDID
>        *
> @@ -98,6 +111,14 @@ int video_bridge_set_active(struct udevice *dev, bool
> active); */
>  int video_bridge_check_attached(struct udevice *dev);
> 
> +/**
> + * video_bridge_get_display_timing() - Get display timings from bridge.
> + *
> + * @dev:     Bridge device containing the linked display timings
> + * Return: 0 if OK, -ve on error
> + */
> +int video_bridge_get_display_timing(struct udevice *dev,
> +                                 struct display_timing 
*timing);
>  /**
>   * video_bridge_read_edid() - Read information from EDID
>   *




Reply via email to