]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge 5.3-rc5 into usb-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2019 05:15:42 +0000 (07:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2019 05:15:42 +0000 (07:15 +0200)
We need the usb fixes in here as well for other patches to build on.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
182 files changed:
Documentation/devicetree/bindings/usb/exynos-usb.txt
Documentation/devicetree/bindings/usb/fcs,fusb302.txt
Documentation/devicetree/bindings/usb/mediatek,mtu3.txt
Documentation/devicetree/bindings/usb/renesas,usb3-peri.txt [moved from Documentation/devicetree/bindings/usb/renesas,usb3.txt with 100% similarity]
MAINTAINERS
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos4210-universal_c210.dts
arch/arm/boot/dts/exynos4412-itop-elite.dts
arch/arm/boot/dts/exynos4412-odroidu3.dts
arch/arm/boot/dts/exynos4412-odroidx.dts
arch/arm/boot/dts/exynos4412-origen.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos54xx.dtsi
drivers/Kconfig
drivers/Makefile
drivers/base/dd.c
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/uwb/Kconfig [moved from drivers/uwb/Kconfig with 100% similarity]
drivers/staging/uwb/Makefile [moved from drivers/uwb/Makefile with 100% similarity]
drivers/staging/uwb/TODO [new file with mode: 0644]
drivers/staging/uwb/address.c [moved from drivers/uwb/address.c with 100% similarity]
drivers/staging/uwb/allocator.c [moved from drivers/uwb/allocator.c with 99% similarity]
drivers/staging/uwb/beacon.c [moved from drivers/uwb/beacon.c with 100% similarity]
drivers/staging/uwb/driver.c [moved from drivers/uwb/driver.c with 100% similarity]
drivers/staging/uwb/drp-avail.c [moved from drivers/uwb/drp-avail.c with 100% similarity]
drivers/staging/uwb/drp-ie.c [moved from drivers/uwb/drp-ie.c with 99% similarity]
drivers/staging/uwb/drp.c [moved from drivers/uwb/drp.c with 100% similarity]
drivers/staging/uwb/est.c [moved from drivers/uwb/est.c with 100% similarity]
drivers/staging/uwb/hwa-rc.c [moved from drivers/uwb/hwa-rc.c with 99% similarity]
drivers/staging/uwb/i1480/Makefile [moved from drivers/uwb/i1480/Makefile with 100% similarity]
drivers/staging/uwb/i1480/dfu/Makefile [moved from drivers/uwb/i1480/dfu/Makefile with 100% similarity]
drivers/staging/uwb/i1480/dfu/dfu.c [moved from drivers/uwb/i1480/dfu/dfu.c with 99% similarity]
drivers/staging/uwb/i1480/dfu/i1480-dfu.h [moved from drivers/uwb/i1480/dfu/i1480-dfu.h with 99% similarity]
drivers/staging/uwb/i1480/dfu/mac.c [moved from drivers/uwb/i1480/dfu/mac.c with 99% similarity]
drivers/staging/uwb/i1480/dfu/phy.c [moved from drivers/uwb/i1480/dfu/phy.c with 99% similarity]
drivers/staging/uwb/i1480/dfu/usb.c [moved from drivers/uwb/i1480/dfu/usb.c with 99% similarity]
drivers/staging/uwb/i1480/i1480-est.c [moved from drivers/uwb/i1480/i1480-est.c with 99% similarity]
drivers/staging/uwb/ie-rcv.c [moved from drivers/uwb/ie-rcv.c with 100% similarity]
drivers/staging/uwb/ie.c [moved from drivers/uwb/ie.c with 100% similarity]
drivers/staging/uwb/include/debug-cmd.h [moved from include/linux/uwb/debug-cmd.h with 100% similarity]
drivers/staging/uwb/include/spec.h [moved from include/linux/uwb/spec.h with 100% similarity]
drivers/staging/uwb/include/umc.h [moved from include/linux/uwb/umc.h with 100% similarity]
drivers/staging/uwb/include/whci.h [moved from include/linux/uwb/whci.h with 100% similarity]
drivers/staging/uwb/lc-dev.c [moved from drivers/uwb/lc-dev.c with 100% similarity]
drivers/staging/uwb/lc-rc.c [moved from drivers/uwb/lc-rc.c with 100% similarity]
drivers/staging/uwb/neh.c [moved from drivers/uwb/neh.c with 100% similarity]
drivers/staging/uwb/pal.c [moved from drivers/uwb/pal.c with 99% similarity]
drivers/staging/uwb/radio.c [moved from drivers/uwb/radio.c with 99% similarity]
drivers/staging/uwb/reset.c [moved from drivers/uwb/reset.c with 100% similarity]
drivers/staging/uwb/rsv.c [moved from drivers/uwb/rsv.c with 99% similarity]
drivers/staging/uwb/scan.c [moved from drivers/uwb/scan.c with 100% similarity]
drivers/staging/uwb/umc-bus.c [moved from drivers/uwb/umc-bus.c with 99% similarity]
drivers/staging/uwb/umc-dev.c [moved from drivers/uwb/umc-dev.c with 98% similarity]
drivers/staging/uwb/umc-drv.c [moved from drivers/uwb/umc-drv.c with 96% similarity]
drivers/staging/uwb/uwb-debug.c [moved from drivers/uwb/uwb-debug.c with 99% similarity]
drivers/staging/uwb/uwb-internal.h [moved from drivers/uwb/uwb-internal.h with 99% similarity]
drivers/staging/uwb/uwb.h [moved from include/linux/uwb.h with 99% similarity]
drivers/staging/uwb/uwbd.c [moved from drivers/uwb/uwbd.c with 100% similarity]
drivers/staging/uwb/whc-rc.c [moved from drivers/uwb/whc-rc.c with 99% similarity]
drivers/staging/uwb/whci.c [moved from drivers/uwb/whci.c with 99% similarity]
drivers/staging/wusbcore/Documentation/wusb-cbaf [moved from Documentation/usb/wusb-cbaf with 100% similarity]
drivers/staging/wusbcore/Documentation/wusb-design-overview.rst [moved from Documentation/usb/wusb-design-overview.rst with 100% similarity]
drivers/staging/wusbcore/Kconfig [moved from drivers/usb/wusbcore/Kconfig with 93% similarity]
drivers/staging/wusbcore/Makefile [moved from drivers/usb/wusbcore/Makefile with 96% similarity]
drivers/staging/wusbcore/TODO [new file with mode: 0644]
drivers/staging/wusbcore/cbaf.c [moved from drivers/usb/wusbcore/cbaf.c with 99% similarity]
drivers/staging/wusbcore/crypto.c [moved from drivers/usb/wusbcore/crypto.c with 99% similarity]
drivers/staging/wusbcore/dev-sysfs.c [moved from drivers/usb/wusbcore/dev-sysfs.c with 100% similarity]
drivers/staging/wusbcore/devconnect.c [moved from drivers/usb/wusbcore/devconnect.c with 99% similarity]
drivers/staging/wusbcore/host/Kconfig [new file with mode: 0644]
drivers/staging/wusbcore/host/Makefile [new file with mode: 0644]
drivers/staging/wusbcore/host/hwa-hc.c [moved from drivers/usb/host/hwa-hc.c with 99% similarity]
drivers/staging/wusbcore/host/whci/Makefile [moved from drivers/usb/host/whci/Makefile with 100% similarity]
drivers/staging/wusbcore/host/whci/asl.c [moved from drivers/usb/host/whci/asl.c with 99% similarity]
drivers/staging/wusbcore/host/whci/debug.c [moved from drivers/usb/host/whci/debug.c with 99% similarity]
drivers/staging/wusbcore/host/whci/hcd.c [moved from drivers/usb/host/whci/hcd.c with 99% similarity]
drivers/staging/wusbcore/host/whci/hw.c [moved from drivers/usb/host/whci/hw.c with 97% similarity]
drivers/staging/wusbcore/host/whci/init.c [moved from drivers/usb/host/whci/init.c with 98% similarity]
drivers/staging/wusbcore/host/whci/int.c [moved from drivers/usb/host/whci/int.c with 96% similarity]
drivers/staging/wusbcore/host/whci/pzl.c [moved from drivers/usb/host/whci/pzl.c with 99% similarity]
drivers/staging/wusbcore/host/whci/qset.c [moved from drivers/usb/host/whci/qset.c with 99% similarity]
drivers/staging/wusbcore/host/whci/whcd.h [moved from drivers/usb/host/whci/whcd.h with 98% similarity]
drivers/staging/wusbcore/host/whci/whci-hc.h [moved from drivers/usb/host/whci/whci-hc.h with 100% similarity]
drivers/staging/wusbcore/host/whci/wusb.c [moved from drivers/usb/host/whci/wusb.c with 98% similarity]
drivers/staging/wusbcore/include/association.h [moved from include/linux/usb/association.h with 100% similarity]
drivers/staging/wusbcore/include/wusb-wa.h [moved from include/linux/usb/wusb-wa.h with 100% similarity]
drivers/staging/wusbcore/include/wusb.h [moved from include/linux/usb/wusb.h with 99% similarity]
drivers/staging/wusbcore/mmc.c [moved from drivers/usb/wusbcore/mmc.c with 99% similarity]
drivers/staging/wusbcore/pal.c [moved from drivers/usb/wusbcore/pal.c with 100% similarity]
drivers/staging/wusbcore/reservation.c [moved from drivers/usb/wusbcore/reservation.c with 99% similarity]
drivers/staging/wusbcore/rh.c [moved from drivers/usb/wusbcore/rh.c with 100% similarity]
drivers/staging/wusbcore/security.c [moved from drivers/usb/wusbcore/security.c with 100% similarity]
drivers/staging/wusbcore/wa-hc.c [moved from drivers/usb/wusbcore/wa-hc.c with 100% similarity]
drivers/staging/wusbcore/wa-hc.h [moved from drivers/usb/wusbcore/wa-hc.h with 99% similarity]
drivers/staging/wusbcore/wa-nep.c [moved from drivers/usb/wusbcore/wa-nep.c with 100% similarity]
drivers/staging/wusbcore/wa-rpipe.c [moved from drivers/usb/wusbcore/wa-rpipe.c with 100% similarity]
drivers/staging/wusbcore/wa-xfer.c [moved from drivers/usb/wusbcore/wa-xfer.c with 100% similarity]
drivers/staging/wusbcore/wusbhc.c [moved from drivers/usb/wusbcore/wusbhc.c with 100% similarity]
drivers/staging/wusbcore/wusbhc.h [moved from drivers/usb/wusbcore/wusbhc.h with 99% similarity]
drivers/usb/Kconfig
drivers/usb/Makefile
drivers/usb/atm/cxacru.c
drivers/usb/atm/ueagle-atm.c
drivers/usb/chipidea/core.c
drivers/usb/chipidea/udc.c
drivers/usb/class/usblp.c
drivers/usb/class/usbtmc.c
drivers/usb/core/devio.c
drivers/usb/core/driver.c
drivers/usb/core/generic.c
drivers/usb/core/hcd-pci.c
drivers/usb/core/port.c
drivers/usb/core/usb.h
drivers/usb/dwc2/params.c
drivers/usb/dwc2/platform.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-keystone.c
drivers/usb/dwc3/dwc3-meson-g12a.c
drivers/usb/dwc3/dwc3-omap.c
drivers/usb/gadget/udc/aspeed-vhub/core.c
drivers/usb/gadget/udc/atmel_usba_udc.c
drivers/usb/gadget/udc/bcm63xx_udc.c
drivers/usb/gadget/udc/bdc/bdc_core.c
drivers/usb/gadget/udc/gr_udc.c
drivers/usb/gadget/udc/lpc32xx_udc.c
drivers/usb/gadget/udc/renesas_usb3.c
drivers/usb/gadget/udc/s3c-hsudc.c
drivers/usb/gadget/udc/s3c2410_udc.c
drivers/usb/gadget/udc/udc-xilinx.c
drivers/usb/host/Kconfig
drivers/usb/host/Makefile
drivers/usb/host/ehci-atmel.c
drivers/usb/host/ehci-exynos.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-platform.c
drivers/usb/host/ehci-sh.c
drivers/usb/host/ehci-st.c
drivers/usb/host/ehci-w90x900.c [deleted file]
drivers/usb/host/imx21-hcd.c
drivers/usb/host/ohci-exynos.c
drivers/usb/host/ohci-platform.c
drivers/usb/host/ohci-st.c
drivers/usb/host/ohci-tmio.c
drivers/usb/host/oxu210hp-hcd.c
drivers/usb/host/oxu210hp.h [deleted file]
drivers/usb/host/xhci-dbgcap.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-plat.c
drivers/usb/misc/cypress_cy7c63.c
drivers/usb/misc/cytherm.c
drivers/usb/misc/lvstest.c
drivers/usb/misc/trancevibrator.c
drivers/usb/misc/usbsevseg.c
drivers/usb/mtu3/mtu3_core.c
drivers/usb/musb/musb_core.c
drivers/usb/phy/phy-ab8500-usb.c
drivers/usb/phy/phy-fsl-usb.c
drivers/usb/phy/phy-mv-usb.c
drivers/usb/phy/phy-tahvo.c
drivers/usb/phy/phy-twl6030-usb.c
drivers/usb/storage/debug.h
drivers/usb/storage/isd200.c
drivers/usb/storage/scsiglue.c
drivers/usb/typec/mux.c
drivers/usb/typec/tcpm/fusb302.c
drivers/usb/typec/tcpm/tcpm.c
drivers/usb/typec/tcpm/wcove.c
drivers/usb/typec/ucsi/ucsi_ccg.c
drivers/usb/usbip/stub_dev.c
drivers/usb/usbip/vudc.h
drivers/usb/usbip/vudc_dev.c
drivers/usb/usbip/vudc_main.c
drivers/usb/usbip/vudc_sysfs.c
include/linux/device.h
include/linux/oxu210hp.h [deleted file]
include/linux/usb.h
include/uapi/linux/usbdevice_fs.h
tools/usb/usbip/libsrc/usbip_common.c
tools/usb/usbip/libsrc/usbip_device_driver.c

index b7111f43fa5995e31fa4543e0e0770f15ddd19bb..66c394f9e11f2317653fe24c9c20b0137119eb71 100644 (file)
@@ -12,13 +12,11 @@ Required properties:
  - interrupts: interrupt number to the cpu.
  - clocks: from common clock binding: handle to usb clock.
  - clock-names: from common clock binding: Shall be "usbhost".
- - port: if in the SoC there are EHCI phys, they should be listed here.
-   One phy per port. Each port should have following entries:
-       - reg: port number on EHCI controller, e.g
-              On Exynos5250, port 0 is USB2.0 otg phy
-                             port 1 is HSIC phy0
-                             port 2 is HSIC phy1
-       - phys: from the *Generic PHY* bindings; specifying phy used by port.
+ - phys: from the *Generic PHY* bindings; array specifying phy(s) used
+   by the root port.
+ - phy-names: from the *Generic PHY* bindings; array of the names for
+   each phy for the root ports, must be a subset of the following:
+   "host", "hsic0", "hsic1".
 
 Optional properties:
  - samsung,vbus-gpio:  if present, specifies the GPIO that
@@ -35,12 +33,8 @@ Example:
                clocks = <&clock 285>;
                clock-names = "usbhost";
 
-               #address-cells = <1>;
-               #size-cells = <0>;
-               port@0 {
-                   reg = <0>;
-                   phys = <&usb2phy 1>;
-               };
+               phys = <&usb2phy 1>;
+               phy-names = "host";
        };
 
 OHCI
@@ -52,13 +46,11 @@ Required properties:
  - interrupts: interrupt number to the cpu.
  - clocks: from common clock binding: handle to usb clock.
  - clock-names: from common clock binding: Shall be "usbhost".
- - port: if in the SoC there are OHCI phys, they should be listed here.
-   One phy per port. Each port should have following entries:
-       - reg: port number on OHCI controller, e.g
-              On Exynos5250, port 0 is USB2.0 otg phy
-                             port 1 is HSIC phy0
-                             port 2 is HSIC phy1
-       - phys: from the *Generic PHY* bindings, specifying phy used by port.
+ - phys: from the *Generic PHY* bindings; array specifying phy(s) used
+   by the root port.
+ - phy-names: from the *Generic PHY* bindings; array of the names for
+   each phy for the root ports, must be a subset of the following:
+   "host", "hsic0", "hsic1".
 
 Example:
        usb@12120000 {
@@ -69,13 +61,8 @@ Example:
                clocks = <&clock 285>;
                clock-names = "usbhost";
 
-               #address-cells = <1>;
-               #size-cells = <0>;
-               port@0 {
-                   reg = <0>;
-                   phys = <&usb2phy 1>;
-               };
-
+               phys = <&usb2phy 1>;
+               phy-names = "host";
        };
 
 DWC3
index a5d011d2efc8eda036a2858d8261c550b1f64a02..ba2e32d500c02f7f7c68a4d1e379dd41864543df 100644 (file)
@@ -11,13 +11,6 @@ Required sub-node:
 
        Documentation/devicetree/bindings/connector/usb-connector.txt
 
-Deprecated properties :
-- fcs,max-sink-microvolt : Maximum sink voltage accepted by port controller
-- fcs,max-sink-microamp : Maximum sink current accepted by port controller
-- fcs,max-sink-microwatt : Maximum sink power accepted by port controller
-- fcs,operating-sink-microwatt : Minimum amount of power accepted from a sink
-  when negotiating
-
 
 Example:
 
index 3382b5cb471d748dad74c9780dff600e5a384587..5d740e9d45256826a959003c8b60d5fe5dabe489 100644 (file)
@@ -16,7 +16,7 @@ Required properties:
        entry in clock-names
  - clock-names : must contain "sys_ck" for clock of controller,
        the following clocks are optional:
-       "ref_ck", "mcu_ck" and "dam_ck";
+       "ref_ck", "mcu_ck" and "dma_ck";
  - phys : see usb-hcd.txt in the current directory
  - dr_mode : should be one of "host", "peripheral" or "otg",
        refer to usb/generic.txt
index 43604d6ab96c2b6c9f989eea100d249bad2f8881..8c343c2f4ce14eadebedcd964f6d44e80a528495 100644 (file)
@@ -3804,14 +3804,9 @@ F:       scripts/sign-file.c
 F:     scripts/extract-cert.c
 
 CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
-L:     linux-usb@vger.kernel.org
-S:     Orphan
-F:     Documentation/usb/wusb-design-overview.rst
-F:     Documentation/usb/wusb-cbaf
-F:     drivers/usb/host/hwa-hc.c
-F:     drivers/usb/host/whci/
-F:     drivers/usb/wusbcore/
-F:     include/linux/usb/wusb*
+L:     devel@driverdev.osuosl.org
+S:     Obsolete
+F:     drivers/staging/wusbcore/
 
 CFAG12864B LCD DRIVER
 M:     Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
@@ -16468,11 +16463,9 @@ F:     drivers/usb/common/ulpi.c
 F:     include/linux/ulpi/
 
 ULTRA-WIDEBAND (UWB) SUBSYSTEM:
-L:     linux-usb@vger.kernel.org
-S:     Orphan
-F:     drivers/uwb/
-F:     include/linux/uwb.h
-F:     include/linux/uwb/
+L:     devel@driverdev.osuosl.org
+S:     Obsolete
+F:     drivers/staging/uwb/
 
 UNICODE SUBSYSTEM:
 M:     Gabriel Krisman Bertazi <krisman@collabora.com>
index 1264cc431ff6f0654d1affc20ab81c945e44e7df..433f109d97cae7d56be37861c4cc47d84bf2eb1d 100644 (file)
@@ -380,23 +380,8 @@ ehci: ehci@12580000 {
                        clocks = <&clock CLK_USB_HOST>;
                        clock-names = "usbhost";
                        status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&exynos_usbphy 1>;
-                               status = "disabled";
-                       };
-                       port@1 {
-                               reg = <1>;
-                               phys = <&exynos_usbphy 2>;
-                               status = "disabled";
-                       };
-                       port@2 {
-                               reg = <2>;
-                               phys = <&exynos_usbphy 3>;
-                               status = "disabled";
-                       };
+                       phys = <&exynos_usbphy 1>, <&exynos_usbphy 2>, <&exynos_usbphy 3>;
+                       phy-names = "host", "hsic0", "hsic1";
                };
 
                ohci: ohci@12590000 {
@@ -406,13 +391,8 @@ ohci: ohci@12590000 {
                        clocks = <&clock CLK_USB_HOST>;
                        clock-names = "usbhost";
                        status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&exynos_usbphy 1>;
-                               status = "disabled";
-                       };
+                       phys = <&exynos_usbphy 1>;
+                       phy-names = "host";
                };
 
                gpu: gpu@13000000 {
index 82a8b5449978a166d4fd1e2d120e54deee98d852..09d3d54d09ff8bf32988d49f2f223d262c799b46 100644 (file)
@@ -204,9 +204,8 @@ &cpu0 {
 
 &ehci {
        status = "okay";
-       port@0 {
-               status = "okay";
-       };
+       phys = <&exynos_usbphy 1>;
+       phy-names = "host";
 };
 
 &exynos_usbphy {
@@ -520,9 +519,6 @@ &mixer {
 
 &ohci {
        status = "okay";
-       port@0 {
-               status = "okay";
-       };
 };
 
 &pinctrl_1 {
index 0dedeba89b5f46d9c3637e90413441adc2139ae1..f6d0a5f5d339edf76da9373fdd7ceb81fb54317e 100644 (file)
@@ -146,13 +146,8 @@ &ehci {
        /* In order to reset USB ethernet */
        samsung,vbus-gpio = <&gpc0 1 GPIO_ACTIVE_HIGH>;
 
-       port@0 {
-               status = "okay";
-       };
-
-       port@2 {
-               status = "okay";
-       };
+       phys = <&exynos_usbphy 1>, <&exynos_usbphy 3>;
+       phy-names = "host", "hsic1";
 };
 
 &exynos_usbphy {
index 96d99887bceb555d6787e833bd443585e048be43..8ff243ba454260f240d65f51d740fbcab17bd4f4 100644 (file)
@@ -105,12 +105,8 @@ &usb3503 {
 };
 
 &ehci {
-       port@1 {
-               status = "okay";
-       };
-       port@2 {
-               status = "okay";
-       };
+       phys = <&exynos_usbphy 2>, <&exynos_usbphy 3>;
+       phy-names = "hsic0", "hsic1";
 };
 
 &sound {
index a2251581f6b60223bedb1d2b0dd594c34c73dab6..3ea2a0101e8086f2b8078a4593ee19d2c2540aa1 100644 (file)
@@ -72,9 +72,8 @@ &buck8_reg {
 };
 
 &ehci {
-       port@1 {
-               status = "okay";
-       };
+       phys = <&exynos_usbphy 2>;
+       phy-names = "hsic0";
 };
 
 &mshc_0 {
index 698de4345d16e672b28fb5386d1c0fec9b4763fa..ecd14b283a6b409d5fdf5488f2af3db0bc543a0b 100644 (file)
@@ -88,13 +88,8 @@ &exynos_usbphy {
 &ehci {
        samsung,vbus-gpio = <&gpx3 5 1>;
        status = "okay";
-
-       port@1 {
-               status = "okay";
-       };
-       port@2 {
-               status = "okay";
-       };
+       phys = <&exynos_usbphy 2>, <&exynos_usbphy 3>;
+       phy-names = "hsic0", "hsic1";
 };
 
 &fimd {
index d5e0392b409ecada566fbd2f43c74b0aa57c8608..c5584f40ebfb28c1479216966bc152098a11f5a9 100644 (file)
@@ -617,12 +617,8 @@ ehci: usb@12110000 {
 
                        clocks = <&clock CLK_USB2>;
                        clock-names = "usbhost";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&usb2_phy_gen 1>;
-                       };
+                       phys = <&usb2_phy_gen 1>;
+                       phy-names = "host";
                };
 
                ohci: usb@12120000 {
@@ -632,12 +628,8 @@ ohci: usb@12120000 {
 
                        clocks = <&clock CLK_USB2>;
                        clock-names = "usbhost";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&usb2_phy_gen 1>;
-                       };
+                       phys = <&usb2_phy_gen 1>;
+                       phy-names = "host";
                };
 
                usb2_phy_gen: phy@12130000 {
index 0b27bebf9528c20bcdb85f7d5c354e8937f44264..9c3b63b7cac6c54f2f6ec49f71230b62d163b526 100644 (file)
@@ -189,26 +189,16 @@ usbhost2: usb@12110000 {
                        compatible = "samsung,exynos4210-ehci";
                        reg = <0x12110000 0x100>;
                        interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&usb2_phy 1>;
-                       };
+                       phys = <&usb2_phy 1>;
+                       phy-names = "host";
                };
 
                usbhost1: usb@12120000 {
                        compatible = "samsung,exynos4210-ohci";
                        reg = <0x12120000 0x100>;
                        interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       port@0 {
-                               reg = <0>;
-                               phys = <&usb2_phy 1>;
-                       };
+                       phys = <&usb2_phy 1>;
+                       phy-names = "host";
                };
 
                usb2_phy: phy@12130000 {
index 61cf4ea2c229b3c03e2fcb5a890def6a15642d31..e8852c09184b595887c787b0fae58cde7b82e213 100644 (file)
@@ -108,8 +108,6 @@ source "drivers/hid/Kconfig"
 
 source "drivers/usb/Kconfig"
 
-source "drivers/uwb/Kconfig"
-
 source "drivers/mmc/Kconfig"
 
 source "drivers/memstick/Kconfig"
index 6d37564e783cb2d27f86a5c38b00891dee611cee..cf046e9bd88ca06dde860b730b6cad5ff7fde9ba 100644 (file)
@@ -100,7 +100,6 @@ obj-$(CONFIG_ZORRO)         += zorro/
 obj-$(CONFIG_ATA_OVER_ETH)     += block/aoe/
 obj-$(CONFIG_PARIDE)           += block/paride/
 obj-$(CONFIG_TC)               += tc/
-obj-$(CONFIG_UWB)              += uwb/
 obj-$(CONFIG_USB_PHY)          += usb/
 obj-$(CONFIG_USB)              += usb/
 obj-$(CONFIG_USB_SUPPORT)      += usb/
index 994a9074742046edfed5afefe62011450e20669c..d811e60610d33ae952efacc2db3ce9fb47349a5e 100644 (file)
@@ -554,9 +554,16 @@ static int really_probe(struct device *dev, struct device_driver *drv)
                        goto probe_failed;
        }
 
+       if (device_add_groups(dev, drv->dev_groups)) {
+               dev_err(dev, "device_add_groups() failed\n");
+               goto dev_groups_failed;
+       }
+
        if (test_remove) {
                test_remove = false;
 
+               device_remove_groups(dev, drv->dev_groups);
+
                if (dev->bus->remove)
                        dev->bus->remove(dev);
                else if (drv->remove)
@@ -584,6 +591,11 @@ static int really_probe(struct device *dev, struct device_driver *drv)
                 drv->bus->name, __func__, dev_name(dev), drv->name);
        goto done;
 
+dev_groups_failed:
+       if (dev->bus->remove)
+               dev->bus->remove(dev);
+       else if (drv->remove)
+               drv->remove(dev);
 probe_failed:
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
@@ -1114,6 +1126,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
 
                pm_runtime_put_sync(dev);
 
+               device_remove_groups(dev, drv->dev_groups);
+
                if (dev->bus && dev->bus->remove)
                        dev->bus->remove(dev);
                else if (drv->remove)
index 7c96a01eef6c714f390816c18d6916aaaddaa721..cf419d9c942d013ae4f19c44a2bbeac02609544c 100644 (file)
@@ -120,4 +120,7 @@ source "drivers/staging/kpc2000/Kconfig"
 
 source "drivers/staging/isdn/Kconfig"
 
+source "drivers/staging/wusbcore/Kconfig"
+source "drivers/staging/uwb/Kconfig"
+
 endif # STAGING
index fcaac9693b8312d45d21667660c7f958a5c2a734..38179bc842a8518b28672f5575161116ffa413c4 100644 (file)
@@ -50,3 +50,5 @@ obj-$(CONFIG_EROFS_FS)                += erofs/
 obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
 obj-$(CONFIG_KPC2000)          += kpc2000/
 obj-$(CONFIG_ISDN_CAPI)                += isdn/
+obj-$(CONFIG_UWB)              += uwb/
+obj-$(CONFIG_USB_WUSB)         += wusbcore/
diff --git a/drivers/staging/uwb/TODO b/drivers/staging/uwb/TODO
new file mode 100644 (file)
index 0000000..abae570
--- /dev/null
@@ -0,0 +1,8 @@
+TODO: Remove in late 2019 unless there are users
+
+There seems to not be any real wireless USB devices anywhere in the wild
+anymore.  It turned out to be a failed technology :(
+
+This will be removed from the tree if no one objects.
+
+Greg Kroah-Hartman <gregkh@linuxfoundation.org>
similarity index 99%
rename from drivers/uwb/allocator.c
rename to drivers/staging/uwb/allocator.c
index 2e1590124d5f8920b1e51f7d3067a77997bb4fc2..1f429fba20b72a5bf5fe297db24c51e24162c10c 100644 (file)
@@ -6,7 +6,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/slab.h>
-#include <linux/uwb.h>
+#include "uwb.h"
 
 #include "uwb-internal.h"
 
similarity index 99%
rename from drivers/uwb/drp-ie.c
rename to drivers/staging/uwb/drp-ie.c
index 4b545b41161cc21ff24586d3793627a23db78c33..b2a862cf76de14b4d3cf05c68d33c9f85a9fb1ad 100644 (file)
@@ -8,8 +8,8 @@
 #include <linux/kernel.h>
 #include <linux/random.h>
 #include <linux/slab.h>
-#include <linux/uwb.h>
 
+#include "uwb.h"
 #include "uwb-internal.h"
 
 
similarity index 100%
rename from drivers/uwb/drp.c
rename to drivers/staging/uwb/drp.c
similarity index 100%
rename from drivers/uwb/est.c
rename to drivers/staging/uwb/est.c
similarity index 99%
rename from drivers/uwb/hwa-rc.c
rename to drivers/staging/uwb/hwa-rc.c
index cd03b7f827c16a4d8736036dc0949bd48fc72b43..b6effad749d789984edad927cf0660e09b57c6ce 100644 (file)
@@ -38,9 +38,9 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
-#include <linux/usb/wusb.h>
-#include <linux/usb/wusb-wa.h>
-#include <linux/uwb.h>
+#include "../wusbcore/include/wusb.h"
+#include "../wusbcore/include/wusb-wa.h"
+#include "uwb.h"
 
 #include "uwb-internal.h"
 
similarity index 99%
rename from drivers/uwb/i1480/dfu/dfu.c
rename to drivers/staging/uwb/i1480/dfu/dfu.c
index ec1af858ead93b5f955396871e25e422a0b6c2d1..9d51ce8faad1e2f0cd5a895743a7be41c198ba8e 100644 (file)
@@ -17,9 +17,9 @@
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/device.h>
-#include <linux/uwb.h>
 #include <linux/random.h>
 #include <linux/export.h>
+#include "../../uwb.h"
 
 /*
  * i1480_rceb_check - Check RCEB for expected field values
similarity index 99%
rename from drivers/uwb/i1480/dfu/i1480-dfu.h
rename to drivers/staging/uwb/i1480/dfu/i1480-dfu.h
index 9dd567d174b3ff525349ff44e6e597f403856598..b21d058ecc23d7fc78b8025c9e89ad3a16a0e052 100644 (file)
@@ -50,9 +50,9 @@
 #ifndef __i1480_DFU_H__
 #define __i1480_DFU_H__
 
-#include <linux/uwb/spec.h>
 #include <linux/types.h>
 #include <linux/completion.h>
+#include "../../include/spec.h"
 
 #define i1480_FW_UPLOAD_MODE_MASK (cpu_to_le32(0x00000018))
 
similarity index 99%
rename from drivers/uwb/i1480/dfu/mac.c
rename to drivers/staging/uwb/i1480/dfu/mac.c
index ddc224f01a7f5723651b9324dd3e0eff53a6adfd..6e4d6c9cecf5cbc83e981c903640fa0de3fc05e0 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/delay.h>
 #include <linux/firmware.h>
 #include <linux/slab.h>
-#include <linux/uwb.h>
+#include "../../uwb.h"
 #include "i1480-dfu.h"
 
 /*
similarity index 99%
rename from drivers/uwb/i1480/dfu/phy.c
rename to drivers/staging/uwb/i1480/dfu/phy.c
index 50da4527c113b04ec0deb84338210e3f94b805cc..13512c7dda0bd9947c4ca4727a5d3d10088eb633 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/firmware.h>
-#include <linux/usb/wusb.h>
+#include "../../../wusbcore/include/wusb.h"
 #include "i1480-dfu.h"
 
 
similarity index 99%
rename from drivers/uwb/i1480/dfu/usb.c
rename to drivers/staging/uwb/i1480/dfu/usb.c
index 6129a8f4b5f2f8316984ef7c5ac542434e0dc858..d41086bdd7838c2c8ba5866ef71f80616247d143 100644 (file)
@@ -25,9 +25,9 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/uwb.h>
-#include <linux/usb/wusb.h>
-#include <linux/usb/wusb-wa.h>
+#include "../../uwb.h"
+#include "../../../wusbcore/include/wusb.h"
+#include "../../../wusbcore/include/wusb-wa.h"
 #include "i1480-dfu.h"
 
 struct i1480_usb {
similarity index 99%
rename from drivers/uwb/i1480/i1480-est.c
rename to drivers/staging/uwb/i1480/i1480-est.c
index 1346c409d10ef7908088a33d499536baef32d94c..106e0a44b138fcabbf24cc1f826f8df615c59daf 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-#include <linux/uwb.h>
+#include "../uwb.h"
 #include "dfu/i1480-dfu.h"
 
 
similarity index 100%
rename from drivers/uwb/ie.c
rename to drivers/staging/uwb/ie.c
similarity index 100%
rename from drivers/uwb/neh.c
rename to drivers/staging/uwb/neh.c
similarity index 99%
rename from drivers/uwb/pal.c
rename to drivers/staging/uwb/pal.c
index 765fd426dbd14f2c36850dbb251398918cb9eb8c..a541e646a6036e5b2e08e050cd45cc78f89b1ed4 100644 (file)
@@ -6,9 +6,9 @@
  */
 #include <linux/kernel.h>
 #include <linux/debugfs.h>
-#include <linux/uwb.h>
 #include <linux/export.h>
 
+#include "uwb.h"
 #include "uwb-internal.h"
 
 /**
similarity index 99%
rename from drivers/uwb/radio.c
rename to drivers/staging/uwb/radio.c
index 240dd755927efe0ba626d06cf53e2a757826f63a..6afb75ce1b5f2c159b4630f32c79c66b03468612 100644 (file)
@@ -5,9 +5,9 @@
  * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
  */
 #include <linux/kernel.h>
-#include <linux/uwb.h>
 #include <linux/export.h>
 
+#include "uwb.h"
 #include "uwb-internal.h"
 
 
similarity index 99%
rename from drivers/uwb/rsv.c
rename to drivers/staging/uwb/rsv.c
index ec924deb0a323482a9d65b4520c5cbc151546644..f45a04ff7275547d0c646e292df3981edaec70fd 100644 (file)
@@ -5,11 +5,11 @@
  * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
  */
 #include <linux/kernel.h>
-#include <linux/uwb.h>
 #include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/export.h>
 
+#include "uwb.h"
 #include "uwb-internal.h"
 
 static void uwb_rsv_timer(struct timer_list *t);
similarity index 99%
rename from drivers/uwb/umc-bus.c
rename to drivers/staging/uwb/umc-bus.c
index 0fdc38078eee256b157e463e881be39061936e85..8b931f66a720bb5c3416a2f0ebea3a9f95ca461e 100644 (file)
@@ -8,8 +8,8 @@
 #include <linux/sysfs.h>
 #include <linux/workqueue.h>
 #include <linux/module.h>
-#include <linux/uwb/umc.h>
 #include <linux/pci.h>
+#include "include/umc.h"
 
 static int umc_bus_pre_reset_helper(struct device *dev, void *data)
 {
similarity index 98%
rename from drivers/uwb/umc-dev.c
rename to drivers/staging/uwb/umc-dev.c
index c845ca414bb269a6e1bb5abd26dac2654bfa1a42..0c71caae00be800e4807fcf224b96a2d97d5a855 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/slab.h>
-#include <linux/uwb/umc.h>
+#include "include/umc.h"
 
 static void umc_device_release(struct device *dev)
 {
similarity index 96%
rename from drivers/uwb/umc-drv.c
rename to drivers/staging/uwb/umc-drv.c
index b141d520efbfdea325937e8f529be3cf8b7aa5ce..ed3bd220e8c2ffbc5174d15aff7be657e4b3f882 100644 (file)
@@ -6,7 +6,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/export.h>
-#include <linux/uwb/umc.h>
+#include "include/umc.h"
 
 int __umc_driver_register(struct umc_driver *umc_drv, struct module *module,
                          const char *mod_name)
similarity index 99%
rename from drivers/uwb/uwb-debug.c
rename to drivers/staging/uwb/uwb-debug.c
index 5457b6d42387102e8a81ae8bd9a9c0bfcc5e4fa9..dd14df219ef81e9d4e61df503dea2912e99f7660 100644 (file)
@@ -19,8 +19,7 @@
 #include <linux/uaccess.h>
 #include <linux/seq_file.h>
 
-#include <linux/uwb/debug-cmd.h>
-
+#include "include/debug-cmd.h"
 #include "uwb-internal.h"
 
 /*
similarity index 99%
rename from drivers/uwb/uwb-internal.h
rename to drivers/staging/uwb/uwb-internal.h
index 00de0a5333d22c75b72e12820c5e39490e19d3ab..4c2fdac7f6105c236618173e2d9b7919212d62bc 100644 (file)
@@ -17,8 +17,8 @@
 
 #include <linux/kernel.h>
 #include <linux/device.h>
-#include <linux/uwb.h>
 #include <linux/mutex.h>
+#include "uwb.h"
 
 struct uwb_beca_e;
 
similarity index 99%
rename from include/linux/uwb.h
rename to drivers/staging/uwb/uwb.h
index 6918a61e1ac11734894e927a08c6eb1e0119650c..6a59706ba3a03ffb2d82b3c7ae43c37910034a27 100644 (file)
@@ -18,8 +18,8 @@
 #include <linux/timer.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
-#include <linux/uwb/spec.h>
 #include <asm/page.h>
+#include "include/spec.h"
 
 struct uwb_dev;
 struct uwb_beca_e;
similarity index 99%
rename from drivers/uwb/whc-rc.c
rename to drivers/staging/uwb/whc-rc.c
index 22397f70dee263dc29a4cabfe69c47084098e1f2..34020ed351abdfde601d2de48b94e39290077d3c 100644 (file)
@@ -33,9 +33,9 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
-#include <linux/uwb.h>
-#include <linux/uwb/whci.h>
-#include <linux/uwb/umc.h>
+#include "uwb.h"
+#include "include/whci.h"
+#include "include/umc.h"
 
 #include "uwb-internal.h"
 
similarity index 99%
rename from drivers/uwb/whci.c
rename to drivers/staging/uwb/whci.c
index be8a8b8e857bb4ba7b7c277d6b4ac87e548ae1f0..a8832f64d708e348b41ee7950e67b92a926d5d94 100644 (file)
@@ -10,8 +10,8 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
-#include <linux/uwb/whci.h>
-#include <linux/uwb/umc.h>
+#include "include/whci.h"
+#include "include/umc.h"
 
 struct whci_card {
        struct pci_dev *pci;
similarity index 93%
rename from drivers/usb/wusbcore/Kconfig
rename to drivers/staging/wusbcore/Kconfig
index abc0f361021f231b9ba2269ef8ea8f855187ab67..a559d023b508fd8873d6776bfc7f0af8b72a7e58 100644 (file)
@@ -4,7 +4,7 @@
 #
 config USB_WUSB
        tristate "Enable Wireless USB extensions"
-       depends on UWB
+       depends on UWB && USB
        select CRYPTO
        select CRYPTO_AES
        select CRYPTO_CCM
@@ -36,3 +36,4 @@ config USB_WUSB_CBAF_DEBUG
          to the system log. Select this if you are having a problem with
          CBA support and want to see more of what is going on.
 
+source "drivers/staging/wusbcore/host/Kconfig"
similarity index 96%
rename from drivers/usb/wusbcore/Makefile
rename to drivers/staging/wusbcore/Makefile
index d604ccdd916f166ff2f91cd746b5daca904ac1c0..b47b874268ac0532cbc5eab6ec3352a883acfb55 100644 (file)
@@ -24,3 +24,5 @@ wusb-wa-y :=          \
        wa-nep.o        \
        wa-rpipe.o      \
        wa-xfer.o
+
+obj-y  += host/
diff --git a/drivers/staging/wusbcore/TODO b/drivers/staging/wusbcore/TODO
new file mode 100644 (file)
index 0000000..abae570
--- /dev/null
@@ -0,0 +1,8 @@
+TODO: Remove in late 2019 unless there are users
+
+There seems to not be any real wireless USB devices anywhere in the wild
+anymore.  It turned out to be a failed technology :(
+
+This will be removed from the tree if no one objects.
+
+Greg Kroah-Hartman <gregkh@linuxfoundation.org>
similarity index 99%
rename from drivers/usb/wusbcore/cbaf.c
rename to drivers/staging/wusbcore/cbaf.c
index af77064c74569addc4badd9959661471c589760d..57062eaf755846e91af725fb6bdb80d67cb2f623 100644 (file)
@@ -80,9 +80,9 @@
 #include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
-#include <linux/uwb.h>
-#include <linux/usb/wusb.h>
-#include <linux/usb/association.h>
+#include "../uwb/uwb.h"
+#include "include/wusb.h"
+#include "include/association.h"
 
 #define CBA_NAME_LEN 0x40 /* [WUSB-AM] table 4-7 */
 
similarity index 99%
rename from drivers/usb/wusbcore/crypto.c
rename to drivers/staging/wusbcore/crypto.c
index 9ee66483ee54de0d305a8c4e6caad052a887bfdf..d7d55ed19a981a33a4bacfdde43a202d7dbe37d1 100644 (file)
 #include <linux/crypto.h>
 #include <linux/module.h>
 #include <linux/err.h>
-#include <linux/uwb.h>
 #include <linux/slab.h>
-#include <linux/usb/wusb.h>
 #include <linux/scatterlist.h>
+#include "../uwb/uwb.h"
+#include "include/wusb.h"
 
 static int debug_crypto_verify;
 
similarity index 99%
rename from drivers/usb/wusbcore/devconnect.c
rename to drivers/staging/wusbcore/devconnect.c
index a93837d57d53bd04eec7882a2976b26625f5956c..1170f8baf6084df92593109a93595c48ca9a2d53 100644 (file)
@@ -49,7 +49,7 @@
  *                              for processing a DN_Alive pong from a device.
  *
  *   wusb_handle_dn_disconnect()Called by notif.c:wusb_handle_dn() to
- *                              process a disconenct request from a
+ *                              process a disconnect request from a
  *                              device.
  *
  *   __wusb_dev_disable()       Called by rh.c:wusbhc_rh_clear_port_feat() when
diff --git a/drivers/staging/wusbcore/host/Kconfig b/drivers/staging/wusbcore/host/Kconfig
new file mode 100644 (file)
index 0000000..9a73f93
--- /dev/null
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config USB_WHCI_HCD
+       tristate "Wireless USB Host Controller Interface (WHCI) driver"
+       depends on USB_PCI && USB && UWB
+       select USB_WUSB
+       select UWB_WHCI
+       help
+         A driver for PCI-based Wireless USB Host Controllers that are
+         compliant with the WHCI specification.
+
+         To compile this driver a module, choose M here: the module
+         will be called "whci-hcd".
+
+config USB_HWA_HCD
+       tristate "Host Wire Adapter (HWA) driver"
+       depends on USB && UWB
+       select USB_WUSB
+       select UWB_HWA
+       help
+         This driver enables you to connect Wireless USB devices to
+         your system using a Host Wire Adaptor USB dongle. This is an
+         UWB Radio Controller and WUSB Host Controller connected to
+         your machine via USB (specified in WUSB1.0).
+
+         To compile this driver a module, choose M here: the module
+         will be called "hwa-hc".
+
diff --git a/drivers/staging/wusbcore/host/Makefile b/drivers/staging/wusbcore/host/Makefile
new file mode 100644 (file)
index 0000000..d65ee8a
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_USB_WHCI_HCD)     += whci/
+obj-$(CONFIG_USB_HWA_HCD)      += hwa-hc.o
similarity index 99%
rename from drivers/usb/host/hwa-hc.c
rename to drivers/staging/wusbcore/host/hwa-hc.c
index 6968b9f2b76b5865bd70e7366b2701f6b2c50f6f..8d959e91fe2772c145d68b6e33da78c6cdd5c667 100644 (file)
@@ -45,8 +45,8 @@
 #include <linux/workqueue.h>
 #include <linux/wait.h>
 #include <linux/completion.h>
-#include "../wusbcore/wa-hc.h"
-#include "../wusbcore/wusbhc.h"
+#include "../wa-hc.h"
+#include "../wusbhc.h"
 
 struct hwahc {
        struct wusbhc wusbhc;   /* has to be 1st */
similarity index 99%
rename from drivers/usb/host/whci/asl.c
rename to drivers/staging/wusbcore/host/whci/asl.c
index 276fb34c8efdae53c4cd35e524a04dc2509aef6f..a2b9a50cfb80e03675dd26256db8f3c93947b467 100644 (file)
@@ -7,10 +7,10 @@
 #include <linux/kernel.h>
 #include <linux/gfp.h>
 #include <linux/dma-mapping.h>
-#include <linux/uwb/umc.h>
 #include <linux/usb.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 99%
rename from drivers/usb/host/whci/debug.c
rename to drivers/staging/wusbcore/host/whci/debug.c
index 8ddfe3f1f6935d392039fab8f249e4711eda2115..443da6719147c0df3115fd9c068420df89c05c23 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/seq_file.h>
 #include <linux/export.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 99%
rename from drivers/usb/host/whci/hcd.c
rename to drivers/staging/wusbcore/host/whci/hcd.c
index 8af9dcfea127cfab5d25e96bc6e42e1aa13dcd4b..bee1ff2d35be25dae5cb2aa95ff50b7f21095508 100644 (file)
@@ -7,9 +7,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/uwb/umc.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 97%
rename from drivers/usb/host/whci/hw.c
rename to drivers/staging/wusbcore/host/whci/hw.c
index 22b3b7f7419dab3454c37d0e3ddeb830dfa51f93..e4e8914abf42d1966fa07541926c9faaa8a994c9 100644 (file)
@@ -6,9 +6,9 @@
  */
 #include <linux/kernel.h>
 #include <linux/dma-mapping.h>
-#include <linux/uwb/umc.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 98%
rename from drivers/usb/host/whci/init.c
rename to drivers/staging/wusbcore/host/whci/init.c
index 82416973f773a6e9bb71823f296f86336bb3dc47..55fd458a8f3012453b9fc882223a1fa3c3ffd10f 100644 (file)
@@ -7,9 +7,9 @@
 #include <linux/kernel.h>
 #include <linux/gfp.h>
 #include <linux/dma-mapping.h>
-#include <linux/uwb/umc.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 96%
rename from drivers/usb/host/whci/int.c
rename to drivers/staging/wusbcore/host/whci/int.c
index 7e4ad1b8f3e3ecf1a36b188500ba8da0e8b677ae..bdbe35e9366f9a7066937199d526d008166ac2bc 100644 (file)
@@ -5,9 +5,9 @@
  * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
  */
 #include <linux/kernel.h>
-#include <linux/uwb/umc.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 99%
rename from drivers/usb/host/whci/pzl.c
rename to drivers/staging/wusbcore/host/whci/pzl.c
index ef52aeb02fde828363fd884047ce22c5b56a2db6..6dfc075f5798001995886af90967f437a122a349 100644 (file)
@@ -7,10 +7,10 @@
 #include <linux/kernel.h>
 #include <linux/gfp.h>
 #include <linux/dma-mapping.h>
-#include <linux/uwb/umc.h>
 #include <linux/usb.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 99%
rename from drivers/usb/host/whci/qset.c
rename to drivers/staging/wusbcore/host/whci/qset.c
index 925166a207aa7fd73599a39bb2d46b7b38e93b7f..66459b77dc7732b85cd57e822e5fd3c28271027b 100644 (file)
@@ -7,10 +7,10 @@
 #include <linux/kernel.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
-#include <linux/uwb/umc.h>
 #include <linux/usb.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 98%
rename from drivers/usb/host/whci/whcd.h
rename to drivers/staging/wusbcore/host/whci/whcd.h
index 139476997e7c1bd091c3a10dc01324722ecb06c3..a442a2589e83d1ac52f75ab728f9e1bf278feff9 100644 (file)
@@ -7,10 +7,10 @@
 #ifndef __WHCD_H
 #define __WHCD_H
 
-#include <linux/uwb/whci.h>
-#include <linux/uwb/umc.h>
 #include <linux/workqueue.h>
 
+#include "../../../uwb/include/whci.h"
+#include "../../../uwb/include/umc.h"
 #include "whci-hc.h"
 
 /* Generic command timeout. */
similarity index 98%
rename from drivers/usb/host/whci/wusb.c
rename to drivers/staging/wusbcore/host/whci/wusb.c
index 8a4d805ff63a1f2b6d372f444fad45273107f1d1..6d0068ab35e468e95f98a552c6446e4211fa7277 100644 (file)
@@ -5,9 +5,9 @@
  * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
  */
 #include <linux/kernel.h>
-#include <linux/uwb/umc.h>
 
-#include "../../wusbcore/wusbhc.h"
+#include "../../../uwb/include/umc.h"
+#include "../../wusbhc.h"
 
 #include "whcd.h"
 
similarity index 99%
rename from include/linux/usb/wusb.h
rename to drivers/staging/wusbcore/include/wusb.h
index 65adee629106031af68d9bb5558a33c3481d182a..09771d1da7bc23118a02847045d3d941fa2ca45b 100644 (file)
@@ -33,9 +33,9 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/uwb/spec.h>
 #include <linux/usb/ch9.h>
 #include <linux/param.h>
+#include "../../uwb/include/spec.h"
 
 /**
  * WUSB Information Element header
similarity index 99%
rename from drivers/usb/wusbcore/mmc.c
rename to drivers/staging/wusbcore/mmc.c
index acce0d551eb29ea8c6110564e5c00770ea486325..881e1f20d7186bfee2e45a8ccaa5edeef01e9e4d 100644 (file)
@@ -22,9 +22,9 @@
  * FIXME:
  *  - add timers that autoremove intervalled IEs?
  */
-#include <linux/usb/wusb.h>
 #include <linux/slab.h>
 #include <linux/export.h>
+#include "include/wusb.h"
 #include "wusbhc.h"
 
 /* Initialize the MMCIEs handling mechanism */
similarity index 99%
rename from drivers/usb/wusbcore/reservation.c
rename to drivers/staging/wusbcore/reservation.c
index 6dcfc6825f55d0be872b94e786bc049a81ac6d81..b921faac698b9b2c959df71022215cf586f5d708 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
  */
 #include <linux/kernel.h>
-#include <linux/uwb.h>
 
+#include "../uwb/uwb.h"
 #include "wusbhc.h"
 
 /*
similarity index 99%
rename from drivers/usb/wusbcore/wa-hc.h
rename to drivers/staging/wusbcore/wa-hc.h
index ec90fff21debe7c8258fa99be6f97f5e377afd79..5a38465724c2eb79aacea32ef76b1d6ea56e9844 100644 (file)
@@ -70,9 +70,9 @@
 #include <linux/usb.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
-#include <linux/uwb.h>
-#include <linux/usb/wusb.h>
-#include <linux/usb/wusb-wa.h>
+#include "../uwb/uwb.h"
+#include "include/wusb.h"
+#include "include/wusb-wa.h"
 
 struct wusbhc;
 struct wahc;
similarity index 99%
rename from drivers/usb/wusbcore/wusbhc.h
rename to drivers/staging/wusbcore/wusbhc.h
index 7681d796ca5b9fe0c1e6c2782d3cf08b82786ab2..716244a2ec44613887c374452126a1b3a63193fb 100644 (file)
@@ -45,8 +45,8 @@
 #include <linux/kref.h>
 #include <linux/workqueue.h>
 #include <linux/usb/hcd.h>
-#include <linux/uwb.h>
-#include <linux/usb/wusb.h>
+#include "../uwb/uwb.h"
+#include "include/wusb.h"
 
 /*
  * Time from a WUSB channel stop request to the last transmitted MMC.
index 6e59d370ef8104bd25794305146be6878219d6d2..9987c399819f7a1b4e40feb61c04a31c65fc50c4 100644 (file)
@@ -98,8 +98,6 @@ source "drivers/usb/core/Kconfig"
 
 source "drivers/usb/mon/Kconfig"
 
-source "drivers/usb/wusbcore/Kconfig"
-
 source "drivers/usb/host/Kconfig"
 
 source "drivers/usb/renesas_usbhs/Kconfig"
index ecc2de1ffaaeab7b2c59bf902a08c396cd4882b5..db064dd59e089e8050832a95c1dcc58f4e518659 100644 (file)
@@ -35,8 +35,6 @@ obj-$(CONFIG_USB_MAX3421_HCD) += host/
 
 obj-$(CONFIG_USB_C67X00_HCD)   += c67x00/
 
-obj-$(CONFIG_USB_WUSB)         += wusbcore/
-
 obj-$(CONFIG_USB_ACM)          += class/
 obj-$(CONFIG_USB_PRINTER)      += class/
 obj-$(CONFIG_USB_WDM)          += class/
index e57a2be8754ab08f5d1fce04e399f253a06a85fd..5d41f85a744544191291b5f788260a1d096c9a30 100644 (file)
@@ -539,6 +539,37 @@ CXACRU_SET_##_action(                                        adsl_config);
 
 CXACRU_ALL_FILES(INIT);
 
+static struct attribute *cxacru_attrs[] = {
+       &dev_attr_adsl_config.attr,
+       &dev_attr_adsl_state.attr,
+       &dev_attr_adsl_controller_version.attr,
+       &dev_attr_adsl_headend_environment.attr,
+       &dev_attr_adsl_headend.attr,
+       &dev_attr_modulation.attr,
+       &dev_attr_line_startable.attr,
+       &dev_attr_downstream_hec_errors.attr,
+       &dev_attr_upstream_hec_errors.attr,
+       &dev_attr_downstream_fec_errors.attr,
+       &dev_attr_upstream_fec_errors.attr,
+       &dev_attr_downstream_crc_errors.attr,
+       &dev_attr_upstream_crc_errors.attr,
+       &dev_attr_startup_attempts.attr,
+       &dev_attr_downstream_bits_per_frame.attr,
+       &dev_attr_upstream_bits_per_frame.attr,
+       &dev_attr_transmitter_power.attr,
+       &dev_attr_downstream_attenuation.attr,
+       &dev_attr_upstream_attenuation.attr,
+       &dev_attr_downstream_snr_margin.attr,
+       &dev_attr_upstream_snr_margin.attr,
+       &dev_attr_mac_address.attr,
+       &dev_attr_line_status.attr,
+       &dev_attr_link_status.attr,
+       &dev_attr_upstream_rate.attr,
+       &dev_attr_downstream_rate.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(cxacru);
+
 /* the following three functions are stolen from drivers/usb/core/message.c */
 static void cxacru_blocking_completion(struct urb *urb)
 {
@@ -736,17 +767,6 @@ static int cxacru_card_status(struct cxacru_data *instance)
        return 0;
 }
 
-static void cxacru_remove_device_files(struct usbatm_data *usbatm_instance,
-               struct atm_dev *atm_dev)
-{
-       struct usb_interface *intf = usbatm_instance->usb_intf;
-
-       #define CXACRU_DEVICE_REMOVE_FILE(_name) \
-               device_remove_file(&intf->dev, &dev_attr_##_name);
-       CXACRU_ALL_FILES(REMOVE);
-       #undef CXACRU_DEVICE_REMOVE_FILE
-}
-
 static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
                struct atm_dev *atm_dev)
 {
@@ -765,13 +785,6 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
                return ret;
        }
 
-       #define CXACRU_DEVICE_CREATE_FILE(_name) \
-               ret = device_create_file(&intf->dev, &dev_attr_##_name); \
-               if (unlikely(ret)) \
-                       goto fail_sysfs;
-       CXACRU_ALL_FILES(CREATE);
-       #undef CXACRU_DEVICE_CREATE_FILE
-
        /* start ADSL */
        mutex_lock(&instance->adsl_state_serialize);
        ret = cxacru_cm(instance, CM_REQUEST_CHIP_ADSL_LINE_START, NULL, 0, NULL, 0);
@@ -804,11 +817,6 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
        if (start_polling)
                cxacru_poll_status(&instance->poll_work.work);
        return 0;
-
-fail_sysfs:
-       usb_err(usbatm_instance, "cxacru_atm_start: device_create_file failed (%d)\n", ret);
-       cxacru_remove_device_files(usbatm_instance, atm_dev);
-       return ret;
 }
 
 static void cxacru_poll_status(struct work_struct *work)
@@ -1332,7 +1340,6 @@ static struct usbatm_driver cxacru_driver = {
        .heavy_init     = cxacru_heavy_init,
        .unbind         = cxacru_unbind,
        .atm_start      = cxacru_atm_start,
-       .atm_stop       = cxacru_remove_device_files,
        .bulk_in        = CXACRU_EP_DATA,
        .bulk_out       = CXACRU_EP_DATA,
        .rx_padding     = 3,
@@ -1364,7 +1371,8 @@ static struct usb_driver cxacru_usb_driver = {
        .name           = cxacru_driver_name,
        .probe          = cxacru_usb_probe,
        .disconnect     = usbatm_usb_disconnect,
-       .id_table       = cxacru_usb_ids
+       .id_table       = cxacru_usb_ids,
+       .dev_groups     = cxacru_groups,
 };
 
 module_usb_driver(cxacru_usb_driver);
index 8faa51b1a520bfa6f9b6d42ab2511cae31cb2085..8b0ea8c70d73040bae8a09f85e7f086ce6afc0ad 100644 (file)
@@ -2458,7 +2458,7 @@ static int claim_interface(struct usb_device *usb_dev,
        return ret;
 }
 
-static struct attribute *attrs[] = {
+static struct attribute *uea_attrs[] = {
        &dev_attr_stat_status.attr,
        &dev_attr_stat_mflags.attr,
        &dev_attr_stat_human_status.attr,
@@ -2479,9 +2479,7 @@ static struct attribute *attrs[] = {
        &dev_attr_stat_firmid.attr,
        NULL,
 };
-static const struct attribute_group attr_grp = {
-       .attrs = attrs,
-};
+ATTRIBUTE_GROUPS(uea);
 
 static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
                   const struct usb_device_id *id)
@@ -2550,18 +2548,12 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
                }
        }
 
-       ret = sysfs_create_group(&intf->dev.kobj, &attr_grp);
-       if (ret < 0)
-               goto error;
-
        ret = uea_boot(sc);
        if (ret < 0)
-               goto error_rm_grp;
+               goto error;
 
        return 0;
 
-error_rm_grp:
-       sysfs_remove_group(&intf->dev.kobj, &attr_grp);
 error:
        kfree(sc);
        return ret;
@@ -2571,7 +2563,6 @@ static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf)
 {
        struct uea_softc *sc = usbatm->driver_data;
 
-       sysfs_remove_group(&intf->dev.kobj, &attr_grp);
        uea_stop(sc);
        kfree(sc);
 }
@@ -2721,6 +2712,7 @@ static struct usb_driver uea_driver = {
        .id_table = uea_ids,
        .probe = uea_probe,
        .disconnect = uea_disconnect,
+       .dev_groups = uea_groups,
 };
 
 MODULE_DEVICE_TABLE(usb, uea_ids);
index 26062d610c20d1c800c7dbde6b5b4c29f5efbab4..215c655295b895f3646de9925bf54b7f7e996e24 100644 (file)
@@ -903,10 +903,7 @@ static struct attribute *ci_attrs[] = {
        &dev_attr_role.attr,
        NULL,
 };
-
-static const struct attribute_group ci_attr_group = {
-       .attrs = ci_attrs,
-};
+ATTRIBUTE_GROUPS(ci);
 
 static int ci_hdrc_probe(struct platform_device *pdev)
 {
@@ -1008,7 +1005,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
 
        ci->irq = platform_get_irq(pdev, 0);
        if (ci->irq < 0) {
-               dev_err(dev, "missing IRQ\n");
                ret = ci->irq;
                goto deinit_phy;
        }
@@ -1106,14 +1102,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
        device_set_wakeup_capable(&pdev->dev, true);
        dbg_create_files(ci);
 
-       ret = sysfs_create_group(&dev->kobj, &ci_attr_group);
-       if (ret)
-               goto remove_debug;
-
        return 0;
 
-remove_debug:
-       dbg_remove_files(ci);
 stop:
        if (ci->is_otg && ci->roles[CI_ROLE_GADGET])
                ci_hdrc_otg_destroy(ci);
@@ -1140,7 +1130,6 @@ static int ci_hdrc_remove(struct platform_device *pdev)
        }
 
        dbg_remove_files(ci);
-       sysfs_remove_group(&ci->dev->kobj, &ci_attr_group);
        ci_role_destroy(ci);
        ci_hdrc_enter_lpm(ci, true);
        ci_usb_phy_exit(ci);
@@ -1319,6 +1308,7 @@ static struct platform_driver ci_hdrc_driver = {
        .driver = {
                .name   = "ci_hdrc",
                .pm     = &ci_pm_ops,
+               .dev_groups = ci_groups,
        },
 };
 
index 6a5ee8e6da10574ce9cb96e1bf082e8751a8aac7..053432d79bf7cfcd9f82fd75f1e3c3ca254aaa90 100644 (file)
@@ -1746,12 +1746,11 @@ static int ci_udc_start(struct usb_gadget *gadget,
                         struct usb_gadget_driver *driver)
 {
        struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
-       int retval = -ENOMEM;
+       int retval;
 
        if (driver->disconnect == NULL)
                return -EINVAL;
 
-
        ci->ep0out->ep.desc = &ctrl_endpt_out_desc;
        retval = usb_ep_enable(&ci->ep0out->ep);
        if (retval)
index 407a7a6198a25ba3bb3d078bf53adab23b5e3a34..7fea4999d352956bd4221ef9a827dd58113535ee 100644 (file)
@@ -1082,6 +1082,12 @@ static ssize_t ieee1284_id_show(struct device *dev, struct device_attribute *att
 
 static DEVICE_ATTR_RO(ieee1284_id);
 
+static struct attribute *usblp_attrs[] = {
+       &dev_attr_ieee1284_id.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(usblp);
+
 static int usblp_probe(struct usb_interface *intf,
                       const struct usb_device_id *id)
 {
@@ -1156,9 +1162,6 @@ static int usblp_probe(struct usb_interface *intf,
 
        /* Retrieve and store the device ID string. */
        usblp_cache_device_id_string(usblp);
-       retval = device_create_file(&intf->dev, &dev_attr_ieee1284_id);
-       if (retval)
-               goto abort_intfdata;
 
 #ifdef DEBUG
        usblp_check_status(usblp, 0);
@@ -1189,7 +1192,6 @@ static int usblp_probe(struct usb_interface *intf,
 
 abort_intfdata:
        usb_set_intfdata(intf, NULL);
-       device_remove_file(&intf->dev, &dev_attr_ieee1284_id);
 abort:
        kfree(usblp->readbuf);
        kfree(usblp->statusbuf);
@@ -1360,8 +1362,6 @@ static void usblp_disconnect(struct usb_interface *intf)
                BUG();
        }
 
-       device_remove_file(&intf->dev, &dev_attr_ieee1284_id);
-
        mutex_lock(&usblp_mutex);
        mutex_lock(&usblp->mut);
        usblp->present = 0;
@@ -1421,6 +1421,7 @@ static struct usb_driver usblp_driver = {
        .suspend =      usblp_suspend,
        .resume =       usblp_resume,
        .id_table =     usblp_ids,
+       .dev_groups =   usblp_groups,
        .supports_autosuspend = 1,
 };
 
index 4942122b2346d4804f2279fa8eb033296e1dd25b..7ff831f2fd21aa4a76e28b380d5a2e40a385e862 100644 (file)
@@ -1836,17 +1836,14 @@ capability_attribute(device_capabilities);
 capability_attribute(usb488_interface_capabilities);
 capability_attribute(usb488_device_capabilities);
 
-static struct attribute *capability_attrs[] = {
+static struct attribute *usbtmc_attrs[] = {
        &dev_attr_interface_capabilities.attr,
        &dev_attr_device_capabilities.attr,
        &dev_attr_usb488_interface_capabilities.attr,
        &dev_attr_usb488_device_capabilities.attr,
        NULL,
 };
-
-static const struct attribute_group capability_attr_grp = {
-       .attrs = capability_attrs,
-};
+ATTRIBUTE_GROUPS(usbtmc);
 
 static int usbtmc_ioctl_indicator_pulse(struct usbtmc_device_data *data)
 {
@@ -2383,9 +2380,6 @@ static int usbtmc_probe(struct usb_interface *intf,
        retcode = get_capabilities(data);
        if (retcode)
                dev_err(&intf->dev, "can't read capabilities\n");
-       else
-               retcode = sysfs_create_group(&intf->dev.kobj,
-                                            &capability_attr_grp);
 
        if (data->iin_ep_present) {
                /* allocate int urb */
@@ -2432,7 +2426,6 @@ static int usbtmc_probe(struct usb_interface *intf,
        return 0;
 
 error_register:
-       sysfs_remove_group(&intf->dev.kobj, &capability_attr_grp);
        usbtmc_free_int(data);
 err_put:
        kref_put(&data->kref, usbtmc_delete);
@@ -2445,7 +2438,6 @@ static void usbtmc_disconnect(struct usb_interface *intf)
        struct list_head *elem;
 
        usb_deregister_dev(intf, &usbtmc_class);
-       sysfs_remove_group(&intf->dev.kobj, &capability_attr_grp);
        mutex_lock(&data->io_mutex);
        data->zombie = 1;
        wake_up_interruptible_all(&data->waitq);
@@ -2551,6 +2543,7 @@ static struct usb_driver usbtmc_driver = {
        .resume         = usbtmc_resume,
        .pre_reset      = usbtmc_pre_reset,
        .post_reset     = usbtmc_post_reset,
+       .dev_groups     = usbtmc_groups,
 };
 
 module_usb_driver(usbtmc_driver);
index 9063ede411ae73e9ceffe7430ad578f6c7283878..24d4a801ca641d8491f3ff47361f3eb0b4b6d289 100644 (file)
 
 #include "usb.h"
 
+#ifdef CONFIG_PM
+#define MAYBE_CAP_SUSPEND      USBDEVFS_CAP_SUSPEND
+#else
+#define MAYBE_CAP_SUSPEND      0
+#endif
+
 #define USB_MAXBUS                     64
 #define USB_DEVICE_MAX                 (USB_MAXBUS * 128)
 #define USB_SG_SIZE                    16384 /* split-size for large txs */
 
+/* Mutual exclusion for ps->list in resume vs. release and remove */
+static DEFINE_MUTEX(usbfs_mutex);
+
 struct usb_dev_state {
        struct list_head list;      /* state list */
        struct usb_device *dev;
@@ -57,14 +66,17 @@ struct usb_dev_state {
        struct list_head async_completed;
        struct list_head memory_list;
        wait_queue_head_t wait;     /* wake up if a request completed */
+       wait_queue_head_t wait_for_resume;   /* wake up upon runtime resume */
        unsigned int discsignr;
        struct pid *disc_pid;
        const struct cred *cred;
        sigval_t disccontext;
        unsigned long ifclaimed;
        u32 disabled_bulk_eps;
-       bool privileges_dropped;
        unsigned long interface_allowed_mask;
+       int not_yet_resumed;
+       bool suspend_allowed;
+       bool privileges_dropped;
 };
 
 struct usb_memory {
@@ -694,9 +706,7 @@ static void driver_disconnect(struct usb_interface *intf)
        destroy_async_on_interface(ps, ifnum);
 }
 
-/* The following routines are merely placeholders.  There is no way
- * to inform a user task about suspend or resumes.
- */
+/* We don't care about suspend/resume of claimed interfaces */
 static int driver_suspend(struct usb_interface *intf, pm_message_t msg)
 {
        return 0;
@@ -707,12 +717,32 @@ static int driver_resume(struct usb_interface *intf)
        return 0;
 }
 
+/* The following routines apply to the entire device, not interfaces */
+void usbfs_notify_suspend(struct usb_device *udev)
+{
+       /* We don't need to handle this */
+}
+
+void usbfs_notify_resume(struct usb_device *udev)
+{
+       struct usb_dev_state *ps;
+
+       /* Protect against simultaneous remove or release */
+       mutex_lock(&usbfs_mutex);
+       list_for_each_entry(ps, &udev->filelist, list) {
+               WRITE_ONCE(ps->not_yet_resumed, 0);
+               wake_up_all(&ps->wait_for_resume);
+       }
+       mutex_unlock(&usbfs_mutex);
+}
+
 struct usb_driver usbfs_driver = {
        .name =         "usbfs",
        .probe =        driver_probe,
        .disconnect =   driver_disconnect,
        .suspend =      driver_suspend,
        .resume =       driver_resume,
+       .supports_autosuspend = 1,
 };
 
 static int claimintf(struct usb_dev_state *ps, unsigned int ifnum)
@@ -997,9 +1027,12 @@ static int usbdev_open(struct inode *inode, struct file *file)
        INIT_LIST_HEAD(&ps->async_completed);
        INIT_LIST_HEAD(&ps->memory_list);
        init_waitqueue_head(&ps->wait);
+       init_waitqueue_head(&ps->wait_for_resume);
        ps->disc_pid = get_pid(task_pid(current));
        ps->cred = get_current_cred();
        smp_wmb();
+
+       /* Can't race with resume; the device is already active */
        list_add_tail(&ps->list, &dev->filelist);
        file->private_data = ps;
        usb_unlock_device(dev);
@@ -1025,7 +1058,10 @@ static int usbdev_release(struct inode *inode, struct file *file)
        usb_lock_device(dev);
        usb_hub_release_all_ports(dev, ps);
 
+       /* Protect against simultaneous resume */
+       mutex_lock(&usbfs_mutex);
        list_del_init(&ps->list);
+       mutex_unlock(&usbfs_mutex);
 
        for (ifnum = 0; ps->ifclaimed && ifnum < 8*sizeof(ps->ifclaimed);
                        ifnum++) {
@@ -1033,7 +1069,8 @@ static int usbdev_release(struct inode *inode, struct file *file)
                        releaseintf(ps, ifnum);
        }
        destroy_all_async(ps);
-       usb_autosuspend_device(dev);
+       if (!ps->suspend_allowed)
+               usb_autosuspend_device(dev);
        usb_unlock_device(dev);
        usb_put_dev(dev);
        put_pid(ps->disc_pid);
@@ -2279,7 +2316,8 @@ static int proc_get_capabilities(struct usb_dev_state *ps, void __user *arg)
 
        caps = USBDEVFS_CAP_ZERO_PACKET | USBDEVFS_CAP_NO_PACKET_SIZE_LIM |
                        USBDEVFS_CAP_REAP_AFTER_DISCONNECT | USBDEVFS_CAP_MMAP |
-                       USBDEVFS_CAP_DROP_PRIVILEGES | USBDEVFS_CAP_CONNINFO_EX;
+                       USBDEVFS_CAP_DROP_PRIVILEGES |
+                       USBDEVFS_CAP_CONNINFO_EX | MAYBE_CAP_SUSPEND;
        if (!ps->dev->bus->no_stop_on_short)
                caps |= USBDEVFS_CAP_BULK_CONTINUATION;
        if (ps->dev->bus->sg_tablesize)
@@ -2382,6 +2420,47 @@ static int proc_drop_privileges(struct usb_dev_state *ps, void __user *arg)
        return 0;
 }
 
+static int proc_forbid_suspend(struct usb_dev_state *ps)
+{
+       int ret = 0;
+
+       if (ps->suspend_allowed) {
+               ret = usb_autoresume_device(ps->dev);
+               if (ret == 0)
+                       ps->suspend_allowed = false;
+               else if (ret != -ENODEV)
+                       ret = -EIO;
+       }
+       return ret;
+}
+
+static int proc_allow_suspend(struct usb_dev_state *ps)
+{
+       if (!connected(ps))
+               return -ENODEV;
+
+       WRITE_ONCE(ps->not_yet_resumed, 1);
+       if (!ps->suspend_allowed) {
+               usb_autosuspend_device(ps->dev);
+               ps->suspend_allowed = true;
+       }
+       return 0;
+}
+
+static int proc_wait_for_resume(struct usb_dev_state *ps)
+{
+       int ret;
+
+       usb_unlock_device(ps->dev);
+       ret = wait_event_interruptible(ps->wait_for_resume,
+                       READ_ONCE(ps->not_yet_resumed) == 0);
+       usb_lock_device(ps->dev);
+
+       if (ret != 0)
+               return -EINTR;
+       return proc_forbid_suspend(ps);
+}
+
 /*
  * NOTE:  All requests here that have interface numbers as parameters
  * are assuming that somehow the configuration has been prevented from
@@ -2576,6 +2655,15 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
        case USBDEVFS_GET_SPEED:
                ret = ps->dev->speed;
                break;
+       case USBDEVFS_FORBID_SUSPEND:
+               ret = proc_forbid_suspend(ps);
+               break;
+       case USBDEVFS_ALLOW_SUSPEND:
+               ret = proc_allow_suspend(ps);
+               break;
+       case USBDEVFS_WAIT_FOR_RESUME:
+               ret = proc_wait_for_resume(ps);
+               break;
        }
 
        /* Handle variable-length commands */
@@ -2649,15 +2737,20 @@ static void usbdev_remove(struct usb_device *udev)
 {
        struct usb_dev_state *ps;
 
+       /* Protect against simultaneous resume */
+       mutex_lock(&usbfs_mutex);
        while (!list_empty(&udev->filelist)) {
                ps = list_entry(udev->filelist.next, struct usb_dev_state, list);
                destroy_all_async(ps);
                wake_up_all(&ps->wait);
+               WRITE_ONCE(ps->not_yet_resumed, 0);
+               wake_up_all(&ps->wait_for_resume);
                list_del_init(&ps->list);
                if (ps->discsignr)
                        kill_pid_usb_asyncio(ps->discsignr, EPIPE, ps->disccontext,
                                             ps->disc_pid, ps->cred);
        }
+       mutex_unlock(&usbfs_mutex);
 }
 
 static int usbdev_notify(struct notifier_block *self,
index ebcadaad89d1dcfa31e65ab439daeada102f5ff5..2b27d232d7a75f29af95867ab710fcbb5b8160a9 100644 (file)
@@ -892,6 +892,7 @@ int usb_register_device_driver(struct usb_device_driver *new_udriver,
        new_udriver->drvwrap.driver.probe = usb_probe_device;
        new_udriver->drvwrap.driver.remove = usb_unbind_device;
        new_udriver->drvwrap.driver.owner = owner;
+       new_udriver->drvwrap.driver.dev_groups = new_udriver->dev_groups;
 
        retval = driver_register(&new_udriver->drvwrap.driver);
 
@@ -954,6 +955,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
        new_driver->drvwrap.driver.remove = usb_unbind_interface;
        new_driver->drvwrap.driver.owner = owner;
        new_driver->drvwrap.driver.mod_name = mod_name;
+       new_driver->drvwrap.driver.dev_groups = new_driver->dev_groups;
        spin_lock_init(&new_driver->dynids.lock);
        INIT_LIST_HEAD(&new_driver->dynids.list);
 
index 1ac9c1e5f773bc2ab12a80086ad3c3cd1c0e0b92..38f8b3e317628a8aab57fd022a69e7ecf4e862bf 100644 (file)
@@ -257,6 +257,8 @@ static int generic_suspend(struct usb_device *udev, pm_message_t msg)
        else
                rc = usb_port_suspend(udev, msg);
 
+       if (rc == 0)
+               usbfs_notify_suspend(udev);
        return rc;
 }
 
@@ -273,6 +275,9 @@ static int generic_resume(struct usb_device *udev, pm_message_t msg)
                rc = hcd_bus_resume(udev, msg);
        else
                rc = usb_port_resume(udev, msg);
+
+       if (rc == 0)
+               usbfs_notify_resume(udev);
        return rc;
 }
 
index 03432467b05fb12810d7cac77d954a11ed0a002a..03bee698d7ebdf156caa85e32b842190bf87f967 100644 (file)
@@ -407,8 +407,7 @@ static inline void powermac_set_asic(struct pci_dev *pci_dev, int enable)
 
 static int check_root_hub_suspended(struct device *dev)
 {
-       struct pci_dev          *pci_dev = to_pci_dev(dev);
-       struct usb_hcd          *hcd = pci_get_drvdata(pci_dev);
+       struct usb_hcd          *hcd = dev_get_drvdata(dev);
 
        if (HCD_RH_RUNNING(hcd)) {
                dev_warn(dev, "Root hub is not suspended\n");
index 1a06a4b5fbb14d592b6da8ed2cab8ebd123eb851..bbbb35fa639fa43e6666eebfdb86c909595f6cf8 100644 (file)
@@ -285,6 +285,14 @@ static int usb_port_runtime_suspend(struct device *dev)
 }
 #endif
 
+static void usb_port_shutdown(struct device *dev)
+{
+       struct usb_port *port_dev = to_usb_port(dev);
+
+       if (port_dev->child)
+               usb_disable_usb2_hardware_lpm(port_dev->child);
+}
+
 static const struct dev_pm_ops usb_port_pm_ops = {
 #ifdef CONFIG_PM
        .runtime_suspend =      usb_port_runtime_suspend,
@@ -301,6 +309,7 @@ struct device_type usb_port_device_type = {
 static struct device_driver usb_port_driver = {
        .name = "usb",
        .owner = THIS_MODULE,
+       .shutdown = usb_port_shutdown,
 };
 
 static int link_peers(struct usb_port *left, struct usb_port *right)
index 0c9fde5ad0524b50f1789803dbd00fa8adec4713..cf4783cf661a86ab521155b125961ce01e3fbf2d 100644 (file)
@@ -95,6 +95,9 @@ extern int usb_runtime_idle(struct device *dev);
 extern int usb_enable_usb2_hardware_lpm(struct usb_device *udev);
 extern int usb_disable_usb2_hardware_lpm(struct usb_device *udev);
 
+extern void usbfs_notify_suspend(struct usb_device *udev);
+extern void usbfs_notify_resume(struct usb_device *udev);
+
 #else
 
 static inline int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
index 55f841a540158993e45ec8be2ad376c39a61cc8c..31e090ac9f1ecb47ee16aa961c77ed2aeac8468f 100644 (file)
@@ -404,10 +404,7 @@ static void dwc2_get_device_properties(struct dwc2_hsotg *hsotg)
                device_property_read_u32(hsotg->dev, "g-np-tx-fifo-size",
                                         &p->g_np_tx_fifo_size);
 
-               num = device_property_read_u32_array(hsotg->dev,
-                                                    "g-tx-fifo-size",
-                                                    NULL, 0);
-
+               num = device_property_count_u32(hsotg->dev, "g-tx-fifo-size");
                if (num > 0) {
                        num = min(num, 15);
                        memset(p->g_tx_fifo_size, 0,
index 80fd3c6dcd1c34ac6d10da938052bff2ef7c8aac..3c6ce09a6db569103ed830c57c4212f88428c512 100644 (file)
@@ -407,10 +407,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
        spin_lock_init(&hsotg->lock);
 
        hsotg->irq = platform_get_irq(dev, 0);
-       if (hsotg->irq < 0) {
-               dev_err(&dev->dev, "missing IRQ resource\n");
+       if (hsotg->irq < 0)
                return hsotg->irq;
-       }
 
        dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
                hsotg->irq);
index c9bb93a2c81e277f17c97d1cca7da53b4bcfb6a8..98bce85c29d0299f88687ddbc3fa425d604efeea 100644 (file)
@@ -813,8 +813,7 @@ static void dwc3_set_incr_burst_type(struct dwc3 *dwc)
         * result = 1, means INCRx burst mode supported.
         * result > 1, means undefined length burst mode supported.
         */
-       ntype = device_property_read_u32_array(dev,
-                       "snps,incr-burst-type-adjustment", NULL, 0);
+       ntype = device_property_count_u32(dev, "snps,incr-burst-type-adjustment");
        if (ntype <= 0)
                return;
 
index cbee5fb9b9fb02d2e40e795d6e4276f0cdeaba6d..a69eb4a7b832fadcc0428184cfcc9469921e54ab 100644 (file)
@@ -112,7 +112,6 @@ static int kdwc3_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               dev_err(&pdev->dev, "missing irq\n");
                error = irq;
                goto err_irq;
        }
index bca7e92a10e93570842a7442fe4236dae986f4ca..d73ccd9e13664ed37330f1ed6fb8c3014f8be5ae 100644 (file)
@@ -386,7 +386,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
        struct device           *dev = &pdev->dev;
        struct device_node      *np = dev->of_node;
        void __iomem *base;
-       struct resource *res;
        enum phy_mode otg_id;
        int ret, i, irq;
 
@@ -394,8 +393,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
        if (!priv)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(dev, res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index ed8b865176758fdeef0fc4d7c754793aad580ac0..6f711d58d82f30ab314b10f07da470e777c1c462 100644 (file)
@@ -469,10 +469,8 @@ static int dwc3_omap_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, omap);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "missing IRQ resource: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        base = devm_ioremap_resource(dev, res);
index db3628be38c07b270eda5b9afe9d3cba1cab47e1..c08d385e27239a231f1a4a988e55a5ed8a1e7320 100644 (file)
@@ -348,7 +348,6 @@ static int ast_vhub_probe(struct platform_device *pdev)
        /* Find interrupt and install handler */
        vhub->irq = platform_get_irq(pdev, 0);
        if (vhub->irq < 0) {
-               dev_err(&pdev->dev, "Failed to get interrupt\n");
                rc = vhub->irq;
                goto err;
        }
index 503d275bc4c4b18c95ba6fbb29e12f02c3e47452..86ffc83078647b2ba1dfbfc6e796489af15c9192 100644 (file)
@@ -327,6 +327,7 @@ static int usba_config_fifo_table(struct usba_udc *udc)
        switch (fifo_mode) {
        default:
                fifo_mode = 0;
+               /* fall through */
        case 0:
                udc->fifo_cfg = NULL;
                n = 0;
index c1fcc77403eaffaba6e2b60089524237d96976f7..97b16463f3ef6013e6199410c64626abe03a07b3 100644 (file)
@@ -2328,10 +2328,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
 
        /* IRQ resource #0: control interrupt (VBUS, speed, etc.) */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "missing IRQ resource #0\n");
+       if (irq < 0)
                goto out_uninit;
-       }
        if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0,
                             dev_name(dev), udc) < 0)
                goto report_request_failure;
@@ -2339,10 +2337,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
        /* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */
        for (i = 0; i < BCM63XX_NUM_IUDMA; i++) {
                irq = platform_get_irq(pdev, i + 1);
-               if (irq < 0) {
-                       dev_err(dev, "missing IRQ resource #%d\n", i + 1);
+               if (irq < 0)
                        goto out_uninit;
-               }
                if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0,
                                     dev_name(dev), &udc->iudma[i]) < 0)
                        goto report_request_failure;
index ccbd1d34eb2a3ee5cd52548abd6676725b5ff1ac..cc4a16e253ac5c5c1d2b449e0473da6cac647f45 100644 (file)
@@ -515,10 +515,8 @@ static int bdc_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "platform_get_irq failed:%d\n", irq);
+       if (irq < 0)
                return irq;
-       }
        spin_lock_init(&bdc->lock);
        platform_set_drvdata(pdev, bdc);
        bdc->irq = irq;
index 729e60e495641c8a523265f6812c5b34c1f23213..7a0e9a58c2d8403bacdcbad08939b2a4453074a8 100644 (file)
@@ -2134,19 +2134,15 @@ static int gr_probe(struct platform_device *pdev)
                return PTR_ERR(regs);
 
        dev->irq = platform_get_irq(pdev, 0);
-       if (dev->irq <= 0) {
-               dev_err(dev->dev, "No irq found\n");
+       if (dev->irq <= 0)
                return -ENODEV;
-       }
 
        /* Some core configurations has separate irqs for IN and OUT events */
        dev->irqi = platform_get_irq(pdev, 1);
        if (dev->irqi > 0) {
                dev->irqo = platform_get_irq(pdev, 2);
-               if (dev->irqo <= 0) {
-                       dev_err(dev->dev, "Found irqi but not irqo\n");
+               if (dev->irqo <= 0)
                        return -ENODEV;
-               }
        } else {
                dev->irqi = 0;
        }
index 5f1b14f3e5a07ba0282cbf0ec56535e1aef95608..e9cf20979bf6dfe5e97663db6df4ae148bd6a0ad 100644 (file)
@@ -3061,11 +3061,8 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
        /* Get IRQs */
        for (i = 0; i < 4; i++) {
                udc->udp_irq[i] = platform_get_irq(pdev, i);
-               if (udc->udp_irq[i] < 0) {
-                       dev_err(udc->dev,
-                               "irq resource %d not available!\n", i);
+               if (udc->udp_irq[i] < 0)
                        return udc->udp_irq[i];
-               }
        }
 
        udc->udp_baseaddr = devm_ioremap_resource(dev, res);
index 1f4c3fbd1df8b37d1d2f8cd82470171be2ae9985..e098f16c01cb5dedef6e4084c33a7ec39f43acdc 100644 (file)
@@ -2744,10 +2744,8 @@ static int renesas_usb3_probe(struct platform_device *pdev)
                priv = of_device_get_match_data(&pdev->dev);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL);
        if (!usb3)
index 31c7c5587cf932aa283174aeec8c492c5bc17593..858993c73442243c2a005934eb91e21b0dc1ae9e 100644 (file)
@@ -1311,10 +1311,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
        s3c_hsudc_setup_ep(hsudc);
 
        ret = platform_get_irq(pdev, 0);
-       if (ret < 0) {
-               dev_err(dev, "unable to obtain IRQ number\n");
+       if (ret < 0)
                goto err_res;
-       }
        hsudc->irq = ret;
 
        ret = devm_request_irq(&pdev->dev, hsudc->irq, s3c_hsudc_irq, 0,
index af3e63316acef08ba1707232d7ef37f3f0bf8d93..f82208fbc2495b7a053e8201c7edbdcdf7556f43 100644 (file)
@@ -312,6 +312,7 @@ static int s3c2410_udc_write_fifo(struct s3c2410_ep *ep,
        switch (idx) {
        default:
                idx = 0;
+               /* fall through */
        case 0:
                fifo_reg = S3C2410_UDC_EP0_FIFO_REG;
                break;
@@ -416,6 +417,7 @@ static int s3c2410_udc_read_fifo(struct s3c2410_ep *ep,
        switch (idx) {
        default:
                idx = 0;
+               /* fall through */
        case 0:
                fifo_reg = S3C2410_UDC_EP0_FIFO_REG;
                break;
index b1f4104d12838e96a0d05c9bab52ce0b437aeef5..29d8e5f8bb58397ec6402f22cf723e5774f6f132 100644 (file)
@@ -2074,10 +2074,8 @@ static int xudc_probe(struct platform_device *pdev)
                return PTR_ERR(udc->addr);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "unable to get irq\n");
+       if (irq < 0)
                return irq;
-       }
        ret = devm_request_irq(&pdev->dev, irq, xudc_irq, 0,
                               dev_name(&pdev->dev), udc);
        if (ret < 0) {
index 40b5de59711299b608f45523f5798bbba135919b..f39f24f107f45afa347e6ff180ea8673f744a445 100644 (file)
@@ -287,12 +287,6 @@ config USB_EHCI_MV
          Dova, Armada 370 and Armada XP. See "Support for Marvell EBU
          on-chip EHCI USB controller" for those.
 
-config USB_W90X900_EHCI
-       tristate "W90X900(W90P910) EHCI support"
-       depends on ARCH_W90X900
-       ---help---
-               Enables support for the W90X900 USB controller
-
 config USB_CNS3XXX_EHCI
        bool "Cavium CNS3XXX EHCI Module (DEPRECATED)"
        depends on ARCH_CNS3XXX
@@ -717,32 +711,6 @@ config USB_RENESAS_USBHS_HCD
          To compile this driver as a module, choose M here: the
          module will be called renesas-usbhs.
 
-config USB_WHCI_HCD
-       tristate "Wireless USB Host Controller Interface (WHCI) driver"
-       depends on USB_PCI && USB && UWB
-       select USB_WUSB
-       select UWB_WHCI
-       help
-         A driver for PCI-based Wireless USB Host Controllers that are
-         compliant with the WHCI specification.
-
-         To compile this driver a module, choose M here: the module
-         will be called "whci-hcd".
-
-config USB_HWA_HCD
-       tristate "Host Wire Adapter (HWA) driver"
-       depends on USB && UWB
-       select USB_WUSB
-       select UWB_HWA
-       help
-         This driver enables you to connect Wireless USB devices to
-         your system using a Host Wire Adaptor USB dongle. This is an
-         UWB Radio Controller and WUSB Host Controller connected to
-         your machine via USB (specified in WUSB1.0).
-
-         To compile this driver a module, choose M here: the module
-         will be called "hwa-hc".
-
 config USB_IMX21_HCD
        tristate "i.MX21 HCD support"
        depends on ARM && ARCH_MXC
index 84514f71ae4403a68ab56b25bff4815d89caf475..b191361257cc5d0d738624edd744a68bcb5d4b3e 100644 (file)
@@ -35,8 +35,6 @@ ifneq ($(CONFIG_DEBUG_FS),)
        xhci-hcd-y              += xhci-debugfs.o
 endif
 
-obj-$(CONFIG_USB_WHCI_HCD)     += whci/
-
 obj-$(CONFIG_USB_PCI)  += pci-quirks.o
 
 obj-$(CONFIG_USB_EHCI_HCD)     += ehci-hcd.o
@@ -51,7 +49,6 @@ obj-$(CONFIG_USB_EHCI_HCD_STI)        += ehci-st.o
 obj-$(CONFIG_USB_EHCI_EXYNOS)  += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += ehci-tegra.o
-obj-$(CONFIG_USB_W90X900_EHCI) += ehci-w90x900.o
 
 obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o
 obj-$(CONFIG_USB_ISP116X_HCD)  += isp116x-hcd.o
@@ -82,7 +79,6 @@ obj-$(CONFIG_USB_SL811_HCD)   += sl811-hcd.o
 obj-$(CONFIG_USB_SL811_CS)     += sl811_cs.o
 obj-$(CONFIG_USB_U132_HCD)     += u132-hcd.o
 obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
-obj-$(CONFIG_USB_HWA_HCD)      += hwa-hc.o
 obj-$(CONFIG_USB_IMX21_HCD)    += imx21-hcd.o
 obj-$(CONFIG_USB_FSL_USB2)     += fsl-mph-dr-of.o
 obj-$(CONFIG_USB_EHCI_FSL)     += fsl-mph-dr-of.o
index 3ba140ceaf52cb6ac35ff0c8709f14d4795fdeb4..e893467d659c5f03b9c7aa9ff1a091dd5924b0a6 100644 (file)
@@ -100,9 +100,6 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq <= 0) {
-               dev_err(&pdev->dev,
-                       "Found HC with no IRQ. Check %s setup!\n",
-                       dev_name(&pdev->dev));
                retval = -ENODEV;
                goto fail_create_hcd;
        }
index 3a29a1a8519c6bcca5d3de5d58de9707e0e3272c..01debfd03d4a0d62c548cef41986694027599912 100644 (file)
@@ -41,6 +41,7 @@ struct exynos_ehci_hcd {
        struct clk *clk;
        struct device_node *of_node;
        struct phy *phy[PHY_NUMBER];
+       bool legacy_phy;
 };
 
 #define to_exynos_ehci(hcd) (struct exynos_ehci_hcd *)(hcd_to_ehci(hcd)->priv)
@@ -50,10 +51,22 @@ static int exynos_ehci_get_phy(struct device *dev,
 {
        struct device_node *child;
        struct phy *phy;
-       int phy_number;
+       int phy_number, num_phys;
        int ret;
 
        /* Get PHYs for the controller */
+       num_phys = of_count_phandle_with_args(dev->of_node, "phys",
+                                             "#phy-cells");
+       for (phy_number = 0; phy_number < num_phys; phy_number++) {
+               phy = devm_of_phy_get_by_index(dev, dev->of_node, phy_number);
+               if (IS_ERR(phy))
+                       return PTR_ERR(phy);
+               exynos_ehci->phy[phy_number] = phy;
+       }
+       if (num_phys > 0)
+               return 0;
+
+       /* Get PHYs using legacy bindings */
        for_each_available_child_of_node(dev->of_node, child) {
                ret = of_property_read_u32(child, "reg", &phy_number);
                if (ret) {
@@ -84,6 +97,7 @@ static int exynos_ehci_get_phy(struct device *dev,
                }
        }
 
+       exynos_ehci->legacy_phy = true;
        return 0;
 }
 
@@ -205,11 +219,12 @@ static int exynos_ehci_probe(struct platform_device *pdev)
        ehci->caps = hcd->regs;
 
        /*
-        * Workaround: reset of_node pointer to avoid conflict between Exynos
-        * EHCI port subnodes and generic USB device bindings
+        * Workaround: reset of_node pointer to avoid conflict between legacy
+        * Exynos EHCI port subnodes and generic USB device bindings
         */
        exynos_ehci->of_node = pdev->dev.of_node;
-       pdev->dev.of_node = NULL;
+       if (exynos_ehci->legacy_phy)
+               pdev->dev.of_node = NULL;
 
        /* DMA burst Enable */
        writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
index 7d20296cbe9f9459d31742a29049c4c9c518b27e..fc125b3d06e7da76913b3009e732f0ce81d0bf75 100644 (file)
@@ -115,10 +115,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(dev, "EHCI irq failed: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        res =  platform_get_resource(pdev, IORESOURCE_MEM, 0);
        regs = devm_ioremap_resource(dev, res);
index 790acf3633e8912382e414c8e5ac343438e5b8f1..a319b1df3011c4e410bc43dc3d8c6d2687082c51 100644 (file)
@@ -223,9 +223,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq <= 0) {
-               dev_err(&pdev->dev,
-                       "Found HC with no IRQ. Check %s setup!\n",
-                       dev_name(&pdev->dev));
                err = -ENODEV;
                goto err;
        }
index 4c306fb6b06997367fe7f0e5659faddaf28759fe..769749ca5961a422ac9e69834a20c76533cab90d 100644 (file)
@@ -145,10 +145,8 @@ static int ehci_platform_probe(struct platform_device *dev)
        }
 
        irq = platform_get_irq(dev, 0);
-       if (irq < 0) {
-               dev_err(&dev->dev, "no irq provided");
+       if (irq < 0)
                return irq;
-       }
 
        hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
                             dev_name(&dev->dev));
index a9ee767952c1d635b52a3a6866e8c9f8a2ffed01..ef75b9d70eb4e4bf90a37c83b0458f62e73267e1 100644 (file)
@@ -85,9 +85,6 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq <= 0) {
-               dev_err(&pdev->dev,
-                       "Found HC with no IRQ. Check %s setup!\n",
-                       dev_name(&pdev->dev));
                ret = -ENODEV;
                goto fail_create_hcd;
        }
index ccb4e611001da2af0f17d8b6008a70341611ae31..f74433aac94860e70bdf8fb705593f1a6b67dde0 100644 (file)
@@ -158,10 +158,8 @@ static int st_ehci_platform_probe(struct platform_device *dev)
                return -ENODEV;
 
        irq = platform_get_irq(dev, 0);
-       if (irq < 0) {
-               dev_err(&dev->dev, "no irq provided");
+       if (irq < 0)
                return irq;
-       }
        res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (!res_mem) {
                dev_err(&dev->dev, "no memory resource provided");
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
deleted file mode 100644 (file)
index 6d77ace..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * linux/driver/usb/host/ehci-w90x900.c
- *
- * Copyright (c) 2008 Nuvoton technology corporation.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- */
-
-#include <linux/dma-mapping.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/usb.h>
-#include <linux/usb/hcd.h>
-
-#include "ehci.h"
-
-/* enable phy0 and phy1 for w90p910 */
-#define        ENPHY           (0x01<<8)
-#define PHY0_CTR       (0xA4)
-#define PHY1_CTR       (0xA8)
-
-#define DRIVER_DESC "EHCI w90x900 driver"
-
-static const char hcd_name[] = "ehci-w90x900 ";
-
-static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
-
-static int ehci_w90x900_probe(struct platform_device *pdev)
-{
-       struct usb_hcd *hcd;
-       struct ehci_hcd *ehci;
-       struct resource *res;
-       int retval = 0, irq;
-       unsigned long val;
-
-       hcd = usb_create_hcd(&ehci_w90x900_hc_driver,
-                       &pdev->dev, "w90x900 EHCI");
-       if (!hcd) {
-               retval = -ENOMEM;
-               goto err1;
-       }
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       hcd->regs = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(hcd->regs)) {
-               retval = PTR_ERR(hcd->regs);
-               goto err2;
-       }
-       hcd->rsrc_start = res->start;
-       hcd->rsrc_len = resource_size(res);
-
-       ehci = hcd_to_ehci(hcd);
-       ehci->caps = hcd->regs;
-       ehci->regs = hcd->regs +
-               HC_LENGTH(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
-
-       /* enable PHY 0,1,the regs only apply to w90p910
-        *  0xA4,0xA8 were offsets of PHY0 and PHY1 controller of
-        *  w90p910 IC relative to ehci->regs.
-        */
-       val = __raw_readl(ehci->regs+PHY0_CTR);
-       val |= ENPHY;
-       __raw_writel(val, ehci->regs+PHY0_CTR);
-
-       val = __raw_readl(ehci->regs+PHY1_CTR);
-       val |= ENPHY;
-       __raw_writel(val, ehci->regs+PHY1_CTR);
-
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               retval = irq;
-               goto err2;
-       }
-
-       retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
-       if (retval != 0)
-               goto err2;
-
-       device_wakeup_enable(hcd->self.controller);
-       return retval;
-err2:
-       usb_put_hcd(hcd);
-err1:
-       return retval;
-}
-
-static int ehci_w90x900_remove(struct platform_device *pdev)
-{
-       struct usb_hcd *hcd = platform_get_drvdata(pdev);
-
-       usb_remove_hcd(hcd);
-       usb_put_hcd(hcd);
-
-       return 0;
-}
-
-static struct platform_driver ehci_hcd_w90x900_driver = {
-       .probe  = ehci_w90x900_probe,
-       .remove = ehci_w90x900_remove,
-       .driver = {
-               .name = "w90x900-ehci",
-       },
-};
-
-static int __init ehci_w90X900_init(void)
-{
-       if (usb_disabled())
-               return -ENODEV;
-
-       pr_info("%s: " DRIVER_DESC "\n", hcd_name);
-
-       ehci_init_driver(&ehci_w90x900_hc_driver, NULL);
-       return platform_driver_register(&ehci_hcd_w90x900_driver);
-}
-module_init(ehci_w90X900_init);
-
-static void __exit ehci_w90X900_cleanup(void)
-{
-       platform_driver_unregister(&ehci_hcd_w90x900_driver);
-}
-module_exit(ehci_w90X900_cleanup);
-
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
-MODULE_ALIAS("platform:w90p910-ehci");
-MODULE_LICENSE("GPL v2");
index 6e3dad19d3696a78054bc809c25ef7c7d6d294a0..e406c5459a973ce29a1e48d3eefcdf8fd09af18d 100644 (file)
@@ -1836,10 +1836,8 @@ static int imx21_probe(struct platform_device *pdev)
        if (!res)
                return -ENODEV;
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        hcd = usb_create_hcd(&imx21_hc_driver,
                &pdev->dev, dev_name(&pdev->dev));
index 905c6317e0c350cd006ded57a16f109c22f11853..d5ce98e205c73f2764de05a6e2df623fbf7e8168 100644 (file)
@@ -32,6 +32,7 @@ struct exynos_ohci_hcd {
        struct clk *clk;
        struct device_node *of_node;
        struct phy *phy[PHY_NUMBER];
+       bool legacy_phy;
 };
 
 static int exynos_ohci_get_phy(struct device *dev,
@@ -39,10 +40,22 @@ static int exynos_ohci_get_phy(struct device *dev,
 {
        struct device_node *child;
        struct phy *phy;
-       int phy_number;
+       int phy_number, num_phys;
        int ret;
 
        /* Get PHYs for the controller */
+       num_phys = of_count_phandle_with_args(dev->of_node, "phys",
+                                             "#phy-cells");
+       for (phy_number = 0; phy_number < num_phys; phy_number++) {
+               phy = devm_of_phy_get_by_index(dev, dev->of_node, phy_number);
+               if (IS_ERR(phy))
+                       return PTR_ERR(phy);
+               exynos_ohci->phy[phy_number] = phy;
+       }
+       if (num_phys > 0)
+               return 0;
+
+       /* Get PHYs using legacy bindings */
        for_each_available_child_of_node(dev->of_node, child) {
                ret = of_property_read_u32(child, "reg", &phy_number);
                if (ret) {
@@ -73,6 +86,7 @@ static int exynos_ohci_get_phy(struct device *dev,
                }
        }
 
+       exynos_ohci->legacy_phy = true;
        return 0;
 }
 
@@ -172,11 +186,12 @@ static int exynos_ohci_probe(struct platform_device *pdev)
        }
 
        /*
-        * Workaround: reset of_node pointer to avoid conflict between Exynos
-        * OHCI port subnodes and generic USB device bindings
+        * Workaround: reset of_node pointer to avoid conflict between legacy
+        * Exynos OHCI port subnodes and generic USB device bindings
         */
        exynos_ohci->of_node = pdev->dev.of_node;
-       pdev->dev.of_node = NULL;
+       if (exynos_ohci->legacy_phy)
+               pdev->dev.of_node = NULL;
 
        err = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (err) {
index 65a1c3fdc88c68b5f5dd8d1e50ffd22d9ea7983f..7addfc2cbadce08d4d92ed858d4f226b0e3e676f 100644 (file)
@@ -111,10 +111,8 @@ static int ohci_platform_probe(struct platform_device *dev)
                return err;
 
        irq = platform_get_irq(dev, 0);
-       if (irq < 0) {
-               dev_err(&dev->dev, "no irq provided");
+       if (irq < 0)
                return irq;
-       }
 
        hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
                        dev_name(&dev->dev));
index 638a92bd2cdc22726715ad5a97690e8d89180381..ac796ccd93ef45e3a1b233b1cb53c4b49cb0dfa7 100644 (file)
@@ -138,10 +138,8 @@ static int st_ohci_platform_probe(struct platform_device *dev)
                return -ENODEV;
 
        irq = platform_get_irq(dev, 0);
-       if (irq < 0) {
-               dev_err(&dev->dev, "no irq provided");
+       if (irq < 0)
                return irq;
-       }
 
        res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (!res_mem) {
index d5a293a707b6fa7b102fdcd8978d92e14ab8202d..fb6f5e9ae5c620e54aa85c2542339314f634d10e 100644 (file)
@@ -97,10 +97,13 @@ static void tmio_stop_hc(struct platform_device *dev)
        switch (ohci->num_ports) {
                default:
                        dev_err(&dev->dev, "Unsupported amount of ports: %d\n", ohci->num_ports);
+                       /* fall through */
                case 3:
                        pm |= CCR_PM_USBPW3;
+                       /* fall through */
                case 2:
                        pm |= CCR_PM_USBPW2;
+                       /* fall through */
                case 1:
                        pm |= CCR_PM_USBPW1;
        }
index 47c5515a9ce4aba55a1dc670a2e46f72f4e411e8..09cc19df798e440c4207b71033b2880d2c539c40 100644 (file)
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 
-#include "oxu210hp.h"
-
 #define DRIVER_VERSION "0.0.50"
 
+#define OXU_DEVICEID                   0x00
+       #define OXU_REV_MASK            0xffff0000
+       #define OXU_REV_SHIFT           16
+       #define OXU_REV_2100            0x2100
+       #define OXU_BO_SHIFT            8
+       #define OXU_BO_MASK             (0x3 << OXU_BO_SHIFT)
+       #define OXU_MAJ_REV_SHIFT       4
+       #define OXU_MAJ_REV_MASK        (0xf << OXU_MAJ_REV_SHIFT)
+       #define OXU_MIN_REV_SHIFT       0
+       #define OXU_MIN_REV_MASK        (0xf << OXU_MIN_REV_SHIFT)
+#define OXU_HOSTIFCONFIG               0x04
+#define OXU_SOFTRESET                  0x08
+       #define OXU_SRESET              (1 << 0)
+
+#define OXU_PIOBURSTREADCTRL           0x0C
+
+#define OXU_CHIPIRQSTATUS              0x10
+#define OXU_CHIPIRQEN_SET              0x14
+#define OXU_CHIPIRQEN_CLR              0x18
+       #define OXU_USBSPHLPWUI         0x00000080
+       #define OXU_USBOTGLPWUI         0x00000040
+       #define OXU_USBSPHI             0x00000002
+       #define OXU_USBOTGI             0x00000001
+
+#define OXU_CLKCTRL_SET                        0x1C
+       #define OXU_SYSCLKEN            0x00000008
+       #define OXU_USBSPHCLKEN         0x00000002
+       #define OXU_USBOTGCLKEN         0x00000001
+
+#define OXU_ASO                                0x68
+       #define OXU_SPHPOEN             0x00000100
+       #define OXU_OVRCCURPUPDEN       0x00000800
+       #define OXU_ASO_OP              (1 << 10)
+       #define OXU_COMPARATOR          0x000004000
+
+#define OXU_USBMODE                    0x1A8
+       #define OXU_VBPS                0x00000020
+       #define OXU_ES_LITTLE           0x00000000
+       #define OXU_CM_HOST_ONLY        0x00000003
+
+/*
+ * Proper EHCI structs & defines
+ */
+
+/* Magic numbers that can affect system performance */
+#define EHCI_TUNE_CERR         3       /* 0-3 qtd retries; 0 == don't stop */
+#define EHCI_TUNE_RL_HS                4       /* nak throttle; see 4.9 */
+#define EHCI_TUNE_RL_TT                0
+#define EHCI_TUNE_MULT_HS      1       /* 1-3 transactions/uframe; 4.10.3 */
+#define EHCI_TUNE_MULT_TT      1
+#define EHCI_TUNE_FLS          2       /* (small) 256 frame schedule */
+
+struct oxu_hcd;
+
+/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
+
+/* Section 2.2 Host Controller Capability Registers */
+struct ehci_caps {
+       /* these fields are specified as 8 and 16 bit registers,
+        * but some hosts can't perform 8 or 16 bit PCI accesses.
+        */
+       u32             hc_capbase;
+#define HC_LENGTH(p)           (((p)>>00)&0x00ff)      /* bits 7:0 */
+#define HC_VERSION(p)          (((p)>>16)&0xffff)      /* bits 31:16 */
+       u32             hcs_params;     /* HCSPARAMS - offset 0x4 */
+#define HCS_DEBUG_PORT(p)      (((p)>>20)&0xf) /* bits 23:20, debug port? */
+#define HCS_INDICATOR(p)       ((p)&(1 << 16)) /* true: has port indicators */
+#define HCS_N_CC(p)            (((p)>>12)&0xf) /* bits 15:12, #companion HCs */
+#define HCS_N_PCC(p)           (((p)>>8)&0xf)  /* bits 11:8, ports per CC */
+#define HCS_PORTROUTED(p)      ((p)&(1 << 7))  /* true: port routing */
+#define HCS_PPC(p)             ((p)&(1 << 4))  /* true: port power control */
+#define HCS_N_PORTS(p)         (((p)>>0)&0xf)  /* bits 3:0, ports on HC */
+
+       u32             hcc_params;      /* HCCPARAMS - offset 0x8 */
+#define HCC_EXT_CAPS(p)                (((p)>>8)&0xff) /* for pci extended caps */
+#define HCC_ISOC_CACHE(p)       ((p)&(1 << 7))  /* true: can cache isoc frame */
+#define HCC_ISOC_THRES(p)       (((p)>>4)&0x7)  /* bits 6:4, uframes cached */
+#define HCC_CANPARK(p)         ((p)&(1 << 2))  /* true: can park on async qh */
+#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1))  /* true: periodic_size changes*/
+#define HCC_64BIT_ADDR(p)       ((p)&(1))       /* true: can use 64-bit addr */
+       u8              portroute[8];    /* nibbles for routing - offset 0xC */
+} __packed;
+
+
+/* Section 2.3 Host Controller Operational Registers */
+struct ehci_regs {
+       /* USBCMD: offset 0x00 */
+       u32             command;
+/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */
+#define CMD_PARK       (1<<11)         /* enable "park" on async qh */
+#define CMD_PARK_CNT(c)        (((c)>>8)&3)    /* how many transfers to park for */
+#define CMD_LRESET     (1<<7)          /* partial reset (no ports, etc) */
+#define CMD_IAAD       (1<<6)          /* "doorbell" interrupt async advance */
+#define CMD_ASE                (1<<5)          /* async schedule enable */
+#define CMD_PSE                (1<<4)          /* periodic schedule enable */
+/* 3:2 is periodic frame list size */
+#define CMD_RESET      (1<<1)          /* reset HC not bus */
+#define CMD_RUN                (1<<0)          /* start/stop HC */
+
+       /* USBSTS: offset 0x04 */
+       u32             status;
+#define STS_ASS                (1<<15)         /* Async Schedule Status */
+#define STS_PSS                (1<<14)         /* Periodic Schedule Status */
+#define STS_RECL       (1<<13)         /* Reclamation */
+#define STS_HALT       (1<<12)         /* Not running (any reason) */
+/* some bits reserved */
+       /* these STS_* flags are also intr_enable bits (USBINTR) */
+#define STS_IAA                (1<<5)          /* Interrupted on async advance */
+#define STS_FATAL      (1<<4)          /* such as some PCI access errors */
+#define STS_FLR                (1<<3)          /* frame list rolled over */
+#define STS_PCD                (1<<2)          /* port change detect */
+#define STS_ERR                (1<<1)          /* "error" completion (overflow, ...) */
+#define STS_INT                (1<<0)          /* "normal" completion (short, ...) */
+
+#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
+
+       /* USBINTR: offset 0x08 */
+       u32             intr_enable;
+
+       /* FRINDEX: offset 0x0C */
+       u32             frame_index;    /* current microframe number */
+       /* CTRLDSSEGMENT: offset 0x10 */
+       u32             segment;        /* address bits 63:32 if needed */
+       /* PERIODICLISTBASE: offset 0x14 */
+       u32             frame_list;     /* points to periodic list */
+       /* ASYNCLISTADDR: offset 0x18 */
+       u32             async_next;     /* address of next async queue head */
+
+       u32             reserved[9];
+
+       /* CONFIGFLAG: offset 0x40 */
+       u32             configured_flag;
+#define FLAG_CF                (1<<0)          /* true: we'll support "high speed" */
+
+       /* PORTSC: offset 0x44 */
+       u32             port_status[0]; /* up to N_PORTS */
+/* 31:23 reserved */
+#define PORT_WKOC_E    (1<<22)         /* wake on overcurrent (enable) */
+#define PORT_WKDISC_E  (1<<21)         /* wake on disconnect (enable) */
+#define PORT_WKCONN_E  (1<<20)         /* wake on connect (enable) */
+/* 19:16 for port testing */
+#define PORT_LED_OFF   (0<<14)
+#define PORT_LED_AMBER (1<<14)
+#define PORT_LED_GREEN (2<<14)
+#define PORT_LED_MASK  (3<<14)
+#define PORT_OWNER     (1<<13)         /* true: companion hc owns this port */
+#define PORT_POWER     (1<<12)         /* true: has power (see PPC) */
+#define PORT_USB11(x) (((x)&(3<<10)) == (1<<10))       /* USB 1.1 device */
+/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
+/* 9 reserved */
+#define PORT_RESET     (1<<8)          /* reset port */
+#define PORT_SUSPEND   (1<<7)          /* suspend port */
+#define PORT_RESUME    (1<<6)          /* resume it */
+#define PORT_OCC       (1<<5)          /* over current change */
+#define PORT_OC                (1<<4)          /* over current active */
+#define PORT_PEC       (1<<3)          /* port enable change */
+#define PORT_PE                (1<<2)          /* port enable */
+#define PORT_CSC       (1<<1)          /* connect status change */
+#define PORT_CONNECT   (1<<0)          /* device connected */
+#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
+} __packed;
+
+/* Appendix C, Debug port ... intended for use with special "debug devices"
+ * that can help if there's no serial console.  (nonstandard enumeration.)
+ */
+struct ehci_dbg_port {
+       u32     control;
+#define DBGP_OWNER     (1<<30)
+#define DBGP_ENABLED   (1<<28)
+#define DBGP_DONE      (1<<16)
+#define DBGP_INUSE     (1<<10)
+#define DBGP_ERRCODE(x)        (((x)>>7)&0x07)
+#      define DBGP_ERR_BAD     1
+#      define DBGP_ERR_SIGNAL  2
+#define DBGP_ERROR     (1<<6)
+#define DBGP_GO                (1<<5)
+#define DBGP_OUT       (1<<4)
+#define DBGP_LEN(x)    (((x)>>0)&0x0f)
+       u32     pids;
+#define DBGP_PID_GET(x)                (((x)>>16)&0xff)
+#define DBGP_PID_SET(data, tok)        (((data)<<8)|(tok))
+       u32     data03;
+       u32     data47;
+       u32     address;
+#define DBGP_EPADDR(dev, ep)   (((dev)<<8)|(ep))
+} __packed;
+
+#define        QTD_NEXT(dma)   cpu_to_le32((u32)dma)
+
+/*
+ * EHCI Specification 0.95 Section 3.5
+ * QTD: describe data transfer components (buffer, direction, ...)
+ * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram".
+ *
+ * These are associated only with "QH" (Queue Head) structures,
+ * used with control, bulk, and interrupt transfers.
+ */
+struct ehci_qtd {
+       /* first part defined by EHCI spec */
+       __le32                  hw_next;                /* see EHCI 3.5.1 */
+       __le32                  hw_alt_next;            /* see EHCI 3.5.2 */
+       __le32                  hw_token;               /* see EHCI 3.5.3 */
+#define        QTD_TOGGLE      (1 << 31)       /* data toggle */
+#define        QTD_LENGTH(tok) (((tok)>>16) & 0x7fff)
+#define        QTD_IOC         (1 << 15)       /* interrupt on complete */
+#define        QTD_CERR(tok)   (((tok)>>10) & 0x3)
+#define        QTD_PID(tok)    (((tok)>>8) & 0x3)
+#define        QTD_STS_ACTIVE  (1 << 7)        /* HC may execute this */
+#define        QTD_STS_HALT    (1 << 6)        /* halted on error */
+#define        QTD_STS_DBE     (1 << 5)        /* data buffer error (in HC) */
+#define        QTD_STS_BABBLE  (1 << 4)        /* device was babbling (qtd halted) */
+#define        QTD_STS_XACT    (1 << 3)        /* device gave illegal response */
+#define        QTD_STS_MMF     (1 << 2)        /* incomplete split transaction */
+#define        QTD_STS_STS     (1 << 1)        /* split transaction state */
+#define        QTD_STS_PING    (1 << 0)        /* issue PING? */
+       __le32                  hw_buf[5];              /* see EHCI 3.5.4 */
+       __le32                  hw_buf_hi[5];           /* Appendix B */
+
+       /* the rest is HCD-private */
+       dma_addr_t              qtd_dma;                /* qtd address */
+       struct list_head        qtd_list;               /* sw qtd list */
+       struct urb              *urb;                   /* qtd's urb */
+       size_t                  length;                 /* length of buffer */
+
+       u32                     qtd_buffer_len;
+       void                    *buffer;
+       dma_addr_t              buffer_dma;
+       void                    *transfer_buffer;
+       void                    *transfer_dma;
+} __aligned(32);
+
+/* mask NakCnt+T in qh->hw_alt_next */
+#define QTD_MASK cpu_to_le32 (~0x1f)
+
+#define IS_SHORT_READ(token) (QTD_LENGTH(token) != 0 && QTD_PID(token) == 1)
+
+/* Type tag from {qh, itd, sitd, fstn}->hw_next */
+#define Q_NEXT_TYPE(dma) ((dma) & cpu_to_le32 (3 << 1))
+
+/* values for that type tag */
+#define Q_TYPE_QH      cpu_to_le32 (1 << 1)
+
+/* next async queue entry, or pointer to interrupt/periodic QH */
+#define        QH_NEXT(dma)    (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH)
+
+/* for periodic/async schedules and qtd lists, mark end of list */
+#define        EHCI_LIST_END   cpu_to_le32(1) /* "null pointer" to hw */
+
+/*
+ * Entries in periodic shadow table are pointers to one of four kinds
+ * of data structure.  That's dictated by the hardware; a type tag is
+ * encoded in the low bits of the hardware's periodic schedule.  Use
+ * Q_NEXT_TYPE to get the tag.
+ *
+ * For entries in the async schedule, the type tag always says "qh".
+ */
+union ehci_shadow {
+       struct ehci_qh          *qh;            /* Q_TYPE_QH */
+       __le32                  *hw_next;       /* (all types) */
+       void                    *ptr;
+};
+
+/*
+ * EHCI Specification 0.95 Section 3.6
+ * QH: describes control/bulk/interrupt endpoints
+ * See Fig 3-7 "Queue Head Structure Layout".
+ *
+ * These appear in both the async and (for interrupt) periodic schedules.
+ */
+
+struct ehci_qh {
+       /* first part defined by EHCI spec */
+       __le32                  hw_next;         /* see EHCI 3.6.1 */
+       __le32                  hw_info1;       /* see EHCI 3.6.2 */
+#define        QH_HEAD         0x00008000
+       __le32                  hw_info2;       /* see EHCI 3.6.2 */
+#define        QH_SMASK        0x000000ff
+#define        QH_CMASK        0x0000ff00
+#define        QH_HUBADDR      0x007f0000
+#define        QH_HUBPORT      0x3f800000
+#define        QH_MULT         0xc0000000
+       __le32                  hw_current;      /* qtd list - see EHCI 3.6.4 */
+
+       /* qtd overlay (hardware parts of a struct ehci_qtd) */
+       __le32                  hw_qtd_next;
+       __le32                  hw_alt_next;
+       __le32                  hw_token;
+       __le32                  hw_buf[5];
+       __le32                  hw_buf_hi[5];
+
+       /* the rest is HCD-private */
+       dma_addr_t              qh_dma;         /* address of qh */
+       union ehci_shadow       qh_next;        /* ptr to qh; or periodic */
+       struct list_head        qtd_list;       /* sw qtd list */
+       struct ehci_qtd         *dummy;
+       struct ehci_qh          *reclaim;       /* next to reclaim */
+
+       struct oxu_hcd          *oxu;
+       struct kref             kref;
+       unsigned int            stamp;
+
+       u8                      qh_state;
+#define        QH_STATE_LINKED         1               /* HC sees this */
+#define        QH_STATE_UNLINK         2               /* HC may still see this */
+#define        QH_STATE_IDLE           3               /* HC doesn't see this */
+#define        QH_STATE_UNLINK_WAIT    4               /* LINKED and on reclaim q */
+#define        QH_STATE_COMPLETING     5               /* don't touch token.HALT */
+
+       /* periodic schedule info */
+       u8                      usecs;          /* intr bandwidth */
+       u8                      gap_uf;         /* uframes split/csplit gap */
+       u8                      c_usecs;        /* ... split completion bw */
+       u16                     tt_usecs;       /* tt downstream bandwidth */
+       unsigned short          period;         /* polling interval */
+       unsigned short          start;          /* where polling starts */
+#define NO_FRAME ((unsigned short)~0)                  /* pick new start */
+       struct usb_device       *dev;           /* access to TT */
+} __aligned(32);
+
+/*
+ * Proper OXU210HP structs
+ */
+
+#define OXU_OTG_CORE_OFFSET    0x00400
+#define OXU_OTG_CAP_OFFSET     (OXU_OTG_CORE_OFFSET + 0x100)
+#define OXU_SPH_CORE_OFFSET    0x00800
+#define OXU_SPH_CAP_OFFSET     (OXU_SPH_CORE_OFFSET + 0x100)
+
+#define OXU_OTG_MEM            0xE000
+#define OXU_SPH_MEM            0x16000
+
+/* Only how many elements & element structure are specifies here. */
+/* 2 host controllers are enabled - total size <= 28 kbytes */
+#define        DEFAULT_I_TDPS          1024
+#define QHEAD_NUM              16
+#define QTD_NUM                        32
+#define SITD_NUM               8
+#define MURB_NUM               8
+
+#define BUFFER_NUM             8
+#define BUFFER_SIZE            512
+
+struct oxu_info {
+       struct usb_hcd *hcd[2];
+};
+
+struct oxu_buf {
+       u8                      buffer[BUFFER_SIZE];
+} __aligned(BUFFER_SIZE);
+
+struct oxu_onchip_mem {
+       struct oxu_buf          db_pool[BUFFER_NUM];
+
+       u32                     frame_list[DEFAULT_I_TDPS];
+       struct ehci_qh          qh_pool[QHEAD_NUM];
+       struct ehci_qtd         qtd_pool[QTD_NUM];
+} __aligned(4 << 10);
+
+#define        EHCI_MAX_ROOT_PORTS     15              /* see HCS_N_PORTS */
+
+struct oxu_murb {
+       struct urb              urb;
+       struct urb              *main;
+       u8                      last;
+};
+
+struct oxu_hcd {                               /* one per controller */
+       unsigned int            is_otg:1;
+
+       u8                      qh_used[QHEAD_NUM];
+       u8                      qtd_used[QTD_NUM];
+       u8                      db_used[BUFFER_NUM];
+       u8                      murb_used[MURB_NUM];
+
+       struct oxu_onchip_mem   __iomem *mem;
+       spinlock_t              mem_lock;
+
+       struct timer_list       urb_timer;
+
+       struct ehci_caps __iomem *caps;
+       struct ehci_regs __iomem *regs;
+
+       u32                     hcs_params;     /* cached register copy */
+       spinlock_t              lock;
+
+       /* async schedule support */
+       struct ehci_qh          *async;
+       struct ehci_qh          *reclaim;
+       unsigned int            reclaim_ready:1;
+       unsigned int            scanning:1;
+
+       /* periodic schedule support */
+       unsigned int            periodic_size;
+       __le32                  *periodic;      /* hw periodic table */
+       dma_addr_t              periodic_dma;
+       unsigned int            i_thresh;       /* uframes HC might cache */
+
+       union ehci_shadow       *pshadow;       /* mirror hw periodic table */
+       int                     next_uframe;    /* scan periodic, start here */
+       unsigned int            periodic_sched; /* periodic activity count */
+
+       /* per root hub port */
+       unsigned long           reset_done[EHCI_MAX_ROOT_PORTS];
+       /* bit vectors (one bit per port) */
+       unsigned long           bus_suspended;  /* which ports were
+                                                * already suspended at the
+                                                * start of a bus suspend
+                                                */
+       unsigned long           companion_ports;/* which ports are dedicated
+                                                * to the companion controller
+                                                */
+
+       struct timer_list       watchdog;
+       unsigned long           actions;
+       unsigned int            stamp;
+       unsigned long           next_statechange;
+       u32                     command;
+
+       /* SILICON QUIRKS */
+       struct list_head        urb_list;       /* this is the head to urb
+                                                * queue that didn't get enough
+                                                * resources
+                                                */
+       struct oxu_murb         *murb_pool;     /* murb per split big urb */
+       unsigned int            urb_len;
+
+       u8                      sbrn;           /* packed release number */
+};
+
+#define EHCI_IAA_JIFFIES       (HZ/100)        /* arbitrary; ~10 msec */
+#define EHCI_IO_JIFFIES                (HZ/10)         /* io watchdog > irq_thresh */
+#define EHCI_ASYNC_JIFFIES      (HZ/20)                /* async idle timeout */
+#define EHCI_SHRINK_JIFFIES     (HZ/200)       /* async qh unlink delay */
+
+enum ehci_timer_action {
+       TIMER_IO_WATCHDOG,
+       TIMER_IAA_WATCHDOG,
+       TIMER_ASYNC_SHRINK,
+       TIMER_ASYNC_OFF,
+};
+
 /*
  * Main defines
  */
diff --git a/drivers/usb/host/oxu210hp.h b/drivers/usb/host/oxu210hp.h
deleted file mode 100644 (file)
index 4370441..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Host interface registers
- */
-
-#define OXU_DEVICEID                   0x00
-       #define OXU_REV_MASK            0xffff0000
-       #define OXU_REV_SHIFT           16
-       #define OXU_REV_2100            0x2100
-       #define OXU_BO_SHIFT            8
-       #define OXU_BO_MASK             (0x3 << OXU_BO_SHIFT)
-       #define OXU_MAJ_REV_SHIFT       4
-       #define OXU_MAJ_REV_MASK        (0xf << OXU_MAJ_REV_SHIFT)
-       #define OXU_MIN_REV_SHIFT       0
-       #define OXU_MIN_REV_MASK        (0xf << OXU_MIN_REV_SHIFT)
-#define OXU_HOSTIFCONFIG               0x04
-#define OXU_SOFTRESET                  0x08
-       #define OXU_SRESET              (1 << 0)
-
-#define OXU_PIOBURSTREADCTRL           0x0C
-
-#define OXU_CHIPIRQSTATUS              0x10
-#define OXU_CHIPIRQEN_SET              0x14
-#define OXU_CHIPIRQEN_CLR              0x18
-       #define OXU_USBSPHLPWUI         0x00000080
-       #define OXU_USBOTGLPWUI         0x00000040
-       #define OXU_USBSPHI             0x00000002
-       #define OXU_USBOTGI             0x00000001
-
-#define OXU_CLKCTRL_SET                        0x1C
-       #define OXU_SYSCLKEN            0x00000008
-       #define OXU_USBSPHCLKEN         0x00000002
-       #define OXU_USBOTGCLKEN         0x00000001
-
-#define OXU_ASO                                0x68
-       #define OXU_SPHPOEN             0x00000100
-       #define OXU_OVRCCURPUPDEN       0x00000800
-       #define OXU_ASO_OP              (1 << 10)
-       #define OXU_COMPARATOR          0x000004000
-
-#define OXU_USBMODE                    0x1A8
-       #define OXU_VBPS                0x00000020
-       #define OXU_ES_LITTLE           0x00000000
-       #define OXU_CM_HOST_ONLY        0x00000003
-
-/*
- * Proper EHCI structs & defines
- */
-
-/* Magic numbers that can affect system performance */
-#define EHCI_TUNE_CERR         3       /* 0-3 qtd retries; 0 == don't stop */
-#define EHCI_TUNE_RL_HS                4       /* nak throttle; see 4.9 */
-#define EHCI_TUNE_RL_TT                0
-#define EHCI_TUNE_MULT_HS      1       /* 1-3 transactions/uframe; 4.10.3 */
-#define EHCI_TUNE_MULT_TT      1
-#define EHCI_TUNE_FLS          2       /* (small) 256 frame schedule */
-
-struct oxu_hcd;
-
-/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
-
-/* Section 2.2 Host Controller Capability Registers */
-struct ehci_caps {
-       /* these fields are specified as 8 and 16 bit registers,
-        * but some hosts can't perform 8 or 16 bit PCI accesses.
-        */
-       u32             hc_capbase;
-#define HC_LENGTH(p)           (((p)>>00)&0x00ff)      /* bits 7:0 */
-#define HC_VERSION(p)          (((p)>>16)&0xffff)      /* bits 31:16 */
-       u32             hcs_params;     /* HCSPARAMS - offset 0x4 */
-#define HCS_DEBUG_PORT(p)      (((p)>>20)&0xf) /* bits 23:20, debug port? */
-#define HCS_INDICATOR(p)       ((p)&(1 << 16)) /* true: has port indicators */
-#define HCS_N_CC(p)            (((p)>>12)&0xf) /* bits 15:12, #companion HCs */
-#define HCS_N_PCC(p)           (((p)>>8)&0xf)  /* bits 11:8, ports per CC */
-#define HCS_PORTROUTED(p)      ((p)&(1 << 7))  /* true: port routing */
-#define HCS_PPC(p)             ((p)&(1 << 4))  /* true: port power control */
-#define HCS_N_PORTS(p)         (((p)>>0)&0xf)  /* bits 3:0, ports on HC */
-
-       u32             hcc_params;      /* HCCPARAMS - offset 0x8 */
-#define HCC_EXT_CAPS(p)                (((p)>>8)&0xff) /* for pci extended caps */
-#define HCC_ISOC_CACHE(p)       ((p)&(1 << 7))  /* true: can cache isoc frame */
-#define HCC_ISOC_THRES(p)       (((p)>>4)&0x7)  /* bits 6:4, uframes cached */
-#define HCC_CANPARK(p)         ((p)&(1 << 2))  /* true: can park on async qh */
-#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1))  /* true: periodic_size changes*/
-#define HCC_64BIT_ADDR(p)       ((p)&(1))       /* true: can use 64-bit addr */
-       u8              portroute[8];    /* nibbles for routing - offset 0xC */
-} __attribute__ ((packed));
-
-
-/* Section 2.3 Host Controller Operational Registers */
-struct ehci_regs {
-       /* USBCMD: offset 0x00 */
-       u32             command;
-/* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */
-#define CMD_PARK       (1<<11)         /* enable "park" on async qh */
-#define CMD_PARK_CNT(c)        (((c)>>8)&3)    /* how many transfers to park for */
-#define CMD_LRESET     (1<<7)          /* partial reset (no ports, etc) */
-#define CMD_IAAD       (1<<6)          /* "doorbell" interrupt async advance */
-#define CMD_ASE                (1<<5)          /* async schedule enable */
-#define CMD_PSE                (1<<4)          /* periodic schedule enable */
-/* 3:2 is periodic frame list size */
-#define CMD_RESET      (1<<1)          /* reset HC not bus */
-#define CMD_RUN                (1<<0)          /* start/stop HC */
-
-       /* USBSTS: offset 0x04 */
-       u32             status;
-#define STS_ASS                (1<<15)         /* Async Schedule Status */
-#define STS_PSS                (1<<14)         /* Periodic Schedule Status */
-#define STS_RECL       (1<<13)         /* Reclamation */
-#define STS_HALT       (1<<12)         /* Not running (any reason) */
-/* some bits reserved */
-       /* these STS_* flags are also intr_enable bits (USBINTR) */
-#define STS_IAA                (1<<5)          /* Interrupted on async advance */
-#define STS_FATAL      (1<<4)          /* such as some PCI access errors */
-#define STS_FLR                (1<<3)          /* frame list rolled over */
-#define STS_PCD                (1<<2)          /* port change detect */
-#define STS_ERR                (1<<1)          /* "error" completion (overflow, ...) */
-#define STS_INT                (1<<0)          /* "normal" completion (short, ...) */
-
-#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
-
-       /* USBINTR: offset 0x08 */
-       u32             intr_enable;
-
-       /* FRINDEX: offset 0x0C */
-       u32             frame_index;    /* current microframe number */
-       /* CTRLDSSEGMENT: offset 0x10 */
-       u32             segment;        /* address bits 63:32 if needed */
-       /* PERIODICLISTBASE: offset 0x14 */
-       u32             frame_list;     /* points to periodic list */
-       /* ASYNCLISTADDR: offset 0x18 */
-       u32             async_next;     /* address of next async queue head */
-
-       u32             reserved[9];
-
-       /* CONFIGFLAG: offset 0x40 */
-       u32             configured_flag;
-#define FLAG_CF                (1<<0)          /* true: we'll support "high speed" */
-
-       /* PORTSC: offset 0x44 */
-       u32             port_status[0]; /* up to N_PORTS */
-/* 31:23 reserved */
-#define PORT_WKOC_E    (1<<22)         /* wake on overcurrent (enable) */
-#define PORT_WKDISC_E  (1<<21)         /* wake on disconnect (enable) */
-#define PORT_WKCONN_E  (1<<20)         /* wake on connect (enable) */
-/* 19:16 for port testing */
-#define PORT_LED_OFF   (0<<14)
-#define PORT_LED_AMBER (1<<14)
-#define PORT_LED_GREEN (2<<14)
-#define PORT_LED_MASK  (3<<14)
-#define PORT_OWNER     (1<<13)         /* true: companion hc owns this port */
-#define PORT_POWER     (1<<12)         /* true: has power (see PPC) */
-#define PORT_USB11(x) (((x)&(3<<10)) == (1<<10))       /* USB 1.1 device */
-/* 11:10 for detecting lowspeed devices (reset vs release ownership) */
-/* 9 reserved */
-#define PORT_RESET     (1<<8)          /* reset port */
-#define PORT_SUSPEND   (1<<7)          /* suspend port */
-#define PORT_RESUME    (1<<6)          /* resume it */
-#define PORT_OCC       (1<<5)          /* over current change */
-#define PORT_OC                (1<<4)          /* over current active */
-#define PORT_PEC       (1<<3)          /* port enable change */
-#define PORT_PE                (1<<2)          /* port enable */
-#define PORT_CSC       (1<<1)          /* connect status change */
-#define PORT_CONNECT   (1<<0)          /* device connected */
-#define PORT_RWC_BITS   (PORT_CSC | PORT_PEC | PORT_OCC)
-} __attribute__ ((packed));
-
-/* Appendix C, Debug port ... intended for use with special "debug devices"
- * that can help if there's no serial console.  (nonstandard enumeration.)
- */
-struct ehci_dbg_port {
-       u32     control;
-#define DBGP_OWNER     (1<<30)
-#define DBGP_ENABLED   (1<<28)
-#define DBGP_DONE      (1<<16)
-#define DBGP_INUSE     (1<<10)
-#define DBGP_ERRCODE(x)        (((x)>>7)&0x07)
-#      define DBGP_ERR_BAD     1
-#      define DBGP_ERR_SIGNAL  2
-#define DBGP_ERROR     (1<<6)
-#define DBGP_GO                (1<<5)
-#define DBGP_OUT       (1<<4)
-#define DBGP_LEN(x)    (((x)>>0)&0x0f)
-       u32     pids;
-#define DBGP_PID_GET(x)                (((x)>>16)&0xff)
-#define DBGP_PID_SET(data, tok)        (((data)<<8)|(tok))
-       u32     data03;
-       u32     data47;
-       u32     address;
-#define DBGP_EPADDR(dev, ep)   (((dev)<<8)|(ep))
-} __attribute__ ((packed));
-
-
-#define        QTD_NEXT(dma)   cpu_to_le32((u32)dma)
-
-/*
- * EHCI Specification 0.95 Section 3.5
- * QTD: describe data transfer components (buffer, direction, ...)
- * See Fig 3-6 "Queue Element Transfer Descriptor Block Diagram".
- *
- * These are associated only with "QH" (Queue Head) structures,
- * used with control, bulk, and interrupt transfers.
- */
-struct ehci_qtd {
-       /* first part defined by EHCI spec */
-       __le32                  hw_next;                /* see EHCI 3.5.1 */
-       __le32                  hw_alt_next;            /* see EHCI 3.5.2 */
-       __le32                  hw_token;               /* see EHCI 3.5.3 */
-#define        QTD_TOGGLE      (1 << 31)       /* data toggle */
-#define        QTD_LENGTH(tok) (((tok)>>16) & 0x7fff)
-#define        QTD_IOC         (1 << 15)       /* interrupt on complete */
-#define        QTD_CERR(tok)   (((tok)>>10) & 0x3)
-#define        QTD_PID(tok)    (((tok)>>8) & 0x3)
-#define        QTD_STS_ACTIVE  (1 << 7)        /* HC may execute this */
-#define        QTD_STS_HALT    (1 << 6)        /* halted on error */
-#define        QTD_STS_DBE     (1 << 5)        /* data buffer error (in HC) */
-#define        QTD_STS_BABBLE  (1 << 4)        /* device was babbling (qtd halted) */
-#define        QTD_STS_XACT    (1 << 3)        /* device gave illegal response */
-#define        QTD_STS_MMF     (1 << 2)        /* incomplete split transaction */
-#define        QTD_STS_STS     (1 << 1)        /* split transaction state */
-#define        QTD_STS_PING    (1 << 0)        /* issue PING? */
-       __le32                  hw_buf[5];              /* see EHCI 3.5.4 */
-       __le32                  hw_buf_hi[5];           /* Appendix B */
-
-       /* the rest is HCD-private */
-       dma_addr_t              qtd_dma;                /* qtd address */
-       struct list_head        qtd_list;               /* sw qtd list */
-       struct urb              *urb;                   /* qtd's urb */
-       size_t                  length;                 /* length of buffer */
-
-       u32                     qtd_buffer_len;
-       void                    *buffer;
-       dma_addr_t              buffer_dma;
-       void                    *transfer_buffer;
-       void                    *transfer_dma;
-} __attribute__ ((aligned(32)));
-
-/* mask NakCnt+T in qh->hw_alt_next */
-#define QTD_MASK cpu_to_le32 (~0x1f)
-
-#define IS_SHORT_READ(token) (QTD_LENGTH(token) != 0 && QTD_PID(token) == 1)
-
-/* Type tag from {qh, itd, sitd, fstn}->hw_next */
-#define Q_NEXT_TYPE(dma) ((dma) & cpu_to_le32 (3 << 1))
-
-/* values for that type tag */
-#define Q_TYPE_QH      cpu_to_le32 (1 << 1)
-
-/* next async queue entry, or pointer to interrupt/periodic QH */
-#define        QH_NEXT(dma)    (cpu_to_le32(((u32)dma)&~0x01f)|Q_TYPE_QH)
-
-/* for periodic/async schedules and qtd lists, mark end of list */
-#define        EHCI_LIST_END   cpu_to_le32(1) /* "null pointer" to hw */
-
-/*
- * Entries in periodic shadow table are pointers to one of four kinds
- * of data structure.  That's dictated by the hardware; a type tag is
- * encoded in the low bits of the hardware's periodic schedule.  Use
- * Q_NEXT_TYPE to get the tag.
- *
- * For entries in the async schedule, the type tag always says "qh".
- */
-union ehci_shadow {
-       struct ehci_qh          *qh;            /* Q_TYPE_QH */
-       __le32                  *hw_next;       /* (all types) */
-       void                    *ptr;
-};
-
-/*
- * EHCI Specification 0.95 Section 3.6
- * QH: describes control/bulk/interrupt endpoints
- * See Fig 3-7 "Queue Head Structure Layout".
- *
- * These appear in both the async and (for interrupt) periodic schedules.
- */
-
-struct ehci_qh {
-       /* first part defined by EHCI spec */
-       __le32                  hw_next;         /* see EHCI 3.6.1 */
-       __le32                  hw_info1;       /* see EHCI 3.6.2 */
-#define        QH_HEAD         0x00008000
-       __le32                  hw_info2;       /* see EHCI 3.6.2 */
-#define        QH_SMASK        0x000000ff
-#define        QH_CMASK        0x0000ff00
-#define        QH_HUBADDR      0x007f0000
-#define        QH_HUBPORT      0x3f800000
-#define        QH_MULT         0xc0000000
-       __le32                  hw_current;      /* qtd list - see EHCI 3.6.4 */
-
-       /* qtd overlay (hardware parts of a struct ehci_qtd) */
-       __le32                  hw_qtd_next;
-       __le32                  hw_alt_next;
-       __le32                  hw_token;
-       __le32                  hw_buf[5];
-       __le32                  hw_buf_hi[5];
-
-       /* the rest is HCD-private */
-       dma_addr_t              qh_dma;         /* address of qh */
-       union ehci_shadow       qh_next;        /* ptr to qh; or periodic */
-       struct list_head        qtd_list;       /* sw qtd list */
-       struct ehci_qtd         *dummy;
-       struct ehci_qh          *reclaim;       /* next to reclaim */
-
-       struct oxu_hcd          *oxu;
-       struct kref             kref;
-       unsigned                stamp;
-
-       u8                      qh_state;
-#define        QH_STATE_LINKED         1               /* HC sees this */
-#define        QH_STATE_UNLINK         2               /* HC may still see this */
-#define        QH_STATE_IDLE           3               /* HC doesn't see this */
-#define        QH_STATE_UNLINK_WAIT    4               /* LINKED and on reclaim q */
-#define        QH_STATE_COMPLETING     5               /* don't touch token.HALT */
-
-       /* periodic schedule info */
-       u8                      usecs;          /* intr bandwidth */
-       u8                      gap_uf;         /* uframes split/csplit gap */
-       u8                      c_usecs;        /* ... split completion bw */
-       u16                     tt_usecs;       /* tt downstream bandwidth */
-       unsigned short          period;         /* polling interval */
-       unsigned short          start;          /* where polling starts */
-#define NO_FRAME ((unsigned short)~0)                  /* pick new start */
-       struct usb_device       *dev;           /* access to TT */
-} __attribute__ ((aligned(32)));
-
-/*
- * Proper OXU210HP structs
- */
-
-#define OXU_OTG_CORE_OFFSET    0x00400
-#define OXU_OTG_CAP_OFFSET     (OXU_OTG_CORE_OFFSET + 0x100)
-#define OXU_SPH_CORE_OFFSET    0x00800
-#define OXU_SPH_CAP_OFFSET     (OXU_SPH_CORE_OFFSET + 0x100)
-
-#define OXU_OTG_MEM            0xE000
-#define OXU_SPH_MEM            0x16000
-
-/* Only how many elements & element structure are specifies here. */
-/* 2 host controllers are enabled - total size <= 28 kbytes */
-#define        DEFAULT_I_TDPS          1024
-#define QHEAD_NUM              16
-#define QTD_NUM                        32
-#define SITD_NUM               8
-#define MURB_NUM               8
-
-#define BUFFER_NUM             8
-#define BUFFER_SIZE            512
-
-struct oxu_info {
-       struct usb_hcd *hcd[2];
-};
-
-struct oxu_buf {
-       u8                      buffer[BUFFER_SIZE];
-} __attribute__ ((aligned(BUFFER_SIZE)));
-
-struct oxu_onchip_mem {
-       struct oxu_buf          db_pool[BUFFER_NUM];
-
-       u32                     frame_list[DEFAULT_I_TDPS];
-       struct ehci_qh          qh_pool[QHEAD_NUM];
-       struct ehci_qtd         qtd_pool[QTD_NUM];
-} __attribute__ ((aligned(4 << 10)));
-
-#define        EHCI_MAX_ROOT_PORTS     15              /* see HCS_N_PORTS */
-
-struct oxu_murb {
-       struct urb              urb;
-       struct urb              *main;
-       u8                      last;
-};
-
-struct oxu_hcd {                               /* one per controller */
-       unsigned int            is_otg:1;
-
-       u8                      qh_used[QHEAD_NUM];
-       u8                      qtd_used[QTD_NUM];
-       u8                      db_used[BUFFER_NUM];
-       u8                      murb_used[MURB_NUM];
-
-       struct oxu_onchip_mem   __iomem *mem;
-       spinlock_t              mem_lock;
-
-       struct timer_list       urb_timer;
-
-       struct ehci_caps __iomem *caps;
-       struct ehci_regs __iomem *regs;
-
-       __u32                   hcs_params;     /* cached register copy */
-       spinlock_t              lock;
-
-       /* async schedule support */
-       struct ehci_qh          *async;
-       struct ehci_qh          *reclaim;
-       unsigned                reclaim_ready:1;
-       unsigned                scanning:1;
-
-       /* periodic schedule support */
-       unsigned                periodic_size;
-       __le32                  *periodic;      /* hw periodic table */
-       dma_addr_t              periodic_dma;
-       unsigned                i_thresh;       /* uframes HC might cache */
-
-       union ehci_shadow       *pshadow;       /* mirror hw periodic table */
-       int                     next_uframe;    /* scan periodic, start here */
-       unsigned                periodic_sched; /* periodic activity count */
-
-       /* per root hub port */
-       unsigned long           reset_done[EHCI_MAX_ROOT_PORTS];
-       /* bit vectors (one bit per port) */
-       unsigned long           bus_suspended;  /* which ports were
-                                                * already suspended at the
-                                                * start of a bus suspend
-                                                */
-       unsigned long           companion_ports;/* which ports are dedicated
-                                                * to the companion controller
-                                                */
-
-       struct timer_list       watchdog;
-       unsigned long           actions;
-       unsigned                stamp;
-       unsigned long           next_statechange;
-       u32                     command;
-
-       /* SILICON QUIRKS */
-       struct list_head        urb_list;       /* this is the head to urb
-                                                * queue that didn't get enough
-                                                * resources
-                                                */
-       struct oxu_murb         *murb_pool;     /* murb per split big urb */
-       unsigned urb_len;
-
-       u8                      sbrn;           /* packed release number */
-};
-
-#define EHCI_IAA_JIFFIES       (HZ/100)        /* arbitrary; ~10 msec */
-#define EHCI_IO_JIFFIES                (HZ/10)         /* io watchdog > irq_thresh */
-#define EHCI_ASYNC_JIFFIES      (HZ/20)                /* async idle timeout */
-#define EHCI_SHRINK_JIFFIES     (HZ/200)       /* async qh unlink delay */
-
-enum ehci_timer_action {
-       TIMER_IO_WATCHDOG,
-       TIMER_IAA_WATCHDOG,
-       TIMER_ASYNC_SHRINK,
-       TIMER_ASYNC_OFF,
-};
-
-#include <linux/oxu210hp.h>
index 52e32644a4b2fb4ea25a8d7270d883726ced2b94..93e2cca5262d16ffbdc7c96586cff3d1eb397924 100644 (file)
@@ -22,7 +22,6 @@ dbc_dma_alloc_coherent(struct xhci_hcd *xhci, size_t size,
 
        vaddr = dma_alloc_coherent(xhci_to_hcd(xhci)->self.sysdev,
                                   size, dma_handle, flags);
-       memset(vaddr, 0, size);
        return vaddr;
 }
 
index 3abe70ff1b1e2afe3eac1cab587f6c34fae45f27..b7d23c4387569e290a7482389169aa932312be7f 100644 (file)
@@ -1149,7 +1149,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                        }
                        port_li = readl(ports[wIndex]->addr + PORTLI);
                        status = xhci_get_ext_port_status(temp, port_li);
-                       put_unaligned_le32(cpu_to_le32(status), &buf[4]);
+                       put_unaligned_le32(status, &buf[4]);
                }
                break;
        case SetPortFeature:
index cf5e1796217987fcd482600047aadc240a9f0384..e16eda6e2b8b22b768387a5c0c2a5091c4573059 100644 (file)
@@ -2399,7 +2399,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
                        flags);
        if (!xhci->dcbaa)
                goto fail;
-       memset(xhci->dcbaa, 0, sizeof *(xhci->dcbaa));
        xhci->dcbaa->dma = dma;
        xhci_dbg_trace(xhci, trace_xhci_dbg_init,
                        "// Device context base array address = 0x%llx (DMA), %p (virt)",
index 998241f5fce36ce656e5f9de26d1fcf7294d5fd5..a1e5ce484bf88ff1b04ee6ff08f976d3f16cc6dd 100644 (file)
@@ -307,7 +307,6 @@ static int xhci_plat_probe(struct platform_device *pdev)
                ret = usb_phy_init(hcd->usb_phy);
                if (ret)
                        goto put_usb3_hcd;
-               hcd->skip_phy_initialization = 1;
        }
 
        hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node);
index 9d780b77314b2df52109dfc5783533fcfc368ec6..14faec51d7a5d7041b4d72b9d5da91b0c8d10f51 100644 (file)
@@ -183,6 +183,7 @@ static ssize_t port0_show(struct device *dev,
 {
        return read_port(dev, attr, buf, 0, CYPRESS_READ_PORT_ID0);
 }
+static DEVICE_ATTR_RW(port0);
 
 /* attribute callback handler (read) */
 static ssize_t port1_show(struct device *dev,
@@ -190,11 +191,14 @@ static ssize_t port1_show(struct device *dev,
 {
        return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1);
 }
-
-static DEVICE_ATTR_RW(port0);
-
 static DEVICE_ATTR_RW(port1);
 
+static struct attribute *cypress_attrs[] = {
+       &dev_attr_port0.attr,
+       &dev_attr_port1.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(cypress);
 
 static int cypress_probe(struct usb_interface *interface,
                         const struct usb_device_id *id)
@@ -212,26 +216,11 @@ static int cypress_probe(struct usb_interface *interface,
        /* save our data pointer in this interface device */
        usb_set_intfdata(interface, dev);
 
-       /* create device attribute files */
-       retval = device_create_file(&interface->dev, &dev_attr_port0);
-       if (retval)
-               goto error;
-       retval = device_create_file(&interface->dev, &dev_attr_port1);
-       if (retval)
-               goto error;
-
        /* let the user know that the device is now attached */
        dev_info(&interface->dev,
                 "Cypress CY7C63xxx device now attached\n");
        return 0;
 
-error:
-       device_remove_file(&interface->dev, &dev_attr_port0);
-       device_remove_file(&interface->dev, &dev_attr_port1);
-       usb_set_intfdata(interface, NULL);
-       usb_put_dev(dev->udev);
-       kfree(dev);
-
 error_mem:
        return retval;
 }
@@ -242,9 +231,6 @@ static void cypress_disconnect(struct usb_interface *interface)
 
        dev = usb_get_intfdata(interface);
 
-       /* remove device attribute files */
-       device_remove_file(&interface->dev, &dev_attr_port0);
-       device_remove_file(&interface->dev, &dev_attr_port1);
        /* the intfdata can be set to NULL only after the
         * device files have been removed */
        usb_set_intfdata(interface, NULL);
@@ -262,6 +248,7 @@ static struct usb_driver cypress_driver = {
        .probe = cypress_probe,
        .disconnect = cypress_disconnect,
        .id_table = cypress_table,
+       .dev_groups = cypress_groups,
 };
 
 module_usb_driver(cypress_driver);
index 8b15ab5e1450a30b1f74b67a4761c2022af0fa9b..3e3802aaefa3bbe2dd1ee1e06e0b53caad61d268 100644 (file)
@@ -36,20 +36,6 @@ struct usb_cytherm {
 };
 
 
-/* local function prototypes */
-static int cytherm_probe(struct usb_interface *interface, 
-                        const struct usb_device_id *id);
-static void cytherm_disconnect(struct usb_interface *interface);
-
-
-/* usb specific object needed to register this driver with the usb subsystem */
-static struct usb_driver cytherm_driver = {
-       .name =         "cytherm",
-       .probe =        cytherm_probe,
-       .disconnect =   cytherm_disconnect,
-       .id_table =     id_table,
-};
-
 /* Vendor requests */
 /* They all operate on one byte at a time */
 #define PING       0x00
@@ -304,6 +290,15 @@ static ssize_t port1_store(struct device *dev, struct device_attribute *attr, co
 }
 static DEVICE_ATTR_RW(port1);
 
+static struct attribute *cytherm_attrs[] = {
+       &dev_attr_brightness.attr,
+       &dev_attr_temp.attr,
+       &dev_attr_button.attr,
+       &dev_attr_port0.attr,
+       &dev_attr_port1.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(cytherm);
 
 static int cytherm_probe(struct usb_interface *interface, 
                         const struct usb_device_id *id)
@@ -322,34 +317,10 @@ static int cytherm_probe(struct usb_interface *interface,
 
        dev->brightness = 0xFF;
 
-       retval = device_create_file(&interface->dev, &dev_attr_brightness);
-       if (retval)
-               goto error;
-       retval = device_create_file(&interface->dev, &dev_attr_temp);
-       if (retval)
-               goto error;
-       retval = device_create_file(&interface->dev, &dev_attr_button);
-       if (retval)
-               goto error;
-       retval = device_create_file(&interface->dev, &dev_attr_port0);
-       if (retval)
-               goto error;
-       retval = device_create_file(&interface->dev, &dev_attr_port1);
-       if (retval)
-               goto error;
-
        dev_info (&interface->dev,
                  "Cypress thermometer device now attached\n");
        return 0;
-error:
-       device_remove_file(&interface->dev, &dev_attr_brightness);
-       device_remove_file(&interface->dev, &dev_attr_temp);
-       device_remove_file(&interface->dev, &dev_attr_button);
-       device_remove_file(&interface->dev, &dev_attr_port0);
-       device_remove_file(&interface->dev, &dev_attr_port1);
-       usb_set_intfdata (interface, NULL);
-       usb_put_dev(dev->udev);
-       kfree(dev);
+
 error_mem:
        return retval;
 }
@@ -360,12 +331,6 @@ static void cytherm_disconnect(struct usb_interface *interface)
 
        dev = usb_get_intfdata (interface);
 
-       device_remove_file(&interface->dev, &dev_attr_brightness);
-       device_remove_file(&interface->dev, &dev_attr_temp);
-       device_remove_file(&interface->dev, &dev_attr_button);
-       device_remove_file(&interface->dev, &dev_attr_port0);
-       device_remove_file(&interface->dev, &dev_attr_port1);
-
        /* first remove the files, then NULL the pointer */
        usb_set_intfdata (interface, NULL);
 
@@ -376,6 +341,15 @@ static void cytherm_disconnect(struct usb_interface *interface)
        dev_info(&interface->dev, "Cypress thermometer now disconnected\n");
 }
 
+/* usb specific object needed to register this driver with the usb subsystem */
+static struct usb_driver cytherm_driver = {
+       .name =         "cytherm",
+       .probe =        cytherm_probe,
+       .disconnect =   cytherm_disconnect,
+       .id_table =     id_table,
+       .dev_groups =   cytherm_groups,
+};
+
 module_usb_driver(cytherm_driver);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
index e5c03c6d16e9eb260fb99b81d2f6b663ed97c8fb..407fe7570f3bc228e27548cd1bfc9c78b82cde0b 100644 (file)
@@ -310,7 +310,7 @@ static ssize_t enable_compliance_store(struct device *dev,
 }
 static DEVICE_ATTR_WO(enable_compliance);
 
-static struct attribute *lvs_attributes[] = {
+static struct attribute *lvs_attrs[] = {
        &dev_attr_get_dev_desc.attr,
        &dev_attr_u1_timeout.attr,
        &dev_attr_u2_timeout.attr,
@@ -321,10 +321,7 @@ static struct attribute *lvs_attributes[] = {
        &dev_attr_enable_compliance.attr,
        NULL
 };
-
-static const struct attribute_group lvs_attr_group = {
-       .attrs = lvs_attributes,
-};
+ATTRIBUTE_GROUPS(lvs);
 
 static void lvs_rh_work(struct work_struct *work)
 {
@@ -439,12 +436,6 @@ static int lvs_rh_probe(struct usb_interface *intf,
 
        INIT_WORK(&lvs->rh_work, lvs_rh_work);
 
-       ret = sysfs_create_group(&intf->dev.kobj, &lvs_attr_group);
-       if (ret < 0) {
-               dev_err(&intf->dev, "Failed to create sysfs node %d\n", ret);
-               goto free_urb;
-       }
-
        pipe = usb_rcvintpipe(hdev, endpoint->bEndpointAddress);
        maxp = usb_maxpacket(hdev, pipe, usb_pipeout(pipe));
        usb_fill_int_urb(lvs->urb, hdev, pipe, &lvs->buffer[0], maxp,
@@ -453,13 +444,11 @@ static int lvs_rh_probe(struct usb_interface *intf,
        ret = usb_submit_urb(lvs->urb, GFP_KERNEL);
        if (ret < 0) {
                dev_err(&intf->dev, "couldn't submit lvs urb %d\n", ret);
-               goto sysfs_remove;
+               goto free_urb;
        }
 
        return ret;
 
-sysfs_remove:
-       sysfs_remove_group(&intf->dev.kobj, &lvs_attr_group);
 free_urb:
        usb_free_urb(lvs->urb);
        return ret;
@@ -469,7 +458,6 @@ static void lvs_rh_disconnect(struct usb_interface *intf)
 {
        struct lvs_rh *lvs = usb_get_intfdata(intf);
 
-       sysfs_remove_group(&intf->dev.kobj, &lvs_attr_group);
        usb_poison_urb(lvs->urb); /* used in scheduled work */
        flush_work(&lvs->rh_work);
        usb_free_urb(lvs->urb);
@@ -479,6 +467,7 @@ static struct usb_driver lvs_driver = {
        .name =         "lvs",
        .probe =        lvs_rh_probe,
        .disconnect =   lvs_rh_disconnect,
+       .dev_groups =   lvs_groups,
 };
 
 module_usb_driver(lvs_driver);
index ac357ce2d1a66cb228847f464c07cf2f65b0ed5d..a3dfc77578ea1200129d69e693740900b8721109 100644 (file)
@@ -71,9 +71,14 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
        }
        return count;
 }
-
 static DEVICE_ATTR_RW(speed);
 
+static struct attribute *tv_attrs[] = {
+       &dev_attr_speed.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(tv);
+
 static int tv_probe(struct usb_interface *interface,
                    const struct usb_device_id *id)
 {
@@ -89,15 +94,9 @@ static int tv_probe(struct usb_interface *interface,
 
        dev->udev = usb_get_dev(udev);
        usb_set_intfdata(interface, dev);
-       retval = device_create_file(&interface->dev, &dev_attr_speed);
-       if (retval)
-               goto error_create_file;
 
        return 0;
 
-error_create_file:
-       usb_put_dev(udev);
-       usb_set_intfdata(interface, NULL);
 error:
        kfree(dev);
        return retval;
@@ -108,7 +107,6 @@ static void tv_disconnect(struct usb_interface *interface)
        struct trancevibrator *dev;
 
        dev = usb_get_intfdata (interface);
-       device_remove_file(&interface->dev, &dev_attr_speed);
        usb_set_intfdata(interface, NULL);
        usb_put_dev(dev->udev);
        kfree(dev);
@@ -120,6 +118,7 @@ static struct usb_driver tv_driver = {
        .probe =        tv_probe,
        .disconnect =   tv_disconnect,
        .id_table =     id_table,
+       .dev_groups =   tv_groups,
 };
 
 module_usb_driver(tv_driver);
index 1923d5b6d9c9b852062f03cc939514c23122f6fb..551074f5b7ad958dda5dfdaaf2bcf9488d3e6d1f 100644 (file)
@@ -316,7 +316,7 @@ MYDEV_ATTR_SIMPLE_UNSIGNED(powered, update_display_powered);
 MYDEV_ATTR_SIMPLE_UNSIGNED(mode_msb, update_display_mode);
 MYDEV_ATTR_SIMPLE_UNSIGNED(mode_lsb, update_display_mode);
 
-static struct attribute *dev_attrs[] = {
+static struct attribute *sevseg_attrs[] = {
        &dev_attr_powered.attr,
        &dev_attr_text.attr,
        &dev_attr_textmode.attr,
@@ -325,10 +325,7 @@ static struct attribute *dev_attrs[] = {
        &dev_attr_mode_lsb.attr,
        NULL
 };
-
-static const struct attribute_group dev_attr_grp = {
-       .attrs = dev_attrs,
-};
+ATTRIBUTE_GROUPS(sevseg);
 
 static int sevseg_probe(struct usb_interface *interface,
        const struct usb_device_id *id)
@@ -354,17 +351,9 @@ static int sevseg_probe(struct usb_interface *interface,
        mydev->mode_msb = 0x06; /* 6 characters */
        mydev->mode_lsb = 0x3f; /* scanmode for 6 chars */
 
-       rc = sysfs_create_group(&interface->dev.kobj, &dev_attr_grp);
-       if (rc)
-               goto error;
-
        dev_info(&interface->dev, "USB 7 Segment device now attached\n");
        return 0;
 
-error:
-       usb_set_intfdata(interface, NULL);
-       usb_put_dev(mydev->udev);
-       kfree(mydev);
 error_mem:
        return rc;
 }
@@ -374,7 +363,6 @@ static void sevseg_disconnect(struct usb_interface *interface)
        struct usb_sevsegdev *mydev;
 
        mydev = usb_get_intfdata(interface);
-       sysfs_remove_group(&interface->dev.kobj, &dev_attr_grp);
        usb_set_intfdata(interface, NULL);
        usb_put_dev(mydev->udev);
        kfree(mydev);
@@ -423,6 +411,7 @@ static struct usb_driver sevseg_driver = {
        .resume =       sevseg_resume,
        .reset_resume = sevseg_reset_resume,
        .id_table =     id_table,
+       .dev_groups =   sevseg_groups,
        .supports_autosuspend = 1,
 };
 
index f8bd1d57e79515b334fd9a84e706fa21178e667d..c3d5c1206eec808bb96d54ef5cc713219c39c93e 100644 (file)
@@ -835,10 +835,8 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
                return -ENOMEM;
 
        mtu->irq = platform_get_irq(pdev, 0);
-       if (mtu->irq < 0) {
-               dev_err(dev, "fail to get irq number\n");
+       if (mtu->irq < 0)
                return mtu->irq;
-       }
        dev_info(dev, "irq %d\n", mtu->irq);
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac");
index 9f5a4819a744b8fac33cd7fec540fc8275c81247..bd63450af76a95d1cb2bd069acf8d2ae41b5c6e6 100644 (file)
@@ -1721,7 +1721,7 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct musb *musb = dev_to_musb(dev);
        unsigned long flags;
-       int ret = -EINVAL;
+       int ret;
 
        spin_lock_irqsave(&musb->lock, flags);
        ret = sprintf(buf, "%s\n", usb_otg_state_string(musb->xceiv->otg->state));
@@ -1829,16 +1829,13 @@ static ssize_t srp_store(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR_WO(srp);
 
-static struct attribute *musb_attributes[] = {
+static struct attribute *musb_attrs[] = {
        &dev_attr_mode.attr,
        &dev_attr_vbus.attr,
        &dev_attr_srp.attr,
        NULL
 };
-
-static const struct attribute_group musb_attr_group = {
-       .attrs = musb_attributes,
-};
+ATTRIBUTE_GROUPS(musb);
 
 #define MUSB_QUIRK_B_INVALID_VBUS_91   (MUSB_DEVCTL_BDEVICE | \
                                         (2 << MUSB_DEVCTL_VBUS_SHIFT) | \
@@ -2038,10 +2035,6 @@ static void musb_free(struct musb *musb)
         * cleanup after everything's been de-activated.
         */
 
-#ifdef CONFIG_SYSFS
-       sysfs_remove_group(&musb->controller->kobj, &musb_attr_group);
-#endif
-
        if (musb->nIrq >= 0) {
                if (musb->irq_wake)
                        disable_irq_wake(musb->nIrq);
@@ -2390,22 +2383,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
 
        musb_init_debugfs(musb);
 
-       status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group);
-       if (status)
-               goto fail5;
-
        musb->is_initialized = 1;
        pm_runtime_mark_last_busy(musb->controller);
        pm_runtime_put_autosuspend(musb->controller);
 
        return 0;
 
-fail5:
-       musb_exit_debugfs(musb);
-
-       musb_gadget_cleanup(musb);
-       musb_host_cleanup(musb);
-
 fail3:
        cancel_delayed_work_sync(&musb->irq_work);
        cancel_delayed_work_sync(&musb->finish_resume_work);
@@ -2798,6 +2781,7 @@ static struct platform_driver musb_driver = {
                .name           = (char *)musb_driver_name,
                .bus            = &platform_bus_type,
                .pm             = MUSB_DEV_PM_OPS,
+               .dev_groups     = musb_groups,
        },
        .probe          = musb_probe,
        .remove         = musb_remove,
index aaf363f19714671aaf75482ead3b2ba5ad6b1174..4bb4b1d42f32c354315f2aa4d5de9e041dad95e3 100644 (file)
@@ -330,6 +330,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
        switch (lsts) {
        case USB_LINK_ACA_RID_B_8505:
                event = UX500_MUSB_RIDB;
+               /* Fall through */
        case USB_LINK_NOT_CONFIGURED_8505:
        case USB_LINK_RESERVED0_8505:
        case USB_LINK_RESERVED1_8505:
@@ -350,6 +351,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
 
        case USB_LINK_ACA_RID_C_NM_8505:
                event = UX500_MUSB_RIDC;
+               /* Fall through */
        case USB_LINK_STD_HOST_NC_8505:
        case USB_LINK_STD_HOST_C_NS_8505:
        case USB_LINK_STD_HOST_C_S_8505:
@@ -368,6 +370,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
        case USB_LINK_ACA_RID_A_8505:
        case USB_LINK_ACA_DOCK_CHGR_8505:
                event = UX500_MUSB_RIDA;
+               /* Fall through */
        case USB_LINK_HM_IDGND_8505:
                if (ab->mode == USB_IDLE) {
                        ab->mode = USB_HOST;
@@ -422,6 +425,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
        switch (lsts) {
        case USB_LINK_ACA_RID_B_8500:
                event = UX500_MUSB_RIDB;
+               /* Fall through */
        case USB_LINK_NOT_CONFIGURED_8500:
        case USB_LINK_NOT_VALID_LINK_8500:
                ab->mode = USB_IDLE;
@@ -438,6 +442,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
        case USB_LINK_ACA_RID_C_HS_8500:
        case USB_LINK_ACA_RID_C_HS_CHIRP_8500:
                event = UX500_MUSB_RIDC;
+               /* Fall through */
        case USB_LINK_STD_HOST_NC_8500:
        case USB_LINK_STD_HOST_C_NS_8500:
        case USB_LINK_STD_HOST_C_S_8500:
@@ -457,6 +462,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
 
        case USB_LINK_ACA_RID_A_8500:
                event = UX500_MUSB_RIDA;
+               /* Fall through */
        case USB_LINK_HM_IDGND_8500:
                if (ab->mode == USB_IDLE) {
                        ab->mode = USB_HOST;
@@ -712,10 +718,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
        if (ab->flags & AB8500_USB_FLAG_USE_LINK_STATUS_IRQ) {
                irq = platform_get_irq_byname(pdev, "USB_LINK_STATUS");
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "Link status irq not found\n");
+               if (irq < 0)
                        return irq;
-               }
                err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                ab8500_usb_link_status_irq,
                                IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
@@ -728,10 +732,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
        if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) {
                irq = platform_get_irq_byname(pdev, "ID_WAKEUP_F");
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "ID fall irq not found\n");
+               if (irq < 0)
                        return irq;
-               }
                err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                ab8500_usb_disconnect_irq,
                                IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
@@ -744,10 +746,8 @@ static int ab8500_usb_irq_setup(struct platform_device *pdev,
 
        if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) {
                irq = platform_get_irq_byname(pdev, "VBUS_DET_F");
-               if (irq < 0) {
-                       dev_err(&pdev->dev, "VBUS fall irq not found\n");
+               if (irq < 0)
                        return irq;
-               }
                err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                                ab8500_usb_disconnect_irq,
                                IRQF_NO_SUSPEND | IRQF_SHARED | IRQF_ONESHOT,
index f7c96d209eda78a73b812685a931c59b53a1a6c8..f6a037b5e9ef22d1b24a875ce06371b236c8038d 100644 (file)
@@ -1043,6 +1043,11 @@ static ssize_t show_fsl_usb2_otg_state(struct device *dev,
 
 static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL);
 
+static struct attribute *fsl_otg_attrs[] = {
+       &dev_attr_fsl_usb2_otg_state.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(fsl_otg);
 
 /* Char driver interface to control some OTG input */
 
@@ -1132,10 +1137,6 @@ static int fsl_otg_probe(struct platform_device *pdev)
                return ret;
        }
 
-       ret = device_create_file(&pdev->dev, &dev_attr_fsl_usb2_otg_state);
-       if (ret)
-               dev_warn(&pdev->dev, "Can't register sysfs attribute\n");
-
        return ret;
 }
 
@@ -1152,8 +1153,6 @@ static int fsl_otg_remove(struct platform_device *pdev)
        kfree(fsl_otg_dev->phy.otg);
        kfree(fsl_otg_dev);
 
-       device_remove_file(&pdev->dev, &dev_attr_fsl_usb2_otg_state);
-
        unregister_chrdev(FSL_OTG_MAJOR, FSL_OTG_NAME);
 
        if (pdata->exit)
@@ -1168,6 +1167,7 @@ struct platform_driver fsl_otg_driver = {
        .driver = {
                .name = driver_name,
                .owner = THIS_MODULE,
+               .dev_groups = fsl_otg_groups,
        },
 };
 
index cf7ecdc9a9d4d72594c685a44c058a4751217dd3..06b47f1028b3afb69feddb91f221cc12a4435f49 100644 (file)
@@ -641,12 +641,15 @@ static const struct attribute_group inputs_attr_group = {
        .attrs = inputs_attrs,
 };
 
+static const struct attribute_group *mv_otg_groups[] = {
+       &inputs_attr_group,
+       NULL,
+};
+
 static int mv_otg_remove(struct platform_device *pdev)
 {
        struct mv_otg *mvotg = platform_get_drvdata(pdev);
 
-       sysfs_remove_group(&mvotg->pdev->dev.kobj, &inputs_attr_group);
-
        if (mvotg->qwork) {
                flush_workqueue(mvotg->qwork);
                destroy_workqueue(mvotg->qwork);
@@ -809,13 +812,6 @@ static int mv_otg_probe(struct platform_device *pdev)
                goto err_disable_clk;
        }
 
-       retval = sysfs_create_group(&pdev->dev.kobj, &inputs_attr_group);
-       if (retval < 0) {
-               dev_dbg(&pdev->dev,
-                       "Can't register sysfs attr group: %d\n", retval);
-               goto err_remove_phy;
-       }
-
        spin_lock_init(&mvotg->wq_lock);
        if (spin_trylock(&mvotg->wq_lock)) {
                mv_otg_run_state_machine(mvotg, 2 * HZ);
@@ -828,8 +824,6 @@ static int mv_otg_probe(struct platform_device *pdev)
 
        return 0;
 
-err_remove_phy:
-       usb_remove_phy(&mvotg->phy);
 err_disable_clk:
        mv_otg_disable_internal(mvotg);
 err_destroy_workqueue:
@@ -883,6 +877,7 @@ static struct platform_driver mv_otg_driver = {
        .remove = mv_otg_remove,
        .driver = {
                   .name = driver_name,
+                  .dev_groups = mv_otg_groups,
                   },
 #ifdef CONFIG_PM
        .suspend = mv_otg_suspend,
index 0981abc3d1adc234af18920283f81455397357e3..baebb1f5a9737c40d5a9b4a9470641f70098b438 100644 (file)
@@ -312,15 +312,12 @@ static ssize_t otg_mode_store(struct device *device,
 }
 static DEVICE_ATTR_RW(otg_mode);
 
-static struct attribute *tahvo_attributes[] = {
+static struct attribute *tahvo_attrs[] = {
        &dev_attr_vbus.attr,
        &dev_attr_otg_mode.attr,
        NULL
 };
-
-static const struct attribute_group tahvo_attr_group = {
-       .attrs = tahvo_attributes,
-};
+ATTRIBUTE_GROUPS(tahvo);
 
 static int tahvo_usb_probe(struct platform_device *pdev)
 {
@@ -406,17 +403,8 @@ static int tahvo_usb_probe(struct platform_device *pdev)
                goto err_remove_phy;
        }
 
-       /* Attributes */
-       ret = sysfs_create_group(&pdev->dev.kobj, &tahvo_attr_group);
-       if (ret) {
-               dev_err(&pdev->dev, "cannot create sysfs group: %d\n", ret);
-               goto err_free_irq;
-       }
-
        return 0;
 
-err_free_irq:
-       free_irq(tu->irq, tu);
 err_remove_phy:
        usb_remove_phy(&tu->phy);
 err_disable_clk:
@@ -430,7 +418,6 @@ static int tahvo_usb_remove(struct platform_device *pdev)
 {
        struct tahvo_usb *tu = platform_get_drvdata(pdev);
 
-       sysfs_remove_group(&pdev->dev.kobj, &tahvo_attr_group);
        free_irq(tu->irq, tu);
        usb_remove_phy(&tu->phy);
        if (!IS_ERR(tu->ick))
@@ -444,6 +431,7 @@ static struct platform_driver tahvo_usb_driver = {
        .remove         = tahvo_usb_remove,
        .driver         = {
                .name   = "tahvo-usb",
+               .dev_groups = tahvo_groups,
        },
 };
 module_platform_driver(tahvo_usb_driver);
index dade34d704198f9320da4f6894c219b9e17a9cec..bfebf1f2e991cf0c00793e1c517b30fb8c66a60e 100644 (file)
@@ -196,6 +196,12 @@ static ssize_t vbus_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(vbus);
 
+static struct attribute *twl6030_attrs[] = {
+       &dev_attr_vbus.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(twl6030);
+
 static irqreturn_t twl6030_usb_irq(int irq, void *_twl)
 {
        struct twl6030_usb *twl = _twl;
@@ -361,8 +367,6 @@ static int twl6030_usb_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, twl);
-       if (device_create_file(&pdev->dev, &dev_attr_vbus))
-               dev_warn(&pdev->dev, "could not create sysfs file\n");
 
        INIT_WORK(&twl->set_vbus_work, otg_set_vbus_work);
        INIT_DELAYED_WORK(&twl->get_status_work, twl6030_status_work);
@@ -373,7 +377,6 @@ static int twl6030_usb_probe(struct platform_device *pdev)
        if (status < 0) {
                dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
                        twl->irq1, status);
-               device_remove_file(twl->dev, &dev_attr_vbus);
                return status;
        }
 
@@ -384,7 +387,6 @@ static int twl6030_usb_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
                        twl->irq2, status);
                free_irq(twl->irq1, twl);
-               device_remove_file(twl->dev, &dev_attr_vbus);
                return status;
        }
 
@@ -408,7 +410,6 @@ static int twl6030_usb_remove(struct platform_device *pdev)
        free_irq(twl->irq1, twl);
        free_irq(twl->irq2, twl);
        regulator_put(twl->usb3v3);
-       device_remove_file(twl->dev, &dev_attr_vbus);
        cancel_work_sync(&twl->set_vbus_work);
 
        return 0;
@@ -426,6 +427,7 @@ static struct platform_driver twl6030_usb_driver = {
        .driver         = {
                .name   = "twl6030_usb",
                .of_match_table = of_match_ptr(twl6030_usb_id_table),
+               .dev_groups = twl6030_groups,
        },
 };
 
index 6d64f342f58706cbfc579797e2e86686d6a467b3..16ce06039a4d180c676353dda09062b90bafe892 100644 (file)
@@ -29,8 +29,6 @@
 
 #include <linux/kernel.h>
 
-#define USB_STORAGE "usb-storage: "
-
 #ifdef CONFIG_USB_STORAGE_DEBUG
 void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
 void usb_stor_show_sense(const struct us_data *us, unsigned char key,
index 2b474d60b4dbeac90fad68a991d5dedeed59f551..28e1128d53a41a02f7e6e6fed457600db44df63b 100644 (file)
@@ -1511,7 +1511,7 @@ static int isd200_Initialization(struct us_data *us)
 
 static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us)
 {
-       int sendToTransport = 1, orig_bufflen;
+       int sendToTransport, orig_bufflen;
        union ata_cdb ataCdb;
 
        /* Make sure driver was initialized */
index 05b80211290d3e2df528eee1ef5065b71f9e9e39..df4de8323eff91cc462d2a20d3c4c71627a80c41 100644 (file)
@@ -379,7 +379,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
 
        /* check for state-transition errors */
        if (us->srb != NULL) {
-               printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
+               printk(KERN_ERR "usb-storage: Error in %s: us->srb = %p\n",
                        __func__, us->srb);
                return SCSI_MLQUEUE_HOST_BUSY;
        }
index 61b7bc58dd81c134b94f89d0010b779e9d757ea0..57907f26f68197fb0a4582936fe2c57df2174a27 100644 (file)
@@ -215,7 +215,7 @@ static void *typec_mux_match(struct device_connection *con, int ep, void *data)
        }
 
        /* Alternate Mode muxes */
-       nval = fwnode_property_read_u16_array(con->fwnode, "svid", NULL, 0);
+       nval = fwnode_property_count_u16(con->fwnode, "svid");
        if (nval <= 0)
                return NULL;
 
index c524088246ee33c5b3d8c1b39d7ca64598819572..ed8655c6af8ca973a3b21b2bb34bd2ea1abbfa57 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/spinlock.h>
 #include <linux/string.h>
 #include <linux/types.h>
+#include <linux/usb.h>
 #include <linux/usb/typec.h>
 #include <linux/usb/tcpm.h>
 #include <linux/usb/pd.h>
@@ -75,7 +76,6 @@ struct fusb302_chip {
        struct i2c_client *i2c_client;
        struct tcpm_port *tcpm_port;
        struct tcpc_dev tcpc_dev;
-       struct tcpc_config tcpc_config;
 
        struct regulator *vbus;
 
@@ -207,23 +207,19 @@ static int fusb302_debug_show(struct seq_file *s, void *v)
 }
 DEFINE_SHOW_ATTRIBUTE(fusb302_debug);
 
-static struct dentry *rootdir;
-
 static void fusb302_debugfs_init(struct fusb302_chip *chip)
 {
-       mutex_init(&chip->logbuffer_lock);
-       if (!rootdir)
-               rootdir = debugfs_create_dir("fusb302", NULL);
+       char name[NAME_MAX];
 
-       chip->dentry = debugfs_create_file(dev_name(chip->dev),
-                                          S_IFREG | 0444, rootdir,
+       mutex_init(&chip->logbuffer_lock);
+       snprintf(name, NAME_MAX, "fusb302-%s", dev_name(chip->dev));
+       chip->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
                                           chip, &fusb302_debug_fops);
 }
 
 static void fusb302_debugfs_exit(struct fusb302_chip *chip)
 {
        debugfs_remove(chip->dentry);
-       debugfs_remove(rootdir);
 }
 
 #else
@@ -1110,23 +1106,6 @@ static void fusb302_bc_lvl_handler_work(struct work_struct *work)
        mutex_unlock(&chip->lock);
 }
 
-#define PDO_FIXED_FLAGS \
-       (PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM)
-
-static const u32 src_pdo[] = {
-       PDO_FIXED(5000, 400, PDO_FIXED_FLAGS),
-};
-
-static const struct tcpc_config fusb302_tcpc_config = {
-       .src_pdo = src_pdo,
-       .nr_src_pdo = ARRAY_SIZE(src_pdo),
-       .operating_snk_mw = 2500,
-       .type = TYPEC_PORT_DRP,
-       .data = TYPEC_PORT_DRD,
-       .default_role = TYPEC_SINK,
-       .alt_modes = NULL,
-};
-
 static void init_tcpc_dev(struct tcpc_dev *fusb302_tcpc_dev)
 {
        fusb302_tcpc_dev->init = tcpm_init;
@@ -1670,27 +1649,36 @@ static int init_gpio(struct fusb302_chip *chip)
        return 0;
 }
 
-static int fusb302_composite_snk_pdo_array(struct fusb302_chip *chip)
-{
-       struct device *dev = chip->dev;
-       u32 max_uv, max_ua;
+#define PDO_FIXED_FLAGS \
+       (PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP | PDO_FIXED_USB_COMM)
 
-       chip->snk_pdo[0] = PDO_FIXED(5000, 400, PDO_FIXED_FLAGS);
+static const u32 src_pdo[] = {
+       PDO_FIXED(5000, 400, PDO_FIXED_FLAGS)
+};
 
-       /*
-        * As max_snk_ma/mv/mw is not needed for tcpc_config,
-        * those settings should be passed in via sink PDO, so
-        * "fcs, max-sink-*" properties will be deprecated, to
-        * perserve compatibility with existing users of them,
-        * we read those properties to convert them to be a var
-        * PDO.
-        */
-       if (device_property_read_u32(dev, "fcs,max-sink-microvolt", &max_uv) ||
-               device_property_read_u32(dev, "fcs,max-sink-microamp", &max_ua))
-               return 1;
+static const u32 snk_pdo[] = {
+       PDO_FIXED(5000, 400, PDO_FIXED_FLAGS)
+};
+
+static const struct property_entry port_props[] = {
+       PROPERTY_ENTRY_STRING("data-role", "dual"),
+       PROPERTY_ENTRY_STRING("power-role", "dual"),
+       PROPERTY_ENTRY_STRING("try-power-role", "sink"),
+       PROPERTY_ENTRY_U32_ARRAY("source-pdos", src_pdo),
+       PROPERTY_ENTRY_U32_ARRAY("sink-pdos", snk_pdo),
+       PROPERTY_ENTRY_U32("op-sink-microwatt", 2500),
+       { }
+};
 
-       chip->snk_pdo[1] = PDO_VAR(5000, max_uv / 1000, max_ua / 1000);
-       return 2;
+static struct fwnode_handle *fusb302_fwnode_get(struct device *dev)
+{
+       struct fwnode_handle *fwnode;
+
+       fwnode = device_get_named_child_node(dev, "connector");
+       if (!fwnode)
+               fwnode = fwnode_create_software_node(port_props, NULL);
+
+       return fwnode;
 }
 
 static int fusb302_probe(struct i2c_client *client,
@@ -1701,7 +1689,6 @@ static int fusb302_probe(struct i2c_client *client,
        struct device *dev = &client->dev;
        const char *name;
        int ret = 0;
-       u32 v;
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
                dev_err(&client->dev,
@@ -1714,20 +1701,8 @@ static int fusb302_probe(struct i2c_client *client,
 
        chip->i2c_client = client;
        chip->dev = &client->dev;
-       chip->tcpc_config = fusb302_tcpc_config;
-       chip->tcpc_dev.config = &chip->tcpc_config;
        mutex_init(&chip->lock);
 
-       chip->tcpc_dev.fwnode =
-               device_get_named_child_node(dev, "connector");
-
-       if (!device_property_read_u32(dev, "fcs,operating-sink-microwatt", &v))
-               chip->tcpc_config.operating_snk_mw = v / 1000;
-
-       /* Composite sink PDO */
-       chip->tcpc_config.nr_snk_pdo = fusb302_composite_snk_pdo_array(chip);
-       chip->tcpc_config.snk_pdo = chip->snk_pdo;
-
        /*
         * Devicetree platforms should get extcon via phandle (not yet
         * supported). On ACPI platforms, we get the name from a device prop.
@@ -1753,6 +1728,7 @@ static int fusb302_probe(struct i2c_client *client,
        INIT_WORK(&chip->irq_work, fusb302_irq_work);
        INIT_DELAYED_WORK(&chip->bc_lvl_handler, fusb302_bc_lvl_handler_work);
        init_tcpc_dev(&chip->tcpc_dev);
+       fusb302_debugfs_init(chip);
 
        if (client->irq) {
                chip->gpio_int_n_irq = client->irq;
@@ -1762,8 +1738,15 @@ static int fusb302_probe(struct i2c_client *client,
                        goto destroy_workqueue;
        }
 
+       chip->tcpc_dev.fwnode = fusb302_fwnode_get(dev);
+       if (IS_ERR(chip->tcpc_dev.fwnode)) {
+               ret = PTR_ERR(chip->tcpc_dev.fwnode);
+               goto destroy_workqueue;
+       }
+
        chip->tcpm_port = tcpm_register_port(&client->dev, &chip->tcpc_dev);
        if (IS_ERR(chip->tcpm_port)) {
+               fwnode_handle_put(chip->tcpc_dev.fwnode);
                ret = PTR_ERR(chip->tcpm_port);
                if (ret != -EPROBE_DEFER)
                        dev_err(dev, "cannot register tcpm port, ret=%d", ret);
@@ -1778,14 +1761,15 @@ static int fusb302_probe(struct i2c_client *client,
                goto tcpm_unregister_port;
        }
        enable_irq_wake(chip->gpio_int_n_irq);
-       fusb302_debugfs_init(chip);
        i2c_set_clientdata(client, chip);
 
        return ret;
 
 tcpm_unregister_port:
        tcpm_unregister_port(chip->tcpm_port);
+       fwnode_handle_put(chip->tcpc_dev.fwnode);
 destroy_workqueue:
+       fusb302_debugfs_exit(chip);
        destroy_workqueue(chip->wq);
 
        return ret;
@@ -1800,6 +1784,7 @@ static int fusb302_remove(struct i2c_client *client)
        cancel_work_sync(&chip->irq_work);
        cancel_delayed_work_sync(&chip->bc_lvl_handler);
        tcpm_unregister_port(chip->tcpm_port);
+       fwnode_handle_put(chip->tcpc_dev.fwnode);
        destroy_workqueue(chip->wq);
        fusb302_debugfs_exit(chip);
 
index 15abe1d9958fdb402f9025248b3836b995c3313b..166b28562395584b09af5e2e2310d2a557de82cf 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/usb.h>
 #include <linux/usb/pd.h>
 #include <linux/usb/pd_ado.h>
 #include <linux/usb/pd_bdo.h>
@@ -571,17 +572,13 @@ static int tcpm_debug_show(struct seq_file *s, void *v)
 }
 DEFINE_SHOW_ATTRIBUTE(tcpm_debug);
 
-static struct dentry *rootdir;
-
 static void tcpm_debugfs_init(struct tcpm_port *port)
 {
-       mutex_init(&port->logbuffer_lock);
-       /* /sys/kernel/debug/tcpm/usbcX */
-       if (!rootdir)
-               rootdir = debugfs_create_dir("tcpm", NULL);
+       char name[NAME_MAX];
 
-       port->dentry = debugfs_create_file(dev_name(port->dev),
-                                          S_IFREG | 0444, rootdir,
+       mutex_init(&port->logbuffer_lock);
+       snprintf(name, NAME_MAX, "tcpm-%s", dev_name(port->dev));
+       port->dentry = debugfs_create_file(name, S_IFREG | 0444, usb_debug_root,
                                           port, &tcpm_debug_fops);
 }
 
@@ -597,10 +594,6 @@ static void tcpm_debugfs_exit(struct tcpm_port *port)
        mutex_unlock(&port->logbuffer_lock);
 
        debugfs_remove(port->dentry);
-       if (list_empty(&rootdir->d_subdirs)) {
-               debugfs_remove(rootdir);
-               rootdir = NULL;
-       }
 }
 
 #else
@@ -4434,8 +4427,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
                goto sink;
 
        /* Get source pdos */
-       ret = fwnode_property_read_u32_array(fwnode, "source-pdos",
-                                            NULL, 0);
+       ret = fwnode_property_count_u32(fwnode, "source-pdos");
        if (ret <= 0)
                return -EINVAL;
 
@@ -4459,8 +4451,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
                return -EINVAL;
 sink:
        /* Get sink pdos */
-       ret = fwnode_property_read_u32_array(fwnode, "sink-pdos",
-                                            NULL, 0);
+       ret = fwnode_property_count_u32(fwnode, "sink-pdos");
        if (ret <= 0)
                return -EINVAL;
 
index 6b317c150bdd07591c882f035185a53db9002b69..edc271da14f4033fb0f3d991cb85099160e94b99 100644 (file)
@@ -617,10 +617,8 @@ static int wcove_typec_probe(struct platform_device *pdev)
        wcove->regmap = pmic->regmap;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        irq = regmap_irq_get_virq(pmic->irq_chip_data_chgr, irq);
        if (irq < 0)
index 8e9f8fba55af999f1b1c3c73bfd68919518e42e5..907e20e1a71ee792079dd107f14dd869328bd41e 100644 (file)
@@ -1104,14 +1104,11 @@ static ssize_t do_flash_store(struct device *dev,
 
 static DEVICE_ATTR_WO(do_flash);
 
-static struct attribute *ucsi_ccg_sysfs_attrs[] = {
+static struct attribute *ucsi_ccg_attrs[] = {
        &dev_attr_do_flash.attr,
        NULL,
 };
-
-static struct attribute_group ucsi_ccg_attr_group = {
-       .attrs = ucsi_ccg_sysfs_attrs,
-};
+ATTRIBUTE_GROUPS(ucsi_ccg);
 
 static int ucsi_ccg_probe(struct i2c_client *client,
                          const struct i2c_device_id *id)
@@ -1189,10 +1186,6 @@ static int ucsi_ccg_probe(struct i2c_client *client,
 
        i2c_set_clientdata(client, uc);
 
-       status = sysfs_create_group(&uc->dev->kobj, &ucsi_ccg_attr_group);
-       if (status)
-               dev_err(uc->dev, "cannot create sysfs group: %d\n", status);
-
        pm_runtime_set_active(uc->dev);
        pm_runtime_enable(uc->dev);
        pm_runtime_idle(uc->dev);
@@ -1209,7 +1202,6 @@ static int ucsi_ccg_remove(struct i2c_client *client)
        ucsi_unregister_ppm(uc->ucsi);
        pm_runtime_disable(uc->dev);
        free_irq(uc->irq, uc);
-       sysfs_remove_group(&uc->dev->kobj, &ucsi_ccg_attr_group);
 
        return 0;
 }
@@ -1270,6 +1262,7 @@ static struct i2c_driver ucsi_ccg_driver = {
        .driver = {
                .name = "ucsi_ccg",
                .pm = &ucsi_ccg_pm,
+               .dev_groups = ucsi_ccg_groups,
        },
        .probe = ucsi_ccg_probe,
        .remove = ucsi_ccg_remove,
index 7931e6cecc70443936643690e1fa40cd0370d895..2305d425e6c9adbc8ebdbcf4db45770da3710c0d 100644 (file)
@@ -106,38 +106,13 @@ static ssize_t usbip_sockfd_store(struct device *dev, struct device_attribute *a
 }
 static DEVICE_ATTR_WO(usbip_sockfd);
 
-static int stub_add_files(struct device *dev)
-{
-       int err = 0;
-
-       err = device_create_file(dev, &dev_attr_usbip_status);
-       if (err)
-               goto err_status;
-
-       err = device_create_file(dev, &dev_attr_usbip_sockfd);
-       if (err)
-               goto err_sockfd;
-
-       err = device_create_file(dev, &dev_attr_usbip_debug);
-       if (err)
-               goto err_debug;
-
-       return 0;
-
-err_debug:
-       device_remove_file(dev, &dev_attr_usbip_sockfd);
-err_sockfd:
-       device_remove_file(dev, &dev_attr_usbip_status);
-err_status:
-       return err;
-}
-
-static void stub_remove_files(struct device *dev)
-{
-       device_remove_file(dev, &dev_attr_usbip_status);
-       device_remove_file(dev, &dev_attr_usbip_sockfd);
-       device_remove_file(dev, &dev_attr_usbip_debug);
-}
+static struct attribute *usbip_attrs[] = {
+       &dev_attr_usbip_status.attr,
+       &dev_attr_usbip_sockfd.attr,
+       &dev_attr_usbip_debug.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(usbip);
 
 static void stub_shutdown_connection(struct usbip_device *ud)
 {
@@ -379,17 +354,8 @@ static int stub_probe(struct usb_device *udev)
                goto err_port;
        }
 
-       rc = stub_add_files(&udev->dev);
-       if (rc) {
-               dev_err(&udev->dev, "stub_add_files for %s\n", udev_busid);
-               goto err_files;
-       }
-
        return 0;
 
-err_files:
-       usb_hub_release_port(udev->parent, udev->portnum,
-                            (struct usb_dev_state *) udev);
 err_port:
        dev_set_drvdata(&udev->dev, NULL);
        usb_put_dev(udev);
@@ -457,7 +423,6 @@ static void stub_disconnect(struct usb_device *udev)
        /*
         * NOTE: rx/tx threads are invoked for each usb_device.
         */
-       stub_remove_files(&udev->dev);
 
        /* release port */
        rc = usb_hub_release_port(udev->parent, udev->portnum,
@@ -526,4 +491,5 @@ struct usb_device_driver stub_driver = {
        .resume         = stub_resume,
 #endif
        .supports_autosuspend   =       0,
+       .dev_groups     = usbip_groups,
 };
index cf968192e59fcdd122ecfc00d0fbd1a38b6814ee..1bd4bc005829bdb71f85861d7ef57d27bf709660 100644 (file)
@@ -115,7 +115,7 @@ struct vudc_device {
        struct list_head dev_entry;
 };
 
-extern const struct attribute_group vudc_attr_group;
+extern const struct attribute_group *vudc_groups[];
 
 /* visible everywhere */
 
index a72c17ff1c6a163c8e0b3b9439a188536adb472f..c8eeabdd9b5685a1310748eedc4386b22a74af68 100644 (file)
@@ -616,18 +616,10 @@ int vudc_probe(struct platform_device *pdev)
        if (ret < 0)
                goto err_add_udc;
 
-       ret = sysfs_create_group(&pdev->dev.kobj, &vudc_attr_group);
-       if (ret) {
-               dev_err(&udc->pdev->dev, "create sysfs files\n");
-               goto err_sysfs;
-       }
-
        platform_set_drvdata(pdev, udc);
 
        return ret;
 
-err_sysfs:
-       usb_del_gadget_udc(&udc->gadget);
 err_add_udc:
        cleanup_vudc_hw(udc);
 err_init_vudc_hw:
@@ -640,7 +632,6 @@ int vudc_remove(struct platform_device *pdev)
 {
        struct vudc *udc = platform_get_drvdata(pdev);
 
-       sysfs_remove_group(&pdev->dev.kobj, &vudc_attr_group);
        usb_del_gadget_udc(&udc->gadget);
        cleanup_vudc_hw(udc);
        kfree(udc);
index 390733e6937e15f534cf28912e65ba71b0d71a70..678faa82598c7076dd9903cc14c3c296e435da73 100644 (file)
@@ -22,6 +22,7 @@ static struct platform_driver vudc_driver = {
        .remove         = vudc_remove,
        .driver         = {
                .name   = GADGET_NAME,
+               .dev_groups = vudc_groups,
        },
 };
 
index 6dcd3ff655c3367cde86919e024b9cc7d174ecec..100f680c572ae149017d6ff26cd5950533dae8be 100644 (file)
@@ -215,7 +215,12 @@ static struct bin_attribute *dev_bin_attrs[] = {
        NULL,
 };
 
-const struct attribute_group vudc_attr_group = {
+static const struct attribute_group vudc_attr_group = {
        .attrs = dev_attrs,
        .bin_attrs = dev_bin_attrs,
 };
+
+const struct attribute_group *vudc_groups[] = {
+       &vudc_attr_group,
+       NULL,
+};
index 6717adee33f0199627c04c6e5b9363552e97a574..47ccb2029bc3fa44014d4b7706baa8953cb208c0 100644 (file)
@@ -262,6 +262,8 @@ enum probe_type {
  * @resume:    Called to bring a device from sleep mode.
  * @groups:    Default attributes that get created by the driver core
  *             automatically.
+ * @dev_groups:        Additional attributes attached to device instance once the
+ *             it is bound to the driver.
  * @pm:                Power management operations of the device which matched
  *             this driver.
  * @coredump:  Called when sysfs entry is written to. The device driver
@@ -296,6 +298,7 @@ struct device_driver {
        int (*suspend) (struct device *dev, pm_message_t state);
        int (*resume) (struct device *dev);
        const struct attribute_group **groups;
+       const struct attribute_group **dev_groups;
 
        const struct dev_pm_ops *pm;
        void (*coredump) (struct device *dev);
diff --git a/include/linux/oxu210hp.h b/include/linux/oxu210hp.h
deleted file mode 100644 (file)
index 94cd251..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* platform data for the OXU210HP HCD */
-
-struct oxu210hp_platform_data {
-       unsigned int bus16:1;
-       unsigned int use_hcd_otg:1;
-       unsigned int use_hcd_sph:1;
-};
index e87826e23d593026f4d2fb2432f418f716585b67..b548c530f988a43fd2d49b4c081e23fe2eafa816 100644 (file)
@@ -1151,6 +1151,8 @@ struct usbdrv_wrap {
  * @id_table: USB drivers use ID table to support hotplugging.
  *     Export this with MODULE_DEVICE_TABLE(usb,...).  This must be set
  *     or your driver's probe function will never get called.
+ * @dev_groups: Attributes attached to the device that will be created once it
+ *     is bound to the driver.
  * @dynids: used internally to hold the list of dynamically added device
  *     ids for this driver.
  * @drvwrap: Driver-model core structure wrapper.
@@ -1198,6 +1200,7 @@ struct usb_driver {
        int (*post_reset)(struct usb_interface *intf);
 
        const struct usb_device_id *id_table;
+       const struct attribute_group **dev_groups;
 
        struct usb_dynids dynids;
        struct usbdrv_wrap drvwrap;
@@ -1221,6 +1224,8 @@ struct usb_driver {
  *     module is being unloaded.
  * @suspend: Called when the device is going to be suspended by the system.
  * @resume: Called when the device is being resumed by the system.
+ * @dev_groups: Attributes attached to the device that will be created once it
+ *     is bound to the driver.
  * @drvwrap: Driver-model core structure wrapper.
  * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
  *     for devices bound to this driver.
@@ -1235,6 +1240,7 @@ struct usb_device_driver {
 
        int (*suspend) (struct usb_device *udev, pm_message_t message);
        int (*resume) (struct usb_device *udev, pm_message_t message);
+       const struct attribute_group **dev_groups;
        struct usbdrv_wrap drvwrap;
        unsigned int supports_autosuspend:1;
 };
index 78efe870c2b7c85c9814ac90c04e137618bfd866..cf525cddeb94dc2cd2c53355ecdfbfebf095c168 100644 (file)
@@ -158,6 +158,7 @@ struct usbdevfs_hub_portinfo {
 #define USBDEVFS_CAP_MMAP                      0x20
 #define USBDEVFS_CAP_DROP_PRIVILEGES           0x40
 #define USBDEVFS_CAP_CONNINFO_EX               0x80
+#define USBDEVFS_CAP_SUSPEND                   0x100
 
 /* USBDEVFS_DISCONNECT_CLAIM flags & struct */
 
@@ -223,5 +224,8 @@ struct usbdevfs_streams {
  * extending size of the data returned.
  */
 #define USBDEVFS_CONNINFO_EX(len)  _IOC(_IOC_READ, 'U', 32, len)
+#define USBDEVFS_FORBID_SUSPEND    _IO('U', 33)
+#define USBDEVFS_ALLOW_SUSPEND     _IO('U', 34)
+#define USBDEVFS_WAIT_FOR_RESUME   _IO('U', 35)
 
 #endif /* _UAPI_LINUX_USBDEVICE_FS_H */
index bb424638d75b0e639020a765192bea2020dd369c..b8d7d480595a8477db79c090cd46ee2f671a4e56 100644 (file)
@@ -226,8 +226,10 @@ int read_usb_device(struct udev_device *sdev, struct usbip_usb_device *udev)
        path = udev_device_get_syspath(sdev);
        name = udev_device_get_sysname(sdev);
 
-       strncpy(udev->path,  path,  SYSFS_PATH_MAX);
-       strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE);
+       strncpy(udev->path,  path,  SYSFS_PATH_MAX - 1);
+       udev->path[SYSFS_PATH_MAX - 1] = '\0';
+       strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE - 1);
+       udev->busid[SYSFS_BUS_ID_SIZE - 1] = '\0';
 
        sscanf(name, "%u-%u", &busnum, &devnum);
        udev->busnum = busnum;
index 5a3726eb44abcd54b3d55e5f452ab73bc96ca015..051d7d3f443b4f6663d38b5c190f9293ac51f359 100644 (file)
@@ -91,7 +91,8 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
        copy_descr_attr16(dev, &descr, idProduct);
        copy_descr_attr16(dev, &descr, bcdDevice);
 
-       strncpy(dev->path, path, SYSFS_PATH_MAX);
+       strncpy(dev->path, path, SYSFS_PATH_MAX - 1);
+       dev->path[SYSFS_PATH_MAX - 1] = '\0';
 
        dev->speed = USB_SPEED_UNKNOWN;
        speed = udev_device_get_sysattr_value(sdev, "current_speed");
@@ -110,7 +111,8 @@ int read_usb_vudc_device(struct udev_device *sdev, struct usbip_usb_device *dev)
        dev->busnum = 0;
 
        name = udev_device_get_sysname(plat);
-       strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
+       strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE - 1);
+       dev->busid[SYSFS_BUS_ID_SIZE - 1] = '\0';
        return 0;
 err:
        fclose(fd);