usb/core: remove "always" from usb_unlink_urb() kernel doc entry
The kernel doc entry for usb_unlink_urb() contains the phrase "This
request is always asynchronous.". The "always" leads to the assumption
that the ->complete() callback is not called from within
usb_unlink_urb(). This is not true. The HCD is allowed to call the
->complete() from within ->urb_dequeue() if it is appropriate for the
hardware.
This patch updates the kernel doc so usb-device driver authors make sure
to drop all locks (and make sure it is okay to drop them) which are
acquired by the complete callback before calling usb_unlink_urb().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jesper Juhl [Thu, 1 Mar 2012 22:01:19 +0000 (23:01 +0100)]
Allocate correct size (portably) in drivers/usb/gadget/f_midi.c::f_midi_bind()
As the coverity checker puts it:
"Passing argument "sizeof (midi_function) /*8*/" to function "kcalloc"
and then casting the return value to "struct usb_descriptor_header **"
is suspicious. ... In this particular case sizeof(struct
usb_descriptor_header **) happens to be equal to sizeof(struct
usb_descriptor_header *), but this is not a portable assumption."
I believe we really do intend to use 'sizeof(*midi_function)' here, so
this patch makes that change.
Preston Fick [Fri, 24 Feb 2012 19:42:39 +0000 (13:42 -0600)]
usb: cp210x: Update to support CP2105 and multiple interface devices
This patch updates the cp210x driver to support CP210x multiple
interface devices devices from Silicon Labs. The existing driver
always sends control requests to interface 0, which is hardcoded in
the usb_control_msg function calls. This only allows for single
interface devices to be used, and causes a bug when using ports on an
interface other than 0 in the multiple interface devices.
Here are the changes included in this patch:
- Updated the device list to contain the Silicon Labs factory default
VID/PID for multiple interface CP210x devices
- Created a cp210x_port_private struct created for each port on
startup, this struct holds the interface number
- Added a cp210x_release function to clean up the cp210x_port_private
memory created on startup
- Modified usb_get_config and usb_set_config to get a pointer to the
cp210x_port_private struct, and use the interface number there in the
usb_control_message wIndex param
Merge tag 'dwc3-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
usb: dwc3: changes for v3.4 merge window
Here are the changes for v3.4 merge window.
It includes a new glue layer for Samsung's Exynos platform, a simplification of
memory management on DWC3 driver by using dev_xxx functions, a few
optimizations to IRQ handling by dropping memcpy() and using bitshifts, a fix
for TI's OMAP5430 TX Fifo Allocation, two fixes on USB2 test mode
implementation (one on debugfs and one on ep0), and several minor changes such
as whitespace cleanups, simplification of a few parts of the code, decreasing a
long delay to something a bit saner, dropping a header which was included twice
and so on.
The highlight on this merge is the support for Samsung's Exynos platform,
increasing the number of different users for this driver to three.
Note that Samsung Exynos glue layer will only compile on platforms which
provide implementation for the clk API for now. Once Samsung supports
pm_runtime, that limitation can be dropped from the Makefile.
Paul Zimmerman [Sat, 25 Feb 2012 01:32:18 +0000 (17:32 -0800)]
usb: dwc3: clear 'res_trans_idx' as soon as it becomes invalid
Transfer resource index is cleared in hardware when XFERCOMPLETE
event is generated, so clear the driver's res_trans_idx variable
immediately after that event is received. The upcoming hibernation
patches depend on this change.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Sat, 25 Feb 2012 01:32:16 +0000 (17:32 -0800)]
usb: dwc3: take lock while modifying flags
dwc3_gadget_ep_set_wedge() and dwc3_gadget_set_selfpowered() were
modifying dwc->flags/dwc->is_selfpowered without taking the lock.
Since those modifications are non-atomic, that could cause other
flags to be corrupted. Fix them both to take the lock.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Sat, 25 Feb 2012 01:32:15 +0000 (17:32 -0800)]
usb: dwc3: shorten long delay in dwc3_gadget_set_link_state()
The loop in dwc3_gadget_set_link_state() was using a udelay(500),
which is a long time to delay in interrupt context. Change it to
udelay(5) and increase the loop count to match.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Wed, 15 Feb 2012 11:35:06 +0000 (13:35 +0200)]
usb: dwc3: gadget: don't wrap around the TRB poll on non-ISOC
If we have a non-ISOC endpoint, we will not have a Link TRB
pointing to the beginning of the TRB pool. On such endpoints,
we don't want to let the driver wrap around the TRB pool
otherwise controller will hang waiting for a valid TRB.
Cc: stable@vger.kernel.org Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Chanho Park [Wed, 15 Feb 2012 09:27:55 +0000 (18:27 +0900)]
usb: dwc3: use devm_xxx functions
This patch enables to use devm_xxx functions during probing driver.
The devm_xxx series functions are able to release resource when the
driver is detatched. We can remove several codes to release resources
in the probe function.
Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Wed, 29 Feb 2012 14:46:23 +0000 (16:46 +0200)]
usb: core: hcd: make hcd->irq unsigned
There's really no point in having hcd->irq as a
signed integer when we consider the fact that
IRQ 0 means NO_IRQ. In order to avoid confusion,
make hcd->irq unsigned and fix users who were
passing -1 as the IRQ number to usb_add_hcd.
Peter Korsgaard [Wed, 29 Feb 2012 09:05:37 +0000 (10:05 +0100)]
USB: ftdi_sio: add support for BeagleBone rev A5+
BeagleBone changed to the default FTDI 0403:6010 id in rev A5 to make life
easier for Windows users, so we need a similar workaround as the Calao
board to support it.
Merge tag 'gadget-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: Gadget: changes for 3.4
This merge is rather big. Here's what it contains:
For am5536udc we have just simple coding style fixes. Nothing that has any
potential to cause any issues going forward.
With mv_udc, there's only one single change removing an unneeded NULL check.
at91_udc also only saw a single change this merge window, and that's only
removing a duplicated header.
The Renesas controller has a few more involved changes. Support for SUDMAC was
added, there's now a special handling of IRQ resources for when the IRQ line is
shared between Renesas controller and SUDMAC, we also had a bug fix where
Renesas controller would sleep in atomic context while doing DMA transfers from
a tasklet. There were also a set of minor cleanups.
The FSL UDC also had a scheduling in atomic context bug fix, but that's all.
Thanks to Sebastian, the dummy_hcd now works better than ever with support for
scatterlists and streams. Sebastian also added SuperSpeed descriptors to the
serial gadgets.
The highlight on this merge is the addition of a generic API for mapping and
unmapping usb_requests. This will avoid code duplication on all UDC controllers
and also kills all the defines for DMA_ADDR_INVALID which UDC controllers
sprinkled around. A few of the UDC controllers were already converted to use
this new API.
Merge tag 'xceiv-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: transceiver changes for 3.4
Here we have a big rework done by Heikki Krogerus (thanks) which
splits OTG functionality away from transceivers.
We have known for quite a long time that struct otg_transceiver was
a bad name for the structure, considering transceiver is far from
being OTG-specific (see 4e67185).
Merge tag 'musb-for-v3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
USB: MUSB changes for 3.4
Here are a set of changes to the MUSB driver. In summary we have
a patch making modules behave better, there's a fix on debugfs'
error path, a small change removing an unnecessary pm_runtime
call on musb_shutdown() and a fix to relesect the endpoint in
Interrupt context.
This last patch is needed because we must drop musb's lock when
calling request->complete() and that could cause problems if another
thread queues a request and ends up changing MUSB_INDEX register.
To quote Shengzhou Liu:
I'm sorry, please don't apply this patch.
It appears not only on P1022 platform.
There will be more breaks on other platforms regarding
CTRL_PHY_CLK_VALID bit.
I will post a new patch with well compatibility on all
platforms as soon as I get necessary confirmations.
USB: serial: add Fintek F81232 usb to serial driver
This is the first cut at a driver for the Fintek F81232 USB to serial
single port converter. This provides the initial framework for the
device, and some data can move through it, but no line settings are
handled, so it's not that useful yet. It does give people a starting
place to work from.
Thank to Fintek for providing samples and specifications, without which,
this driver would have never been able to be written.
This converts the zio.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: whiteheat.c: use module_usb_serial_driver
This converts the whiteheat.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Support Department <support@connecttech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: vivopay-serial.c: use module_usb_serial_driver
This converts the vivopay-serial.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: usb_debug.c: use module_usb_serial_driver
This converts the usb_debug.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: symbolserial.c: use module_usb_serial_driver
This converts the symbolserial.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Johan Hovold <jhovold@gmail.com> CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: ssu100.c: use module_usb_serial_driver
This converts the ssu100.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: spcp8x5.c: use module_usb_serial_driver
This converts the spcp8x5.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: sierra.c: use module_usb_serial_driver
This converts the sierra.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Johan Hovold <jhovold@gmail.com> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: siemens_mpi.c: use module_usb_serial_driver
This converts the siemens_mpi.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: qcserial.c: use module_usb_serial_driver
This converts the qcserial.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Steven Hardy <shardy@redhat.com> CC: Thomas Tuttle <ttuttle@chromium.org> CC: Paul Gortmaker <paul.gortmaker@windriver.com> CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: qcaux.c: use module_usb_serial_driver
This converts the qcaux.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> CC: Dan Williams <dcbw@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: oti6858.c: use module_usb_serial_driver
This converts the oti6858.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: option.c: use module_usb_serial_driver
This converts the option.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
USB: serial: opticon.c: use module_usb_serial_driver
This converts the opticon.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Johan Hovold <jhovold@gmail.com> CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> CC: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: omninet.c: use module_usb_serial_driver
This converts the omninet.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: navman.c: use module_usb_serial_driver
This converts the navman.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: moto_modem.c: use module_usb_serial_driver
This converts the moto_modem.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> CC: Elizabeth Jennifer Myers <elizabeth@sporksirc.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: mos7840.c: use module_usb_serial_driver
This converts the mos7840.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: mos7720.c: use module_usb_serial_driver
This converts the mos7720.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: mct_u232.c: use module_usb_serial_driver
This converts the mct_u232.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: kobil_sct.c: use module_usb_serial_driver
This converts the kobil_sct.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Jiri Slaby <jslaby@suse.cz> CC: Alan Stern <stern@rowland.harvard.edu> CC: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: kl5kusb105.c: use module_usb_serial_driver
This converts the kl5kusb105.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: keyspan_pda.c: use module_usb_serial_driver
This converts the keyspan_pda.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
USB: serial: keyspan.c: use module_usb_serial_driver
This converts the keyspan.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
USB: serial: iuu_phoenix.c: use module_usb_serial_driver
This converts the iuu_phoenix.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Johan Hovold <jhovold@gmail.com> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This converts the ipw.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Oliver Neukum <oneukum@suse.de> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: io_ti.c: use module_usb_serial_driver
This converts the io_ti.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Lucas De Marchi <lucas.demarchi@profusion.mobi> CC: "Eric W. Biederman" <ebiederm@xmission.com> CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: io_edgeport.c: use module_usb_serial_driver
This converts the io_edgeport.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Huzaifa Sidhpurwala <huzaifas@redhat.com> CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This converts the hp4x.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: garmin_gps.c: use module_usb_serial_driver
This converts the garmin_gps.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Andrew Morton <akpm@linux-foundation.org> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: funsoft.c: use module_usb_serial_driver
This converts the funsoft.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: empeg.c: use module_usb_serial_driver
This converts the empeg.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Gary Brubaker <xavyer@ix.netcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: digi_acceleport.c: use module_usb_serial_driver
This converts the digi_acceleport.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Peter Berger <pberger@brimson.com> CC: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: cypress_m8.c: use module_usb_serial_driver
This converts the cypress_m8.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
USB: serial: cyberjack.c: use module_usb_serial_driver
This converts the cyberjack.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: cp210x.c: use module_usb_serial_driver
This converts the cp210x.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Florian Fainelli <f.fainelli@gmail.com> CC: "Malte Schröder" <maltesch@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: ch341.c: use module_usb_serial_driver
This converts the ch341.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Johan Hovold <jhovold@gmail.com> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: belkin_sa.c: use module_usb_serial_driver
This converts the belkin_sa.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: William Greathouse <wgreathouse@smva.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: ark3116.c: use module_usb_serial_driver
This converts the ark3116.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
USB: serial: aircable.c: use module_usb_serial_driver
This converts the aircable.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Paul Gortmaker <paul.gortmaker@windriver.com> CC: Lucas De Marchi <lucas.demarchi@profusion.mobi> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: serqt_usb2.c: use module_usb_serial_driver
This converts the serqt_usb2.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Bill Pemberton <wfp5p@virginia.edu> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: serial: quatech_usb2.c: use module_usb_serial_driver
This converts the quatech_usb2.c driver to use the module_usb_serial_driver() call
instead of having to have a module_init/module_exit function, saving a lot
of duplicated code.
CC: Lucas De Marchi <lucas.demarchi@profusion.mobi> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Alan Stern <stern@rowland.harvard.edu> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg KH [Fri, 24 Feb 2012 23:38:14 +0000 (15:38 -0800)]
USB: create module_usb_serial_driver macro
Now that Alan Stern has cleaned up the usb serial driver registration,
we have the ability to create a module_usb_serial_driver macro to make
things a bit simpler, like the other *_driver macros created.
But, as we need two functions here, we can't reuse the existing
module_driver() macro, so we need to roll our own.
Here's a patch implementing module_usb_serial_driver() and it converts
the pl2303 driver to use it, showing a nice cleanup.
usb/storage: remove Filler member from struct bulk_cs_wrap
As Alan Stern pointed out this member has nothing to do with the Command
Status Wrapper (CSW) as specified by the Universal Serial Bus Mass
Storage Class Bulk-Only Transport rev 1.0. It defines the structure
without the additional 18 filler bytes and defines the total size of the
struct to exactly 13 bytes. Larger responses should be dropped. All
in-tree users use a defines instead of sizeof() of this struct as far I
can tell.
Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb/gadget: use common defines within the storage gadget
This replaces the remaining defines which are available in "public"
include/ directory and are re-defined by the storage gadget.
This is patch is basicaly search & replace followed by the removal of
the defines.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
US_BULK_FLAG_IN is defined as 1 and not used. The USB storage spec says
that bit 7 of flags within CBW defines the data direction. 1 is DATA-IN
(read from device) and 0 is the DATA-OUT. Bit 6 is obselete and bits 0-5
are reserved.
This patch redefines the unsued define US_BULK_FLAG_IN from 1 to 1 << 7
aka 0x80 and replaces the obvious users. In a following patch the
storage gadget will use it as well.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb/storage: a couple defines from drivers/usb/storage/transport.h to include/linux/usb/storage.h
This moves the BOT data structures for CBW and CSW from drivers internal
header file to global include able file in include/.
The storage gadget is using the same name for CSW but a different for
CBW so I fix it up properly. The same goes for the ub driver and keucr
driver in staging.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shengzhou Liu [Sat, 25 Feb 2012 15:56:30 +0000 (23:56 +0800)]
powerpc/usb: fix usb CTRL_PHY_CLK_VALID breaks on some platform
Fix checking of CTRL_PHY_CLK_VALID bit break on some platform on which
there is not USB CTRL_PHY_CLK_VALID bit.
- P1023/P3041/P5020 etc,have this bit
- P3060/4080/PSC913x do have this bit, but not mentioned in RM.
- P1022(perhaps and other) has no this bit
Paul Gortmaker [Sun, 26 Feb 2012 00:09:40 +0000 (19:09 -0500)]
usb: fix defined but not used warnings in hcd-pci.c
Shows up on ia64 builds (and possibly elsewhere) for configs that
don't set PM_RUNTIME or PM_SLEEP as follows:
drivers/usb/core/hcd-pci.c:383:12: warning: 'suspend_common' defined but not used
drivers/usb/core/hcd-pci.c:438:12: warning: 'resume_common' defined but not used
As per above, the functions are only used if RUNTIME/SLEEP are set,
so make the two functions conditional on these Kconfig values.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: ftdi_sio: fix problem when the manufacture is a NULL string
On some misconfigured ftdi_sio devices, if the manufacturer string is
NULL, the kernel will oops when the device is plugged in. This patch
fixes the problem.
Reported-by: Wojciech M Zabolotny <W.Zabolotny@elka.pw.edu.pl> Tested-by: Wojciech M Zabolotny <W.Zabolotny@elka.pw.edu.pl> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Felipe Balbi [Mon, 19 Dec 2011 09:32:34 +0000 (11:32 +0200)]
usb: dwc3: gadget: use generic map/unmap routines
those routines have everything we need to map/unmap
USB requests and it's better to use them.
In order to achieve that, we had to add a simple
change on how we allocate and use our setup buffer;
we cannot allocate it from coherent anymore otherwise
the generic map/unmap routines won't be able to easily
know that the GetStatus request already has a DMA
address.
such utilities are currently duplicated on all UDC
drivers basically with the same structure. Let's group
all implementations into one generic implementation
and get rid of that duplication.
Heikki Krogerus [Mon, 13 Feb 2012 11:24:20 +0000 (13:24 +0200)]
usb: otg: Convert all users to pass struct usb_otg for OTG functions
This changes the otg functions so that they receive struct
otg instead of struct usb_phy as parameter and
converts all users of these functions to pass the otg member
of their usb_phy.
Includes fixes to IMX code from Sascha Hauer.
[ balbi@ti.com : fixed a compile warning on ehci-mv.c ]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Heikki Krogerus [Mon, 13 Feb 2012 11:24:19 +0000 (13:24 +0200)]
usb: otg: Remove OTG specific members from usb_phy
All the drivers are now converted to use struct usb_otg, so
removing the OTG specific members from struct usb_phy.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Heikki Krogerus [Mon, 13 Feb 2012 11:24:18 +0000 (13:24 +0200)]
usb: Convert all users to new usb_phy
Use the new usb_phy_* functions with transceiver
operations instead of the old otg functions.
Includes fixes from Sascha Hauer.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Heikki Krogerus [Mon, 13 Feb 2012 11:24:17 +0000 (13:24 +0200)]
usb: otg: mv_otg: Start using struct usb_otg
Use struct usb_otg members with OTG specific functions instead
of usb_phy members.
[ balbi@ti.com : fixed a compile error on isp1704_charger.c ]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>