* [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched
@ 2026-01-26 12:06 Jan Remmet
2026-01-26 14:32 ` Heikki Krogerus
0 siblings, 1 reply; 4+ messages in thread
From: Jan Remmet @ 2026-01-26 12:06 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman, Krishna Kurapati
Cc: linux-usb, linux-kernel, upstream
Check regulator state as peripheral and detach can disable vbus.
Without this check we will try to disable the regulator twice if
we disconnect host and then connect as device.
Signed-off-by: Jan Remmet <j.remmet@phytec.de>
---
This is a fixup from
- Link to v1: https://lore.kernel.org/r/20260115-wip-jremmet-hd3ss3220_vbus-v1-1-b7d9adfbe346@phytec.de
To
- Link to v2: https://lore.kernel.org/r/20260123-wip-jremmet-hd3ss3220_vbus-v2-1-bcad313ce92b@phytec.de
---
drivers/usb/typec/hd3ss3220.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
index a7c54aa8635f70d6979d98c95f80d4dac277fef2..3e39b800e6b5f4d0cbba957c0dd66c18f781ff38 100644
--- a/drivers/usb/typec/hd3ss3220.c
+++ b/drivers/usb/typec/hd3ss3220.c
@@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
{
int ret;
+ if (regulator_is_enabled(hd3ss3220->vbus) == on)
+ return;
+
if (on)
ret = regulator_enable(hd3ss3220->vbus);
else
---
base-commit: 8acc379b664ec987dcc7eca25a5f5c4a9a4eb9c4
change-id: 20260126-wip-jremmet-hd3ss3220_vbus_split-946802479e89
Best regards,
--
Jan Remmet <j.remmet@phytec.de>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched
2026-01-26 12:06 [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched Jan Remmet
@ 2026-01-26 14:32 ` Heikki Krogerus
2026-01-26 15:22 ` Jan Remmet
0 siblings, 1 reply; 4+ messages in thread
From: Heikki Krogerus @ 2026-01-26 14:32 UTC (permalink / raw)
To: Jan Remmet
Cc: Greg Kroah-Hartman, Krishna Kurapati, linux-usb, linux-kernel,
upstream
Mon, Jan 26, 2026 at 01:06:36PM +0100, Jan Remmet kirjoitti:
> Check regulator state as peripheral and detach can disable vbus.
> Without this check we will try to disable the regulator twice if
> we disconnect host and then connect as device.
>
> Signed-off-by: Jan Remmet <j.remmet@phytec.de>
> ---
> This is a fixup from
> - Link to v1: https://lore.kernel.org/r/20260115-wip-jremmet-hd3ss3220_vbus-v1-1-b7d9adfbe346@phytec.de
> To
> - Link to v2: https://lore.kernel.org/r/20260123-wip-jremmet-hd3ss3220_vbus-v2-1-bcad313ce92b@phytec.de
I don't understand that, but I think you are fixing a commit in Greg's
tree, right?
If that's the case, then you need the Fixes tag.
thanks,
> ---
> drivers/usb/typec/hd3ss3220.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
> index a7c54aa8635f70d6979d98c95f80d4dac277fef2..3e39b800e6b5f4d0cbba957c0dd66c18f781ff38 100644
> --- a/drivers/usb/typec/hd3ss3220.c
> +++ b/drivers/usb/typec/hd3ss3220.c
> @@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
> {
> int ret;
>
> + if (regulator_is_enabled(hd3ss3220->vbus) == on)
> + return;
> +
> if (on)
> ret = regulator_enable(hd3ss3220->vbus);
> else
>
> ---
> base-commit: 8acc379b664ec987dcc7eca25a5f5c4a9a4eb9c4
> change-id: 20260126-wip-jremmet-hd3ss3220_vbus_split-946802479e89
>
> Best regards,
> --
> Jan Remmet <j.remmet@phytec.de>
--
heikki
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched
2026-01-26 14:32 ` Heikki Krogerus
@ 2026-01-26 15:22 ` Jan Remmet
2026-01-27 14:21 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Jan Remmet @ 2026-01-26 15:22 UTC (permalink / raw)
To: Heikki Krogerus
Cc: Greg Kroah-Hartman, Krishna Kurapati, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, upstream@lists.phytec.de
Am 26.01.26 um 15:32 schrieb Heikki Krogerus:
> Mon, Jan 26, 2026 at 01:06:36PM +0100, Jan Remmet kirjoitti:
>> Check regulator state as peripheral and detach can disable vbus.
>> Without this check we will try to disable the regulator twice if
>> we disconnect host and then connect as device.
>>
>> Signed-off-by: Jan Remmet <j.remmet@phytec.de>
>> ---
>> This is a fixup from
>> - Link to v1: https://lore.kernel.org/r/20260115-wip-jremmet-hd3ss3220_vbus-v1-1-b7d9adfbe346@phytec.de
>> To
>> - Link to v2: https://lore.kernel.org/r/20260123-wip-jremmet-hd3ss3220_vbus-v2-1-bcad313ce92b@phytec.de
>
> I don't understand that, but I think you are fixing a commit in Greg's
> tree, right?
Yes
>
> If that's the case, then you need the Fixes tag.
Sorry, I'm not familar with the workflow here. Should it be a "--fixup"
git commit against the usb-next commit id?
Or
Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to
be switched")
In the commit message (again with commit sha from Greg's usb-next
Jan
>
> thanks,
>
>> ---
>> drivers/usb/typec/hd3ss3220.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/usb/typec/hd3ss3220.c b/drivers/usb/typec/hd3ss3220.c
>> index a7c54aa8635f70d6979d98c95f80d4dac277fef2..3e39b800e6b5f4d0cbba957c0dd66c18f781ff38 100644
>> --- a/drivers/usb/typec/hd3ss3220.c
>> +++ b/drivers/usb/typec/hd3ss3220.c
>> @@ -208,6 +208,9 @@ static void hd3ss3220_regulator_control(struct hd3ss3220 *hd3ss3220, bool on)
>> {
>> int ret;
>>
>> + if (regulator_is_enabled(hd3ss3220->vbus) == on)
>> + return;
>> +
>> if (on)
>> ret = regulator_enable(hd3ss3220->vbus);
>> else
>>
>> ---
>> base-commit: 8acc379b664ec987dcc7eca25a5f5c4a9a4eb9c4
>> change-id: 20260126-wip-jremmet-hd3ss3220_vbus_split-946802479e89
>>
>> Best regards,
>> --
>> Jan Remmet <j.remmet@phytec.de>
>
--
Mit freundlichen Grüßen / best regards
Jan Remmet
- Software Development -
PHYTEC Messtechnik GmbH
Barcelona-Allee 1
55129 Mainz
Germany
Tel.: +49 (0)6131 9221-53
Mail: j.remmet@pyhtec.de
Web: www.phytec.de
Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Marcus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.-Nr.: 26/665/00608, USt-ID: DE 149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in this
E-Mail is strictly forbidden.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched
2026-01-26 15:22 ` Jan Remmet
@ 2026-01-27 14:21 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-01-27 14:21 UTC (permalink / raw)
To: Jan Remmet
Cc: Heikki Krogerus, Krishna Kurapati, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, upstream@lists.phytec.de
On Mon, Jan 26, 2026 at 03:22:01PM +0000, Jan Remmet wrote:
> Am 26.01.26 um 15:32 schrieb Heikki Krogerus:
> > Mon, Jan 26, 2026 at 01:06:36PM +0100, Jan Remmet kirjoitti:
> >> Check regulator state as peripheral and detach can disable vbus.
> >> Without this check we will try to disable the regulator twice if
> >> we disconnect host and then connect as device.
> >>
> >> Signed-off-by: Jan Remmet <j.remmet@phytec.de>
> >> ---
> >> This is a fixup from
> >> - Link to v1: https://lore.kernel.org/r/20260115-wip-jremmet-hd3ss3220_vbus-v1-1-b7d9adfbe346@phytec.de
> >> To
> >> - Link to v2: https://lore.kernel.org/r/20260123-wip-jremmet-hd3ss3220_vbus-v2-1-bcad313ce92b@phytec.de
> >
> > I don't understand that, but I think you are fixing a commit in Greg's
> > tree, right?
> Yes
> >
> > If that's the case, then you need the Fixes tag.
>
> Sorry, I'm not familar with the workflow here. Should it be a "--fixup"
> git commit against the usb-next commit id?
>
> Or
> Fixes: 7e7025811579 ("usb: typec: hd3ss3220: Check if regulator needs to
> be switched")
>
> In the commit message (again with commit sha from Greg's usb-next
This one, Fixes: is the correct way to do it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-27 14:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 12:06 [PATCH] usb: typec: hd3ss3220: Check if regulator needs to be switched Jan Remmet
2026-01-26 14:32 ` Heikki Krogerus
2026-01-26 15:22 ` Jan Remmet
2026-01-27 14:21 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox