Message ID | 20200224014008.27114-1-paul@crapouillou.net |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | [v2,1/5] dt-bindings: usb: Convert jz4740-musb doc to YAML | expand |
Hi, On Sun, Feb 23, 2020 at 10:40:06PM -0300, Paul Cercueil wrote: > Register a USB role switch, in order to get notified by the connector > driver when the USB role changes. The notification is then transmitted > to the PHY. > > Signed-off-by: Paul Cercueil <paul@crapouillou.net> > --- > > Notes: > v2: No change > > drivers/usb/musb/Kconfig | 1 + > drivers/usb/musb/jz4740.c | 46 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 47 insertions(+) > > diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig > index c4b349e074c1..3268adb7d7cf 100644 > --- a/drivers/usb/musb/Kconfig > +++ b/drivers/usb/musb/Kconfig > @@ -113,6 +113,7 @@ config USB_MUSB_JZ4740 > depends on MIPS || COMPILE_TEST > depends on USB_MUSB_GADGET > depends on USB=n || USB_OTG_BLACKLIST_HUB > + select USB_ROLE_SWITCH > > config USB_MUSB_MEDIATEK > tristate "MediaTek platforms" > diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c > index aa32b5af0c1f..bbfeb9881788 100644 > --- a/drivers/usb/musb/jz4740.c > +++ b/drivers/usb/musb/jz4740.c > @@ -12,13 +12,16 @@ > #include <linux/module.h> > #include <linux/of_device.h> > #include <linux/platform_device.h> > +#include <linux/usb/role.h> > #include <linux/usb/usb_phy_generic.h> > > #include "musb_core.h" > > struct jz4740_glue { > struct platform_device *pdev; > + struct musb *musb; > struct clk *clk; > + struct usb_role_switch *role_sw; > }; > > static irqreturn_t jz4740_musb_interrupt(int irq, void *__hci) > @@ -72,11 +75,38 @@ static const struct musb_hdrc_config jz4740_musb_config = { > .fifo_cfg_size = ARRAY_SIZE(jz4740_musb_fifo_cfg), > }; > > +static int jz4740_musb_role_switch_set(struct device *dev, enum usb_role role) The prototype has been changed by bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API"). Please update. Thanks, -Bin.
diff --git a/Documentation/devicetree/bindings/usb/ingenic,jz4740-musb.txt b/Documentation/devicetree/bindings/usb/ingenic,jz4740-musb.txt deleted file mode 100644 index 16808721f3ff..000000000000 --- a/Documentation/devicetree/bindings/usb/ingenic,jz4740-musb.txt +++ /dev/null @@ -1,32 +0,0 @@ -Ingenic JZ4740 MUSB driver - -Required properties: - -- compatible: Must be "ingenic,jz4740-musb" -- reg: Address range of the UDC register set -- interrupts: IRQ number related to the UDC hardware -- interrupt-names: must be "mc" -- clocks: phandle to the "udc" clock -- clock-names: must be "udc" -- phys: phandle to the USB PHY - -Example: - -usb_phy: usb-phy@0 { - compatible = "usb-nop-xceiv"; - #phy-cells = <0>; -}; - -udc: usb@13040000 { - compatible = "ingenic,jz4740-musb"; - reg = <0x13040000 0x10000>; - - interrupt-parent = <&intc>; - interrupts = <24>; - interrupt-names = "mc"; - - clocks = <&cgu JZ4740_CLK_UDC>; - clock-names = "udc"; - - phys = <&usb_phy>; -}; diff --git a/Documentation/devicetree/bindings/usb/ingenic,musb.yaml b/Documentation/devicetree/bindings/usb/ingenic,musb.yaml new file mode 100644 index 000000000000..7f33d3caa214 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/ingenic,musb.yaml @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/ingenic,musb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ingenic JZ47xx USB IP DT bindings + +maintainers: + - Paul Cercueil <paul@crapouillou.net> + +properties: + $nodename: + pattern: '^usb@.*' + + compatible: + enum: + - ingenic,jz4770-musb + - ingenic,jz4740-musb + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: udc + + interrupts: + maxItems: 1 + + interrupt-names: + items: + - const: mc + + phys: + description: PHY specifier for the USB PHY + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + - phys + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/jz4740-cgu.h> + usb_phy: usb-phy@0 { + compatible = "usb-nop-xceiv"; + #phy-cells = <0>; + }; + + udc: usb@13040000 { + compatible = "ingenic,jz4740-musb"; + reg = <0x13040000 0x10000>; + + interrupt-parent = <&intc>; + interrupts = <24>; + interrupt-names = "mc"; + + clocks = <&cgu JZ4740_CLK_UDC>; + clock-names = "udc"; + + phys = <&usb_phy>; + };