aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2013-08-12usb: ehci: Add support for SINGLE_STEP_SET_FEATURE test of EHSETManu Gautam3-2/+263
The USB Embedded High-speed Host Electrical Test (EHSET) defines the SINGLE_STEP_SET_FEATURE test as follows: 1) The host enumerates the test device with VID:0x1A0A, PID:0x0108 2) The host sends the SETUP stage of a GetDescriptor(Device) 3) The device ACKs the request 4) The host issues SOFs for 15 seconds allowing the test operator to raise the scope trigger just above the SOF voltage level 5) The host sends the IN packet 6) The device sends data in response, triggering the scope 7) The host sends an ACK in response to the data This patch adds additional handling to the EHCI hub driver and allows the EHSET driver to initiate this test mode by issuing a a SetFeature request to the root hub with a Test Selector value of 0x06. From there it mimics ehci_urb_enqueue() but separately submits QTDs for the SETUP and DATA/STATUS stages in order to insert a delay in between. Signed-off-by: Manu Gautam <[email protected]> Acked-by: Alan Stern <[email protected]> [[email protected]: imported from commit c2084930 on codeaurora.org; minor cleanup and updated author email] Signed-off-by: Jack Pham <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb/hcd: Log error code if reset() failsMark Brown1-1/+1
If someone provided meaningful error codes from reset() we should tell the user what they were. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: config->desc.bLength may not exceed amount of data returned by the deviceHans de Goede1-1/+2
While reading the config parsing code I noticed this check is missing, without this check config->desc.wTotalLength can end up with a value larger then the dev->rawdescriptors length for the config, and when userspace then tries to get the rawdescriptors bad things may happen. Signed-off-by: Hans de Goede <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Support operation with no I2C controlMark Brown1-17/+76
Refactor so that register writes for configuration are only performed if the device has a regmap provided and also register as a platform driver. This allows the driver to be used to manage GPIO based control of the device. Signed-off-by: Mark Brown <[email protected]> Cc: [email protected] Reviewed-by: Dongjin Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Add USB3503A to the compatible listMark Brown1-0/+1
There are no software visible differences that I am aware of but in case any are discovered allow the DTS to specify exactly which device is present. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Default to hub modeMark Brown1-1/+1
Since there is no runtime interface for changing modes this is probably the most sensible default. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Fix typos in error messagesMark Brown1-2/+2
Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Factor out I2C probeMark Brown1-34/+43
In preparation for supporting operation without an I2C control interface factor out the I2C-specific parts of the probe routine from those that don't do any register I/O. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Convert to regmapMark Brown2-57/+37
This will give access to the diagnostic infrastructure regmap has but the main point is to support future refactoring. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Actively manage Hub Connect GPIOMark Brown1-6/+12
If the connect signal is pulled high then the device will start up meaning that if we just pull it high on probe then the device will start running prior to the configuration being written out. Fix this by pulling the GPIO low when we reset and only pulling it high when configuration is finished. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Use gpio_set_value_cansleep()Mark Brown1-1/+1
The /RESET GPIO is not manipulated from atomic context so support GPIOs that can't be written from atomic context by using _cansleep(). Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: Move definition of USB_EHCI_BIG_ENDIAN_MMIO et al. out side of the ifs.David Daney2-20/+17
When CONFIG_USB_SUPPORT is not selected we get things like: scripts/kconfig/mconf Kconfig warning: (MIPS_SEAD3 && PMC_MSP && CPU_CAVIUM_OCTEON) selects USB_EHCI_BIG_ENDIAN_MMIO which has unmet direct dependencies (USB_SUPPORT && USB) It is much cleaner to make the various system Kconfigs select USB_EHCI_BIG_ENDIAN_MMIO rather than move the system config information into USB's Kconfig, but the warnings are annoying. Eliminate the warning by moving the definition of USB_EHCI_BIG_ENDIAN_MMIO outside of all the Kconfig if statements. While we are at it move USB_OHCI_BIG_ENDIAN_DESC, USB_OHCI_BIG_ENDIAN_MMIO, USB_OHCI_LITTLE_ENDIAN and USB_EHCI_BIG_ENDIAN_DESC too, as they could very well suffer similar problems for other systems. Get rid of the redundant "default n" in USB_OHCI_BIG_ENDIAN_DESC and USB_OHCI_BIG_ENDIAN_MMIO Signed-off-by: David Daney <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: usb3503: Convert to devm_ APIsMark Brown1-35/+7
Saves us a bit of code. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: misc: Fix swapped properties in usb3503 DT parsingMark Brown1-2/+2
The intn and connect GPIO properties are swapped in the code which will cause failures at runtime if these are connected, fix the code. There are currently no in-tree users of this device to check or update. Signed-off-by: Mark Brown <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: serial: move the "simple" drivers into usb-serial-simple.cGreg Kroah-Hartman11-422/+129
Instead of having to create a new driver for a "simple" usb to serial device, mush them all into one file, with a macro, so as to make it easy to add new ones. Cc: "René Bürgel" <[email protected]> Acked-by: Wei Shuai <[email protected]> Cc: Josh Triplett <[email protected]> Acked-by: Frans Klaver <[email protected]> Cc: "Wesley W. Terpstra" <[email protected]> Cc: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: musb: dsps: make it depend on OF_IRQFelipe Balbi1-0/+1
musb_dsps.c utilizes a symbol which is only available when CONFIG_OF_IRQ is set, so make it depend on that. Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12USB: XHCI: mark no_sg_constraintMing Lei1-0/+4
This patch marks all xHCI controllers as no_sg_constraint since xHCI supports building packet from discontinuous buffers. Cc: Alan Stern <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: introduce usb_device_no_sg_constraint() helperMing Lei1-1/+2
Some host controllers(such as xHCI) can support building packet from discontinuous buffers, so introduce one flag and helper for this kind of host controllers, then the feature can help some applications(such as usbnet) by supporting arbitrary length of sg buffers. Acked-by: Alan Stern <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: EHCI: support running URB giveback in tasklet contextMing Lei14-18/+13
All 4 transfer types can work well on EHCI HCD after switching to run URB giveback in tasklet context, so mark all HCD drivers to support it. Also we don't need to release ehci->lock during URB giveback any more. >From below test results on 3 machines(2 ARM and one x86), time consumed by EHCI interrupt handler droped much without performance loss. 1 test description 1.1 mass storage performance test: - run below command 10 times and compute the average performance dd if=/dev/sdN iflag=direct of=/dev/null bs=200M count=1 - two usb mass storage device: A: sandisk extreme USB 3.0 16G(used in test case 1 & case 2) B: kingston DataTraveler G2 4GB(only used in test case 2) 1.2 uvc function test: - run one simple capture program in the below link http://kernel.ubuntu.com/~ming/up/capture.c - capture format 640*480 and results in High Bandwidth mode on the uvc device: Z-Star 0x0ac8/0x3450 - on T410(x86) laptop, also use guvcview to watch video capture/playback 1.3 about test2 and test4 - both two devices involved are tested concurrently by above test items 1.4 how to compute irq time(the time consumed by ehci_irq) - use trace points of irq:irq_handler_entry and irq:irq_handler_exit 1.5 kernel 3.10.0-rc3-next-20130528 1.6 test machines Pandaboard A1: ARM CortexA9 dural core Arndale board: ARM CortexA15 dural core T410: i5 CPU 2.67GHz quad core 2 test result 2.1 test case1: single mass storage device performance test -------------------------------------------------------------------- upstream | patched perf(MB/s)+irq time(us) | perf(MB/s)+irq time(us) -------------------------------------------------------------------- Pandaboard A1: 25.280(avg:145,max:772) | 25.540(avg:14, max:75) Arndale board: 29.700(avg:33, max:129) | 29.700(avg:10, max:50) T410: 34.430(avg:17, max:154*)| 34.660(avg:12, max:155) --------------------------------------------------------------------- 2.2 test case2: two mass storage devices' performance test -------------------------------------------------------------------- upstream | patched perf(MB/s)+irq time(us) | perf(MB/s)+irq time(us) -------------------------------------------------------------------- Pandaboard A1: 15.840/15.580(avg:158,max:1216) | 16.500/16.160(avg:15,max:139) Arndale board: 17.370/16.220(avg:33 max:234) | 17.480/16.200(avg:11, max:91) T410: 21.180/19.820(avg:18 max:160) | 21.220/19.880(avg:11, max:149) --------------------------------------------------------------------- 2.3 test case3: one uvc streaming test - uvc device works well(on x86, luvcview can be used too and has same result with uvc capture) -------------------------------------------------------------------- upstream | patched irq time(us) | irq time(us) -------------------------------------------------------------------- Pandaboard A1: (avg:445, max:873) | (avg:33, max:44) Arndale board: (avg:316, max:630) | (avg:20, max:27) T410: (avg:39, max:107) | (avg:10, max:65) --------------------------------------------------------------------- 2.4 test case4: one uvc streaming plus one mass storage device test -------------------------------------------------------------------- upstream | patched perf(MB/s)+irq time(us) | perf(MB/s)+irq time(us) -------------------------------------------------------------------- Pandaboard A1: 20.340(avg:259,max:1704)| 20.390(avg:24, max:101) Arndale board: 23.460(avg:124,max:726) | 23.370(avg:15, max:52) T410: 28.520(avg:27, max:169) | 28.630(avg:13, max:160) --------------------------------------------------------------------- 2.5 test case5: read single mass storage device with small transfer - run below command 10 times and compute the average speed dd if=/dev/sdN iflag=direct of=/dev/null bs=4K count=4000 1), test device A: -------------------------------------------------------------------- upstream | patched perf(MB/s)+irq time(us) | perf(MB/s)+irq time(us) -------------------------------------------------------------------- Pandaboard A1: 6.5(avg:21, max:64) | 6.5(avg:10, max:24) Arndale board: 8.13(avg:12, max:23) | 8.06(avg:7, max:17) T410: 6.66(avg:13, max:131) | 6.84(avg:11, max:149) --------------------------------------------------------------------- 2), test device B: -------------------------------------------------------------------- upstream | patched perf(MB/s)+irq time(us) | perf(MB/s)+irq time(us) -------------------------------------------------------------------- Pandaboard A1: 5.5(avg:21,max:43) | 5.49(avg:10, max:24) Arndale board: 5.9(avg:12, max:22) | 5.9(avg:7, max:17) T410: 5.48(avg:13, max:155) | 5.48(avg:7, max:140) --------------------------------------------------------------------- * On T410, sometimes read ehci status register in ehci_irq takes more than 100us, and the problem has been reported on the link: http://marc.info/?t=137065867300001&r=1&w=2 Acked-by: Alan Stern <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: EHCI: improve interrupt qh unlinkMing Lei6-3/+84
ehci-hcd currently unlinks an interrupt QH when it becomes empty, that is, after its last URB completes. This works well because in almost all cases, the completion handler for an interrupt URB resubmits the URB; therefore the QH doesn't become empty and doesn't get unlinked. When we start using tasklets for URB completion, this scheme won't work as well. The resubmission won't occur until the tasklet runs, which will be some time after the completion is queued with the tasklet. During that delay, the QH will be empty and so will be unlinked unnecessarily. To prevent this problem, this patch adds a 5-ms time delay before empty interrupt QHs are unlinked. Most often, during that time the interrupt URB will be resubmitted and thus we can avoid unlinking the QH. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: EHCI: improve ehci_endpoint_disableMing Lei1-10/+6
The patch does the below improvement: - think QH_STATE_COMPLETING as unlinking state since all URBs on the endpoint should be in unlinking or unlinked when doing endpoint_disable() - add "WARN_ON(!list_empty(&qh->qtd_list));" if qh->qh_state is QH_STATE_LINKED because there shouldn't be any active transfer in qh - when qh->qh_state is QH_STATE_LINKED, the QH(async or periodic) should be in its corresponding list, so the search through the async list isn't necessary. - unlink periodic QH to speed up unlinking if the QH is in linked state Basically, only the last one is related with this patchset because the assumption of "periodic qh self-unlinks on empty" isn't true any more when we introduce unlink-wait for periodic qh. Acked-by: Alan Stern <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12USB: HCD: support giveback of URB in tasklet contextMing Lei1-30/+117
This patch implements the mechanism of giveback of URB in tasklet context, so that hardware interrupt handling time for usb host controller can be saved much, and HCD interrupt handling can be simplified. Motivations: 1), on some arch(such as ARM), DMA mapping/unmapping is a bit time-consuming, for example: when accessing usb mass storage via EHCI on pandaboard, the common length of transfer buffer is 120KB, the time consumed on DMA unmapping may reach hundreds of microseconds; even on A15 based box, the time is still about scores of microseconds 2), on some arch, reading DMA coherent memoery is very time-consuming, the most common example is usb video class driver[1] 3), driver's complete() callback may do much things which is driver specific, so the time is consumed unnecessarily in hardware irq context. 4), running driver's complete() callback in hardware irq context causes that host controller driver has to release its lock in interrupt handler, so reacquiring the lock after return may busy wait a while and increase interrupt handling time. More seriously, releasing the HCD lock makes HCD becoming quite complicated to deal with introduced races. So the patch proposes to run giveback of URB in tasklet context, then time consumed in HCD irq handling doesn't depend on drivers' complete and DMA mapping/unmapping any more, also we can simplify HCD since the HCD lock isn't needed to be released during irq handling. The patch should be reasonable and doable: 1), for drivers, they don't care if the complete() is called in hard irq context or softirq context 2), the biggest change is the situation in which usb_submit_urb() is called in complete() callback, so the introduced tasklet schedule delay might be a con, but it shouldn't be a big deal: - control/bulk asynchronous transfer isn't sensitive to schedule delay - the patch schedules giveback of periodic URBs using tasklet_hi_schedule, so the introduced delay should be very small - for ISOC transfer, generally, drivers submit several URBs concurrently to avoid interrupt delay, so it is OK with the little schedule delay. - for interrupt transfer, generally, drivers only submit one URB at the same time, but interrupt transfer is often used in event report, polling, ... situations, and a little delay should be OK. Considered that HCDs may optimize on submitting URB in complete(), the patch may cause the optimization not working, so introduces one flag to mark if the HCD supports to run giveback URB in tasklet context. When all HCDs are ready, the flag can be removed. [1], http://marc.info/?t=136438111600010&r=1&w=2 Cc: Oliver Neukum <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-12usb: host: tegra: Tegra30 supportTuomas Tynkkynen1-5/+29
The Tegra30 EHCI controller is mostly compatible with the Tegra20 controller, except Tegra30 includes the HOSTPC register extension. The has_hostpc capability bit must be set in the ehci_hcd structure if the controller has such extensions. The new tegra_ehci_soc_config structure is added to describe the differences between the SoCs. Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Program new PHY parametersTuomas Tynkkynen1-18/+63
The Tegra30 TRM recommends configuration of certain PHY parameters for optimal quality. Program the following registers based on device tree parameters: - UTMIP_XCVR_HSSLEW: HS slew rate control. - UTMIP_HSSQUELCH_LEVEL: HS squelch detector level - UTMIP_HSDISCON_LEVEL: HS disconnect detector level. These registers exist in Tegra20, but programming them hasn't been necessary, so these parameters won't be set on Tegra20 to keep the device trees backward compatible. Additionally, the UTMIP_XCVR_SETUP parameter can be set from fuses instead of a software-programmed value, as the optimal value can vary between invidual boards. The boolean property nvidia,xcvr-setup-use-fuses can be used to enable this behaviour. Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Tegra30 supportTuomas Tynkkynen1-28/+93
The Tegra30 USB PHY is a bit different than the Tegra20 PHY: - The EHCI controller supports the HOSTPC register extension, and some of the fields that the PHY needs to modify (PHCD and PTS) have moved to the new HOSTPC register. - Some of the UTMI PLL configuration registers have moved from the USB register space to the Clock-And-Reset controller space. In Tegra30 the clock driver is responsible for configuring the UTMI PLL. - The USBMODE register must be explicitly written to enter host mode. - Certain PHY parameters need to be programmed for optimal signal quality. Support for this will be added in the next patch. The new tegra_phy_soc_config structure is added to describe the differences between the SoCs. Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: phy: tegra: Fix wrong PHY parametersTuomas Tynkkynen1-6/+14
Some of the PHY parameters are not set according to the TRMs: - UTMIP_FS_PREABMLE_J should be set, not cleared - UTMIP_XCVR_LSBIAS_SEL should be cleared, not set - UTMIP_PD_CHRG should be set in host mode and cleared in device mode - UTMIP_XCVR_SETUP is a two-part field; the upper bits were not set properly Signed-off-by: Tuomas Tynkkynen <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-12usb: host: add has_tdi_phy_lpm capability bitTuomas Tynkkynen3-7/+9
The has_hostpc capability bit indicates that the host controller has the HOSTPC register extensions, but at the same time enables clock disabling power saving features with the PHY Low Power Clock Disable (PHCD) bit. However, some host controllers have the HOSTPC extensions but don't support the low-power feature, so the PHCD bit must not be set on those controllers. Add a separate capability bit for the low-power feature instead, and change all existing users of has_hostpc to use this new capability bit. The idea for this commit is taken from an old 2012 commit that never got merged ("disociate chipidea PHY low power suspend control from hostpc") Inspired-by: Matthieu CASTET <[email protected]> Signed-off-by: Tuomas Tynkkynen <[email protected]> Acked-by: Alan Stern <[email protected]> Tested-by: Stephen Warren <[email protected]> Reviewed-by: Stephen Warren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: uvc: Fix error handling in uvc_queue_buffer()Laurent Pinchart1-1/+5
The conversion to videobuf2 failed to check the return value of vb2_qbuf(). Fix it. Cc: [email protected] Reported-by: Michael Grzeschik <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Tested-By: Michael Grzeschik <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: musb dma: add cppi41 dma driverSebastian Andrzej Siewior4-1/+558
This driver is currently used by musb' cppi41 couter part. I may merge both dma engine user of musb at some point but not just yet. The driver seems to work in RX/TX mode in host mode, tested on mass storage. I increaed the size of the TX / RX transfers and waited for the core code to cancel a transfers and it seems to recover. v2..3: - use mall transfers on RX side and check data toggle. - use rndis mode on tx side so we haveon interrupt for 4096 transfers. - remove custom "transferred" hack and use dmaengine_tx_status() to compute the total amount of data that has been transferred. - cancel transfers and reclaim descriptors v1..v2: - RX path added - dma mode 0 & 1 is working - device tree nodes re-created. Cc: Vinod Koul <[email protected]> Cc: Dan Williams <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: musb: dsps: use proper child nodesSebastian Andrzej Siewior4-157/+160
This moves the two instances from the big node into two child nodes. The glue layer ontop does almost nothing. There is one devices containing the control module for USB (2) phy, (2) usb and later the dma engine. The usb device is the "glue device" which contains the musb device as a child. This is what we do ever since. The new file musb_am335x is just here to prob the new bus and populate child devices. There are a lot of changes to the dsps file as a result of the changes: - musb_core_offset This is gone. The device tree provides memory ressources information for the device there is no need to "fix" things - instances This is gone as well. If we have two instances then we have have two child enabled nodes in the device tree. For instance the SoC in beagle bone has two USB instances but only one has been wired up so there is no need to load and init the second instance since it won't be used. - dsps_glue is now per glue device In the past there was one of this structs but with an array of two and each instance accessed its variable depending on the platform device id. - no unneeded copy of structs I do not know why struct dsps_musb_wrapper is copied but it is not necessary. The same goes for musb_hdrc_platform_data which allocated on demand and then again by platform_device_add_data(). One copy is enough. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: musb: dsps: remove the hardcoded phy piecesSebastian Andrzej Siewior1-96/+1
dsps uses a nop driver which is added in dsps itself and does the PHY on/off calls within dsps. Since those calls are now moved the nop driver itself, we can now request the phy proper phy and remove those calls. Currently only the first musb interface is used so we only add one phy node for now. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: Add AM335x PHY driverSebastian Andrzej Siewior5-0/+270
This driver is a redo of my earlier attempt. It uses parts of the generic PHY driver and uses the new control driver for the register the phy needs to power on/off the phy. It also enables easy access for the wakeup register which is not yet implemented. The difference between the omap attempt is: - no static holding variable - one global visible function which exports a struct with callbacks to access the "control" registers. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: phy-generic: export init functionsSebastian Andrzej Siewior2-58/+94
This patch exports the mostly generic functions so they can be used from other phy driver instead of duplicating the code. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09Merge branch 'nop-phy-rename' into nextFelipe Balbi10-37/+37
Signed-off-by: Felipe Balbi <[email protected]> Conflicts: drivers/usb/phy/phy-generic.c
2013-08-09usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceivSebastian Andrzej Siewior10-37/+37
The "nop" driver isn't a do-nothing-stub but supports a couple functions like clock on/off or is able to use a voltage regulator. This patch simply renames the driver to "generic" since it is easy possible to extend it by a simple function istead of writing a complete driver. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: mv-usb: remove incorrect __exit_p annotationJingoo Han1-2/+2
When platform_driver_probe() is not used, bind/unbind via sysfs is enabled. Thus, __exit_p annotation should be removed from remove(). Also, mv_otg_remove() is staticized, because this function is used only in this file. Fix the following sparse warning: drivers/usb/phy/phy-mv-usb.c:656:5: warning: symbol 'mv_otg_remove' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: phy: mv-u3d: Staticize mv_u3d_phy_shutdown()Jingoo Han1-1/+1
mv_u3d_phy_shutdown() is used only in this file. Fix the following sparse warning: drivers/usb/phy/phy-mv-u3d-usb.c:85:6: warning: symbol 'mv_u3d_phy_shutdown' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: f_uac1: Staticize local functionsJingoo Han1-2/+2
control_selector_init() is used only in this file. audio_bind_config() is used only in audio.c file to which f_uac1.c is included. Thus, these functions are staticized to fix the following warnings. drivers/usb/gadget/f_uac1.c:698:12: warning: symbol 'control_selector_init' was not declared. Should it be static? drivers/usb/gadget/f_uac1.c:722:12: warning: symbol 'audio_bind_config' was not declared. Should it be static? Acked-by: Jassi Brar <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: u_uac1: add __user annotationJingoo Han1-1/+1
Added __user annotation to fix the following sparse warning. drivers/usb/gadget/u_uac1.c:194:52: warning: incorrect type in argument 2 (different address spaces) drivers/usb/gadget/u_uac1.c:194:52: expected void const [noderef] <asn:1>*buf drivers/usb/gadget/u_uac1.c:194:52: got void *buf Acked-by: Jassi Brar <[email protected]> Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: rndis: Staticize rndis_init()/rndis_exit()Jingoo Han1-2/+2
rndis_init() and rndis_exit() are used only in this file. Fix the following sparse warnings: drivers/usb/gadget/rndis.c:1145:5: warning: symbol 'rndis_init' was not declared. Should it be static? drivers/usb/gadget/rndis.c:1179:6: warning: symbol 'rndis_exit' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: f_mass_storage: use NULL instead of 0Jingoo Han1-3/+3
The local variables such as 'filename', 'vendor_name', and 'product_name' are pointers; thus, use NULL instead of 0 to fix the following sparse warnings drivers/usb/gadget/f_mass_storage.c:3046:27: warning: Using plain integer as NULL pointer drivers/usb/gadget/f_mass_storage.c:3050:28: warning: Using plain integer as NULL pointer drivers/usb/gadget/f_mass_storage.c:3051:29: warning: Using plain integer as NULL pointer Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-09usb: gadget: amd5536udc: unconditionally use GFP_ATOMIC in udc_queue()Alexey Khoroshilov1-2/+2
As far as prep_dma() is called with spinlock held, we have to pass GFP_ATOMIC regardless of gfp argument. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-05Merge 3.11-rc4 into usb-nextGreg Kroah-Hartman14-91/+223
We want those fixes in here also. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-05usb: dwc3: use extcon fwrk to receive connect/disconnectKishon Vijay Abraham I2-19/+107
Modified dwc3-omap to receive connect and disconnect notification using extcon framework. Also did the necessary cleanups required after adapting to extcon framework. Signed-off-by: Kishon Vijay Abraham I <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
2013-08-03usb: fix some scripts/kernel-doc warningsYacine Belkadi9-83/+165
When building the htmldocs (in verbose mode), scripts/kernel-doc reports the following type of warnings: Warning(drivers/usb/core/usb.c:76): No description found for return value of 'usb_find_alt_setting' Fix them by: - adding some missing descriptions of return values - using "Return" sections for those descriptions Signed-off-by: Yacine Belkadi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-08-02usb: gadget: at91_udc: add usb_clk for transition to common clk frameworkBoris BREZILLON2-3/+16
The AT91 PMC (Power Management Controller) provides an USB clock used by USB Full Speed host (ohci) and USB Full Speed device (udc). The usb drivers (ohci and udc) must configure this clock to 48Mhz. This configuration was formely done in mach-at91/clock.c, but this implementation will be removed when moving to common clk framework. This patch adds support for usb clock retrieval and configuration, and is backward compatible with the current at91 clk implementation (if usb clk is not found, it does not configure/enable it). Signed-off-by: Boris BREZILLON <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-02usb: gadget: at91_udc: add missing clk_put on fclk and iclkBoris BREZILLON1-0/+4
This patch adds missing clk_put on fclk and iclk in case the probe function fails after these clocks have been retrieved. Signed-off-by: Boris BREZILLON <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-02usb: gadget: fusb300_udc: Staticize fusb300_rdcxf()Jingoo Han1-1/+1
fusb300_rdcxf() used only in this file. Fix the following sparse warning: drivers/usb/gadget/fusb300_udc.c:560:6: warning: symbol 'fusb300_rdcxf' was not declared. Should it be static? Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-02usb: gadget: goku_udc: use NULL instead of 0Jingoo Han1-1/+1
'req' is a pointer; thus, use NULL instead of 0 to fix the following sparse warning: drivers/usb/gadget/goku_udc.c:775:13: warning: Using plain integer as NULL pointer Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-08-02usb: dwc3: pci: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han1-7/+3
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. Unnecessary CONFIG_PM ifdefs are removed. drivers/usb/dwc3/dwc3-pci.c:215:12: warning: 'dwc3_pci_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-pci.c:224:12: warning: 'dwc3_pci_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>