1. 21 8月, 2014 1 次提交
    • P
      usb: gadget: remove $(PWD) in ccflags-y · 5d197038
      Philippe Reynes 提交于
      The variable $(PWD) is useless, and it may break the compilation.
      For example, it breaks the kernel compilation when it's done with
      buildroot :
      
        /home/trem/Codes/armadeus/armadeus/buildroot/output/host/usr/bin/ccache
      /home/trem/Codes/armadeus/armadeus/buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc
      -Wp,-MD,drivers/usb/gadget/legacy/.hid.o.d  -nostdinc -isystem
      /home/trem/Codes/armadeus/armadeus/buildroot/output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.7.3/include
      -I./arch/arm/include -Iarch/arm/include/generated  -Iinclude
      -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi
      -I./include/uapi -Iinclude/generated/uapi -include
      ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef
      -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
      -Werror-implicit-function-declaration -Wno-format-security
      -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp
      -funwind-tables -marm -D__LINUX_ARM_ARCH__=5 -march=armv5te
      -mtune=arm9tdmi -msoft-float -Uarm -fno-delete-null-pointer-checks -O2
      --param=allow-store-data-races=0 -Wframe-larger-than=1024
      -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer
      -fno-var-tracking-assignments -g -Wdeclaration-after-statement
      -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
      -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO
      -I/home/trem/Codes/armadeus/armadeus/buildroot/drivers/usb/gadget/
      -I/home/trem/Codes/armadeus/armadeus/buildroot/drivers/usb/gadget/udc/
      -I/home/trem/Codes/armadeus/armadeus/buildroot/drivers/usb/gadget/function/
      -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hid)"
      -D"KBUILD_MODNAME=KBUILD_STR(g_hid)" -c -o
      drivers/usb/gadget/legacy/hid.o drivers/usb/gadget/legacy/hid.c
      drivers/usb/gadget/epautoconf.c:23:26: erreur fatale: gadget_chips.h :
      Aucun fichier ou dossier de ce type
      
      This compilation line include :
      ..../buildroot/driver/usb/gadget
      but the real path is :
      ..../buildroot/output/build/linux-3.17-rc1/driver/usb/gadget
      Signed-off-by: NPhilippe Reynes <tremyfr@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      5d197038
  2. 17 7月, 2014 3 次提交
  3. 25 4月, 2014 1 次提交
  4. 24 12月, 2013 1 次提交
  5. 13 12月, 2013 2 次提交
  6. 27 11月, 2013 1 次提交
  7. 12 10月, 2013 1 次提交
  8. 10 10月, 2013 2 次提交
  9. 01 10月, 2013 1 次提交
    • A
      usb: gadget: create a utility module for mass_storage · 6fdc5dd2
      Andrzej Pietrasiewicz 提交于
      Converting to configfs requires making the f_mass_storage.c a module.
      
      But first we need to get rid of "#include "storage_common.c".
      
      This patch makes storage_common.c a separately compiled file, which is
      built as a utility module named u_ms.ko. After all mass storage users are
      converted to the new function interface this module can be eliminated
      by merging it with the mass storage function's module.
      
      USB descriptors are exported so that they can be accessed from
      f_mass_storage.
      
      FSG_VENDOR_ID and FSG_PRODUCT_ID are moved to their only user.
      
      Handling of CONFIG_USB_GADGET_DEBUG_FILES is moved to f_mass_storage.c.
      The fsg_num_buffers static is moved to FSG_MODULE_PARAMETER users, so
      instead of using a global variable the f_mass_storage introduces
      fsg_num_buffers member in fsg_common (and fsg_config).
      
      fsg_strings and fsg_stringtab are moved to f_mass_storage.c.
      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>
      6fdc5dd2
  10. 29 7月, 2013 1 次提交
    • F
      usb: gadget: remove imx_udc · 2b0c4953
      Felipe Balbi 提交于
      That driver hasn't been really maintained for
      a long time. It doesn't compile in any way, it
      includes non-existent headers, has no users,
      and is just plain broken.
      
      The person who used to work with that driver
      has publicly stated that he has no plans to
      touch that driver again and is ok with removal[1].
      
      Due to these factors, imx_udc is now removed from
      the tree, if someone really believe it needs to
      be kept, please fix the bugs in that driver.
      
      [1] http://marc.info/?l=linux-usb&m=136197620417636&w=2Signed-off-by: NFelipe Balbi <balbi@ti.com>
      2b0c4953
  11. 10 6月, 2013 9 次提交
  12. 03 4月, 2013 4 次提交
    • 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: 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: 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
  13. 04 3月, 2013 1 次提交
  14. 22 1月, 2013 4 次提交
    • S
      usb: gadget: f_acm: convert to new function interface with backwards compatibility · ff47f594
      Sebastian Andrzej Siewior 提交于
      This patch converts f_acm into a module which uses the new function
      interface. It also converts one of its users that is g_serial to make
      use of it. The other users of it (g_nokia for instance) are still using
      the old include file system and should not notice the change at all. So
      they can be converter later independently.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ff47f594
    • S
      usb: gadget: u_serial: convert into a module · 3249ca22
      Sebastian Andrzej Siewior 提交于
      Every user of u_serial has now to select the U_SERIAL symbol instead of
      including the file.
      There is one limition with this: ports and and gs_tty_driver are global
      variables in u_serial. Since all users share them, there can be only one
      user loaded at a time i.e. either g_serial or g_nokia.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3249ca22
    • S
      usb: gadget: convert source sink and loopback to new function interface · cf9a08ae
      Sebastian Andrzej Siewior 提交于
      This patch converts the f_sourcesink and f_loopback file to the USB-function
      module. Both functions shares a few common utility functions which are
      currently implemented in g_zero.c itself. This patch moves the common
      code into the sourcesink file and creates one module out of the the two
      functions (source sink and loop back).
      The g_zero gadget is function specific to source sink and loop back to
      set a few options. This Symbol dependency enforces a modul load right
      now.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      cf9a08ae
    • S
      usb: gadget: add some infracture to register/unregister functions · de53c254
      Sebastian Andrzej Siewior 提交于
      This patch provides an infrastructure to register & unregister a USB
      function. This allows to turn a function into a module and avoid the
      '#include "f_.*.c"' magic and we get a clear API / cut between the bare
      gadget and its functions.
      The concept is simple:
      Each function defines the DECLARE_USB_FUNCTION_INIT macro whith an unique
      name of the function and two allocation functions.
      - one to create an "instance". The instance holds the current configuration
        set. In case there are two usb_configudations with one function there will
        be one instance and two usb_functions
      - one to create an "function" from the instance.
      
      The name of the instance is used to automaticaly load the module if it the
      instance is not yet available.
      The usb_function callbacks are slightly modified and extended:
      - usb_get_function()
        creates a struct usb_function inclunding all pointers (bind,
        unbind,…). It uses the "instance" to map its configuration. So we can
        have _two_ struct usb_function, one for each usb_configuration.
      - ->unbind()
        Since the struct usb_function was not allocated in ->bind() it should
        not kfree()d here. This function should only reverse what happens in
        ->bind() that is request cleanup and the cleanup of allocated
        descriptors.
      - ->free_func()
        a simple kfree() of the struct usb_function
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      de53c254
  15. 08 11月, 2012 1 次提交
  16. 10 9月, 2012 6 次提交
  17. 05 9月, 2012 1 次提交