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 AB1CDCA5FE4 for ; Mon, 19 Jan 2026 07:33:02 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P2gv/JLLi9DSUze6+qrJ0wuUJFz9NK4TawPhJNCjmKg=; b=QKCLKKyxvWgMIg 4ERya4I4pt1VcjkKAje+6nv+k4V5LPqnMw0dmlzHtEmjeTvRJGiXAvjAxoa+ltOPsxwtRqCbP6ZAF OkoHbzKFccD7qoI3SgUr+JVMZaQQ86M0j7EcarH0lH5QYfNoURiL4gktOY867JPKBcZCQKRwEebW+ l+tT4VrzCRTVOjyGuOveVWg8+ikVS0yR9lpfigjiFX8uBH6mNcIzL9az3FMRbHToHhO1V2Th43pMG Jdhesml8oynygwNFnNqvWAZ3Vb/Wso5tarVaCcgSciZdP49OGQPvbgeoUNJthstL9Lzz+hbdb3d34 yslljYpO8NhXDFEMxGWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vhjkz-00000001UKp-3mN6; Mon, 19 Jan 2026 07:33:01 +0000 Received: from smtpbguseast2.qq.com ([54.204.34.130]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vhjkp-00000001Twk-2YtR; Mon, 19 Jan 2026 07:32:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=airkyi.com; s=altu2504; t=1768807919; bh=R2+PAKy3j90tO2/aruykNQqG1CqbsF2c64m7OhVP2Wo=; h=From:To:Subject:Date:Message-Id; b=rNZHckNKhaY6F7wiYYQiZkDYylENwPGBlwWj6V1o9vEwLLaSCzI+fkaHnMBEA4egO NnrEz1tJJILZ6y0o2FWTsHRkfZtPMOuTC/F3HbtsFWxL3dHMX4SbjBsQ3knxQkLq59 Jt7flNPyJjdu3heAmJGxt+4GQZJZ0a7+Sh/5D7Fg= X-QQ-mid: esmtpsz17t1768807916td2cc47e5 X-QQ-Originating-IP: 3ssUqBNd2o2Knol46BpVfLFCjgBvfw+ahn46Z46w9Z8= Received: from DESKTOP-8BT1A2O.localdomain ( [58.22.7.114]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 19 Jan 2026 15:31:50 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 924543254067491200 From: Chaoyi Chen To: Heikki Krogerus , Greg Kroah-Hartman , Dmitry Baryshkov , Peter Chen , Luca Ceresoli , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Sandy Huang , Andy Yan , Yubing Zhang , Frank Wang , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Amit Sunil Dhamne , Chaoyi Chen , Dragan Simic , Johan Jonker , Diederik de Haas , Peter Robinson Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH v14 6/9] drm/rockchip: cdn-dp: Support handle lane info without extcon Date: Mon, 19 Jan 2026 15:30:57 +0800 Message-Id: <20260119073100.143-7-kernel@airkyi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260119073100.143-1-kernel@airkyi.com> References: <20260119073100.143-1-kernel@airkyi.com> X-QQ-SENDSIZE: 520 Feedback-ID: esmtpsz:airkyi.com:qybglogicsvrgz:qybglogicsvrgz6b-0 X-QQ-XMAILINFO: NnBlO8MsmACrglOFaBS8I5wY/8DtEHu1hfUKYZOzmRcMqDoBS2gbrF4D ke49P8Yu9jtoJ78WfoBf49dDBkGtyY1fUpKMPTlVcKIhZ9ZtdvWjVWIh4gzORGCcSmzK7ZT SccI68QPl161N+cpY4C39JnXMWn6RpcmgYPqQP+/G3TxYALQj13LhSz7STnSBcrHPquFK14 w5+7n4FeoLkIIdWWiQm11sPCA5dZhV3chSsJMS5WFwxah5K50J6YuL1Y2EN4q2msMoEyfsI TaLvbcfaS4S189rZnnJFBuH0ie1rmQvAAoHEQ2g9/qw74neplEQQam4uNRsg6mB3ZdD/XJw fVYS1ig0vAbtb7S7i+IJgZjbp1xJWC8m96BufH0KUJBn79MX/c7xsBHAB2iF1T2Lm2Vk0yM tbvPPDEecSrMlQZkW0HHcRnDXnByk+sSRsTtvIA44MgQrj/qaJ5ZZ8SSScXuUQ4Kz2qgEOq Y9ZliBWydKQkOV/B1vT9wlzFAn+iROzAAwWQprIugHmvgFHTFWalPzD2ouz1qlso6JouitE vO0JUuzE8ipb6aXlJkyB4onnPkARX98oH/m8tFse6pVwrXUlrroymS0edMynItArFVvYJxT CJI8XfTMtsiPsIs3rJSaxWOdqRzQAShkSjMRPzt3zDxrENihvwlnNiyhbHXgMZwi4a9Taxn CRTnQXHTqEJ4svdLw9yQddfvt+jf3JbrOz/Tmbl6Zu1pr/Fhz2J0xWB6HXn0SvwSBvmPp3Z TDC9No6RDs03Jjy3NprG2qONbLX4POrd0+lQfc6rqTinZxNicG/CuuA8hPfvB2AYLBSRqOV F/SY0v9IIaimscWSJKnYLdLVOzssN4ksssj0DgTny35M70tsZ0r/HvFt4n1OPyFPo0lazeY FANvt4lxYBHvWw5t6Heot4Y3o9TfFZW7ugTliEAMcuCyK5CkWgSKS/AjCTOW65cnDe1knuT ub3i7E/p/A8T6FYXLU2C8ZWbD2SimS5ANrmZRNdv8RGBj9AXSW9pL7nykRKV/aumgT1ydWt a4apD661i6Vfsi15QeLY1Ql+thmmkJMWy9x4uHj8upXhgPcQyjoQPF/Mr9+3A= X-QQ-XMRINFO: OWPUhxQsoeAVwkVaQIEGSKwwgKCxK/fD5g== X-QQ-RECHKSPAM: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260118_233253_097365_77E6618A X-CRM114-Status: GOOD ( 16.95 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Chaoyi Chen This patch add support for get PHY lane info without help of extcon. There is no extcon needed if the Type-C controller is present. In this case, the lane info can be get from PHY instead of extcon. The extcon device should still be supported if Type-C controller is not present. Signed-off-by: Chaoyi Chen --- (no changes since v5) Changes in v4: - Remove cdn_dp_hpd_notify(). (no changes since v3) Changes in v2: - Ignore duplicate HPD events. --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index b7e3f5dcf8d5..1e27301584a4 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -156,6 +156,9 @@ static int cdn_dp_get_port_lanes(struct cdn_dp_port *port) int dptx; u8 lanes; + if (!edev) + return phy_get_bus_width(port->phy); + dptx = extcon_get_state(edev, EXTCON_DISP_DP); if (dptx > 0) { extcon_get_property(edev, EXTCON_DISP_DP, @@ -219,7 +222,7 @@ static bool cdn_dp_check_sink_connection(struct cdn_dp_device *dp) * some docks need more time to power up. */ while (time_before(jiffies, timeout)) { - if (!extcon_get_state(port->extcon, EXTCON_DISP_DP)) + if (port->extcon && !extcon_get_state(port->extcon, EXTCON_DISP_DP)) return false; if (!cdn_dp_get_sink_count(dp, &sink_count)) @@ -385,11 +388,14 @@ static int cdn_dp_enable_phy(struct cdn_dp_device *dp, struct cdn_dp_port *port) goto err_power_on; } - ret = extcon_get_property(port->extcon, EXTCON_DISP_DP, - EXTCON_PROP_USB_TYPEC_POLARITY, &property); - if (ret) { - DRM_DEV_ERROR(dp->dev, "get property failed\n"); - goto err_power_on; + property.intval = 0; + if (port->extcon) { + ret = extcon_get_property(port->extcon, EXTCON_DISP_DP, + EXTCON_PROP_USB_TYPEC_POLARITY, &property); + if (ret) { + DRM_DEV_ERROR(dp->dev, "get property failed\n"); + goto err_power_on; + } } port->lanes = cdn_dp_get_port_lanes(port); @@ -1028,6 +1034,9 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data) for (i = 0; i < dp->ports; i++) { port = dp->port[i]; + if (!port->extcon) + continue; + port->event_nb.notifier_call = cdn_dp_pd_event; ret = devm_extcon_register_notifier(dp->dev, port->extcon, EXTCON_DISP_DP, @@ -1120,14 +1129,14 @@ static int cdn_dp_probe(struct platform_device *pdev) PTR_ERR(phy) == -EPROBE_DEFER) return -EPROBE_DEFER; - if (IS_ERR(extcon) || IS_ERR(phy)) + if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV) continue; port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); if (!port) return -ENOMEM; - port->extcon = extcon; + port->extcon = IS_ERR(extcon) ? NULL : extcon; port->phy = phy; port->dp = dp; port->id = i; -- 2.51.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy