Add two new configuration drivers for Microchip USB hubs
Subsystems (2)
PATCH 1/1 Add two new configuration drivers for Microchip USB hubs
Most USB hub chips from Microchip can be configured via I2C/SMBus interface. The series adds two new drivers for configuration of the following USB hub series:
- USB253x
- USB3x13
- USB46x4
- USB47xx
- USB49xx
PATCH 1/4 dt-bindings: usb: Add Microchip USB253x/USB3x13/USB46x4 support
Add DT bindings for Microchip USB253x/USB3x13/USB46x4 driver.
--- .../devicetree/bindings/usb/usb253x.yaml | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb253x.yaml
Documentation/devicetree/bindings/usb/usb253x.yaml new file +234 -0
@@ -0,0 +1,234 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb253x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB253x/USB3x13/USB46x4 USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/AppNotes/00001801C.pdf + +properties: + compatible: + enum: + - microchip,usb2532 + - microchip,usb2532i + - microchip,usb2533 + - microchip,usb2533i + - microchip,usb2534 + - microchip,usb2534i + - microchip,usb3613 + - microchip,usb3613i + - microchip,usb3813 + - microchip,usb3813i + - microchip,usb4604 + - microchip,usb4604i + - microchip,usb4624 + - microchip,usb4624i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. a total of 93 characters for + manufacturer, product and serial). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. a total of 93 characters for + manufacturer, product and serial). + + serial: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Serial string (max. a total of 93 characters for + manufacturer, product and serial). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-us: + enum: + - 100 + - 4000 + - 8000 + - 16000 + default: 8000 + description: + Delay time (in microseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb2534i@2d { + compatible = "microchip,usb2534i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb253x.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + /*skip-config;*/ + /* T_ON,max = 4 ms for NCP380 */ + power-on-time-ms = <4>; + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 2 is connected to an internal SD-Card reader */ + non-removable-ports = <2>; + /* hub controller mapped to logical port 5 */ + hub-controller-port = <5>; + }; + }; + +...
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
PATCH 2/4 usb: misc: Add USB253x/xi Hi-Speed Hub Controller Driver
In reply to Christian EggersThis patch adds a driver for configuration of the Microchip USB253x/xi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports.
Furthermore add myself as a maintainer for this driver.
The datasheet can be found at the manufacturers website, see [1]. All device-tree exposed configuration features have been tested on a i.MX6 platform with a USB2534i hub.
[1] http://ww1.microchip.com/downloads/en/AppNotes/00001801C.pdf
--- MAINTAINERS | 7 + drivers/usb/misc/Kconfig | 10 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb253x.c | 834 +++++++++++++++++++++++++++++++++++++ 4 files changed, 852 insertions(+) create mode 100644 drivers/usb/misc/usb253x.c
MAINTAINERS +7 -0
@@ -11356,6 +11356,13 @@ S: Maintained F: Documentation/devicetree/bindings/usb/usb251xb.txt F: drivers/usb/misc/usb251xb.c +MICROCHIP USB253X DRIVER +M: Christian Eggers <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/usb/usb253x.yaml +F: drivers/usb/misc/usb253x.c + MICROCHIP USBA UDC DRIVER M: Cristian Birsan <[email protected]> L: [email protected] (moderated for non-subscribers)
drivers/usb/misc/Kconfig +10 -0
@@ -242,6 +242,16 @@ config USB_HUB_USB251XB parameters may be set in devicetree or platform data. Say Y or M here if you need to configure such a device via SMBus. +config USB_HUB_USB253X + tristate "USB253X Hub Controller Configuration Driver" + depends on I2C + select REGMAP + help + This option enables support for configuration via I2C bus of the + Microchip USB253x/xi USB 2.0 Hub Controller series. + Configuration parameters may be set in devicetree or platform data. + Say Y or M here if you need to configure such a device via I2C. + config USB_HSIC_USB3503 tristate "USB3503 HSIC to USB20 Driver" depends on I2C
drivers/usb/misc/Makefile +1 -0
@@ -25,6 +25,7 @@ obj-$(CONFIG_USB_USS720) += uss720.o obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o obj-$(CONFIG_USB_YUREX) += yurex.o obj-$(CONFIG_USB_HUB_USB251XB) += usb251xb.o +obj-$(CONFIG_USB_HUB_USB253X) += usb253x.o obj-$(CONFIG_USB_HSIC_USB3503) += usb3503.o obj-$(CONFIG_USB_HSIC_USB4604) += usb4604.o obj-$(CONFIG_USB_CHAOSKEY) += chaoskey.o
drivers/usb/misc/usb253x.c new file +834 -0
834 lines not on this page · raw message
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
PATCH 3/4 dt-bindings: usb: Add Microchip USB47xx/USB49xx support
In reply to Christian EggersAdd DT bindings for Microchip USB47xx/USB49xx driver.
--- .../devicetree/bindings/usb/usb49xx.yaml | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb49xx.yaml
Documentation/devicetree/bindings/usb/usb49xx.yaml new file +230 -0
@@ -0,0 +1,230 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb49xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB47xx/USB49xx USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/Appnotes/AN2651-Configuration-of-Microchip-USB47xx-USB49xx-Application-Note-00002651B.pdf + +properties: + compatible: + enum: + - microchip,usb4712 + - microchip,usb4712i + - microchip,usb4715 + - microchip,usb4715i + - microchip,usb4912 + - microchip,usb4912i + - microchip,usb4914 + - microchip,usb4914i + - microchip,usb4916 + - microchip,usb4916i + - microchip,usb4925 + - microchip,usb4925i + - microchip,usb4927 + - microchip,usb4927i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. 62 characters long). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. 62 characters long). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-us: + enum: + - 50 + - 100 + - 200 + - 400 + default: 200 + description: + Delay time (in microseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb4916i@2d { + compatible = "microchip,usb4916i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb49xx.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + //skip-config; + //self-powered; /* power on default */ + //individual-sensing; /* power on default */ + //multi-tt; /* power on default */ + //disable-eop; /* power on default */ + //individual-port-switching; /* power on default */ + //oc-delay-ns = <200>; /* power on default */ + power-on-time-ms = <4>; /* T_ON,max = 4 ms for NCP380 */ + ocs-min-width-ms = <0>; /* MIC2005 only outputs 2us FAULT pulses */ + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 5 is connected to an internal SD-Card reader */ + non-removable-ports = <5>; + }; + }; + +...
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
Rob Herring
maintainerRe: [PATCH 3/4] dt-bindings: usb: Add Microchip USB47xx/USB49xx support
Quoted 8 lines · Christian Eggers
Add DT bindings for Microchip USB47xx/USB49xx driver.
Signed-off-by Christian Eggers <[email protected]>--- .../devicetree/bindings/usb/usb49xx.yaml | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb49xx.yaml
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/usb49xx.example.dt.yaml: usb4916i@2d: 'ocs-min-width-ms' does not match any of the regexes: 'pinctrl-[0-9]+'
See https://patchwork.ozlabs.org/patch/1334134
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
PATCH v2 3/4 dt-bindings: usb: Add Microchip USB47xx/USB49xx support
Add DT bindings for Microchip USB47xx/USB49xx driver.
---
Quoted 5 lines
My bot found errors running 'make
dt_binding_check' on your patch:/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/usb49xx.example.dt.yaml: usb4916i@2d: 'ocs-min-width-ms' does not match any of the regexes: 'pinctrl-[0-9]+' If you already ran 'make
dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:
The mistake was sitting in front of the computer. I simply overlooked this message.
Changes in v2:
- added property description for ocs-min-width-ms
- fixed property description for oc-delay-ns
.../devicetree/bindings/usb/usb49xx.yaml | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb49xx.yaml
Documentation/devicetree/bindings/usb/usb49xx.yaml new file +238 -0
@@ -0,0 +1,238 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb49xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB47xx/USB49xx USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/Appnotes/AN2651-Configuration-of-Microchip-USB47xx-USB49xx-Application-Note-00002651B.pdf + +properties: + compatible: + enum: + - microchip,usb4712 + - microchip,usb4712i + - microchip,usb4715 + - microchip,usb4715i + - microchip,usb4912 + - microchip,usb4912i + - microchip,usb4914 + - microchip,usb4914i + - microchip,usb4916 + - microchip,usb4916i + - microchip,usb4925 + - microchip,usb4925i + - microchip,usb4927 + - microchip,usb4927i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. 62 characters long). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. 62 characters long). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-ns: + enum: + - 50 + - 100 + - 200 + - 400 + default: 200 + description: + Delay time (in nanoseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + ocs-min-width-ms: + default: 5 + minimum: 0 + maximum: 5 + description: + Minimum OCS pulse width (in milliseconds) required to detect an OCS + event. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb4916i@2d { + compatible = "microchip,usb4916i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb49xx.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + //skip-config; + //self-powered; /* power on default */ + //individual-sensing; /* power on default */ + //multi-tt; /* power on default */ + //disable-eop; /* power on default */ + //individual-port-switching; /* power on default */ + //oc-delay-ns = <200>; /* power on default */ + power-on-time-ms = <4>; /* T_ON,max = 4 ms for NCP380 */ + ocs-min-width-ms = <0>; /* MIC2005 only outputs 2us FAULT pulses */ + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 5 is connected to an internal SD-Card reader */ + non-removable-ports = <5>; + }; + }; + +...
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
Greg Kroah-Hartman
maintainerRe: [PATCH v2 3/4] dt-bindings: usb: Add Microchip USB47xx/USB49xx support
Quoted 6 lines · Christian Eggers
Add DT bindings for Microchip USB47xx/USB49xx driver.
Signed-off-by Christian Eggers <[email protected]>---
Quoted 1 line
My bot found errors running 'make
dt_binding_check' on your patch:
Quoted 8 lines
Quoted 3 lines
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/usb49xx.example.dt.yaml: usb4916i@2d: 'ocs-min-width-ms' does not match any of the regexes: 'pinctrl-[0-9]+' If you already ran 'make
dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:The mistake was sitting in front of the computer. I simply overlooked this message.
Changes in v2:
- added property description for ocs-min-width-ms
- fixed property description for oc-delay-ns
Please resend the whole series, not just a single patch, as it makes it very difficult to pick the "correct" patches to be applied...
thanks,
greg k-h
PATCH v3 1/1 Add two new configuration drivers for Microchip USB hubs
Quoted 2 lines · greg k-h
Please resend the whole series, not just a single patch, as it makes it very difficult to pick the "correct" patches to be applied...
Changes in v3:
- none (only resend the whole series)
Changes in v2:
- added property description for ocs-min-width-ms
- fixed property description for oc-delay-ns
PATCH v3 1/4 dt-bindings: usb: Add Microchip USB253x/USB3x13/USB46x4 support
Add DT bindings for Microchip USB253x/USB3x13/USB46x4 driver.
--- .../devicetree/bindings/usb/usb253x.yaml | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb253x.yaml
Documentation/devicetree/bindings/usb/usb253x.yaml new file +234 -0
@@ -0,0 +1,234 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb253x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB253x/USB3x13/USB46x4 USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/AppNotes/00001801C.pdf + +properties: + compatible: + enum: + - microchip,usb2532 + - microchip,usb2532i + - microchip,usb2533 + - microchip,usb2533i + - microchip,usb2534 + - microchip,usb2534i + - microchip,usb3613 + - microchip,usb3613i + - microchip,usb3813 + - microchip,usb3813i + - microchip,usb4604 + - microchip,usb4604i + - microchip,usb4624 + - microchip,usb4624i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. a total of 93 characters for + manufacturer, product and serial). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. a total of 93 characters for + manufacturer, product and serial). + + serial: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Serial string (max. a total of 93 characters for + manufacturer, product and serial). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-us: + enum: + - 100 + - 4000 + - 8000 + - 16000 + default: 8000 + description: + Delay time (in microseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb2534i@2d { + compatible = "microchip,usb2534i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb253x.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + /*skip-config;*/ + /* T_ON,max = 4 ms for NCP380 */ + power-on-time-ms = <4>; + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 2 is connected to an internal SD-Card reader */ + non-removable-ports = <2>; + /* hub controller mapped to logical port 5 */ + hub-controller-port = <5>; + }; + }; + +...
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
Rob Herring
maintainerRe: [PATCH v3 1/4] dt-bindings: usb: Add Microchip USB253x/USB3x13/USB46x4 support
Quoted 1 line · Christian Eggers
Add DT bindings for Microchip USB253x/USB3x13/USB46x4 driver.
Looks like a lot copied from usb251xb.txt. Many of these properties need to be defined in a common schema. That could be either common to USB devices, hubs, or Microchip hubs or some combination of those.
Quoted 257 lines
Signed-off-by Christian Eggers <[email protected]>--- .../devicetree/bindings/usb/usb253x.yaml | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb253x.yamlDocumentation/devicetree/bindings/usb/usb253x.yaml new file +234
-0@@ -0,0 +1,234 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb253x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB253x/USB3x13/USB46x4 USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/AppNotes/00001801C.pdf + +properties: + compatible: + enum: + - microchip,usb2532 + - microchip,usb2532i + - microchip,usb2533 + - microchip,usb2533i + - microchip,usb2534 + - microchip,usb2534i + - microchip,usb3613 + - microchip,usb3613i + - microchip,usb3813 + - microchip,usb3813i + - microchip,usb4604 + - microchip,usb4604i + - microchip,usb4624 + - microchip,usb4624i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. a total of 93 characters for + manufacturer, product and serial). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. a total of 93 characters for + manufacturer, product and serial). + + serial: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Serial string (max. a total of 93 characters for + manufacturer, product and serial). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-us: + enum: + - 100 + - 4000 + - 8000 + - 16000 + default: 8000 + description: + Delay time (in microseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb2534i@2d { + compatible = "microchip,usb2534i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb253x.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + /*skip-config;*/ + /* T_ON,max = 4 ms for NCP380 */ + power-on-time-ms = <4>; + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 2 is connected to an internal SD-Card reader */ + non-removable-ports = <2>; + /* hub controller mapped to logical port 5 */ + hub-controller-port = <5>; + }; + }; + +...Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
PATCH v3 2/4 usb: misc: Add USB253x/xi Hi-Speed Hub Controller Driver
In reply to Christian EggersThis patch adds a driver for configuration of the Microchip USB253x/xi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports.
Furthermore add myself as a maintainer for this driver.
The datasheet can be found at the manufacturers website, see [1]. All device-tree exposed configuration features have been tested on a i.MX6 platform with a USB2534i hub.
[1] http://ww1.microchip.com/downloads/en/AppNotes/00001801C.pdf
--- MAINTAINERS | 7 + drivers/usb/misc/Kconfig | 10 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb253x.c | 834 +++++++++++++++++++++++++++++++++++++ 4 files changed, 852 insertions(+) create mode 100644 drivers/usb/misc/usb253x.c
MAINTAINERS +7 -0
@@ -11356,6 +11356,13 @@ S: Maintained F: Documentation/devicetree/bindings/usb/usb251xb.txt F: drivers/usb/misc/usb251xb.c +MICROCHIP USB253X DRIVER +M: Christian Eggers <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/usb/usb253x.yaml +F: drivers/usb/misc/usb253x.c + MICROCHIP USBA UDC DRIVER M: Cristian Birsan <[email protected]> L: [email protected] (moderated for non-subscribers)
drivers/usb/misc/Kconfig +10 -0
@@ -242,6 +242,16 @@ config USB_HUB_USB251XB parameters may be set in devicetree or platform data. Say Y or M here if you need to configure such a device via SMBus. +config USB_HUB_USB253X + tristate "USB253X Hub Controller Configuration Driver" + depends on I2C + select REGMAP + help + This option enables support for configuration via I2C bus of the + Microchip USB253x/xi USB 2.0 Hub Controller series. + Configuration parameters may be set in devicetree or platform data. + Say Y or M here if you need to configure such a device via I2C. + config USB_HSIC_USB3503 tristate "USB3503 HSIC to USB20 Driver" depends on I2C
drivers/usb/misc/Makefile +1 -0
@@ -25,6 +25,7 @@ obj-$(CONFIG_USB_USS720) += uss720.o obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o obj-$(CONFIG_USB_YUREX) += yurex.o obj-$(CONFIG_USB_HUB_USB251XB) += usb251xb.o +obj-$(CONFIG_USB_HUB_USB253X) += usb253x.o obj-$(CONFIG_USB_HSIC_USB3503) += usb3503.o obj-$(CONFIG_USB_HSIC_USB4604) += usb4604.o obj-$(CONFIG_USB_CHAOSKEY) += chaoskey.o
drivers/usb/misc/usb253x.c new file +834 -0
834 lines not on this page · raw message
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
PATCH v3 3/4 dt-bindings: usb: Add Microchip USB47xx/USB49xx support
In reply to Christian EggersAdd DT bindings for Microchip USB47xx/USB49xx driver.
--- .../devicetree/bindings/usb/usb49xx.yaml | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/usb49xx.yaml
Documentation/devicetree/bindings/usb/usb49xx.yaml new file +238 -0
@@ -0,0 +1,238 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/usb49xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip USB47xx/USB49xx USB 2.0 Hi-Speed Hub Controller + +maintainers: + - Christian Eggers <[email protected]> + +description: | + http://ww1.microchip.com/downloads/en/Appnotes/AN2651-Configuration-of-Microchip-USB47xx-USB49xx-Application-Note-00002651B.pdf + +properties: + compatible: + enum: + - microchip,usb4712 + - microchip,usb4712i + - microchip,usb4715 + - microchip,usb4715i + - microchip,usb4912 + - microchip,usb4912i + - microchip,usb4914 + - microchip,usb4914i + - microchip,usb4916 + - microchip,usb4916i + - microchip,usb4925 + - microchip,usb4925i + - microchip,usb4927 + - microchip,usb4927i + + reg: + maxItems: 1 + description: + I2C address on the selected bus (usually <0x2D>). + + reset-gpios: + maxItems: 1 + description: + Specify the gpio for hub reset. + + vdd-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Specify the regulator supplying vdd. + + skip-config: + $ref: /schemas/types.yaml#/definitions/flag + description: + Skip Hub configuration, but only send the USB-Attach command. + + vendor-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Vendor ID of the hub. + + product-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Product ID of the hub. + + device-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Device ID of the hub. + + language-id: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 65535 + description: + Set USB Language ID. + + manufacturer: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Manufacturer string (max. 62 characters long). + + product: + $ref: /schemas/types.yaml#/definitions/string + description: + Set USB Product string (max. 62 characters long). + + bus-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects bus powered operation. + + self-powered: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects self powered operation (default). + + disable-hi-speed: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable USB Hi-Speed support. + + multi-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects multi-transaction-translator (default). + + single-tt: + $ref: /schemas/types.yaml#/definitions/flag + description: + Selects single-transaction-translator. + + disable-eop: + $ref: /schemas/types.yaml#/definitions/flag + description: + Disable End of Packet generation in full-speed mode. + + ganged-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged over-current sense type in self-powered mode. + + individual-sensing: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual over-current sense type in self-powered mode (default). + + ganged-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select ganged port power switching mode. + + individual-port-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Select individual port power switching mode (default). + + dynamic-power-switching: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable auto-switching from self- to bus-powered operation if the local + power source is removed or unavailable. + + oc-delay-ns: + enum: + - 50 + - 100 + - 200 + - 400 + default: 200 + description: + Delay time (in nanoseconds) for filtering the over-current sense inputs. + If an invalid value is given, the default is used instead. + + compound-device: + $ref: /schemas/types.yaml#/definitions/flag + description: + Indicate the hub is part of a compound device. + + port-mapping-mode: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enable port mapping mode. + + non-removable-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Should specify the ports which have a non-removable device connected. + + sp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be self-power disabled. + + bp-disabled-ports: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Specifies the ports which will be bus-power disabled. + + power-on-time-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 100 + minimum: 0 + maximum: 510 + description: + Specifies the time (in milliseconds) it takes from the time the host + initiates the power-on sequence to a port until the port has adequate + power. + + ocs-min-width-ms: + default: 5 + minimum: 0 + maximum: 5 + description: + Minimum OCS pulse width (in milliseconds) required to detect an OCS + event. + + hub-controller-port: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Hub port where the internal hub controller shall be connected. Usually + <number of ports>+1. + +additionalProperties: false + +required: + - compatible + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + usb4916i@2d { + compatible = "microchip,usb4916i"; + reg = <0x2d>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_hub>; + /* usb49xx.c already assumes low-active, don't negate twice */ + reset-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>; + //skip-config; + //self-powered; /* power on default */ + //individual-sensing; /* power on default */ + //multi-tt; /* power on default */ + //disable-eop; /* power on default */ + //individual-port-switching; /* power on default */ + //oc-delay-ns = <200>; /* power on default */ + power-on-time-ms = <4>; /* T_ON,max = 4 ms for NCP380 */ + ocs-min-width-ms = <0>; /* MIC2005 only outputs 2us FAULT pulses */ + manufacturer = "Foo"; + product = "Foo-Bar"; + /* port 5 is connected to an internal SD-Card reader */ + non-removable-ports = <5>; + }; + }; + +...
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
PATCH v3 4/4 usb: misc: Add USB49xx/xi Hi-Speed Hub Controller Driver
In reply to Christian EggersThis patch adds a driver for configuration of the Microchip USB49xx/xi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports.
Furthermore add myself as a maintainer for this driver.
The datasheet can be found at the manufacturers website, see [1]. All device-tree exposed configuration features have been tested on a i.MX6 platform with a USB4916 hub.
--- MAINTAINERS | 7 + drivers/usb/misc/Kconfig | 10 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb49xx.c | 825 +++++++++++++++++++++++++++++++++++++ 4 files changed, 843 insertions(+) create mode 100644 drivers/usb/misc/usb49xx.c
MAINTAINERS +7 -0
@@ -11363,6 +11363,13 @@ S: Maintained F: Documentation/devicetree/bindings/usb/usb253x.yaml F: drivers/usb/misc/usb253x.c +MICROCHIP USB49XX DRIVER +M: Christian Eggers <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/usb/usb49xx.yaml +F: drivers/usb/misc/usb49xx.c + MICROCHIP USBA UDC DRIVER M: Cristian Birsan <[email protected]> L: [email protected] (moderated for non-subscribers)
drivers/usb/misc/Kconfig +10 -0
@@ -252,6 +252,16 @@ config USB_HUB_USB253X Configuration parameters may be set in devicetree or platform data. Say Y or M here if you need to configure such a device via I2C. +config USB_HUB_USB49XX + tristate "USB47XX/USB49XX Hub Controller Configuration Driver" + depends on I2C + select REGMAP + help + This option enables support for configuration via I2C bus of the + Microchip USB47xx/49xx USB 2.0 Hub Controller series. + Configuration parameters may be set in devicetree or platform data. + Say Y or M here if you need to configure such a device via I2C. + config USB_HSIC_USB3503 tristate "USB3503 HSIC to USB20 Driver" depends on I2C
drivers/usb/misc/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o obj-$(CONFIG_USB_YUREX) += yurex.o obj-$(CONFIG_USB_HUB_USB251XB) += usb251xb.o obj-$(CONFIG_USB_HUB_USB253X) += usb253x.o +obj-$(CONFIG_USB_HUB_USB49XX) += usb49xx.o obj-$(CONFIG_USB_HSIC_USB3503) += usb3503.o obj-$(CONFIG_USB_HSIC_USB4604) += usb4604.o obj-$(CONFIG_USB_CHAOSKEY) += chaoskey.o
drivers/usb/misc/usb49xx.c new file +825 -0
825 lines not on this page · raw message
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
Quoted 3 lines · Christian Eggers
Quoted 2 lines · greg k-h
Please resend the whole series, not just a single patch, as it makes it very difficult to pick the "correct" patches to be applied...
Hi Christian,
sorry for the late reply. My MUA somehow didn't show me that series earlier...
I haven't looked into the patches in detail, but at a first glance it looks like a lot copy-n-paste.
Have you thought about merging the (after your series) 3 hub drivers into one? Something like a "microchip i2c usb hub driver"? Would that be feasible for your point of view?
regards;rl
Quoted 8 lines
Changes in v3:
- none (only resend the whole series)Changes in v2:
- added property description for ocs-min-width-ms
- fixed property description for oc-delay-ns
Hi Richard,
Quoted 3 lines · Richard Leitner
Hi Christian,
sorry for the late reply. My MUA somehow didn't show me that series earlier...
likewise... I was on holiday last week.
Quoted 5 lines
I haven't looked into the patches in detail, but at a first glance it looks like a lot copy-n-paste.
Have you thought about merging the (after your series) 3 hub drivers into one? Something like a "microchip i2c usb hub driver"? Would that be feasible for your point of view?
I'm not sure about the criteria for having separate drivers vs. a combined one.
As changing the driver usually requires testing with real hardware, keeping them separate may be easier. On the other hand, I already synced some changes from usb251xb into "my" drivers, so it is likely that such work will also have to done in future.
Rob Herring already suggested to create a common yaml document for the device tree bindings. It would probably make sense to share the device tree code between our drivers. But I would like to keep the "hardware" side of the drivers independent, as there are subtle differences between the different hub series.
Compared to usb251x, the new drivers don't write the full configuration memory of the hub (the configuration memory space is much bigger than 8 bit and has many holes). They rely on the defaults after hardware reset on perform read- modify-write for the properties set in the device tree.
If the usb251xb hubs could be programmed in a similar way, merging all drivers should be possible using a mic_usb_hub_ops struct with function pointers for applying the (common) device tree properties (e.g. set_product_id(), set_device_id(), ..., set_oc_delay(), set_manufacturer_string(), ...).
Best regards
Christian
PATCH 4/4 usb: misc: Add USB49xx/xi Hi-Speed Hub Controller Driver
In reply to Christian EggersThis patch adds a driver for configuration of the Microchip USB49xx/xi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports.
Furthermore add myself as a maintainer for this driver.
The datasheet can be found at the manufacturers website, see [1]. All device-tree exposed configuration features have been tested on a i.MX6 platform with a USB4916 hub.
--- MAINTAINERS | 7 + drivers/usb/misc/Kconfig | 10 + drivers/usb/misc/Makefile | 1 + drivers/usb/misc/usb49xx.c | 825 +++++++++++++++++++++++++++++++++++++ 4 files changed, 843 insertions(+) create mode 100644 drivers/usb/misc/usb49xx.c
MAINTAINERS +7 -0
@@ -11363,6 +11363,13 @@ S: Maintained F: Documentation/devicetree/bindings/usb/usb253x.yaml F: drivers/usb/misc/usb253x.c +MICROCHIP USB49XX DRIVER +M: Christian Eggers <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/usb/usb49xx.yaml +F: drivers/usb/misc/usb49xx.c + MICROCHIP USBA UDC DRIVER M: Cristian Birsan <[email protected]> L: [email protected] (moderated for non-subscribers)
drivers/usb/misc/Kconfig +10 -0
@@ -252,6 +252,16 @@ config USB_HUB_USB253X Configuration parameters may be set in devicetree or platform data. Say Y or M here if you need to configure such a device via I2C. +config USB_HUB_USB49XX + tristate "USB47XX/USB49XX Hub Controller Configuration Driver" + depends on I2C + select REGMAP + help + This option enables support for configuration via I2C bus of the + Microchip USB47xx/49xx USB 2.0 Hub Controller series. + Configuration parameters may be set in devicetree or platform data. + Say Y or M here if you need to configure such a device via I2C. + config USB_HSIC_USB3503 tristate "USB3503 HSIC to USB20 Driver" depends on I2C
drivers/usb/misc/Makefile +1 -0
@@ -26,6 +26,7 @@ obj-$(CONFIG_USB_SEVSEG) += usbsevseg.o obj-$(CONFIG_USB_YUREX) += yurex.o obj-$(CONFIG_USB_HUB_USB251XB) += usb251xb.o obj-$(CONFIG_USB_HUB_USB253X) += usb253x.o +obj-$(CONFIG_USB_HUB_USB49XX) += usb49xx.o obj-$(CONFIG_USB_HSIC_USB3503) += usb3503.o obj-$(CONFIG_USB_HSIC_USB4604) += usb4604.o obj-$(CONFIG_USB_CHAOSKEY) += chaoskey.o
drivers/usb/misc/usb49xx.c new file +825 -0
825 lines not on this page · raw message
Signature · 8 lines
Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler