summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2011-10-13usb: gadget: mv_udc: fix a clerical errorNeil Zhang
The max size of data payload is in bit0 - bit10, so we need use 0x7ff as the bitmask to fetch from usb_endpoint_descriptor.wMaxPacketSize. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: mv_udc: fix kernel panic on some platformsNeil Zhang
Some platforms will use usb to download images, the controller may not be stopped correctly when start kernel. In some cases, it may have some pending interrupts, and they will be triggered immediately when we finish requesting irq in function probe. But we haven't finished the device initialization at this time. So let's stop udc here to avoid this case occurred. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: mv_udc: add section informationNeil Zhang
Tag the probe function as __devinit. Tag the remove function as __devexit. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: mv_udc: refine the driver structureNeil Zhang
This patch do the following things: 1. Add header and Copyright for marvell usb driver. 2. Add mv_usb.h in include/linux/platform_data, make the driver fits all the marvell platform using the same ChipIdea usb ip. 3. Some SOC may has mutiple clock sources, so let me define it in mv_usb_platform_data and give two helper functions named udc_clock_enable/udc_clock_disable to deal with the clocks. 4. Different SOCs will have some difference in PHY initialization, so we will remove file mv_udc_phy.c and add two funtions in mv_usb_platform_data, let the platform relative driver to realize it. 5. Rewrite probe function according to the modification list above. Find it will kernel panic when probe failed. The root cause is as follows: When probe failed, the error handle may call device_unregister() which in return will call gadget_release.In current code, gadget_release have two issues: 1: the_controller is a NULL pointer. 2: if we free udc here, then the following code in probe will access NULL pointer. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: fix compile warningFelipe Balbi
| drivers/usb/renesas_usbhs/fifo.c: In function ‘usbhsf_dma_prepare_push’: | drivers/usb/renesas_usbhs/fifo.c:823:7: warning: cast from pointer \ to integer of different size [-Wpointer-to-int-cast] | drivers/usb/renesas_usbhs/fifo.c: In function ‘usbhsf_dma_try_pop’: | drivers/usb/renesas_usbhs/fifo.c:900:7: warning: cast from pointer \ to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: drop dependencyFelipe Balbi
that driver can compile cleanly on x86 without any issues. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: fixup driver compile styleKuninori Morimoto
In current renesas-usbhs, there was inconsistency about the style of kernel module or built-in. This patch solve it. [ balbi@ti.com : fix compile issue when building modules ] Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: bugfix: don't modify platform dataKuninori Morimoto
renesas_usbhs has default callback functions and settings. And it tried overwrite to platform private data if platform doesn't have them. So, if renesas_usbhs was compiled as module, it will be hung-up on 2nd insmod. This patch fixup it. Special thanks to Bastian Reported-by: Bastian Hecht <hechtb@googlemail.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add mod_host supportKuninori Morimoto
This is mod_host prototype support for renesas_usbhs driver. It doesn't support USB-Hub, and USB-DMAC for now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: usbhs_dcp_control_transfer_done() cares mod_hostKuninori Morimoto
CCPL setting is needed on only mod_gadget. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add data/status stage handlerKuninori Morimoto
mod_host needs data/status stage handler Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add INTSTS1 interrupt supportKuninori Morimoto
mod_host use INTSTS1 interrupt Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_set_device_speed() support for hostKuninori Morimoto
mod_host needs device speed setup function Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: make sure SOF packet sending-out controlKuninori Morimoto
It is enabled to set SOF packet output bit when USBRST bit was set. And USBRST bit should be set 0 when SOF packet was output. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: support otg pin controlKuninori Morimoto
some renesas_usbhs device is supporting OTG external device interface. In that device, it is necessary to control PWEN/EXTLP on DVSTCTR. This patch support it. But renesas_usbhs driver doesn't have OTG support for now. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: disable pipe on top of interruptKuninori Morimoto
When data read interrupt happened, the pipe is BUF which means "enable". then, next un-necessary interrupt/token might be issued again when all data were popped from fifo. It will cause un-understandable bug. This patch decides pipe disable on top of read interrupt. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: modify pipe sequence settingsKuninori Morimoto
renesas_usbhs can manually set DATA0/DATA1. This patch is prepare for mod_host support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: disable auto paket start on usbhs_pkt_push()Kuninori Morimoto
Automatically packet start by usbhs_pkt_push() was useful. But the pushed packet will be called twice if new packet was pushed on usbhs_pkt :: done callback. (1st is called by usbhs_pkt_push(), 2nd is called by usbhsf_pkt_handler()) This patch disables automatic packet start, and clarified packet start timing. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: move done callback to struct usbhs_pktKuninori Morimoto
transfer done function was registered in struct struct usbhs_pipe_info. It was good for mod_gadget, but not good for mod_host. This function move it to struct usbhs_pkt. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_pipe_name()Kuninori Morimoto
pipe name is usefull function for mod_xxx Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add device select support in ↵Kuninori Morimoto
usbhs_pipe_config_update() device select method will be used on mod_host Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add struct usbhs_priv to packet done functionKuninori Morimoto
There was no method to get struct usbhs_priv when packet transfer done function was called. This patch allow that callback function receive it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_dcp_dir_for_host()Kuninori Morimoto
renesas_usbhs device needs special bit settings if it was mod_host and dcp pipe. This patch support it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: remove unneeded parameter from usbhs_mod_is_host()Kuninori Morimoto
it was possible to get usbhs_mod from usbhs_priv. this patch remove unneeded parameter. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: move usbhs_usbreq_get/set_val() to common.cKuninori Morimoto
usbhs_usbreq_get/set_val() functions were in pipe.c file, but it is irrelevant to pipe. this patch move it to common.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: move usbhsp_type() to usbhs_pipe_type()Kuninori Morimoto
Pipe type check macro will be used in other files. This patch move local macro to global macro. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add usbhs_bus_get_speed()Kuninori Morimoto
current mod_gadget had got usb speed on usbhsg_irq_dev_state() which is status change interrupt callback function. And the usb speed data was included in its parameter. But this style works for mod_gadget, but doesn't work for mod_host which isn't interrupted when device status was changed. This patch add usbhs_bus_get_speed() to solve this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add bus control functionsKuninori Morimoto
this patch add DVSTCTR control function for HOST support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: change usbhsc_bus_ctrl() to usbsc_set_buswait()Kuninori Morimoto
renesas_usbhs will have register DVSTCTR control function for HOST support. This patch changes usbhsc_bus_ctrl() to usbsc_set_buswait(), to remove DVSTCTR access from it, Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: tidyup INTENB0 methodKuninori Morimoto
This patch tidyup Interrupt Enable Register 0 (INTENB0) which has relationship with picky BEMPENB/BRDYENB. - add explain comment - ignore nonsense 0 write case Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: struct usbhs_pipe hold handlerKuninori Morimoto
packet handler had moved to struct usbhs_pipe from struct usbhsg_uep. it is preparation of mod_host support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: each pipe hold maxpacket sizeKuninori Morimoto
Current renesas_usbhs pipe accessed DCPMAXP/PIPEMAXP register to get own maxpacket size every time. But maxpacket size isn't changed after pipe start, and register access is too slow. This patch adds new maxp variable to keep own maxpacket. And un-used function are removed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: remove desc from usbhs_pipe_mallocKuninori Morimoto
Current usbhs_pipe_malloc() used usb_endpoint_descriptor to get necessary information. It was very good for mod_gadget which allocate pipe in runtime, but is not good for mod_host which allocate pipe in initial timing. This patch remove usb_endpoint_descriptor from usbhs_pipe_malloc() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: move USBHSF_PKT_xxx to pipe.cKuninori Morimoto
There is no longer necessity that USBHSF_PKT_xxx are in fifo.h. it are used in only fifo.c now. This patch move it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas_usbhs: add suspend/resume supportKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: storage: add superspeed supportFelipe Balbi
this patch adds superspeed descriptors for the storage gadgets. Acked-by: Michal Nazarewicz <mina86@mina86.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: fix typo for default U1/U2 exit latenciesFelipe Balbi
s/DEFULT/DEFAULT/, no functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: r8a66597: convert to new styleFelipe Balbi
convert to new style UDC registration and remove the global 'the_controller' pointer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: renesas: convert to new styleFelipe Balbi
using udc_start()/udc_stop() as we should. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: net2280: convert to new styleFelipe Balbi
with this patch we can finally remove the global "the_controller" pointer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: net2272: convert to new styleFelipe Balbi
with this patch we can finally remove the global "the controller" pointer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: langwell: convert to new styleFelipe Balbi
with this patch we can finally remove the global "the_controller" pointer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: langwell: don't use the_controller when it's not neededFelipe Balbi
in most cases, we can fetch our structure by calling dev_get_drvdata(). Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: at91_udc: change french comments to englishRobert Schwebel
While being there, change C++ style comments to /* */. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: pxa25x: is_vbus_present is goneArnd Bergmann
A recent commit obsoleted the is_vbus_present function, so we must not use it any more. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb: gadget: storage: fix mass storage gadgets to work with Synopsys UDCPaul Zimmerman
The Synopsys USB device controller requires all OUT transfer request lengths to be aligned to max packet size. The mass storage gadgets do not meet this requirement for Super Speed. The gadgets already have a function which performs this alignment for CBW packets, so use it for data packets too. The alternative would be to implement bounce buffers in the DWC3 driver, but that could have a significant impact on performance. This version is based upon a more-correct patch written by Alan Stern. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13USB: gadget: f_midi: allow a dynamic number of input and output portsDaniel Mack
The code in the MIDI gadget was already sort of prepared for multi-port configuration, so the streaming logic itself didn't need much tweaking. However, the descriptors change when the number of ports do, and so some rework of the the preparation algorithms were necessary. Successfully tested on Linux and Max OS X hosts for both input and output streams. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13USB: gadget: midi: refactor the device codeDaniel Mack
Make use of the newly added MIDI function in f_midi.c and strip down the MIDI gadget code radically. Also use the generic framework function to avoid code duplication and rename some symbols to bring them in sync with other code in the gadget framework. [ balbi@ti.com : fix Section mismatch warnings. rebased on top of usb_speed_string() patch to avoid conflicts. ] Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13USB: gadget: midi: add midi function driverDaniel Mack
This patch adds f_midi.c to implement a USB gadget function that works with the composite framework, so it can be combined with other USB functions. The code for the ALSA/MIDI logic was taken from the midi device gadget, other parts have been rewritten to benefit from the dynamic descriptor allocation features. This was successfully tested on an OMAP3 board. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-10-13usb gadget: fix langwell_udc.c build errorRandy Dunlap
Move function to fix langwell_udc.c build error: drivers/usb/gadget/langwell_udc.c: In function 'show_langwell_udc': drivers/usb/gadget/langwell_udc.c:1693:3: error: implicit declaration of function 'lpm_device_speed' drivers/usb/gadget/langwell_udc.c: At top level: drivers/usb/gadget/langwell_udc.c:2637:37: error: conflicting types for 'lpm_device_speed' drivers/usb/gadget/langwell_udc.c:1693:20: note: previous implicit declaration of 'lpm_device_speed' was here Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Acked-by: Felipe Balbi <balbi@ti.com> Cc: linux-usb@vger.kernel.org