Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: typec: mux: fsa4480: wait after enabling supply
@ 2026-08-20 11:44 Vasiliy Doylov via B4 Relay
  2026-08-24  0:09 ` Danila Tikhonov
  0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Doylov via B4 Relay @ 2026-08-20 11:44 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, danila, phone-devel,
	~postmarketos/upstreaming, Vasiliy Doylov

From: Vasiliy Doylov <neko@altlinux.org>

Add a 200 ms delay after enabling the optional vcc regulator in the
FSA4480 probe function. On some platforms (nothing-spacewar) the supply
needs time to stabilize before the chip is ready to respond to I2C reads.
Without this delay the initial DEVICE_ID read fails with -ENODEV.

Tested on: Nothing Phone (1) "sm7325-nothing-spacewar"

Signed-off-by: Vasiliy Doylov <neko@altlinux.org>
---
Add a 200 ms delay after enabling the optional vcc regulator in the
FSA4480 probe function. On some platforms (nothing-spacewar)
the supply needs time to stabilize before the chip is ready to respond
to I2C reads. Without this delay the initial DEVICE_ID read
intermittently fails with -ENODEV, preventing the driver from binding.
---
 drivers/usb/typec/mux/fsa4480.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
index bea0c1deec94..4dab12c2b9d7 100644
--- a/drivers/usb/typec/mux/fsa4480.c
+++ b/drivers/usb/typec/mux/fsa4480.c
@@ -278,6 +278,8 @@ static int fsa4480_probe(struct i2c_client *client)
 	if (ret && ret != -ENODEV)
 		return dev_err_probe(dev, ret, "Failed to get regulator\n");
 
+	fsleep(200000);
+
 	ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
 	if (ret)
 		return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");

---
base-commit: 6a746cd265aed59107ebdaa9ce039bb832922969
change-id: 20260820-fsa4480-wait-for-power-7ffdcd2bebbc

Best regards,
--  
Vasiliy Doylov <neko@altlinux.org>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: mux: fsa4480: wait after enabling supply
  2026-08-20 11:44 [PATCH] usb: typec: mux: fsa4480: wait after enabling supply Vasiliy Doylov via B4 Relay
@ 2026-08-24  0:09 ` Danila Tikhonov
  0 siblings, 0 replies; 2+ messages in thread
From: Danila Tikhonov @ 2026-08-24  0:09 UTC (permalink / raw)
  To: neko, Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, phone-devel, ~postmarketos/upstreaming

Hello Vasiliy,

On 20/08/2026 14:44, Vasiliy Doylov via B4 Relay wrote:
> From: Vasiliy Doylov <neko@altlinux.org>
>
> Add a 200 ms delay after enabling the optional vcc regulator in the
> FSA4480 probe function. On some platforms (nothing-spacewar) the supply
> needs time to stabilize before the chip is ready to respond to I2C reads.
> Without this delay the initial DEVICE_ID read fails with -ENODEV.
>
> Tested on: Nothing Phone (1) "sm7325-nothing-spacewar"
>
> Signed-off-by: Vasiliy Doylov <neko@altlinux.org>

Thanks!

Tested-by: Danila Tikhonov <danila@mainlining.org> # sm7325-nothing-spacewar

> ---
> Add a 200 ms delay after enabling the optional vcc regulator in the
> FSA4480 probe function. On some platforms (nothing-spacewar)
> the supply needs time to stabilize before the chip is ready to respond
> to I2C reads. Without this delay the initial DEVICE_ID read
> intermittently fails with -ENODEV, preventing the driver from binding.
> ---
>   drivers/usb/typec/mux/fsa4480.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
> index bea0c1deec94..4dab12c2b9d7 100644
> --- a/drivers/usb/typec/mux/fsa4480.c
> +++ b/drivers/usb/typec/mux/fsa4480.c
> @@ -278,6 +278,8 @@ static int fsa4480_probe(struct i2c_client *client)
>   	if (ret && ret != -ENODEV)
>   		return dev_err_probe(dev, ret, "Failed to get regulator\n");
>   
> +	fsleep(200000);
> +
>   	ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
>   	if (ret)
>   		return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
>
> ---
> base-commit: 6a746cd265aed59107ebdaa9ce039bb832922969
> change-id: 20260820-fsa4480-wait-for-power-7ffdcd2bebbc
>
> Best regards,
> --
> Vasiliy Doylov <neko@altlinux.org>
>
-- 
Best regards,
Danila


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-24  0:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 11:44 [PATCH] usb: typec: mux: fsa4480: wait after enabling supply Vasiliy Doylov via B4 Relay
2026-08-24  0:09 ` Danila Tikhonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox