public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 2/2] usb: typec: hd3ss3220: Enable VBUS based on ID pin state
Date: Wed, 26 Nov 2025 13:27:10 +0100	[thread overview]
Message-ID: <aSbyHj-keYZWLwDy@black.igk.intel.com> (raw)
In-Reply-To: <20251111072025.2199142-3-krishna.kurapati@oss.qualcomm.com>

On Tue, Nov 11, 2025 at 12:50:25PM +0530, Krishna Kurapati wrote:
> There is a ID pin present on HD3SS3220 controller that can be routed
> to SoC. As per the datasheet:
> 
> "Upon detecting a UFP device, HD3SS3220 will keep ID pin high if VBUS is
> not at VSafe0V. Once VBUS is at VSafe0V, the HD3SS3220 will assert ID pin
> low. This is done to enforce Type-C requirement that VBUS must be at
> VSafe0V before re-enabling VBUS"
> 
> Add support to read the ID pin state and enable VBUS accordingly.

...

> +	if (hd3ss3220->vbus) {
> +		hd3ss3220->id_gpiod = devm_gpiod_get_optional(hd3ss3220->dev,
> +							      "id",
> +							      GPIOD_IN);

Can be also

		ret = PTR_ERR_OR_ZERO(hd3ss3220->id_gpiod);
		if (IS_ERR(hd3ss3220->id_gpiod))
			goto err_put_fwnode;

> +		if (IS_ERR(hd3ss3220->id_gpiod)) {

> +		if (IS_ERR(hd3ss3220->id_gpiod)) {
> +			ret = PTR_ERR(hd3ss3220->id_gpiod);
> +			goto err_put_fwnode;
> +		}
> +	}

...

> +		ret = devm_request_threaded_irq(hd3ss3220->dev,
> +						hd3ss3220->id_irq, NULL,
> +						hd3ss3220_id_isr,
> +						IRQF_TRIGGER_RISING |
> +						IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> +						dev_name(hd3ss3220->dev), hd3ss3220);
> +		if (ret < 0) {
> +			dev_err(hd3ss3220->dev, "failed to get ID irq: %d\n", ret);

The above call already prints an error message, no need to repeat it here.

> +			goto err_put_fwnode;
> +		}

Since the patch is already applied, please send a followup for the second one
(the first one is up to you, just a hint for the future code contributions).

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2025-11-26 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11  7:20 [PATCH v7 0/2] Implement vbus support for HD3SS3220 port controller Krishna Kurapati
2025-11-11  7:20 ` [PATCH v7 1/2] dt-bindings: usb: ti,hd3ss3220: Add support for VBUS based on ID state Krishna Kurapati
2025-11-11  7:20 ` [PATCH v7 2/2] usb: typec: hd3ss3220: Enable VBUS based on ID pin state Krishna Kurapati
2025-11-17  8:42   ` Heikki Krogerus
2025-11-26 12:27   ` Andy Shevchenko [this message]

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=aSbyHj-keYZWLwDy@black.igk.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=krzk+dt@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