2021-02-23 17:48:09

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v3 0/3] usb: host: ehci-platform: add spurious-oc support

Over-current reporting isn't supported on some platforms such as bcm63xx.
These devices will incorrectly report over-current if this flag isn't properly
activated.

v3: add missing patch from Florian Fainelli.
v2: change flag name and improve documentation as suggested by Alan Stern.

Florian Fainelli (1):
usb: ehci: add spurious flag to disable overcurrent checking

Álvaro Fernández Rojas (2):
dt-bindings: usb: generic-ehci: document spurious-oc flag
usb: host: ehci-platform: add spurious_oc DT support

Documentation/devicetree/bindings/usb/generic-ehci.yaml | 6 ++++++
drivers/usb/host/ehci-hcd.c | 2 +-
drivers/usb/host/ehci-hub.c | 4 ++--
drivers/usb/host/ehci-platform.c | 5 +++++
drivers/usb/host/ehci.h | 1 +
include/linux/usb/ehci_pdriver.h | 1 +
6 files changed, 16 insertions(+), 3 deletions(-)

--
2.20.1


2021-02-23 17:50:44

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v3 2/3] dt-bindings: usb: generic-ehci: document spurious-oc flag

Over-current reporting isn't supported on some platforms such as bcm63xx.
These devices will incorrectly report over-current if this flag isn't properly
activated.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
v3: no changes.
v2: change flag name and improve documentation as suggested by Alan Stern.

Documentation/devicetree/bindings/usb/generic-ehci.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/generic-ehci.yaml b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
index cf83f2d9afac..8089dc956ba3 100644
--- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
@@ -122,6 +122,12 @@ properties:
description:
Set this flag to force EHCI reset after resume.

+ spurious-oc:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ Set this flag to indicate that the hardware sometimes turns on
+ the OC bit when an over-current isn't actually present.
+
companion:
$ref: /schemas/types.yaml#/definitions/phandle
description:
--
2.20.1

2021-02-23 17:50:53

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v3 3/3] usb: host: ehci-platform: add spurious_oc DT support

Over-current reporting isn't supported on some platforms such as bcm63xx.
These devices will incorrectly report over-current if this flag isn't properly
activated.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
v3: no changes.

drivers/usb/host/ehci-platform.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 4d7b17f4f82b..c70f2d0b4aaf 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -286,6 +286,9 @@ static int ehci_platform_probe(struct platform_device *dev)
if (of_property_read_bool(dev->dev.of_node, "big-endian"))
ehci->big_endian_mmio = ehci->big_endian_desc = 1;

+ if (of_property_read_bool(dev->dev.of_node, "spurious-oc"))
+ ehci->spurious_oc = 1;
+
if (of_property_read_bool(dev->dev.of_node,
"needs-reset-on-resume"))
priv->reset_on_resume = true;
--
2.20.1

2021-02-24 08:18:24

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] dt-bindings: usb: generic-ehci: document spurious-oc flag

I didn’t change this, but I missed Alan’s Acked-by, so:
Acked-by: Alan Stern <[email protected]>

> El 23 feb 2021, a las 18:44, Álvaro Fernández Rojas <[email protected]> escribió:
>
> Over-current reporting isn't supported on some platforms such as bcm63xx.
> These devices will incorrectly report over-current if this flag isn't properly
> activated.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> ---
> v3: no changes.
> v2: change flag name and improve documentation as suggested by Alan Stern.
>
> Documentation/devicetree/bindings/usb/generic-ehci.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/generic-ehci.yaml b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> index cf83f2d9afac..8089dc956ba3 100644
> --- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> @@ -122,6 +122,12 @@ properties:
> description:
> Set this flag to force EHCI reset after resume.
>
> + spurious-oc:
> + $ref: /schemas/types.yaml#/definitions/flag
> + description:
> + Set this flag to indicate that the hardware sometimes turns on
> + the OC bit when an over-current isn't actually present.
> +
> companion:
> $ref: /schemas/types.yaml#/definitions/phandle
> description:
> --
> 2.20.1
>

2021-03-06 20:04:56

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] dt-bindings: usb: generic-ehci: document spurious-oc flag

On Tue, 23 Feb 2021 18:44:54 +0100, ?lvaro Fern?ndez Rojas wrote:
> Over-current reporting isn't supported on some platforms such as bcm63xx.
> These devices will incorrectly report over-current if this flag isn't properly
> activated.
>
> Signed-off-by: ?lvaro Fern?ndez Rojas <[email protected]>
> ---
> v3: no changes.
> v2: change flag name and improve documentation as suggested by Alan Stern.
>
> Documentation/devicetree/bindings/usb/generic-ehci.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>

Acked-by: Rob Herring <[email protected]>