1. 10 4月, 2013 5 次提交
    • F
      USB: enclose EHCI HCD drivers within an if USB_EHCI_HCD block · 42443dc4
      Florian Fainelli 提交于
      Thist patch removes the depends on USB_EHCI_HCD that the various USB
      EHCI HCD drivers use and encloses every driver within an if USB_EHCI_HCD
      / endif block. The EHCI HCD platform and Octeon drivers have been moved
      around to remain enclosed within this block.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      42443dc4
    • F
      USB: remove USB_EHCI_BIG_ENDIAN_{DESC,MMIO} depends on architecture symbol · 9296d94d
      Florian Fainelli 提交于
      Just like the OHCI counter part we just can remove the architecture
      specific symbols which prevent these configuration symbols from being
      selected by platforms/architectures requiring it. The original
      implementation did not scale at all since it required each and every
      single architecture to be added for these configuration symbols to be
      selected. Now it is up to the EHCI driver and/or platform to select
      these configuration symbols accordingly.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9296d94d
    • F
      USB: regroup all depends on USB within an if USB block · 25e11ec4
      Florian Fainelli 提交于
      This patch removes the depends on USB from all config symbols in
      drivers/usb/host/Kconfig and replace that with an if USB / endif block
      as suggested by Alan Stern. Some source ... Kconfig lines have been
      shuffled around to permit a better regroupment of the Kconfig files
      depending on "config USB" item. No functionnal change is introduced.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      25e11ec4
    • B
      USB: option: add a D-Link DWM-156 variant · a2a2d6c7
      Bjørn Mork 提交于
      Adding support for a Mediatek based device labelled as
      D-Link Model: DWM-156, H/W Ver: A7
      
      Also adding two other device IDs found in the Debian(!)
      packages included on the embedded device driver CD.
      
      This is a composite MBIM + serial ports + card reader device:
      
      T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 14 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2001 ProdID=7d01 Rev= 3.00
      S:  Manufacturer=D-Link,Inc
      S:  Product=D-Link DWM-156
      C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
      E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=125us
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option
      E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=500us
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2a2d6c7
    • V
      usb: ehci-s5p: fix: Fix null pointer dereferencing · bbcd85a0
      Vivek Gautam 提交于
      7edb3daf: (USB: EHCI: make ehci-s5p a separate driver)
      raised an issue with ehci-s5p's driver data.
      Now that 's5p_ehci_hcd' doesn't maintain pointer to 'usb_hcd'
      and s5p_ehci is nothing but a pointer to hcd->priv;
      add hcd to the driver data rather than s5p_ehci.
      
      This fixes issues with null pointer dereferencing in
      s5p_ehci_shutdown(), s5p_ehci_suspend(), s5p_ehci_resume().
      Signed-off-by: NVivek Gautam <gautam.vivek@samsung.com>
      CC: Manjunath Goudar <manjunath.goudar@linaro.org>
      CC: Arnd Bergmann <arnd@arndb.de>
      CC: Jingoo Han <jg1.han@samsung.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bbcd85a0
  2. 09 4月, 2013 7 次提交
    • M
      USB: EHCI: make ehci-msm a separate driver · 8c68e84f
      Manjunath Goudar 提交于
      Separate the  Qualcomm QSD/MSM on-chip host controller driver from
      ehci-hcd host code so that it can be built as a separate driver module.
      This work is part of enabling multi-platform kernels on ARM;
      however, note that other changes are still needed before Qualcomm QSD/MSM
      can be booted with a multi-platform kernel, which is not expected before
      3.11.
      
      With the infrastructure added by Alan Stern in patch 3e023203
      "USB: EHCI: prepare to make ehci-hcd a library module", we can
      avoid this problem by turning a bus glue into a separate
      module, as we do here for the msm bus glue.
      
      In V5 (arnd):
       - add FIXME about missing usb_add_hcd() or usb_remove_hcd() calls
      
      In V3:
       - Detailed commit message added here describing why this patch is required.
       - Arranged  #include's in alphabetical order.
       - driver.name initialized hcd_name[] = "ehci-msm" in platform_driver
         structure initialization instead of "msm-ehci", which was the reason
         why it broke in EHCI USB testing
      
      In V2:
      Tegra patch related changes removed from this patch.
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NDavid Brown <davidb@codeaurora.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c68e84f
    • M
      USB: EHCI: make ehci-atmel a separate driver · 97736961
      Manjunath Goudar 提交于
      Separate the Atmel host controller driver from ehci-hcd host code
      so that it can be built as a separate driver module.
      This work is part of enabling multi-platform kernels on ARM;
      however, note that other changes are still needed before Atmel can be
      booted with a multi-platform kernel. This is currently planned for
      Linux-3.11.
      
      With the infrastructure added by Alan Stern in patch 3e023203
      "USB: EHCI: prepare to make ehci-hcd a library module", we can
      avoid this problem by turning a bus glue into a separate
      module, as we do here for the Atmel bus glue.
      
      In V4 (arnd):
       - reordered #include statements.
       - removed call to ehci_shutdown and the corresponding export
      
      In V3:
       - Detailed commit message added here about why this patch is required.
       - Replaced hcd_name string "ehci-atmel" to "atmel-ehci".
       - Inserted blank line in the Makefile to separate the EHCI drivers from
         the following non-EHCI drivers.
       - Exported ehci_shutdown symbol as it is needed by the Atmel driver.
       - Eliminated ehci_atmel_setup routine because hcd registers
         can be directly set in the ehci_atmel_drv_probe function.
      
      In V2:
        Resolved below compiler error.
        drivers/usb/host/ehci-atmel.c: In function 'ehci_atmel_drv_remove':
        drivers/usb/host/ehci-atmel.c:167: error: implicit declaration of function 'ehci_shutdown'
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97736961
    • M
      USB: EHCI: make ehci-s5p a separate driver · 7edb3daf
      Manjunath Goudar 提交于
      Separate the  Samsung S5P/EXYNOS host controller driver from ehci-hcd
      host code so that it can be built as a separate driver module.
      This work is part of enabling multi-platform kernels on ARM;
      however, note that other changes are still needed before S5P/EXYNOS can
      be booted with a multi-platform kernel. We currently expect those
      to get merged for 3.10.
      
      With the infrastructure added by Alan Stern in patch 3e023203
      "USB: EHCI: prepare to make ehci-hcd a library module", we can
      avoid this problem by turning a bus glue into a separate
      module, as we do here for the s5p bus glue.
      
      In V4 (arnd)
       - revert some of the pointless changes.
       - fix allocation of s5p specific data structure.
      
      In V3:
       - Detailed commit message added here, why this patch is required.
       - MODULE_LICENSE is GPL v2.
       - Added .extra_priv_size to eliminate the separate allocation of
         the s5p_ehci_hcd structure and removed .reset function pointer
         initialization.
       - Arranged  #include's in alphabetical order.
       - After using extra_priv_size initialization, struct usb_hcd *hcd
         is redundant and can be removed from the probe function.
       - Eliminated s5p_ehci_phy_enable,contents of statements moved
         into the s5p_ehci_probe
       - Eliminated s5p_ehci_phy_disable, contents of statements moved into
         the s5p_ehci_remove.
      
      In V2:
       - Tegra patch related changes removed from this patch.
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Acked-by: NJingoo Han <jg1.han@samsung.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7edb3daf
    • M
      USB: EHCI: make ehci-spear a separate driver · 7675d6ba
      Manjunath Goudar 提交于
      Separate the SPEAr host controller driver from ehci-hcd host code
      so that it can be built as a separate driver module.
      This work is part of enabling multi-platform kernels on ARM;
      however, note that other changes are still needed before SPEAr can be
      booted with a multi-platform kernel, but they are queued in the
      arm-soc tree for 3.10.
      
      With the infrastructure added by Alan Stern in patch 3e023203
      "USB: EHCI: prepare to make ehci-hcd a library module", we can
      avoid this problem by turning a bus glue into a separate
      module, as we do here for the SPEAr bus glue.
      
      In V4 (arnd):
       - renamed all 'struct spear_ehci' pointers from 'ehci' to the
         less ambiguous 'sehci'.
       - folded trivial spear_start_ehci/spear_stop_ehci functions into
         callers.
       - brought back initialization of ehci->caps.
      
      In V3:
       - Detailed commit message added here about why this patch is required.
       - Eliminated ehci_spear_setup routine because hcd registers can
         be directly set in the spear_ehci_hcd_drv_probe function.
       - spear_overrides struct initialized.
       - Converted to using .extra_priv_size for allocating spear_ehci,
         and updated all users of that structure.
       - to_spear_ehci() macro modified for spear_ehci.
      
      In V2:
       - Replaced spear as SPEAr everywhere, leaving functions/variables/config options.
      Signed-off-by: NDeepak Saxena <dsaxena@linaro.org>
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NViresh Kumar <viresh.linux@gmail.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Shiraz Hashim <shiraz.hashim@st.com>
      Cc: spear-devel@list.st.com
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7675d6ba
    • M
      USB: EHCI: make ehci-orion a separate driver · a76dd463
      Manjunath Goudar 提交于
      Separate the Orion host controller driver from ehci-hcd host
      code into its own driver module because of following reason.
      
      With the multiplatform changes in arm-soc tree, it becomes
      possible to enable the mvebu platform (which uses
      ehci-orion) at the same time as other platforms that require
      a conflicting EHCI bus glue. At the moment, this results
      in a warning like
      
      drivers/usb/host/ehci-hcd.c:1297:0: warning: "PLATFORM_DRIVER" redefined [enabled by default]
      drivers/usb/host/ehci-hcd.c:1277:0: note: this is the location of the previous definition
      drivers/usb/host/ehci-orion.c:334:31: warning: 'ehci_orion_driver' defined but not used [-Wunused-variable]
      
      and an ehci driver that only works on one of them.
      
      With the infrastructure added by Alan Stern in patch 3e023203
      "USB: EHCI: prepare to make ehci-hcd a library module", we can
      avoid this problem by turning a bus glue into a separate
      module, as we do here for the orion bus glue.
      
      An earlier version of this patch was included in 3.9 but caused
      a regression there, which has subsequently been fixed.
      
      While we are here, use the opportunity to disabiguate the two
      Marvell EHCI controller implementations in Kconfig.
      
      In V4 (arnd):
      - Improve Kconfig text
      
      In V3:
      - More detail provided in commit message regarding this patch.
      - Replaced hcd_name string "ehci-orion" into "orion-ehci".
      - MODULE_LICENSE is GPL v2.
      - In ehci_init_driver calling second argument passed  as NULL instead of
        ehci_orion_overrides because ehci_orion_overrides is removed.
      
      In V2:
      - Tegra patch related changes removed from this patch.
      Signed-off-by: NManjunath Goudar <manjunath.goudar@linaro.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a76dd463
    • S
      USB: add ftdi_sio USB ID for GDM Boost V1.x · 58f8b6c4
      Stefani Seibold 提交于
      This patch add a missing usb device id for the GDMBoost V1.x device
      
      The patch is against 3.9-rc5
      Signed-off-by: NStefani Seibold <stefani@seibold.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58f8b6c4
    • D
      usb, gadget: use appropriate warning accessors · 75bfe23a
      David Rientjes 提交于
      Use the appropriate WARN() and WARN_ON() accessors to avoid a build error
      when CONFIG_BUG=n:
      
      	drivers/usb/gadget/configfs.c: In function 'config_usb_cfg_unlink':
      	drivers/usb/gadget/configfs.c:442:2: error: implicit declaration of function '__WARN_printf'
      	drivers/usb/gadget/configfs.c: In function 'configfs_do_nothing':
      	drivers/usb/gadget/configfs.c:733:2: error: implicit declaration of function '__WARN'
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      75bfe23a
  3. 08 4月, 2013 1 次提交
  4. 06 4月, 2013 5 次提交
  5. 04 4月, 2013 7 次提交
  6. 03 4月, 2013 15 次提交
    • F
      usb: phy: twl6030-usb: check regulator_enable return value · bb54542c
      Fabio Baltieri 提交于
      Since regulator_enable() is going to be marked as __must_check in the
      next merge window, always check regulator_enable() return value and
      print a warning if it fails.
      
      Cc: Hema HK <hemahk@ti.com>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      bb54542c
    • F
      usb: phy: twl4030-usb: check regulator_enable return value · 9ec602ec
      Fabio Baltieri 提交于
      Since regulator_enable() is going to be marked as __must_check in the
      next merge window, always check regulator_enable() return value and
      print a warning if it fails.
      Reviewed-by: NKalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9ec602ec
    • F
      usb: phy: ab8500-usb: check regulator_enable return value · 88b1c78d
      Fabio Baltieri 提交于
      Since regulator_enable() is going to be marked as __must_check in the
      next merge window, always check regulator_enable() return value and
      print a warning if it fails.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NFabio Baltieri <fabio.baltieri@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      88b1c78d
    • A
      usb: gadget: f_obex: add configfs support · ecfd3f7b
      Andrzej Pietrasiewicz 提交于
      f_obex learns about our new configfs-based interface,
      which will allow gadgets to be bound to controllers
      through userland.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ecfd3f7b
    • A
      usb: gadget: serial: convert to new interface of f_obex · d1412794
      Andrzej Pietrasiewicz 提交于
      f_obex is now a self-contained module. We need to teach
      serial.c about it.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d1412794
    • A
      usb: gadget: f_obex: convert to new function interface with backward compatibility · 1d8fc251
      Andrzej Pietrasiewicz 提交于
      Converting f_obex to the new function interface requires converting
      the f_obex's function code and its users.
      
      This patch converts the f_obex.c to the new function interface.
      The file is now compiled into a separate usb_f_obex.ko module.
      
      The old function interface is provided by means of preprocessor
      conditional directives. After all users are converted, the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1d8fc251
    • A
      usb: gadget: f_serial: add configfs support · 0b6a1e6f
      Andrzej Pietrasiewicz 提交于
      this patch implements the new configfs based interface
      on f_serial function driver.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0b6a1e6f
    • A
      usb: gadget: f_serial: remove compatibility layer · 9786b456
      Andrzej Pietrasiewicz 提交于
      There are no old function interface users left, so the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9786b456
    • A
    • A
      usb: gadget: f_serial: convert to new function interface with backward compatibility · 60540ea2
      Andrzej Pietrasiewicz 提交于
      Converting f_serial to the new function interface requires converting
      the f_serial's function code and its users.
      
      This patch converts the f_serial.c to the new function interface.
      
      The file is now compiled into a separate usb_f_serial.ko module.
      The old function interface is provided by means of preprocessor
      conditional directives. After all users are converted, the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      60540ea2
    • A
      usb: gadget: nokia: remove unused include · 81f886cb
      Andrzej Pietrasiewicz 提交于
      f_serial.c isn't necessary in nokia.c, we can
      safely remove it.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      81f886cb
    • A
      usb: gadget: use consistent naming scheme for usb function modules · 4f47a1be
      Andrzej Pietrasiewicz 提交于
      In order to convert to configfs the USB functions need to be converted
      to the new interface from Sebastian, which also requires turning them
      into separate modules. Some of these modules will consist of just
      one object file, e.g. f_ncm.o. But some of the modules will eventually
      consist of more than one object file, e.g. for mass storage there
      will be f_mass_storage.o and storage_common.o. The resulting module
      cannot be called f_mass_storage.ko due to cyclic dependency. This patch
      introduces a naming scheme for the said resulting modules:
      
      usb_f_xxxxxx.ko
      
      e.g. usb_f_mass_storage.ko, usb_f_ss_lb.ko, usb_f_rndis.ko etc.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4f47a1be
    • S
      usb: gadget: the start of the configfs interface · 88af8bbe
      Sebastian Andrzej Siewior 提交于
      |# modprobe dummy_hcd num=2
      |# modprobe libcomposite
      
      |# lsmod
      |Module                  Size  Used by
      |libcomposite           31648  0
      |dummy_hcd              19871  0
      
      |# mkdir /sys/kernel/config/usb_gadget/oha
      |# cd /sys/kernel/config/usb_gadget/oha
      |# mkdir configs/def.1
      |# mkdir configs/def.2
      |# mkdir functions/acm.ttyS1
      |# mkdir strings/0x1
      |mkdir: cannot create directory `strings/0x1': Invalid argument
      |# mkdir strings/0x409
      |# mkdir strings/1033
      |mkdir: cannot create directory `strings/1033': File exists
      |# mkdir strings/1032
      |# mkdir configs/def.1/strings/0x409
      |# mkdir configs/def.2/strings/0x409
      
      |#find . -ls
      |   975    0 drwxr-xr-x   5 root     root            0 Dec 23 17:40 .
      |   978    0 drwxr-xr-x   4 root     root            0 Dec 23 17:43 ./strings
      |  4100    0 drwxr-xr-x   2 root     root            0 Dec 23 17:43 ./strings/1032
      |   995    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/serialnumber
      |   996    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/product
      |   997    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/manufacturer
      |  2002    0 drwxr-xr-x   2 root     root            0 Dec 23 17:41 ./strings/0x409
      |   998    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/serialnumber
      |   999    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/product
      |  1000    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/manufacturer
      |   977    0 drwxr-xr-x   4 root     root            0 Dec 23 17:41 ./configs
      |  4081    0 drwxr-xr-x   3 root     root            0 Dec 23 17:41 ./configs/def.2
      |  4082    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.2/strings
      |  2016    0 drwxr-xr-x   2 root     root            0 Dec 23 17:42 ./configs/def.2/strings/0x409
      |  1001    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/strings/0x409/configuration
      |  1002    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/bmAttributes
      |  1003    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/MaxPower
      |   979    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.1
      |   980    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.1/strings
      |  5122    0 drwxr-xr-x   2 root     root            0 Dec 23 17:42 ./configs/def.1/strings/0x409
      |  1004    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/strings/0x409/configuration
      |  1005    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/bmAttributes
      |  1006    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/MaxPower
      |   976    0 drwxr-xr-x   3 root     root            0 Dec 23 17:41 ./functions
      |   981    0 drwxr-xr-x   2 root     root            0 Dec 23 17:41 ./functions/acm.ttyS1
      |  1007    0 -r--r--r--   1 root     root         4096 Dec 23 17:43 ./functions/acm.ttyS1/port_num
      |  1008    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./UDC
      |  1009    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bcdUSB
      |  1010    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bcdDevice
      |  1011    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./idProduct
      |  1012    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./idVendor
      |  1013    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bMaxPacketSize0
      |  1014    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceProtocol
      |  1015    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceSubClass
      |  1016    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceClass
      
      |# cat functions/acm.ttyS1/port_num
      |0
      |# ls -lah /dev/ttyGS*
      |crw-rw---T 1 root dialout 252, 0 Dec 23 17:41 /dev/ttyGS0
      |
      |# echo 0x1234 > idProduct
      |# echo 0xabcd > idVendor
      |# echo 1122 > strings/0x409/serialnumber
      |# echo "The manufacturer" > strings/0x409/manufacturer
      |# echo 1 > strings/1032/manufacturer
      |# echo 1sa > strings/1032/product
      |# echo tada > strings/1032/serialnumber
      |echo "Primary configuration" > configs/def.1/strings/0x409/configuration
      |# echo "Secondary configuration" > configs/def.2/strings/0x409/configuration
      |# ln -s functions/acm.ttyS1 configs/def.1/
      |# ln -s functions/acm.ttyS1 configs/def.2/
      |find configs/def.1/ -ls
      |   979    0 drwxr-xr-x   3 root     root            0 Dec 23 17:49 configs/def.1/
      |  6264    0 lrwxrwxrwx   1 root     root            0 Dec 23 17:48 configs/def.1/acm.ttyS1 -> ../../../../usb_gadget/oha/functions/acm.ttyS1
      |   980    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 configs/def.1/strings
      |  5122    0 drwxr-xr-x   2 root     root            0 Dec 23 17:49 configs/def.1/strings/0x409
      |  6284    0 -rw-r--r--   1 root     root         4096 Dec 23 17:47 configs/def.1/strings/0x409/configuration
      |  6285    0 -rw-r--r--   1 root     root         4096 Dec 23 17:49 configs/def.1/bmAttributes
      |  6286    0 -rw-r--r--   1 root     root         4096 Dec 23 17:49 configs/def.1/MaxPower
      |
      |echo 120 > configs/def.1/MaxPower
      |
      |# ls -lh /sys/class/udc/
      |total 0
      |lrwxrwxrwx 1 root root 0 Dec 23 17:50 dummy_udc.0 -> ../../devices/platform/dummy_udc.0/udc/dummy_udc.0
      |lrwxrwxrwx 1 root root 0 Dec 23 17:50 dummy_udc.1 -> ../../devices/platform/dummy_udc.1/udc/dummy_udc.1
      |# echo dummy_udc.0 > UDC
      |# lsusb
      |Bus 001 Device 002: ID abcd:1234 Unknown
      |
      |lsusb -d abcd:1234 -v
      |Device Descriptor:
      …
      |  idVendor           0xabcd Unknown
      |  idProduct          0x1234
      |  bcdDevice            3.06
      |  iManufacturer           1 The manufacturer
      |  iProduct                2
      |  iSerial                 3 1122
      |  bNumConfigurations      2
      …
      |echo "" > UDC
      
      v5…v6
      - wired up strings with usb_gstrings_attach()
      - add UDC attribe. Write "udc-name" will bind the gadget. Write an empty
        string (it should contain \n since 0 bytes write get optimzed away)
        will unbind the UDC from the gadget. The name of available UDCs can be
        obtained from /sys/class/udc/
      
      v4…v5
      - string rework. This will add a strings folder incl. language code like
          strings/409/manufacturer
        as suggested by Alan.
      - rebased ontop reworked functions.c which has usb_function_instance
        which is used prior after "mkdir acm.instance" and can be directly
        used for configuration via configfs.
      
      v3…v4
       - moved functions from the root folde down to the gadget as suggested
         by Michał
       - configs have now their own configs folder as suggested by Michał.
         The folder is still name.bConfigurationValue where name becomes the
         sConfiguration. Is this usefull should we just stilc
         configs/bConfigurationValue/ ?
       - added configfs support to the ACM function. The port_num attribute is
         exported by f_acm. An argument has been added to the USB alloc
         function to distinguish between "old" (use facm_configure() to
         configure and configfs interface (expose a config_node).
         The port_num is currently a dumb counter. It will
         require some function re-work to make it work.
      
      scheduled for v5:
      - sym linking function into config.
      
      v2…v3
      - replaced one ifndef by ifdef as suggested by Micahał
      - strstr()/strchr() function_make as suggested by Micahł
      - replace [iSerialNumber|iProduct|iManufacturer] with
        [sSerialNumber|sProduct|sManufacturer] as suggested by Alan
      - added creation of config descriptors
      
      v1…v2
      - moved gadgets from configfs' root directory into /udcs/ within our
        "usb_gadget" folder. Requested by Andrzej & Michał
      - use a dot as a delimiter between function's name and its instance's name
        as suggested by Michał
      - renamed all config_item_type, configfs_group_operations, make_group,
        drop_item as suggested by suggested by Andrzej to remain consisten
        within this file and within other configfs users
      - Since configfs.c and functions.c are now part of the udc-core module,
        the module itself is now called udc. Also added a tiny ifdef around
        init code becuase udc-core is subsys init and this is too early for
        configfs in the built-in case. In the module case, we can only have
        one init function.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      88af8bbe
    • S
      usb: gadget: push tty port allocation from gadget into f_acm · c4ed4ac1
      Sebastian Andrzej Siewior 提交于
      It possible to allocate the tty port number within the "instance"
      structure of the function and there is no need to expose this
      information within the gadget and therefore it is removed here.
      This patch converts only f_acm and all its users. The other gadgets will
      follow once the function is converted to the function interface.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c4ed4ac1
    • S
      usb: gadget: move the global the_dev variable to their users · d6a01439
      Sebastian Andrzej Siewior 提交于
      the u_ether.c file has a global variable named the_dev which keeps a
      pointer to the network device after it has been created via
      gether_setup_name(). It is only used internally by u_ether. This patches
      moves the variable to its users and passes it via the port.ioport where
      it is saved later anyway.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d6a01439