public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
@ 2024-05-24  7:10 Francesco Dolcini
  2024-05-24  7:10 ` [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional Francesco Dolcini
  2024-05-24  7:10 ` [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
  0 siblings, 2 replies; 9+ messages in thread
From: Francesco Dolcini @ 2024-05-24  7:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heikki Krogerus, Bjorn Andersson
  Cc: Francesco Dolcini, linux-usb, devicetree, linux-kernel,
	Dmitry Baryshkov

From: Francesco Dolcini <francesco.dolcini@toradex.com>

The enable gpio is not required when the SBU mux is used only for orientation,
make it optional.

Francesco Dolcini (2):
  dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional
  usb: typec: mux: gpio-sbu: Make enable gpio optional

 .../devicetree/bindings/usb/gpio-sbu-mux.yaml         |  7 ++++++-
 drivers/usb/typec/mux/gpio-sbu-mux.c                  | 11 ++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

-- 
2.39.2


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

* [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional
  2024-05-24  7:10 [PATCH v1 0/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
@ 2024-05-24  7:10 ` Francesco Dolcini
  2024-05-24 18:31   ` Conor Dooley
  2024-05-24  7:10 ` [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
  1 sibling, 1 reply; 9+ messages in thread
From: Francesco Dolcini @ 2024-05-24  7:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson
  Cc: Francesco Dolcini, linux-usb, devicetree, linux-kernel,
	Dmitry Baryshkov

From: Francesco Dolcini <francesco.dolcini@toradex.com>

The enable gpio is not required when the SBU mux is used only for
orientation, make enable-gpios required only for alternate mode
switch use case.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
index 88e1607cf053..30edcce82f97 100644
--- a/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
+++ b/Documentation/devicetree/bindings/usb/gpio-sbu-mux.yaml
@@ -44,13 +44,18 @@ properties:
 
 required:
   - compatible
-  - enable-gpios
   - select-gpios
   - orientation-switch
   - port
 
 allOf:
   - $ref: usb-switch.yaml#
+  - if:
+      required:
+        - mode-switch
+    then:
+      required:
+        - enable-gpios
 
 additionalProperties: false
 
-- 
2.39.2


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

* [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24  7:10 [PATCH v1 0/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
  2024-05-24  7:10 ` [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional Francesco Dolcini
@ 2024-05-24  7:10 ` Francesco Dolcini
  2024-05-24  9:56   ` Dmitry Baryshkov
  1 sibling, 1 reply; 9+ messages in thread
From: Francesco Dolcini @ 2024-05-24  7:10 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman
  Cc: Francesco Dolcini, linux-usb, linux-kernel, Dmitry Baryshkov,
	Bjorn Andersson

From: Francesco Dolcini <francesco.dolcini@toradex.com>

The enable gpio is not required when the SBU mux is used only for
orientation, make it optional.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
index 374168482d36..cf44259980a1 100644
--- a/drivers/usb/typec/mux/gpio-sbu-mux.c
+++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
@@ -47,7 +47,7 @@ static int gpio_sbu_switch_set(struct typec_switch_dev *sw,
 		break;
 	}
 
-	if (enabled != sbu_mux->enabled)
+	if (sbu_mux->enable_gpio && enabled != sbu_mux->enabled)
 		gpiod_set_value_cansleep(sbu_mux->enable_gpio, enabled);
 
 	if (swapped != sbu_mux->swapped)
@@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
 {
 	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
 
+	if (!sbu_mux->enable_gpio)
+		return -EOPNOTSUPP;
+
 	mutex_lock(&sbu_mux->lock);
 
 	switch (state->mode) {
@@ -102,7 +105,8 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev)
 
 	mutex_init(&sbu_mux->lock);
 
-	sbu_mux->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
+	sbu_mux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
+						       GPIOD_OUT_LOW);
 	if (IS_ERR(sbu_mux->enable_gpio))
 		return dev_err_probe(dev, PTR_ERR(sbu_mux->enable_gpio),
 				     "unable to acquire enable gpio\n");
@@ -141,7 +145,8 @@ static void gpio_sbu_mux_remove(struct platform_device *pdev)
 {
 	struct gpio_sbu_mux *sbu_mux = platform_get_drvdata(pdev);
 
-	gpiod_set_value_cansleep(sbu_mux->enable_gpio, 0);
+	if (sbu_mux->enable_gpio)
+		gpiod_set_value_cansleep(sbu_mux->enable_gpio, 0);
 
 	typec_mux_unregister(sbu_mux->mux);
 	typec_switch_unregister(sbu_mux->sw);
-- 
2.39.2


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

* Re: [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24  7:10 ` [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
@ 2024-05-24  9:56   ` Dmitry Baryshkov
  2024-05-24 11:31     ` Francesco Dolcini
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-05-24  9:56 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Heikki Krogerus, Greg Kroah-Hartman, Francesco Dolcini, linux-usb,
	linux-kernel, Bjorn Andersson

On Fri, May 24, 2024 at 09:10:34AM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> The enable gpio is not required when the SBU mux is used only for
> orientation, make it optional.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> index 374168482d36..cf44259980a1 100644
> --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> @@ -47,7 +47,7 @@ static int gpio_sbu_switch_set(struct typec_switch_dev *sw,
>  		break;
>  	}
>  
> -	if (enabled != sbu_mux->enabled)
> +	if (sbu_mux->enable_gpio && enabled != sbu_mux->enabled)
>  		gpiod_set_value_cansleep(sbu_mux->enable_gpio, enabled);

I think it's safe to pass NULL to gpiod_set_value_cansleep().

>  
>  	if (swapped != sbu_mux->swapped)
> @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
>  {
>  	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
>  
> +	if (!sbu_mux->enable_gpio)
> +		return -EOPNOTSUPP;

Can we skip registering the mux if there is no enable_gpio? This can
save users from the unexpected errors during runtime.

> +
>  	mutex_lock(&sbu_mux->lock);
>  
>  	switch (state->mode) {
> @@ -102,7 +105,8 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev)
>  
>  	mutex_init(&sbu_mux->lock);
>  
> -	sbu_mux->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
> +	sbu_mux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
> +						       GPIOD_OUT_LOW);
>  	if (IS_ERR(sbu_mux->enable_gpio))
>  		return dev_err_probe(dev, PTR_ERR(sbu_mux->enable_gpio),
>  				     "unable to acquire enable gpio\n");
> @@ -141,7 +145,8 @@ static void gpio_sbu_mux_remove(struct platform_device *pdev)
>  {
>  	struct gpio_sbu_mux *sbu_mux = platform_get_drvdata(pdev);
>  
> -	gpiod_set_value_cansleep(sbu_mux->enable_gpio, 0);
> +	if (sbu_mux->enable_gpio)
> +		gpiod_set_value_cansleep(sbu_mux->enable_gpio, 0);
>  
>  	typec_mux_unregister(sbu_mux->mux);
>  	typec_switch_unregister(sbu_mux->sw);
> -- 
> 2.39.2
> 

-- 
With best wishes
Dmitry

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

* Re: [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24  9:56   ` Dmitry Baryshkov
@ 2024-05-24 11:31     ` Francesco Dolcini
  2024-05-24 11:42       ` Dmitry Baryshkov
  0 siblings, 1 reply; 9+ messages in thread
From: Francesco Dolcini @ 2024-05-24 11:31 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Francesco Dolcini, Heikki Krogerus, Greg Kroah-Hartman,
	Francesco Dolcini, linux-usb, linux-kernel, Bjorn Andersson

Hello Dmitry,
thanks for the review.

On Fri, May 24, 2024 at 12:56:15PM +0300, Dmitry Baryshkov wrote:
> On Fri, May 24, 2024 at 09:10:34AM +0200, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > The enable gpio is not required when the SBU mux is used only for
> > orientation, make it optional.
> > 
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > ---
> >  drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > index 374168482d36..cf44259980a1 100644
> > --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> > +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
...
> > @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
> >  {
> >  	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
> >  
> > +	if (!sbu_mux->enable_gpio)
> > +		return -EOPNOTSUPP;
> 
> Can we skip registering the mux if there is no enable_gpio? This can
> save users from the unexpected errors during runtime.

Yes, I considered this option.

The rationale for the current implementation is that if the device tree is
correct (no mode-switch property, when enable-gpios is not present), nobody
will call gpio_sbu_mux_set() so no runtime error is possible. If the
configuration in the DT is not correct you get this runtime error.

With your proposal in case the DT configuration is not correct there will be no
errors from the kernel, but the functionality will not work.

Francesco


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

* Re: [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24 11:31     ` Francesco Dolcini
@ 2024-05-24 11:42       ` Dmitry Baryshkov
  2024-05-24 12:51         ` Francesco Dolcini
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-05-24 11:42 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Heikki Krogerus, Greg Kroah-Hartman, Francesco Dolcini, linux-usb,
	linux-kernel, Bjorn Andersson

On Fri, May 24, 2024 at 01:31:58PM +0200, Francesco Dolcini wrote:
> Hello Dmitry,
> thanks for the review.
> 
> On Fri, May 24, 2024 at 12:56:15PM +0300, Dmitry Baryshkov wrote:
> > On Fri, May 24, 2024 at 09:10:34AM +0200, Francesco Dolcini wrote:
> > > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > 
> > > The enable gpio is not required when the SBU mux is used only for
> > > orientation, make it optional.
> > > 
> > > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > ---
> > >  drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > index 374168482d36..cf44259980a1 100644
> > > --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> ...
> > > @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
> > >  {
> > >  	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
> > >  
> > > +	if (!sbu_mux->enable_gpio)
> > > +		return -EOPNOTSUPP;
> > 
> > Can we skip registering the mux if there is no enable_gpio? This can
> > save users from the unexpected errors during runtime.
> 
> Yes, I considered this option.
> 
> The rationale for the current implementation is that if the device tree is
> correct (no mode-switch property, when enable-gpios is not present), nobody
> will call gpio_sbu_mux_set() so no runtime error is possible. If the
> configuration in the DT is not correct you get this runtime error.
> 
> With your proposal in case the DT configuration is not correct there will be no
> errors from the kernel, but the functionality will not work.

I'm slightly biased maybe, but I prefer an error from probe (or
dependent devices being deferred). On the other hand, current motto is
that 'the kernel should not duplicate dt-validate's work'.

-- 
With best wishes
Dmitry

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

* Re: [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24 11:42       ` Dmitry Baryshkov
@ 2024-05-24 12:51         ` Francesco Dolcini
  2024-05-24 20:25           ` Dmitry Baryshkov
  0 siblings, 1 reply; 9+ messages in thread
From: Francesco Dolcini @ 2024-05-24 12:51 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Francesco Dolcini, Heikki Krogerus, Greg Kroah-Hartman,
	Francesco Dolcini, linux-usb, linux-kernel, Bjorn Andersson

Hello Dmitry,

On Fri, May 24, 2024 at 02:42:04PM +0300, Dmitry Baryshkov wrote:
> On Fri, May 24, 2024 at 01:31:58PM +0200, Francesco Dolcini wrote:
> > On Fri, May 24, 2024 at 12:56:15PM +0300, Dmitry Baryshkov wrote:
> > > On Fri, May 24, 2024 at 09:10:34AM +0200, Francesco Dolcini wrote:
> > > > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > > 
> > > > The enable gpio is not required when the SBU mux is used only for
> > > > orientation, make it optional.
> > > > 
> > > > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > > ---
> > > >  drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
> > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > > index 374168482d36..cf44259980a1 100644
> > > > --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > > +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > ...
> > > > @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
> > > >  {
> > > >  	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
> > > >  
> > > > +	if (!sbu_mux->enable_gpio)
> > > > +		return -EOPNOTSUPP;
> > > 
> > > Can we skip registering the mux if there is no enable_gpio? This can
> > > save users from the unexpected errors during runtime.
> > 
> > Yes, I considered this option.
> > 
> > The rationale for the current implementation is that if the device tree is
> > correct (no mode-switch property, when enable-gpios is not present), nobody
> > will call gpio_sbu_mux_set() so no runtime error is possible. If the
> > configuration in the DT is not correct you get this runtime error.
> > 
> > With your proposal in case the DT configuration is not correct there will be no
> > errors from the kernel, but the functionality will not work.
> 
> I'm slightly biased maybe, but I prefer an error from probe (or
> dependent devices being deferred). On the other hand, current motto is
> that 'the kernel should not duplicate dt-validate's work'.

I am in favor of "the kernel should not duplicate dt-validate's work".

Now the question is if you are ok with the current implementation or you want
me to change the way you suggested.

Or maybe there is a third variant, not doing the return -EOPNOTSUPP and
registering gpio_sbu_mux_set() even if the gpio get returns NULL. This is a
one-line patch and everything will work just fine.

Francesco

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

* Re: [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional
  2024-05-24  7:10 ` [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional Francesco Dolcini
@ 2024-05-24 18:31   ` Conor Dooley
  0 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2024-05-24 18:31 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Bjorn Andersson, Francesco Dolcini, linux-usb,
	devicetree, linux-kernel, Dmitry Baryshkov

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

On Fri, May 24, 2024 at 09:10:33AM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> The enable gpio is not required when the SBU mux is used only for
> orientation, make enable-gpios required only for alternate mode
> switch use case.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
  2024-05-24 12:51         ` Francesco Dolcini
@ 2024-05-24 20:25           ` Dmitry Baryshkov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2024-05-24 20:25 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Heikki Krogerus, Greg Kroah-Hartman, Francesco Dolcini, linux-usb,
	linux-kernel, Bjorn Andersson

On Fri, May 24, 2024 at 02:51:10PM +0200, Francesco Dolcini wrote:
> Hello Dmitry,
> 
> On Fri, May 24, 2024 at 02:42:04PM +0300, Dmitry Baryshkov wrote:
> > On Fri, May 24, 2024 at 01:31:58PM +0200, Francesco Dolcini wrote:
> > > On Fri, May 24, 2024 at 12:56:15PM +0300, Dmitry Baryshkov wrote:
> > > > On Fri, May 24, 2024 at 09:10:34AM +0200, Francesco Dolcini wrote:
> > > > > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > > > 
> > > > > The enable gpio is not required when the SBU mux is used only for
> > > > > orientation, make it optional.
> > > > > 
> > > > > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > > > ---
> > > > >  drivers/usb/typec/mux/gpio-sbu-mux.c | 11 ++++++++---
> > > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > > > index 374168482d36..cf44259980a1 100644
> > > > > --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > > > +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> > > ...
> > > > > @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
> > > > >  {
> > > > >  	struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
> > > > >  
> > > > > +	if (!sbu_mux->enable_gpio)
> > > > > +		return -EOPNOTSUPP;
> > > > 
> > > > Can we skip registering the mux if there is no enable_gpio? This can
> > > > save users from the unexpected errors during runtime.
> > > 
> > > Yes, I considered this option.
> > > 
> > > The rationale for the current implementation is that if the device tree is
> > > correct (no mode-switch property, when enable-gpios is not present), nobody
> > > will call gpio_sbu_mux_set() so no runtime error is possible. If the
> > > configuration in the DT is not correct you get this runtime error.
> > > 
> > > With your proposal in case the DT configuration is not correct there will be no
> > > errors from the kernel, but the functionality will not work.
> > 
> > I'm slightly biased maybe, but I prefer an error from probe (or
> > dependent devices being deferred). On the other hand, current motto is
> > that 'the kernel should not duplicate dt-validate's work'.
> 
> I am in favor of "the kernel should not duplicate dt-validate's work".
> 
> Now the question is if you are ok with the current implementation or you want
> me to change the way you suggested.
> 
> Or maybe there is a third variant, not doing the return -EOPNOTSUPP and
> registering gpio_sbu_mux_set() even if the gpio get returns NULL. This is a
> one-line patch and everything will work just fine.

I'm fine either way.

-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2024-05-24 20:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24  7:10 [PATCH v1 0/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
2024-05-24  7:10 ` [PATCH v1 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional Francesco Dolcini
2024-05-24 18:31   ` Conor Dooley
2024-05-24  7:10 ` [PATCH v1 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
2024-05-24  9:56   ` Dmitry Baryshkov
2024-05-24 11:31     ` Francesco Dolcini
2024-05-24 11:42       ` Dmitry Baryshkov
2024-05-24 12:51         ` Francesco Dolcini
2024-05-24 20:25           ` Dmitry Baryshkov

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