summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | usb: gadget: s3c-hsotg: fix clear feature ENDPOINT_HALTRobert Baldyga2013-10-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All requests for endpoint are completed when it was halted and the halt was cleared by CLEAR_FEATURE, but not when new state is same as previous. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: fix "halted" property updatingRobert Baldyga2013-10-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Property "halted" of s3c_hsotg_ep structure is actually initialised when ep enabled, and changed when halt is set/cleared. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: add DAINT maskingRobert Baldyga2013-10-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In OEPInt/IEPInt interrupts handling added bitwise and of DAINT and DAINTMSK, because we should handle masked interrupts only. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: fix endpoint interrupts handlingRobert Baldyga2013-10-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When s3c_hsotg_trytx is called for ep without enqueued request, interrupts for this ep are disabled, to prevent interrupt flooding. Interrupts are enabled when new request for this ep is starting. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: fix s3c_hsotg_write_fifo function for dedicated fifo ↵Robert Baldyga2013-10-151-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode In s3c_hsotg_write_fifo function PTxFEmp/NPTxFEmp interrupts are enabled only in shared-fifo mode. In dedicated-fifo mode they should not be used (when enabled then cause interrupt storm). Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: fix "protocol stall" handlingRobert Baldyga2013-10-151-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After normal handling of SetupDone interrupt, XferCompl interrupt occurs, and then we enqueue new setup request. But when ep0 is stalled, there is no XferCompl, so we have to enqueue setup request immediately after stalling ep. Otherwise incoming control requests won't be processed correctly. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: storage_common: pass filesem to fsg_store_cdromAndrzej Pietrasiewicz2013-10-153-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If cdrom flag is set ro flag is implied. Try setting the ro first, and only if it succeeds set the cdrom flag. 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: storage_common: use strtobool instead of kstrtouintAndrzej Pietrasiewicz2013-10-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strtobool is more flexible for the user and is more appropriate in the context. 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: phy: don't return with NULL from devm_usb_get_phy()Gabor Juhos2013-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callers are expecting an ERR_PTR value in case of an error. Change he code to return with an encoded -ENOMEM value in the case of a failed devres_alloc call. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: Make VERBOSE_DEBUG enableable via KconfigAndreas Larsson2013-10-112-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a way for VERBOSE_DEBUG to be enabled during drivers/usb/gadget/ build. Signed-off-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: remove unused labelRobert Baldyga2013-10-111-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes unused label. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: add multi count supportRobert Baldyga2013-10-111-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds Multi Count support. It adds few modifications: - Fix s3c_hsotg_set_ep_maxpacket() function. Field wMaxPacketSize of endpoint descriptor is now splitted into maximum packet size value and number of additional transaction per microframe. - Modify s3c_hsotg_write_fifo() function. It actually calculates transfer size, taking into account Multi Count value, which indicates number of transactions per microframe. - Fix s3c_hsotg_start_req() function by setting number of packets to Multi Count field in DIEPTSIZ register for isochronous endpoints. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: add isochronous transfers supportRobert Baldyga2013-10-111-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds isochronous transfer support. It adds few modifications: - Modify s3c_hsotg_epint() function. Some interrupts are ignored for isochronous endpoints, (e.g. INTknTXFEmpMsk) becouse isochronous request is always transfered in single transaction, which ends with XferCompl interrupt. - Add Odd/Even microframe toggle to allow data transfering in each microframe in s3c_hsotg_epint() function. - Fix s3c_hsotg_ep_enable() function by supporting isochronous endpoint type. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: dwc3: core: use pm_runtime_put_sync() on removeFelipe Balbi2013-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to disable runtime_pm and we're removing the driver, we must disable the device now. Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Add RCAR Gen2 USB phyValentine Barshak2013-10-103-0/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds RCAR Gen2 USB phy support. The driver configures USB channels 0/2 which are shared between PCI USB hosts and USBHS/USBSS devices. It also controls internal USBHS phy. Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: musb: cancel work on removalSebastian Andrzej Siewior2013-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So I captured this: |WARNING: CPU: 0 PID: 2078 at /home/bigeasy/work/new/TI/linux/lib/debugobjects.c:260 debug_print_object+0x94/0xc4() |ODEBUG: free active (active state 0) object type: work_struct hint: musb_irq_work+0x0/0x38 [musb_hdrc] |CPU: 0 PID: 2078 Comm: rmmod Not tainted 3.12.0-rc4+ #338 |[<c0014d38>] (unwind_backtrace+0x0/0xf4) from [<c001249c>] (show_stack+0x14/0x1c) |[<c001249c>] (show_stack+0x14/0x1c) from [<c0037720>] (warn_slowpath_common+0x64/0x84) |[<c0037720>] (warn_slowpath_common+0x64/0x84) from [<c00377d4>] (warn_slowpath_fmt+0x30/0x40) |[<c00377d4>] (warn_slowpath_fmt+0x30/0x40) from [<c022ae90>] (debug_print_object+0x94/0xc4) |[<c022ae90>] (debug_print_object+0x94/0xc4) from [<c022b7e0>] (debug_check_no_obj_freed+0x1c0/0x228) |[<c022b7e0>] (debug_check_no_obj_freed+0x1c0/0x228) from [<c00f1f38>] (kfree+0xf8/0x228) |[<c00f1f38>] (kfree+0xf8/0x228) from [<c02921c4>] (release_nodes+0x1a8/0x248) |[<c02921c4>] (release_nodes+0x1a8/0x248) from [<c028f70c>] (__device_release_driver+0x98/0xf0) |[<c028f70c>] (__device_release_driver+0x98/0xf0) from [<c028f840>] (device_release_driver+0x24/0x34) |[<c028f840>] (device_release_driver+0x24/0x34) from [<c028ebe8>] (bus_remove_device+0x148/0x15c) |[<c028ebe8>] (bus_remove_device+0x148/0x15c) from [<c028d120>] (device_del+0x104/0x1c0) |[<c028d120>] (device_del+0x104/0x1c0) from [<c02911e4>] (platform_device_del+0x18/0xac) |[<c02911e4>] (platform_device_del+0x18/0xac) from [<c029179c>] (platform_device_unregister+0xc/0x18) |[<c029179c>] (platform_device_unregister+0xc/0x18) from [<bf1902fc>] (dsps_remove+0x20/0x4c [musb_dsps]) |[<bf1902fc>] (dsps_remove+0x20/0x4c [musb_dsps]) from [<c0290d7c>] (platform_drv_remove+0x1c/0x24) |[<c0290d7c>] (platform_drv_remove+0x1c/0x24) from [<c028f704>] (__device_release_driver+0x90/0xf0) |[<c028f704>] (__device_release_driver+0x90/0xf0) from [<c028f818>] (driver_detach+0xb4/0xb8) |[<c028f818>] (driver_detach+0xb4/0xb8) from [<c028e6e8>] (bus_remove_driver+0x98/0xec) |[<c028e6e8>] (bus_remove_driver+0x98/0xec) from [<c008fc70>] (SyS_delete_module+0x1e0/0x24c) |[<c008fc70>] (SyS_delete_module+0x1e0/0x24c) from [<c000e680>] (ret_fast_syscall+0x0/0x48) |---[ end trace d79045419a3e51ec ]--- The workqueue is only scheduled from the ep0 and never canceled in case the musb is removed before the work has a chance to run. Cc: stable@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: mass_storage: merge usb_f_mass_storage module with u_ms moduleAndrzej Pietrasiewicz2013-10-102-10/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | u_ms.ko is needed only together with usb_f_mass_storage.ko. Merge them. 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: remove compatibility layerAndrzej Pietrasiewicz2013-10-102-152/+19Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no more old interface users left. Remove it. 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: multi: convert to new interface of f_mass_storageAndrzej Pietrasiewicz2013-10-102-30/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the legacy multi gadget to the new 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: multi: convert to new interface of f_rndisAndrzej Pietrasiewicz2013-10-102-24/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the legacy multi gadget to the new interface of f_rndis, so that later the compatibility layer in f_rndis 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: multi: convert to new interface of f_ecmAndrzej Pietrasiewicz2013-10-102-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the legacy multi gadget to the new interface of f_ecm, so that later the compatibility layer in f_ecm 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: acm_ms: convert to new interface of f_mass_storageAndrzej Pietrasiewicz2013-10-102-39/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add configfs supportAndrzej Pietrasiewicz2013-10-103-0/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From this commit on f_mass_storage is available through configfs. 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: storage_common: add methods to show/store 'cdrom' and 'removable'Andrzej Pietrasiewicz2013-10-102-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be required by configfs integration. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: storage_common: make attribute operations more genericAndrzej Pietrasiewicz2013-10-103-41/+38Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show/store methods for sysfs attributes contain code which can be used also by configfs. Make them abstract the source the lun and rw_semaphore are taken from. 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: mass_storage: convert to new interface of f_mass_storageAndrzej Pietrasiewicz2013-10-104-27/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert old mass_storage gadget to use the new interface of f_mass_storage so that later the compatibility layer in f_mass_storage can be removed. struct fsg_common is not known to mass_storage.c, so a setter method is added to f_mass_storage. 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-107-22/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: f_mass_storage: create fsg_common_run_thread for use in ↵Andrzej Pietrasiewicz2013-10-102-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor a portion of it out. 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: f_mass_storage: create fsg_common_set_inquiry_string for use in ↵Andrzej Pietrasiewicz2013-10-102-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor a portion of it out. 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: f_mass_storage: create lun creation helpers for use in ↵Andrzej Pietrasiewicz2013-10-102-91/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor portions of it out. 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: f_mass_storage: create fsg_common_set_cdev for use in ↵Andrzej Pietrasiewicz2013-10-102-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor a portion of it out. 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: f_mass_storage: create lun handling helpers for use in ↵Andrzej Pietrasiewicz2013-10-102-17/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor portions of it out. 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: f_mass_storage: create fsg_common_set_num_buffers for use in ↵Andrzej Pietrasiewicz2013-10-102-26/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init fsg_common_init is a lengthy function. Factor a portion of it out. 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: f_mass_storage: create fsg_common_setup for use in fsg_common_initAndrzej Pietrasiewicz2013-10-101-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fsg_common_init is a lengthy function. Factor a portion of it out. 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: f_mass_storage: make sysfs interface optionalAndrzej Pietrasiewicz2013-10-103-14/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When configfs is in place, the luns will not be represented in sysfs, so there will be no struct device associated with a lun. In order to maintain compatibility and allow configfs adoption sysfs is made optional in this patch. As a consequence some debug macros need to be adjusted. Two new fields are added to struct fsg_lun: name and name_pfx. The "name" is for storing a string which is presented to the user instead of the dev_name. The "name_pfx", if non-NULL, is prepended to the "name" at printing time. The name_pfx is for a future lun.0, which will be a default group in mass_storage.<name>. By design at USB function configfs group's creation time its name is not known (but instead set a bit later in drivers/usb/gadget/configfs.c:function_make) and it is this name that serves the purpose of the said name prefix. So instead of copying a yet-unknown string a pointer to it is stored in struct fsg_lun. 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: f_mass_storage: create _fsg_common_free_buffersAndrzej Pietrasiewicz2013-10-101-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When configfs is in place, gadgets will have to be able to free fsg buffers. Add a helper function. 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: s3c-hsotg: fix set_ep_maxpacket functionRobert Baldyga2013-10-101-6/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes max packet size check in s3c_hsotg_set_ep_maxpacket() function. According USB specification, bits 10..0 of mps specifies maximum packet size, so there is bitwise AND between mps and 0x7ff value. Also added check if maxpacket isn't grater than 1024 which is maximum size od single USB transaction. In s3c_hsotg_ep_enable() function added s3c_hsotg_set_ep_maxpacket() call instead of setting ep.maxpacket value directly. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: mv_u3d_core: remove deprecated IRQF_DISABLEDMichael Opdenacker2013-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch proposes to remove the use of the IRQF_DISABLED flag It's a NOOP since 2.6.35 and it will be removed one day. Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: g_ffs: fix compilation warningDavid Cohen2013-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If USB_FUNCTIONFS is selected without USB_FUNCTIONFS_ETH and USB_FUNCTIONFS_RNIS, u_ether.h won't be included and then USB_ETHERNET_MODULE_PARAMAETERS macro won't be available causing the following warning compilation: drivers/usb/gadget/g_ffs.c:81:1: warning: data definition has no type or storage class [enabled by default] drivers/usb/gadget/g_ffs.c:81:1: warning: type defaults to ‘int’ in declaration of ‘USB_ETHERNET_MODULE_PARAMETERS’ [-Wimplicit-int] drivers/usb/gadget/g_ffs.c:81:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] This patch fixes the warning by making USB_ETHERNET_MODULE_PARAMETERS to be used iff u_ether.h is included, otherwise it is not needed. Signed-off-by: David Cohen <david.a.cohen@linux.intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: s3c-hsotg: fix maxpacket sizeRobert Baldyga2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes ep maxpacket value from 512 to 1024, because it's needed to handle interupt and isochronous endpoints in high-speed mode. This change doesn't affect on driver functioning, because fifo size (3072) is still enough for the maximum transaction payload (3*1024 for high-speed high-bandwidtch endpoints). Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Reordering of OTG FSM variablesAnton Tikhomirov2013-10-041-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorder variables in struct otg_fsm as they appear in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Add and use missed OTG FSM inputs/outputsAnton Tikhomirov2013-10-042-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several input/output variables missed in current FSM implementation. This patch adds and makes use of them as specified in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Rename "B-device session end SRP" OTG FSM inputAnton Tikhomirov2013-10-043-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In accordance with OTG and EH supplement, the correct name of the FSM input is b_ssend_srp. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Rename OTG FSM informative variablesAnton Tikhomirov2013-10-043-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark informative variables with suffix '_inf' to distinguish them from other non-informative variables with the same name. If such non-informative varialbes were missed, they are created. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Add and use missed OTG FSM timersAnton Tikhomirov2013-10-042-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a_bidl_adis_tmr and a_wait_vfall_tmr OTG timers missed in current FSM implementation. This patch adds and makes use of the timers as speicfied in OTG and EH supplement to USB2.0. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Fix OTG FSM timer handlingAnton Tikhomirov2013-10-043-25/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of using OTG driver specific timers by passing timer type to corresponding callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Add and use missed helper functionsAnton Tikhomirov2013-10-042-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements missed helper functions for start_gadget() and start_host() OTG FSM callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Check OTG FSM callback existance in helper functionsAnton Tikhomirov2013-10-041-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existence of callback must be checked to avoid NULL pointer dereferncing. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: phy: Pass OTG FSM pointer to callback functionsAnton Tikhomirov2013-10-043-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct otg_fsm may be embedded to device's context structure. The callbacks may require pointer to struct otg_fsm to obtain necessary data for its operation (example: regulator reference for drv_vbus()). Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| | * | | | | | usb: gadget: udc-core: Do not report -EISNAM error from gadgetfsFabio Estevam2013-10-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mounting a gadgetfs the following error message is seen: $ modprobe gadgetfs gadgetfs: USB Gadget filesystem, version 24 Aug 2004 $ mkdir /dev/gadget $ mount -t gadgetfs none /dev/gadget nop ci_hdrc.0: failed to start (null): -120 The error comes from gadgetfs_probe(), which returns -EISNAM (-120). As Alan Stern explains[1], this is the normal behavior: "It is a temporary measure, used only when the file system is set up initially. The real bind routine is gadgetfs_bind(), which gets called when userspace configures the gadget. In short, this is how it is intended to work. It isn't a bug." [1] http://marc.info/?l=linux-usb&m=138029668707075&w=2 So in order to prevent the error message, do not report EISNAM as an error. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>