Devicetree
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] usb: typec: tcpm: qcom: prefer VBUS supply from the connector node
Date: Tue, 19 May 2026 17:05:43 +0300	[thread overview]
Message-ID: <agxuN6O8rRKGQr1F@kuha> (raw)
In-Reply-To: <20260519-fix-tcpm-vbus-v1-2-14754695282d@oss.qualcomm.com>

On Tue, May 19, 2026 at 01:48:04PM +0300, Dmitry Baryshkov wrote:
> Current way of specifying VBUS supply (via the device's vdd-vbus-supply
> property) is not ideal. In the end, VBUS is supplied to the USB-C
> connector rather than the Type-C block in the PMIC. Follow the standard
> way of specifying it (via the connector node) and fallback to the old
> property if there is no vbus-supply in the connector node.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> index 8051eaa46991..429bd42a0e62 100644
> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> @@ -9,6 +9,7 @@
>  #include <linux/kernel.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
> @@ -704,6 +705,7 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
>  	struct device *dev = &pdev->dev;
>  	struct pmic_typec_port_irq_data *irq_data;
>  	struct pmic_typec_port *pmic_typec_port;
> +	struct fwnode_handle *connector;
>  	int i, ret, irq;
>  
>  	pmic_typec_port = devm_kzalloc(dev, sizeof(*pmic_typec_port), GFP_KERNEL);
> @@ -720,7 +722,15 @@ int qcom_pmic_typec_port_probe(struct platform_device *pdev,
>  
>  	mutex_init(&pmic_typec_port->vbus_lock);
>  
> -	pmic_typec_port->vdd_vbus = devm_regulator_get(dev, "vdd-vbus");
> +	connector = device_get_named_child_node(dev, "connector");
> +	if (!connector)
> +		return -EINVAL;
> +
> +	pmic_typec_port->vdd_vbus = devm_of_regulator_get_optional(dev,
> +								   to_of_node(connector),
> +								   "vbus");
> +	if (pmic_typec_port->vdd_vbus == ERR_PTR(-ENODEV))
> +		pmic_typec_port->vdd_vbus = devm_regulator_get(dev, "vdd-vbus");
>  	if (IS_ERR(pmic_typec_port->vdd_vbus))
>  		return PTR_ERR(pmic_typec_port->vdd_vbus);
>  
> 
> -- 
> 2.47.3

-- 
heikki

  parent reply	other threads:[~2026-05-19 14:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 10:48 [PATCH 0/6] usb: typec: tcpm: qcom: use connector to specify VBUS regulator Dmitry Baryshkov
2026-05-19 10:48 ` [PATCH 1/6] dt-bindings: usb: qcom,pmic-typec: deprecate device-specific VBUS Dmitry Baryshkov
2026-05-19 10:58   ` sashiko-bot
2026-05-19 11:26   ` Konrad Dybcio
2026-05-19 11:37   ` Bryan O'Donoghue
2026-05-19 10:48 ` [PATCH 2/6] usb: typec: tcpm: qcom: prefer VBUS supply from the connector node Dmitry Baryshkov
2026-05-19 11:16   ` sashiko-bot
2026-05-19 11:25   ` Konrad Dybcio
2026-05-19 14:05   ` Heikki Krogerus [this message]
2026-05-19 10:48 ` [PATCH 3/6] arm64: dts: qcom: pm4125: move vdd-vbus-supply to connector nodes Dmitry Baryshkov
2026-05-19 11:26   ` Konrad Dybcio
2026-05-19 10:48 ` [PATCH 4/6] arm64: dts: qcom: pm7250b: " Dmitry Baryshkov
2026-05-19 11:27   ` Konrad Dybcio
2026-05-19 12:01   ` sashiko-bot
2026-05-19 12:17     ` Dmitry Baryshkov
2026-05-19 10:48 ` [PATCH 5/6] arm64: dts: qcom: pm8150b: " Dmitry Baryshkov
2026-05-19 11:27   ` Konrad Dybcio
2026-05-19 13:00   ` sashiko-bot
2026-05-19 10:48 ` [PATCH 6/6] arm64: dts: qcom: pmi632: " Dmitry Baryshkov
2026-05-19 11:27   ` Konrad Dybcio
2026-05-19 11:41 ` [PATCH 0/6] usb: typec: tcpm: qcom: use connector to specify VBUS regulator Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agxuN6O8rRKGQr1F@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox