[v6,15/22] drm: bridge: dw_hdmi: Declare bridge CEC notifier support

Message ID 20260516183838.2024991-16-jonas@kwiboo.se (mailing list archive)
State New
Headers
Series drm: bridge: dw_hdmi: Misc enable/disable, CEC and EDID cleanup |

Commit Message

Jonas Karlman May 16, 2026, 6:38 p.m. UTC
EDID and CEC phys addr is now being updated in bridge detect() func,
making it possible to have CEC notifier support using the bridge
connector.

Add the CEC notifier bridge op to instruct the bridge connector to make
use of the generic CEC notifier helpers.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
v6: New patch
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

sashiko-bot@kernel.org May 16, 2026, 7:30 p.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The driver unconditionally advertises CEC notifier support even if the CEC platform device fails to register.
--

commit 28a90bcf8d7861ee7124899b88745cc0c892f390
Author: Jonas Karlman <jonas@kwiboo.se>

drm: bridge: dw_hdmi: Declare bridge CEC notifier support

This commit updates the bridge to advertise CEC notifier support,
instructing the bridge connector to use generic CEC notifier helpers.

> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 3649ccf8d994e..1402b3963ae12 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -3537,6 +3537,9 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>  		pdevinfo.dma_mask = 0;
>  
>  		hdmi->cec = platform_device_register_full(&pdevinfo);
> +
> +		hdmi->bridge.ops |= DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER;
> +		hdmi->bridge.hdmi_cec_dev = hdmi->dev;

If platform_device_register_full() fails and returns an error pointer,
should we still advertise CEC notifier support?

It looks like DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER and hdmi_cec_dev are set
unconditionally here. If the CEC device registration fails, could this
cause the DRM bridge connector initialization to unnecessarily allocate
and register a CEC notifier for a hardware adapter that did not probe?

>  	}
>  
>  	drm_bridge_add(&hdmi->bridge);
  

Patch

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 3649ccf8d994..1402b3963ae1 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -3537,6 +3537,9 @@  struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
 		pdevinfo.dma_mask = 0;
 
 		hdmi->cec = platform_device_register_full(&pdevinfo);
+
+		hdmi->bridge.ops |= DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER;
+		hdmi->bridge.hdmi_cec_dev = hdmi->dev;
 	}
 
 	drm_bridge_add(&hdmi->bridge);