* [PATCH] usb: typec: mux: fsa4480: add regulator support
@ 2025-04-03 23:02 Michael Grzeschik
2025-04-08 12:18 ` Dmitry Baryshkov
2025-04-15 13:40 ` Heikki Krogerus
0 siblings, 2 replies; 5+ messages in thread
From: Michael Grzeschik @ 2025-04-03 23:02 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, kernel, Michael Grzeschik
The fsa4480 vcc lane could be driven by some external regulator.
This patch is adding support to enable the regulator before probing.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/typec/mux/fsa4480.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
index f71dba8bf07c9..c54e42c7e6a16 100644
--- a/drivers/usb/typec/mux/fsa4480.c
+++ b/drivers/usb/typec/mux/fsa4480.c
@@ -12,6 +12,7 @@
#include <linux/regmap.h>
#include <linux/usb/typec_dp.h>
#include <linux/usb/typec_mux.h>
+#include <linux/regulator/consumer.h>
#define FSA4480_DEVICE_ID 0x00
#define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6)
@@ -273,6 +274,10 @@ static int fsa4480_probe(struct i2c_client *client)
if (IS_ERR(fsa->regmap))
return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
+ ret = devm_regulator_get_enable_optional(dev, "vcc");
+ if (ret && ret != -ENODEV)
+ return dev_err_probe(dev, ret, "Failed to get regulator\n");
+
ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
if (ret)
return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
---
base-commit: a1b5bd45d4ee58af4f56e49497b8c3db96d8f8a3
change-id: 20250404-ml-topic-typec-mux-fs4480-392407f94f84
Best regards,
--
Michael Grzeschik <m.grzeschik@pengutronix.de>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: mux: fsa4480: add regulator support
2025-04-03 23:02 [PATCH] usb: typec: mux: fsa4480: add regulator support Michael Grzeschik
@ 2025-04-08 12:18 ` Dmitry Baryshkov
2025-04-10 21:54 ` Michael Grzeschik
2025-04-15 13:40 ` Heikki Krogerus
1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2025-04-08 12:18 UTC (permalink / raw)
To: Michael Grzeschik
Cc: Heikki Krogerus, Greg Kroah-Hartman, linux-usb, linux-kernel,
kernel
On Fri, Apr 04, 2025 at 01:02:20AM +0200, Michael Grzeschik wrote:
> The fsa4480 vcc lane could be driven by some external regulator.
> This patch is adding support to enable the regulator before probing.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> drivers/usb/typec/mux/fsa4480.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
> index f71dba8bf07c9..c54e42c7e6a16 100644
> --- a/drivers/usb/typec/mux/fsa4480.c
> +++ b/drivers/usb/typec/mux/fsa4480.c
> @@ -12,6 +12,7 @@
> #include <linux/regmap.h>
> #include <linux/usb/typec_dp.h>
> #include <linux/usb/typec_mux.h>
> +#include <linux/regulator/consumer.h>
>
> #define FSA4480_DEVICE_ID 0x00
> #define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6)
> @@ -273,6 +274,10 @@ static int fsa4480_probe(struct i2c_client *client)
> if (IS_ERR(fsa->regmap))
> return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
>
> + ret = devm_regulator_get_enable_optional(dev, "vcc");
Missing DT bindings update that describes this supply.
> + if (ret && ret != -ENODEV)
> + return dev_err_probe(dev, ret, "Failed to get regulator\n");
> +
> ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
> if (ret)
> return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
>
> ---
> base-commit: a1b5bd45d4ee58af4f56e49497b8c3db96d8f8a3
> change-id: 20250404-ml-topic-typec-mux-fs4480-392407f94f84
>
> Best regards,
> --
> Michael Grzeschik <m.grzeschik@pengutronix.de>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: mux: fsa4480: add regulator support
2025-04-08 12:18 ` Dmitry Baryshkov
@ 2025-04-10 21:54 ` Michael Grzeschik
2025-04-15 13:32 ` Dmitry Baryshkov
0 siblings, 1 reply; 5+ messages in thread
From: Michael Grzeschik @ 2025-04-10 21:54 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Heikki Krogerus, Greg Kroah-Hartman, linux-usb, linux-kernel,
kernel
[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]
On Tue, Apr 08, 2025 at 03:18:14PM +0300, Dmitry Baryshkov wrote:
>On Fri, Apr 04, 2025 at 01:02:20AM +0200, Michael Grzeschik wrote:
>> The fsa4480 vcc lane could be driven by some external regulator.
>> This patch is adding support to enable the regulator before probing.
>>
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> ---
>> drivers/usb/typec/mux/fsa4480.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
>> index f71dba8bf07c9..c54e42c7e6a16 100644
>> --- a/drivers/usb/typec/mux/fsa4480.c
>> +++ b/drivers/usb/typec/mux/fsa4480.c
>> @@ -12,6 +12,7 @@
>> #include <linux/regmap.h>
>> #include <linux/usb/typec_dp.h>
>> #include <linux/usb/typec_mux.h>
>> +#include <linux/regulator/consumer.h>
>>
>> #define FSA4480_DEVICE_ID 0x00
>> #define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6)
>> @@ -273,6 +274,10 @@ static int fsa4480_probe(struct i2c_client *client)
>> if (IS_ERR(fsa->regmap))
>> return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
>>
>> + ret = devm_regulator_get_enable_optional(dev, "vcc");
>
>Missing DT bindings update that describes this supply.
Looking into "Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml" it
seems vcc-supply is alread documented. Is more needed?
>> + if (ret && ret != -ENODEV)
>> + return dev_err_probe(dev, ret, "Failed to get regulator\n");
>> +
>> ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
>> if (ret)
>> return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
>>
>> ---
>> base-commit: a1b5bd45d4ee58af4f56e49497b8c3db96d8f8a3
>> change-id: 20250404-ml-topic-typec-mux-fs4480-392407f94f84
>>
>> Best regards,
>> --
>> Michael Grzeschik <m.grzeschik@pengutronix.de>
>>
>
>--
>With best wishes
>Dmitry
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: mux: fsa4480: add regulator support
2025-04-10 21:54 ` Michael Grzeschik
@ 2025-04-15 13:32 ` Dmitry Baryshkov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2025-04-15 13:32 UTC (permalink / raw)
To: Michael Grzeschik
Cc: Heikki Krogerus, Greg Kroah-Hartman, linux-usb, linux-kernel,
kernel
On Thu, Apr 10, 2025 at 11:54:38PM +0200, Michael Grzeschik wrote:
> On Tue, Apr 08, 2025 at 03:18:14PM +0300, Dmitry Baryshkov wrote:
> > On Fri, Apr 04, 2025 at 01:02:20AM +0200, Michael Grzeschik wrote:
> > > The fsa4480 vcc lane could be driven by some external regulator.
> > > This patch is adding support to enable the regulator before probing.
> > >
> > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > > ---
> > > drivers/usb/typec/mux/fsa4480.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
> > > index f71dba8bf07c9..c54e42c7e6a16 100644
> > > --- a/drivers/usb/typec/mux/fsa4480.c
> > > +++ b/drivers/usb/typec/mux/fsa4480.c
> > > @@ -12,6 +12,7 @@
> > > #include <linux/regmap.h>
> > > #include <linux/usb/typec_dp.h>
> > > #include <linux/usb/typec_mux.h>
> > > +#include <linux/regulator/consumer.h>
> > >
> > > #define FSA4480_DEVICE_ID 0x00
> > > #define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6)
> > > @@ -273,6 +274,10 @@ static int fsa4480_probe(struct i2c_client *client)
> > > if (IS_ERR(fsa->regmap))
> > > return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
> > >
> > > + ret = devm_regulator_get_enable_optional(dev, "vcc");
> >
> > Missing DT bindings update that describes this supply.
>
> Looking into "Documentation/devicetree/bindings/usb/fcs,fsa4480.yaml" it
> seems vcc-supply is alread documented. Is more needed?
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: typec: mux: fsa4480: add regulator support
2025-04-03 23:02 [PATCH] usb: typec: mux: fsa4480: add regulator support Michael Grzeschik
2025-04-08 12:18 ` Dmitry Baryshkov
@ 2025-04-15 13:40 ` Heikki Krogerus
1 sibling, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2025-04-15 13:40 UTC (permalink / raw)
To: Michael Grzeschik; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, kernel
On Fri, Apr 04, 2025 at 01:02:20AM +0200, Michael Grzeschik wrote:
> The fsa4480 vcc lane could be driven by some external regulator.
> This patch is adding support to enable the regulator before probing.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/mux/fsa4480.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/usb/typec/mux/fsa4480.c b/drivers/usb/typec/mux/fsa4480.c
> index f71dba8bf07c9..c54e42c7e6a16 100644
> --- a/drivers/usb/typec/mux/fsa4480.c
> +++ b/drivers/usb/typec/mux/fsa4480.c
> @@ -12,6 +12,7 @@
> #include <linux/regmap.h>
> #include <linux/usb/typec_dp.h>
> #include <linux/usb/typec_mux.h>
> +#include <linux/regulator/consumer.h>
>
> #define FSA4480_DEVICE_ID 0x00
> #define FSA4480_DEVICE_ID_VENDOR_ID GENMASK(7, 6)
> @@ -273,6 +274,10 @@ static int fsa4480_probe(struct i2c_client *client)
> if (IS_ERR(fsa->regmap))
> return dev_err_probe(dev, PTR_ERR(fsa->regmap), "failed to initialize regmap\n");
>
> + ret = devm_regulator_get_enable_optional(dev, "vcc");
> + if (ret && ret != -ENODEV)
> + return dev_err_probe(dev, ret, "Failed to get regulator\n");
> +
> ret = regmap_read(fsa->regmap, FSA4480_DEVICE_ID, &val);
> if (ret)
> return dev_err_probe(dev, -ENODEV, "FSA4480 not found\n");
>
> ---
> base-commit: a1b5bd45d4ee58af4f56e49497b8c3db96d8f8a3
> change-id: 20250404-ml-topic-typec-mux-fs4480-392407f94f84
>
> Best regards,
> --
> Michael Grzeschik <m.grzeschik@pengutronix.de>
>
--
heikki
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-15 13:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 23:02 [PATCH] usb: typec: mux: fsa4480: add regulator support Michael Grzeschik
2025-04-08 12:18 ` Dmitry Baryshkov
2025-04-10 21:54 ` Michael Grzeschik
2025-04-15 13:32 ` Dmitry Baryshkov
2025-04-15 13:40 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox