Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2704883rdb; Mon, 4 Dec 2023 05:29:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQUu6/YRtqFocC60FskzXzsdCKJQMK17kYU4NmH8+YknaNjTvbK5Vx9suUscF85BimR1XP X-Received: by 2002:a17:90b:4a08:b0:286:a2a3:1e4f with SMTP id kk8-20020a17090b4a0800b00286a2a31e4fmr858420pjb.64.1701696589555; Mon, 04 Dec 2023 05:29:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701696589; cv=none; d=google.com; s=arc-20160816; b=d+H1k44x04zftoO5yrQhQ/m/qH6M1fSSL2JNNqspWfH9uhH1+giGhqRhKjmOnxzMk7 dwCYuC8Ludy70VMJjT5LkxxqV9PetcdwvtjlFW3/FDObzoHK0KUGnjHuXZXwkVOocoOT 3CH8yNSolV89N8QhVwY/tkjK/LYRZ4tUmjUEniTtyjvQ8+Ez1P6RuG9qCFsbzM8E1V20 3Zgw+nqqkOwVMuUn0U+CydjIo+Q+4iQbVcjBj0sUc2WDU3gXVWJmDgkUT/sRpzCVdQPB +yvypeY2yY2uFUC02CMzhtJHhuPa1VnnieklQ4jwegzloIClFY8Fukg7djTiWis1dz0o ojiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xN0cuz99WhbfYLDcL7pjgYX8hz8navN7T66QWBoQ3Jw=; fh=QbV9LZB2/JAzBLz3RY8oYA5eiw8S9eZqMjIh7sopyLc=; b=LB+X3tPdQFXMFZzrQlptkKNkqnACTxe4TnfgYJj5v6oSowkMP+kehV2pvi5eyG6CN3 BJX+ffd9gqDA3bGUA2s+otCk0LCpSV3n3OLH1c5GwvXGhA89XbFvezta+4xVW0x0V24Q W+90ZL6gzV8RlR7aMHohbVzDKcj+rQ8okTkv+0/00IzKt82Bjy7Jy0LxSiaShwWkuMg7 MBPt5cIgy9AyOLmtxr3uGyB8JkRxMCR46DnQne1SEnPZXETq2VDV7EKQjFgkyJrn5odb 1Zgs+cZjYi15f2urYPFcTj7H3hZzNzZO7ZpvarNlqoLtIJEMzYu92nl3up+c/iIK/S7S VR4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lDK5++dL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id nv2-20020a17090b1b4200b002850de13989si1871891pjb.175.2023.12.04.05.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 05:29:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lDK5++dL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 65D0A80A30E6; Mon, 4 Dec 2023 05:29:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235414AbjLDN3i (ORCPT + 99 others); Mon, 4 Dec 2023 08:29:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234136AbjLDN3Z (ORCPT ); Mon, 4 Dec 2023 08:29:25 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50FF12D76; Mon, 4 Dec 2023 05:27:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701696472; x=1733232472; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=xAo1jP5xdLJDHA5y+K5s26G3/Skb6cWDEtnKHmw94sw=; b=lDK5++dLYq9IIOBw0RtETWA9o5/PiFweVqEdnrq6yrN0Qmsh76AmMtD7 sSo5PT5RCtkHRH6NmDynYABDPhiiUD6qIMWwMEy0ne3JluDGmI5a8ye2T mQ24lgUu4fyXW2PGUHfCdEMABA1U7RhVMZWrZploP1OQfBSRh/xs9ikGS d6ym37BJDF08BVt7AKd2NvIBaSBIQgVapzbezmvhSj8bUU/XcPXy2t76r Qoc0faa/d9tDHpuIIJNQwM6iXiZvlj5XW5wOTuGCyHIeY92QO31ziCiW+ xLDtI/q3CgLdWByockDErhKZ61c4JaJ1l3WUrhPtTue3nATLQ+ZMUQL3P g==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="12445082" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="12445082" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:27:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="914424174" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="914424174" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 04 Dec 2023 05:27:45 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 04 Dec 2023 15:27:44 +0200 Date: Mon, 4 Dec 2023 15:27:44 +0200 From: Heikki Krogerus To: Dmitry Baryshkov Cc: Greg Kroah-Hartman , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Bryan O'Donoghue , Guenter Roeck , Janne Grunau , Simon Ser , Andy Gross , Bjorn Andersson , Konrad Dybcio , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org Subject: Re: [PATCH RESEND 6/6] usb: typec: qcom-pmic-typec: switch to DRM_AUX_HPD_BRIDGE Message-ID: References: <20231203114333.1305826-1-dmitry.baryshkov@linaro.org> <20231203114333.1305826-7-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231203114333.1305826-7-dmitry.baryshkov@linaro.org> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:29:48 -0800 (PST) Hi Dmitry, On Sun, Dec 03, 2023 at 02:43:33PM +0300, Dmitry Baryshkov wrote: > Use the freshly defined DRM_AUX_HPD_BRIDGE instead of open-coding the > same functionality for the DRM bridge chain termination. > > Acked-by: Bryan O'Donoghue > Signed-off-by: Dmitry Baryshkov I'm sorry, I've completely missed this second typec patch. Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/Kconfig | 1 + > drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 41 +++---------------- > 2 files changed, 7 insertions(+), 35 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/Kconfig b/drivers/usb/typec/tcpm/Kconfig > index 0b2993fef564..64d5421c69e6 100644 > --- a/drivers/usb/typec/tcpm/Kconfig > +++ b/drivers/usb/typec/tcpm/Kconfig > @@ -80,6 +80,7 @@ config TYPEC_QCOM_PMIC > tristate "Qualcomm PMIC USB Type-C Port Controller Manager driver" > depends on ARCH_QCOM || COMPILE_TEST > depends on DRM || DRM=n > + select DRM_AUX_HPD_BRIDGE if DRM_BRIDGE > help > A Type-C port and Power Delivery driver which aggregates two > discrete pieces of silicon in the PM8150b PMIC block: the > diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c > index 581199d37b49..1a2b4bddaa97 100644 > --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c > +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c > @@ -18,7 +18,7 @@ > #include > #include > > -#include > +#include > > #include "qcom_pmic_typec_pdphy.h" > #include "qcom_pmic_typec_port.h" > @@ -36,7 +36,6 @@ struct pmic_typec { > struct pmic_typec_port *pmic_typec_port; > bool vbus_enabled; > struct mutex lock; /* VBUS state serialization */ > - struct drm_bridge bridge; > }; > > #define tcpc_to_tcpm(_tcpc_) container_of(_tcpc_, struct pmic_typec, tcpc) > @@ -150,35 +149,6 @@ static int qcom_pmic_typec_init(struct tcpc_dev *tcpc) > return 0; > } > > -#if IS_ENABLED(CONFIG_DRM) > -static int qcom_pmic_typec_attach(struct drm_bridge *bridge, > - enum drm_bridge_attach_flags flags) > -{ > - return flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR ? 0 : -EINVAL; > -} > - > -static const struct drm_bridge_funcs qcom_pmic_typec_bridge_funcs = { > - .attach = qcom_pmic_typec_attach, > -}; > - > -static int qcom_pmic_typec_init_drm(struct pmic_typec *tcpm) > -{ > - tcpm->bridge.funcs = &qcom_pmic_typec_bridge_funcs; > -#ifdef CONFIG_OF > - tcpm->bridge.of_node = of_get_child_by_name(tcpm->dev->of_node, "connector"); > -#endif > - tcpm->bridge.ops = DRM_BRIDGE_OP_HPD; > - tcpm->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; > - > - return devm_drm_bridge_add(tcpm->dev, &tcpm->bridge); > -} > -#else > -static int qcom_pmic_typec_init_drm(struct pmic_typec *tcpm) > -{ > - return 0; > -} > -#endif > - > static int qcom_pmic_typec_probe(struct platform_device *pdev) > { > struct pmic_typec *tcpm; > @@ -186,6 +156,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev) > struct device_node *np = dev->of_node; > const struct pmic_typec_resources *res; > struct regmap *regmap; > + struct device *bridge_dev; > u32 base[2]; > int ret; > > @@ -241,14 +212,14 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev) > mutex_init(&tcpm->lock); > platform_set_drvdata(pdev, tcpm); > > - ret = qcom_pmic_typec_init_drm(tcpm); > - if (ret) > - return ret; > - > tcpm->tcpc.fwnode = device_get_named_child_node(tcpm->dev, "connector"); > if (!tcpm->tcpc.fwnode) > return -EINVAL; > > + bridge_dev = drm_dp_hpd_bridge_register(tcpm->dev, to_of_node(tcpm->tcpc.fwnode)); > + if (IS_ERR(bridge_dev)) > + return PTR_ERR(bridge_dev); > + > tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc); > if (IS_ERR(tcpm->tcpm_port)) { > ret = PTR_ERR(tcpm->tcpm_port); > -- > 2.39.2 -- heikki