summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'usb-for-v4.1' of ↵Greg Kroah-Hartman2015-03-2419-1535/+2126
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.1 merge window As usual, a big pile of commits. This time a total of 111 non-merge commits. Other than the usual set of cleanups and non-critical fixes, we have some interesting work for AM335x's MUSB babble recovery. Now that takes a lot less time and we don't have to Reset MUSB all the time. The printer gadget has been converted to configfs interface and the atmel udc has learned suspend/resume with wakeup. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_printer: fix dependenciesAndrzej Pietrasiewicz2015-03-241-0/+1
| | | | | | | | | | | | | | | | If f_printer is selected without legacy g_printer, it should depend on USB_CONFIGFS which pulls in libcomposite. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: atmel_usba: use endian agnostic IO on ARMBen Dooks2015-03-192-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from using the __raw IO accesors to the endian agnostic versions of readl/writel_relaxed when not on AVR32. This fixes issues with running big endian on ARMv7. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> -- CC: Nicolas Ferre <nicolas.ferre@atmel.com> CC: Felipe Balbi <balbi@ti.com> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: constify of_device_id arrayFabian Frederick2015-03-191-1/+1
| | | | | | | | | | | | | | | | of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: goku_udc: Remove uses of seq_<foo> return valuesJoe Perches2015-03-191-111/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The seq_printf/seq_puts/seq_putc return values, because they are frequently misused, will eventually be converted to void. See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Miscellanea: o Coalesce formats, realign arguments o Create static functions for statement expression macros o Use c90 style comments instead of c99 Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: udc: add usb_udc_vbus_handlerPeter Chen2015-03-191-1/+33
| | | | | | | | | | | | | | | | | | This commit updates udc core vbus status, and try to connect or disconnect gadget. Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: udc: store usb_udc pointer in struct usb_gadgetPeter Chen2015-03-191-25/+9
| | | | | | | | | | | | | | | | | | | | | | | | Instead of iterate to find usb_udc according to usb_gadget, this way is easier. Alan Stern suggests this way too: http://marc.info/?l=linux-usb&m=142168496528894&w=2 Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_printer: use non-zero flag for bitwise andAndrzej Pietrasiewicz2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | USB_DIR_OUT happens to be zero, so the result of bitwise and is always 0. Consequently, break will never happen in the SOFT_RESET case. This patch uses a compatible condition with a non-zero USB_DIR_IN, which might or might not evaluate to zero. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: use after free in gprinter_alloc_inst()Dan Carpenter2015-03-131-0/+1
| | | | | | | | | | | | | | | | There was a missing goto so we free "opts" and then dereference it. Fixes: ee1cd515e889 ('usb: gadget: printer: add configfs support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: delete some dead codeDan Carpenter2015-03-131-5/+0
| | | | | | | | | | | | | | | | "num" is a u16 so it can't go higher than 65535. kstrtou16() has a range check built in so this is already handled. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: serial: %pf is only for function pointersScott Wood2015-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use %ps for actual addresses, otherwise you'll get bad output on arches like ppc64 where %pf expects a function descriptor (which is not what __builtin_return_address returns). Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com> Cc: linux-usb@vger.kernel.org CC: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: lpc32xxx_udc: Fix NULL dereferencePeter Chen2015-03-111-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | udc is then checked for NULL, if NULL, it is then dereferenced as udc->dev, it is found using Coccinelle. We simplify the code to fix this problem, and we delete some conditions at if {} which will never be met. Reported-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Reported-by : Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_hid: remove unnecessary usb_ep_dequeue()Robert Baldyga2015-03-111-1/+0
| | | | | | | | | | | | | | | | | | Function usb_ep_disable() causes completion of all requests queued for given endpoint, so there is no need to dequeue them after endpoint disabling. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: dummy-hcd: Remove utf8 from format stringRasmus Villemoes2015-03-111-1/+1
| | | | | | | | | | | | | | | | | | Not everybody uses a utf8 locale (unfortunately), so let's avoid non-ascii characters in the kernel log. Replace the 3-byte utf8 sequence with a 3-byte ascii equivalent. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: atmel_usba_udc: Add suspend/resume with wakeup supportSylvain Rochet2015-03-111-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add suspend/resume with wakeup support for Atmel USBA. On suspend: We stay continuously clocked if Vbus signal is not available. If Vbus signal is available we set the Vbus signal as a wake up source then we stop the USBA itself and all clocks used by USBA. On resume: We recover clocks and USBA if we stopped them. If a device is currently connected at resume time we enable the controller. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: atmel_usba_udc: condition clocks to vbus stateSylvain Rochet2015-03-112-48/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If USB PLL is not necessary for other USB drivers (e.g. OHCI and EHCI) we will reduce power consumption by switching off the USB PLL if no USB Host is currently connected to this USB Device. We are using Vbus GPIO signal to detect Host presence. If Vbus signal is not available then the device stays continuously clocked. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQSylvain Rochet2015-03-111-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vbus IRQ handler needs a started UDC driver to work because it uses udc->driver, which is set by the UDC start handler. The previous way chosen was to return from interrupt if udc->driver is NULL using a spinlock around the check. We now request an auto disabled (IRQ_NOAUTOEN) Vbus signal IRQ instead of an auto enabled IRQ followed by disable_irq(). This way we remove the very small timeslot of enabled IRQ which existed previously between request() and disable(). We don't need anymore to check if udc->driver is NULL in IRQ handler. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: atmel_usba_udc: Fixed vbus_prev initial stateSylvain Rochet2015-03-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_mass_storage: use defined constant instead of numeric valueTal Shorer2015-03-111-1/+1
| | | | | | | | | | | | | | | | replace numeric value with TYPE_NO_LUN (defined in <scsi/scsi.h>) Signed-off-by: Tal Shorer <tal.shorer@gmail.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: Fix typo fond in Documentation/Docbook/gadget.xmlMasanari Iida2015-03-111-2/+2
| | | | | | | | | | | | | | | | | | This patch fix some spelling typo found in gadget.xml. It is because this file is generated from comments in sources, I had to fix comments in the source, instead of xml file itself. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: add configfs supportAndrzej Pietrasiewicz2015-03-103-2/+148
| | | | | | | | | | | | | | | | Add support for configfs interface so that f_printer can be used as a component of usb gadgets composed with it. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: use module_usb_composite_driver helper macroAndrzej Pietrasiewicz2015-03-101-13/+1
| | | | | | | | | | | | | | Substitute some boilerplate code with a dedicated macro. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_printer: remove compatibility layerAndrzej Pietrasiewicz2015-03-101-113/+0
| | | | | | | | | | | | | | There are no old interface users left, so it can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: convert to new interface of f_printerAndrzej Pietrasiewicz2015-03-102-14/+37
| | | | | | | | | | | | | | | | The goal is to remove the old function interface, so its (only) user must be converted to the new interface. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: f_printer: convert to new function interface with backward ↵Andrzej Pietrasiewicz2015-03-105-1/+220
| | | | | | | | | | | | | | | | | | | | | | | | compatibility In order to add configfs support, a usb function must be converted to use the new interface. This patch converts the function to the new interface and provides backward compatiblity layer, which can be removed after all its users are converted to use the new interface. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: factor out f_printerAndrzej Pietrasiewicz2015-03-102-1249/+1285
| | | | | | | | | | | | | | | | | | The legacy printer gadget now contains both a reusable printer function and legacy gadget proper implementations interwoven, but logically separate. This patch factors out a reusable f_printer. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: allocate printer_dev instances dynamicallyAndrzej Pietrasiewicz2015-03-101-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | With all the obstacles removed it is possible to allow more than one instance of the printer function. Since the function requires allocating character device region, a maximum number of allowed instances is defined. Such an approach is used in f_acm and in f_hid. With multiple instances it does not make sense to depend on a lock_printer_io member of a dynamically allocated (and destroyed) struct printer_dev to clean up after all instances of the printer function. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: add req_match for printer functionAndrzej Pietrasiewicz2015-03-101-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that a given usb_ctrlrequest is meant for printer function. The following parts of the request are tested: - bmRequestType:Data transfer direction - bmRequestType:Type - bmRequestType:Recipient - bRequest - wValue for bRequest 1 and 2 - wLength Additionally, the request is considered meant for this function iff the decoded interface number matches dev->interface. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: name class specific requestsAndrzej Pietrasiewicz2015-03-101-3/+6
| | | | | | | | | | | | | | Avoid using magic numbers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: composite: add req_match method to usb_functionAndrzej Pietrasiewicz2015-03-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-standard requests can encode the actual interface number in a non-standard way. For example composite_setup() assumes that it is w_index && 0xFF, but the printer function encodes the interface number in a context-dependet way (either w_index or w_index >> 8). This can lead to such requests being directed to wrong functions. This patch adds req_match() method to usb_function. Its purpose is to verify that a given request can be handled by a given function. If any function within a configuration provides the method and it returns true, then it is assumed that the right function is found. If a function uses req_match(), it should try as hard as possible to determine if the request is meant for it. If no functions in a configuration provide req_match or none of them returns true, then fall back to the usual approach. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: add container_of helper for printer_devAndrzej Pietrasiewicz2015-03-101-5/+10
| | | | | | | | | | | | | | | | 5 uses of container_of() in the same context justify wrapping it in a static inline function. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: don't access file global usb_printer_gadget in ↵Andrzej Pietrasiewicz2015-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | function's code The printer_dev can be recovered from printer_func_unbind() function's parameters. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: eliminate file global printer_mutexAndrzej Pietrasiewicz2015-03-101-3/+0
| | | | | | | | | | | | | | | | The mutex is a legacy after semi-automatic Big Kernel Lock removal. printer_open() does its own locking, so no need to duplicate it. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: call gprinter_setup() from gadget's bindAndrzej Pietrasiewicz2015-03-101-17/+18
| | | | | | | | | | | | | | | | | | Call gprinter_setup() from gadget's bind instead of module's init. Call gprinter_cleaup() corerspondingly. This detaches printer function's logic from legacy printer gadget's implementation. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: add setup and cleanup functionsAndrzej Pietrasiewicz2015-03-101-15/+31
| | | | | | | | | | | | | | | | Factor out gprinter_setup() and gprinter_cleanup() so that it is easy to change the place they are called from. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: don't access file global pnp_string in function's codeAndrzej Pietrasiewicz2015-03-101-6/+8
| | | | | | | | | | | | | | | | | | In order to factor out a reusable f_printer, the function's code should not use file global variables related to legacy printer gadget's implementation. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: define pnp string buffer lengthAndrzej Pietrasiewicz2015-03-101-2/+4
| | | | | | | | | | | | | | Avoid using magic numbers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: move function-related unbind code to function's unbindAndrzej Pietrasiewicz2015-03-101-33/+25
| | | | | | | | | | | | | | | | | | | | In order to factor out a reusable f_printer.c, the code related to the function should be placed in functions related to the function. printer_cfg_unbind() becomes empty, so it is removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: call usb_add_function() lastAndrzej Pietrasiewicz2015-03-101-5/+4
| | | | | | | | | | | | | | | | | | | | | | Conversion to the new function interface requires splitting a <something>_bind_config() function into two parts: allocation of container_of struct usb_function and invocation of usb_add_function(). This patch moves the latter to the end of the f_printer_bind_config() in order to enable conversion to the new interface. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: move function-related bind code to function's bindAndrzej Pietrasiewicz2015-03-101-48/+66
| | | | | | | | | | | | | | | | In order to factor out a reusable f_printer.c, the code related to the function should be placed in functions related to the function. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: standardize printer_do_configAndrzej Pietrasiewicz2015-03-101-15/+24
| | | | | | | | | | | | | | | | Follow the convention of distributing source code between <something>_do_config() and <something>_bind_config(). Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: follow the naming convention for usb_add_config callbackAndrzej Pietrasiewicz2015-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Legacy gadgets, before converting them to the new function framework, used to use the name <something>_do_config() for usb_add_config()'s callback. This patch changes the name so that it is easier to follow the convention. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: eliminate pdev member of struct printer_devAndrzej Pietrasiewicz2015-03-101-4/+4
| | | | | | | | | | | | | | | | The pdev member of struct printer_dev is not used outside printer_bind_config(), so it can just as well be a local variable there. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: add missing error handlingAndrzej Pietrasiewicz2015-03-101-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If cdev_add() in printer_bind_config() fails, care is taken to reverse the effects of initializations completed until the fail happens. But if printer_req_alloc() fails, it is just one of the two lists that is cleaned up while the effects of cdev_add() and device_create() are not reverted. This patch changes error handling so that at least as much cleanup is done as when a failure happens before printer_req_alloc() invocations. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: revert usb_add_function() effect in error recoveryAndrzej Pietrasiewicz2015-03-101-0/+1
| | | | | | | | | | | | | | | | Whenever the "goto fail" branch is taken, the effect of usb_add_function() should be reverted. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: eliminate random pointer dereferenceAndrzej Pietrasiewicz2015-03-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct printer_dev contains 3 list heads: tx_reqs, rx_reqs and rx_buffers. There is just one instance of this structure in the driver and it is file static, and as such initialized with all zeros. If device_create() or cdev_add() fails then "goto fail" branch is taken, which results in printer_cfg_unbind() call. The latter checks if tx_reqs, rx_reqs and rx_buffers lists are empty. The check for emptiness is in fact a check whether the "next" member of struct list_head points to the head of the list. But the heads of the lists in question have not been initialized yet and, as mentioned above, contain all zeros, so list_empty() returns false and respective "while" loop body starts executing. Here, container_of() just subtracts the offset of a struct usb_request member from an address of this same member, which results in a value somewhere near 0 or 0xfff...ff. And the argument to list_del() dereferences such a pointer which causes a disaster. This patch moves respective INIT_LIST_HEAD() invocations to a point before "goto fail" branch can be taken. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: remove unused and empty printer_unbindAndrzej Pietrasiewicz2015-03-101-6/+0
| | | | | | | | | | | | | | | | The unbind() method is optional is usb_composite_driver. In this particular driver the method does nothing so it can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: printer: enqueue printer's response for setup requestAndrzej Pietrasiewicz2015-03-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function-specific setup requests should be handled in such a way, that apart from filling in the data buffer, the requests are also actually enqueued: if function-specific setup is called from composte_setup(), the "usb_ep_queue()" block of code in composite_setup() is skipped. The printer function lacks this part and it results in e.g. get device id requests failing: the host expects some response, the device prepares it but does not equeue it for sending to the host, so the host finally asserts timeout. This patch adds enqueueing the prepared responses. Cc: <stable@vger.kernel.org> # v3.4+ Fixes: 2e87edf49227: "usb: gadget: make g_printer use composite" Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: composite: don't try standard handling for non-standard requestsAndrzej Pietrasiewicz2015-03-101-0/+7
| | | | | | | | | | | | | | | | | | | | If a non-standard request is processed and its parameters just happen to match those of some standard request, the logic of composite_setup() can be fooled, so don't even try any switch cases, just go to the proper place where unknown requests are handled. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: net2280: silence sparse warningFelipe Balbi2015-03-101-0/+2
| | | | | | | | | | | | | | | | | | Silence the following warning: drivers/usb/gadget/udc/net2280.c:3176:33: warning: context imbalance in 'handle_stat1_irqs' - unexpected unlock Signed-off-by: Felipe Balbi <balbi@ti.com>