summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | usb: gadget: f_midi: convert to new function interface with backward ↵Andrzej Pietrasiewicz2014-11-055-6/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compatibility Converting midi to the new function interface requires converting the USB midi's function code and its users. This patch converts the f_midi.c to the new function interface. The file can now be compiled into a separate usb_f_midi.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: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: f_midi: check kstrdup() return valueAndrzej Pietrasiewicz2014-11-051-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kstrdup() might fail, so check its return value and react appropriately. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: f_midi: enable use of the index parameterAndrzej Pietrasiewicz2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The soundcard index to use for the ALSA device creation is passed as a parameter to f_midi_bind_config(), but is assigned to midi->index only after the call to f_midi_register_card(midi). So no matter what is passed to f_midi_bind_config(), the actual index for snd_card_new() is always 0. This probably works ok if at the moment of f_midi's bind there are no other snd_cards, but if there are, it is not possible to bind f_midi. This patch moves the assignment to a place before the call to f_midi_register_card(midi). Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: Kconfig: enable separate compilation of uac1/uac2 functionsAndrzej Pietrasiewicz2014-11-051-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uac1 and uac2 functions are available through the configfs interface and it should be possible to build them without building their legacy gadgets. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: fix ptr_ret.cocci warningsFengguang Wu2014-11-031-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/usb/gadget/udc/r8a66597-udc.c:1849:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: function: Added usb_assign_descriptors failure checkPavitrakumar Managutte2014-11-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added failure check for usb_assign_descriptors call in bind function. Acked-By: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Pavitrakumar Managutte <pavitra1729@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: pxa27x: do not call usb_gadget_unregister_driver()Felipe Balbi2014-11-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that call is completely unnecessary because usb_del_gadget_udc() already makes sure the gadget driver is properly unregistered from the UDC. Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: net2272: do not call usb_gadget_unregister_driver()Felipe Balbi2014-11-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that call is completely unnecessary because usb_del_gadget_udc() already makes sure the gadget driver is properly unregistered from the UDC. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: dummy: do not call usb_gadget_unregister_driver()Felipe Balbi2014-11-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that call is completely unnecessary because usb_del_gadget_udc() already makes sure the gadget driver is properly unregistered from the UDC. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: pxa27x_udc: fix clock prepare and enableRobert Jarzmik2014-11-031-21/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the udc clock controls both the output signals and the internal IP, it must be enabled before any UDC register is touched. The bug is revealed when the clock framework disables the clock for a couple of milliseconds during the boot sequence, and the endpoint configuration is lost. The bug is hidden when clock framework is not used, because no "unused clocks disable" occurs. This patch fixes the wrong behaviour by ensuring that : - whenever a UDC register is read or written, the clock is enabled - reworks the endpoints programming to have it done under running clock - reworks suspend/resume to ensure the same thing Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: pxa27x_udc: use devm_* helpersRobert Jarzmik2014-11-031-32/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_* helpers in the probe function to simplify the error path and the remove path. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: core: prepend udc_attach_driver with usb_Felipe Balbi2014-11-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes, just adding a prefix which should have been there from the start. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: remove unnecessary 'driver' argumentFelipe Balbi2014-11-0326-83/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that no UDC driver relies on the extra 'driver' argument to ->udc_stop(), we can safely remove it. This commit is based on previous work by Robert Baldyga <r.baldyga@samsung.com> which can be found at [1]; however that patch turned out to have a high probability of regressing many UDC drivers because of a blind search & replace s/driver/$udc->driver/ which caused the 'driver' argument to stop_activity() to be a valid non-NULL pointer when it should be NULL, thus causing UDCs to mistakenly call gadget driver's ->disconnect() callback. [1] http://markmail.org/message/x5zneg4xea4zntab Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: core: fix unregistering messageFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we're printing gadget driver name when registering and UDC name when unregistering. Standardize on always printing gadget driver name. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: s3c-hsudc: remove bind/unbind messagesFelipe Balbi2014-11-031-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: net2280: remove bind/unbind messagesFelipe Balbi2014-11-031-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: net2272: remove bind/unbind messagesFelipe Balbi2014-11-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: gr_udc: remove bind/unbind messagesFelipe Balbi2014-11-031-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: fsl_qe: remove bind/unbind messagesFelipe Balbi2014-11-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: dummy: remove bind/unbind messagesFelipe Balbi2014-11-031-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: atmel_usba: remove bind/unbind messagesFelipe Balbi2014-11-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: at91: remove bind/unbind messagesFelipe Balbi2014-11-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now that we provide generic register/unregister debugging messages from udc-core, we can remove the same messages from this driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: pass a single argument to usb_gadget_udc_start/stopFelipe Balbi2014-11-031-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know that our udc points to our gadget and our gadget_driver, simplify the interface by passing a single argument. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: s3c-hsudc: do not rely on 'driver' argumentFelipe Balbi2014-11-031-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: pxa27x: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: pxa25x: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: net2280: do not rely on 'driver' argumentFelipe Balbi2014-11-031-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: net2272: do not rely on 'driver' argumentFelipe Balbi2014-11-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: mv_udc: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: mv_u3d: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: lpc32xx: do not rely on 'driver' argumentFelipe Balbi2014-11-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: fsl_qe: do not rely on 'driver' argumentFelipe Balbi2014-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: dummy: do not rely on 'driver' argumentFelipe Balbi2014-11-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: at91: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc: amd5536: do not rely on 'driver' argumentFelipe Balbi2014-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: s3c-hsudc: delete unnecessary 'out of memory' messagesPeter Chen2014-11-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: bcm63xx_udc: delete unnecessary 'out of memory' messagesPeter Chen2014-11-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: fsl_qe_udc: delete unnecessary 'out of memory' messagesPeter Chen2014-11-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: mv_udc_core: delete unnecessary 'out of memory' messagesPeter Chen2014-11-031-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The memory subsystem has already had similar message for it. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: configfs: add suspend/resumeAndrzej Pietrasiewicz2014-11-032-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB gadgets composed with configfs lack suspend and resume methods. This patch uses composite_suspend()/composite_resume() the same way e.g. composite_setup() or composite_disconnect() are used in a configfs-based gadget. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: f_uac1: remove an unneeded NULL checkDan Carpenter2014-11-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This NULL check sets off a static checker warning because we already dereferenced "card" earlier in the function. However, since "card" is never NULL so we can just remove the check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: udc-core: call ->disconnect() when soft disconnectingFelipe Balbi2014-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when disconnecting from host using our soft_connect sysfs interface, also let the gadget driver know about it by calling the gadget driver's ->disconnect() method. No problems have been found while not calling ->disconnect() so far, it's just good convention. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: pxa27x_udc: add devicetree supportRobert Jarzmik2014-11-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for device-tree device discovery. If devicetree is not provided, fallback to legacy platform data "discovery". Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Cc: devicetree@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: pxa27x_udc: transfer mach_info into pxa_udcRobert Jarzmik2014-11-032-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the mach info, and store the udc_command in the pxa_udc control structure. It is to be noticed that the udc_is_connected() in mach info is not transfered. This was not used, as mioa701 machine doesn't need it, balloon3 doesn't really use it, and most importantly the current driver never uses it. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: pxa27x_udc: prepare device-tree supportRobert Jarzmik2014-11-032-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this preparation, a preliminary cleanup is done : - convert the probing of pxa27x_udc to gpio_desc. The conversion is partial because : - the platform data still provides a gpio number, not a gpio desc Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: composite: conditionally dequeue os_desc and setup requestsFelipe Balbi2014-11-031-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case we unload a gadget driver while any of os_desc_req or req are still pending, we need to make sure to dequeue them. By using our setup_pending and os_desc_pending flags we achieve that in a way that doesn't cause any regressions because we won't dequeue a request which was already completed. The original idea came from Li Jun's commit f2267089ea17fa97b796b1b4247e3f8957655df3 (usb: gadget: composite: dequeue cdev->req before free it in composite_dev_cleanup) which, unfortunately, caused two regressions (kfree() being called before usb_ep_dequeue() and calling usb_ep_dequeue() when the request was already completed). That commit also didn't take care of os_desc_req which can fall into the same situation so we must care for that one too. Note that in order to make code slightly easier to read, we introduce composite_ep_queue() which hides details about how to fiddle with our pending flags. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: composite: set our req->context to cdevFelipe Balbi2014-11-031-0/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | by doing that we will be able to match our requests against req and os_desc_req and also clear our pending flags from complete callback. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | | Merge branch 'for-linus' of ↵Linus Torvalds2014-12-122-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree update from Jiri Kosina: "Usual stuff: documentation updates, printk() fixes, etc" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (24 commits) intel_ips: fix a type in error message cpufreq: cpufreq-dt: Move newline to end of error message ps3rom: fix error return code treewide: fix typo in printk and Kconfig ARM: dts: bcm63138: change "interupts" to "interrupts" Replace mentions of "list_struct" to "list_head" kernel: trace: fix printk message scsi: mpt2sas: fix ioctl in comment zbud, zswap: change module author email clocksource: Fix 'clcoksource' typo in comment arm: fix wording of "Crotex" in CONFIG_ARCH_EXYNOS3 help gpio: msm-v1: make boolean argument more obvious usb: Fix typo in usb-serial-simple.c PCI: Fix comment typo 'COMFIG_PM_OPS' powerpc: Fix comment typo 'CONIFG_8xx' powerpc: Fix comment typos 'CONFiG_ALTIVEC' clk: st: Spelling s/stucture/structure/ isci: Spelling s/stucture/structure/ usb: gadget: zero: Spelling s/infrastucture/infrastructure/ treewide: Fix company name in module descriptions ...
| * | | treewide: fix typo in printk and KconfigMasanari Iida2014-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fix spelling typo in printk and Kconfig within various part of kernel sources. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | Merge Linus' tree to be be to apply submitted patches to newer code thanJiri Kosina2014-11-2074-962/+4702
| |\| | | | | | | | | | | | | | current trivial.git base