summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/acm_ms.c
Commit message (Collapse)AuthorAgeFilesLines
* USB: gadget: fix up some comments about CONFIG_USB_DEBUGGreg Kroah-Hartman2013-12-211-1/+1
| | | | | | | | | These two gadget drivers said that their #endif was for CONFIG_USB_DEBUG, but they really were not, so fix them up to be correct. Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: gadget: acm_ms: convert to new interface of f_mass_storageAndrzej Pietrasiewicz2013-10-101-39/+74
| | | | | | | | | | Convert the legacy acm_ms gadget to use the new function interface of f_mass_storage, so that later the compatibility layer in f_mass_storage can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: f_mass_storage: convert to new function interface with backward ↵Andrzej Pietrasiewicz2013-10-101-0/+1
| | | | | | | | | | | | | | | | compatibility Converting mass storage to the new function interface requires converting the USB mass storage's function code and its users. This patch converts the f_mass_storage.c to the new function interface. The file is now compiled into a separate usb_f_mass_storage.ko module. The old function interface is provided by means of a preprocessor conditional directives. After all users are converted, the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: create a utility module for mass_storageAndrzej Pietrasiewicz2013-10-011-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: push tty port allocation from gadget into f_acmSebastian Andrzej Siewior2013-04-031-14/+1
| | | | | | | | | | | 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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: acm_ms: use function framework for ACMSebastian Andrzej Siewior2013-01-211-6/+27
| | | | | | | | This patch converts the acm_ms gadget to make use of the function framework to request the ACM function. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: f_acm: convert to new function interface with backwards ↵Sebastian Andrzej Siewior2013-01-211-1/+1
| | | | | | | | | | | | | compatibility 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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: allocate & giveback serial ports instead hard code themSebastian Andrzej Siewior2013-01-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | This patch removes gserial_setup() and gserial_cleanup() and adds gserial_alloc_line() and gserial_free_line() to replace them. The initial setup of u_serial happens now on module load time. A maximum of four TTY ports can be requested which is the current limit. In theory we could extend this limit, the hard limit is the number of available endpoints. alloc_tty_driver() is now called at module init time with the max available ports. The per-line footprint here is on 32bit is 3 * size of pointer + 60 bytes (for cdevs). The remaining memory (struct gs_port) is allocated once a port is requested. With this change it is possible to load g_multi and g_serial at the same time. GS0 receives the module that is loaded first, GS1 is received by the next module and so on. With the configfs interface the port number can be exported and the device node is more predictable. Nothing changes for g_serial and friends as long as one module is used. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: u_serial: convert into a moduleSebastian Andrzej Siewior2013-01-211-1/+0
| | | | | | | | | | | 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: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove usb_gadget_controller_number()Sebastian Andrzej Siewior2012-09-101-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bcdDevice field is defined as |Device release number in binary-coded decimal in the USB 2.0 specification. We use this field to distinguish the UDCs from each other. In theory this could be used on the host side to apply certain quirks if the "special" UDC in combination with this gadget is used. This hasn't been done as far as I am aware. In practice it would be better to fix the UDC driver before shipping since a later release might not need this quirk anymore. There are some driver in tree (on the host side) which use the bcdDevice field to figure out special workarounds for a given firmware revision. This seems to make sense. Therefore this patch converts all gadgets (except a few) to use the kernel version instead a random 2 or 3 plus the UDC number. The few that don't report kernel's version are: - webcam This one reports always a version 0x10 so allow it to do so in future. - nokia This one reports always 0x211. The comment says that this gadget works only if the UDC supports altsettings so I added a check for this. - serial This one reports 0x2400 + UDC number. Since the gadget version is 2.4 this could make sense. Therefore bcdDevice is 0x2400 here. I also remove various gadget_is_<name> macros which are unused. The remaining few macros should be moved to feature / bug bitfield. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: move composite.c into libcompositeSebastian Andrzej Siewior2012-09-101-1/+1
| | | | | | | | | This moves composite.c into libcomposite and updates all gadgets. Finally! Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: Provide a default implementation of default manufacturer stringSebastian Andrzej Siewior2012-09-101-11/+1
| | | | | | | | | | | | | | | | | Some gadgets provide custom entry here. Some may override it with an etntry that is also created by composite if there was no value sumbitted at all. This patch removes all "custom manufacturer" strings which are the same as these which are created by composite. Then it moves the creation of the default manufacturer string to usb_composite_overwrite_options() in case no command line argument has been used and the entry is still an empty string. By doing this we get rid of the global variable "composite_manufacturer" in composite. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: make sure each gadget is using same index for Product, Serial,…Sebastian Andrzej Siewior2012-09-101-7/+5
| | | | | | | | | | | | | | The index in usb_string array is defined by the gadget. The gadget can choose which index entry it assigns for the serial number and which the product name. The gadget has just to ensure that the descriptor contains the proper string id which is assigned by composite. If the composite layer knows the index of the "default" information which will be overwritten by module parameters, it can be used later to overwrite it. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: push VID/PID/USB BCD module option into gadgetsSebastian Andrzej Siewior2012-09-101-0/+2
| | | | | | | | | | | This patch moves the module options idVendor, idProduct and bcdDevice from composite.c into each gadgets. This ensures compatibility with current gadgets and removes the global variable which brings me step closer towards composite.c in libcomposite Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: use usb_string_ids_tab instead multiple usb_string_id()Sebastian Andrzej Siewior2012-09-101-9/+3
| | | | | | | | | Using usb_string_ids_tab() instead multiple calls of usb_string_id() seems to be handy. It also allows to add string without many checks. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: add epautoconf.c to libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | This patch adds epautoconf.c into libcomposite and updates all gadgets. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: libcomposite: move config.c into libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | This patch moves config.c into libcomposite and updates all gadgets. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: start with libcompositeSebastian Andrzej Siewior2012-09-101-1/+0
| | | | | | | | | | This patch aims to be simple. It removes #include usbstribgs.c line from each gadget and creates libcomposite.ko which has only one member, that is usbstribgs.c. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: move bind() callback back to struct usb_composite_driverSebastian Andrzej Siewior2012-09-101-1/+2
| | | | | | | | | | | This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in struct usb_composite_driver") and fixes new drivers. The section missmatch problems was solved by whitelisting structs in question via __ref. Cc: devel@driverdev.osuosl.org Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: push all usb_composite_driver structs into __refdataSebastian Andrzej Siewior2012-09-101-1/+1
| | | | | | | | | | | | | | As it turns out, Sam's comment was better than I initially assumed. This patch pushes as struct usb_composite_driver data structures into __refdata section to avoid a section missmatch report from modpost because the ->bind() can be marked __init. The only downside is that modpost does not check between ->bind() and other member. However, it is temporary. Cc: Sam Ravnborg <sam@ravnborg.org> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: acm_ms: need to set max_speedSteve Bennett2012-06-221-0/+1
| | | | | | | | Failing to set max_speed prevents g_acm_ms working with many drivers which check for driver->max_speed < USB_SPEED_FULL, including pxa25x_udc Signed-off-by: Steve Bennett <steveb@workware.net.au> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: add new usb gadget for ACM and mass storageKlaus Schwarzkopf2011-10-131-0/+256
This driver provides two functions in one configuration: a mass storage, and a ACM (serial port) link. Heavily based on multi.c and cdc2.c Signed-off-by: Klaus Schwarzkopf <schwarzkopf@sensortherm.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud