From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4234CD4F3C for ; Mon, 18 May 2026 18:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uhgLCaKlQaEk/Wj9sKnH/ktWD8ajQ1NwIEm12iemzj8=; b=REQ7/tzzyet5bu TKAyR1N2lH81+k10dlHK+ugMAU6oM4BGysdsVaokDYsGlFw+VFgpIK2JeEFIbFTs47B8qcQtmzYI0 1+g9RElPPp+7ynrDqIkyPiqrnRqYcOb2bHY7QaEUR66bfg80AnSBgoGBZ3LbjvXBOwGE4YxCeKeL7 alXV7Ob6T2pJu19k4g6ToVkQ9HhLi22s9CWZ8SLjbOGMOzmvH4z7qK5jyUX0GG/vkG7SFvH30/UJp 921n7umb+zKlgB02kxemKhgNfxFFAIpECay20kBQIpTh6pdUYWmCI3tmdV4uX/tramGAqY4xpWZPc p1PSFlSxHx351K5aptNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wP2JJ-0000000GTta-1rLI; Mon, 18 May 2026 18:03:25 +0000 Received: from smtp.forwardemail.net ([121.127.44.66]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wP2JG-0000000GTlw-09Zm for linux-amlogic@lists.infradead.org; Mon, 18 May 2026 18:03:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1779127401; bh=ozZ64lc/u62KCDiC1IyBlegc4d7ugh2Odmie8y2x51Y=; b=iRD1Bil56FSaomRC7C3X8yWlq5QFlMqkQ9Dku00doXt6Nvod2Yi9WNAZt33XU9hwbQKCq+gpG kgpc2hCnZekgHCI1YyLg4FKRxMcyrTrdAIQG4HGuYxlLCYB+tH5E+vB/74N0JgxbfNM9ICbhdlP YY9Aq6+MqbE95/yKhX0IM4f4JKHlqabVwWZ6Y5cisXUB9eqVAfuHKENPgeUEBXBxrZG4Vx2ArvX O1BBbIUiCQ2STZkDx6Yt1EYYKA8W/e6OELbuzQuVByRVpfRS9qalGRlAO0Xb6M9tv5v9K8N/2i9 +ZZgtd0M4bg6YhcN5B8b9nUF27MXaikj6cjCxs97T7ew== X-Forward-Email-ID: 6a0b5465b84dbc72d2274f3e X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 121.127.44.66 X-Forward-Email-Version: 2.8.12 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Andrzej Hajda , Neil Armstrong , Robert Foss , Heiko Stuebner , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Subject: [PATCH v7 15/23] drm: bridge: dw_hdmi: Use generic CEC notifier helpers Date: Mon, 18 May 2026 18:01:51 +0000 Message-ID: <20260518180206.2480119-16-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518180206.2480119-1-jonas@kwiboo.se> References: <20260518180206.2480119-1-jonas@kwiboo.se> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260518_110322_188683_F3ED412F X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Baryshkov , imx@lists.linux.dev, Liu Ying , linux-kernel@vger.kernel.org, Sandy Huang , dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Diederik de Haas , linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, Andy Yan , Chen-Yu Tsai , Nicolas Frattaroli , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The commit 8b1a8f8b2002 ("drm/display: add CEC helpers code") added generic CEC helpers to be used by HDMI drivers. Replace the open-coded CEC notifier handling with use of the generic CEC notifier helpers. Ensure DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER is also selected when DRM_DW_HDMI_CEC is enabled so that the CEC helpers is available. The drmm release action for the generic CEC notifier should run just before dw_hdmi_connector_destroy(), closely matching the lifetime of the replaced CEC notifier and the connector. Reviewed-by: Neil Armstrong Tested-by: Diederik de Haas # Rock64, RockPro64, Quartz64-B Signed-off-by: Jonas Karlman --- v7: No change v6: Update commit message, Collect t-b tag v5: Collect r-b tag v4: New patch --- drivers/gpu/drm/bridge/synopsys/Kconfig | 1 + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 26 +++++------------------ 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/Kconfig b/drivers/gpu/drm/bridge/synopsys/Kconfig index a46df7583bcf..e6723af03b43 100644 --- a/drivers/gpu/drm/bridge/synopsys/Kconfig +++ b/drivers/gpu/drm/bridge/synopsys/Kconfig @@ -49,6 +49,7 @@ config DRM_DW_HDMI_CEC depends on DRM_DW_HDMI select CEC_CORE select CEC_NOTIFIER + select DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER help Support the CE interface which is part of the Synopsys Designware HDMI block. diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 0e84dff72470..37406555af7b 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -23,12 +23,11 @@ #include #include -#include - #include #include #include +#include #include #include #include @@ -183,8 +182,6 @@ struct dw_hdmi { void (*enable_audio)(struct dw_hdmi *hdmi); void (*disable_audio)(struct dw_hdmi *hdmi); - struct cec_notifier *cec_notifier; - hdmi_codec_plugged_cb plugged_cb; struct device *codec_dev; enum drm_connector_status last_connector_result; @@ -2453,7 +2450,7 @@ dw_hdmi_connector_status_update(struct dw_hdmi *hdmi, if (status == connector_status_disconnected) { drm_edid_connector_update(connector, NULL); - cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); + drm_connector_cec_phys_addr_invalidate(connector); return; } @@ -2462,8 +2459,7 @@ dw_hdmi_connector_status_update(struct dw_hdmi *hdmi, drm_edid_free(drm_edid); if (status == connector_status_connected) - cec_notifier_set_phys_addr(hdmi->cec_notifier, - connector->display_info.source_physical_address); + drm_connector_cec_phys_addr_set(connector); } static enum drm_connector_status @@ -2525,9 +2521,6 @@ static void dw_hdmi_connector_destroy(struct drm_connector *connector) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); - cec_notifier_conn_unregister(hdmi->cec_notifier); - hdmi->cec_notifier = NULL; - drm_connector_cleanup(connector); drm_bridge_put(&hdmi->bridge); } @@ -2550,8 +2543,6 @@ static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) { struct drm_connector *connector = &hdmi->connector; - struct cec_connector_info conn_info; - struct cec_notifier *notifier; int ret; if (hdmi->version >= 0x200a) @@ -2587,15 +2578,8 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) drm_connector_attach_encoder(connector, hdmi->bridge.encoder); - cec_fill_conn_info_from_drm(&conn_info, connector); - - notifier = cec_notifier_conn_register(hdmi->dev, NULL, &conn_info); - if (!notifier) - return -ENOMEM; - - hdmi->cec_notifier = notifier; - - return 0; + return drmm_connector_hdmi_cec_notifier_register(connector, NULL, + hdmi->dev); } /* ----------------------------------------------------------------------------- -- 2.54.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic