platform/kernel/linux-3.10.git
12 years agoUSB: qcserial.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:27 +0000 (16:27 -0700)]
USB: qcserial.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the qcserial.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Thomas Tuttle <ttuttle@chromium.org>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: navman.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:25 +0000 (16:27 -0700)]
USB: navman.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the navman.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

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>
12 years agoUSB: ir-usb.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:23 +0000 (16:27 -0700)]
USB: ir-usb.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the ir-usb.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

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>
12 years agoUSB: ipaq.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:20 +0000 (16:27 -0700)]
USB: ipaq.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the ipaq.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

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>
12 years agoUSB: generic.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:18 +0000 (16:27 -0700)]
USB: generic.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the generic.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: f81232.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:17 +0000 (16:27 -0700)]
USB: f81232.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the f81232.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: belkin_sa.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:11 +0000 (16:27 -0700)]
USB: belkin_sa.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the belkin_sa.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: William Greathouse <wgreathouse@smva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ark3116.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:11 +0000 (16:27 -0700)]
USB: ark3116.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the ark3116.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
CC: Bart Hartgers <bart.hartgers@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: aircable.c: remove dbg() usage
Greg Kroah-Hartman [Tue, 15 May 2012 23:27:08 +0000 (16:27 -0700)]
USB: aircable.c: remove dbg() usage

dbg() is a usb-serial specific macro.  This patch converts
the aircable.c driver to use dev_dbg() instead to tie into the
dynamic debug infrastructure.

CC: Paul Gortmaker <paul.gortmaker@windriver.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>
12 years agoUSB: serial: sierra: put reset_resume callback back.
Greg Kroah-Hartman [Tue, 15 May 2012 22:43:19 +0000 (15:43 -0700)]
USB: serial: sierra: put reset_resume callback back.

A few patches ago, I removed the reset_resume callback in this driver.
Now that the usb-serial core supports reset_resume, put this driver
callback back as well, so it should work identically to how it was
originally.

Now if this function really is doing what it should be doing, well,
that's a different story, but we are at least doing the identical thing
that we were before...

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Anton Samokhvalov <pg83@yandex.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: ch341: put reset_resume callback back.
Greg Kroah-Hartman [Tue, 15 May 2012 22:41:47 +0000 (15:41 -0700)]
USB: serial: ch341: put reset_resume callback back.

A few patches ago, I removed the reset_resume callback, changing it to
resume instead.  Now that the usb-serial core supports reset_resume, put
this driver callback back as well, so it should work identically to how
it was originally.

Now if this function really is doing what it should be doing, well,
that's a different story, but we are at least doing the identical thing
that we were before...

Cc: Johan Hovold <jhovold@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: hook up reset_resume callback
Greg Kroah-Hartman [Tue, 15 May 2012 22:40:00 +0000 (15:40 -0700)]
USB: serial: hook up reset_resume callback

The callback is now hooked up for any USB to serial driver that wants
it.  We only register the callback if any of the usb-serial structures
want it, this keeps the USB core happy.

Thanks to Alan Stern for the ideas on how to do this.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: remove zero check of hw_ep_max
Richard Zhao [Tue, 15 May 2012 13:58:18 +0000 (21:58 +0800)]
usb: chipidea: remove zero check of hw_ep_max

It's 0 for host only device.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: CI13xxx: Use usb_put_hcd() on failure to drop HCD
Marek Vasut [Tue, 15 May 2012 04:10:21 +0000 (06:10 +0200)]
USB: CI13xxx: Use usb_put_hcd() on failure to drop HCD

Use usb_put_hcd() call instead of usb_remove_hcd() as that's the appropriate
call to drop hcd which failed registration.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: CI13xxx: Allow use of CONFIG_USB_EHCI_ROOT_HUB_TT
Marek Vasut [Tue, 15 May 2012 04:10:20 +0000 (06:10 +0200)]
USB: CI13xxx: Allow use of CONFIG_USB_EHCI_ROOT_HUB_TT

The CI13xxx usb host needs the root TT support to work properly.
Allow selecting this for the CI13xxx too.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: testusb: add path /dev/bus/usb to default search paths for usbfs
Du, ChangbinX [Tue, 15 May 2012 01:49:25 +0000 (01:49 +0000)]
USB: testusb: add path /dev/bus/usb to default search paths for usbfs

As real device-nodes managed by udev whose nodes lived in /dev/bus/usb
are mostly used today, let testusb tool use that directory as one default
path make tool be more convenient to use.

Signed-off-by: Du Changbin <changbinx.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: EHCI: work around bug in the Philips ISP1562 controller
Alan Stern [Mon, 14 May 2012 17:48:16 +0000 (13:48 -0400)]
USB: EHCI: work around bug in the Philips ISP1562 controller

This patch (as1556) works around a bug in the Philips ISP1562 EHCI
controller.  Although the controller claims to support frame-list
lengths smaller than the default of 1024 for its periodic schedule, in
fact smaller values don't work.  A new quirk flag is added to indicate
when the bug is present, and if it is then the schedule size is left
at the default value.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: EHCI: improve full-speed isochronous scheduling routine
Alan Stern [Mon, 14 May 2012 17:47:20 +0000 (13:47 -0400)]
USB: EHCI: improve full-speed isochronous scheduling routine

This patch (as1555) improves the code ehci-hcd uses while checking the
periodic schedule for isochronous transfers to full-speed devices.  In
addition to making sure that a new transfer does not violate the
restrictions on the high-speed schedule, it also has to check the
restrictions on the full-speed part of the bus, i.e., the part beyond
the Transaction Translator (TT).

It does this by calling tt_available() (or tt_no_collision() if
CONFIG_USB_EHCI_TT_NEWSCHED isn't enabled).  However it calls that
routine on each pass through a loop over the frames being modified,
which is an unnecessary expense because tt_available() (or
tt_no_collision) already does its own loop over frames.  It is
sufficient to do the check just once, before starting the loop.

In addition, the function calls incorrectly converted the transfer's
period from microframes to frames by doing a left shift instead of a
right shift.  The patch fixes this while moving the calls.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: musb: cppi: add missing include to fix compilation
Reinhard Tartler [Mon, 14 May 2012 16:05:20 +0000 (18:05 +0200)]
usb: musb: cppi: add missing include to fix compilation

This fixes compilation as module.

Signed-off-by: Reinhard Tartler <tartler@cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: add read support to usb-serial/../new_id
Bjørn Mork [Sun, 13 May 2012 10:35:00 +0000 (12:35 +0200)]
USB: add read support to usb-serial/../new_id

Keep the usb-serial support for dynamic IDs in sync with the usb
support.  This enables readout of dynamic device IDs for
usb-serial drivers.  Common code is exported from the usb core
system and reused by the usb-serial bus driver.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: let both new_id and remove_id show dynamic id list
Bjørn Mork [Sun, 13 May 2012 10:34:59 +0000 (12:34 +0200)]
USB: let both new_id and remove_id show dynamic id list

This enables the current list of dynamic IDs to be read out through
either new_id or remove_id.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoFunctionFS: enable multiple functions
Andrzej Pietrasiewicz [Mon, 14 May 2012 13:51:52 +0000 (15:51 +0200)]
FunctionFS: enable multiple functions

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>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoRevert "usb: add struct usb_hub_port to store port related members."
Greg Kroah-Hartman [Mon, 14 May 2012 16:22:58 +0000 (09:22 -0700)]
Revert "usb: add struct usb_hub_port to store port related members."

This reverts commit f397d7c4c5e8a1eb93f2ed15808a509318ccf1dd.

This series isn't quite ready for 3.5 just yet, so revert it and give
the author more time to get it correct.

Cc: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoRevert "usb: move struct usb_device->children to struct usb_hub_port->child"
Greg Kroah-Hartman [Mon, 14 May 2012 16:20:37 +0000 (09:20 -0700)]
Revert "usb: move struct usb_device->children to struct usb_hub_port->child"

This reverts commit bebc56d58dc780539777d2b1ca80df5566e2ad87.

The call here is fragile and not well thought out, so revert it, it's
not fully baked yet and I don't want this to go into 3.5.

Cc: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gpio_vbus: avoid consecutive vbus_session calls with the same "is_active"
Shinya Kuribayashi [Thu, 10 May 2012 04:02:38 +0000 (13:02 +0900)]
USB: gpio_vbus: avoid consecutive vbus_session calls with the same "is_active"

Basically, ->vbus_session() calls should be served when VBUS session
starts and ends (it's not whenever transciever drivers detect VBUS
_changes_).  Otherwise, if UDC gadget drivers don't want for some
reason ->vbus_session() calls with the same "is_active" value, either
OTG or UDC drivers need to have some protection handlings.

Also, on platforms using this 'gpio_vbus' driver, the driver is only
allowed to check whether VBUS is applied.  There is no kernel-standard
way prepared for UDC gadget drivers to do that.

With this in mind, gpio_vbus should try to prevent unnecessary
consecutive vbus_session calls being served with the same "in_active"
value.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gpio_vbus: put a missing regulator_put() on error
Shinya Kuribayashi [Thu, 10 May 2012 01:32:14 +0000 (10:32 +0900)]
USB: gpio_vbus: put a missing regulator_put() on error

Note that regulator_put() doesn't care about whether ->vbus_draw is
valid or not.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gpio_vbus: provide an appropriate debounce interval
Shinya Kuribayashi [Thu, 10 May 2012 01:31:21 +0000 (10:31 +0900)]
USB: gpio_vbus: provide an appropriate debounce interval

In commit c2344f13b59e007d782a3e591ebc551bc583a8b7 (USB: gpio_vbus:
add delayed vbus_session calls, 2009-01-24), usb_gadget_vbus_connect()
and ...disconnect() were extracted from the interrupt handler, so to
allow vbus_session handlers to deal with msleep() calls.

This patch takes the approach one step further.

USB2.0 specification (7.1.7.3 Connect and Disconnect Signaling) says
that the USB system software (shall) provide a debounce interval with
a minimum duration of 100 ms, which ensures that the electrical and
mechanical connection is stable before software attempts to reset
the attached device.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gpio_vbus: fix inconsistent 'dev_id' parameters at free_irq()
Shinya Kuribayashi [Thu, 10 May 2012 01:31:51 +0000 (10:31 +0900)]
USB: gpio_vbus: fix inconsistent 'dev_id' parameters at free_irq()

'dev_id' has to be the same with the one passed to request_irq().

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: Kconfig: remove unneeded default value
David Herrmann [Sun, 13 May 2012 16:07:08 +0000 (18:07 +0200)]
usb: Kconfig: remove unneeded default value

If no default value is specified, then 'n' is used so the default value
used here is not needed. Furthermore, we should never change default
values depending on EXPERT mode. EXPERT mode should only make options
visible, not change them.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ohci-omap: Use usb_put_transceiver instead of put_device
Jarkko Nikula [Sun, 13 May 2012 18:10:43 +0000 (21:10 +0300)]
USB: ohci-omap: Use usb_put_transceiver instead of put_device

Currently usb_put_transceiver calls put_device so this is a no-op but it
is better to keep API usage consistent as ohci->transceiver is allocated
with usb_get_transceiver.

While at there remove one extra ohci->transceiver test as the code block
has already tested it.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ehci-fsl: Use usb_put_transceiver instead of put_device
Jarkko Nikula [Sun, 13 May 2012 18:10:20 +0000 (21:10 +0300)]
USB: ehci-fsl: Use usb_put_transceiver instead of put_device

Currently usb_put_transceiver calls put_device so this is a no-op but it
is better to keep API usage consistent as ehci->transceiver is allocated
with usb_get_transceiver.

While at there remove one extra ehci->transceiver test as the code block
has already tested it.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: move struct usb_device->children to struct usb_hub_port->child
Lan Tianyu [Fri, 11 May 2012 08:08:30 +0000 (16:08 +0800)]
usb: move struct usb_device->children to struct usb_hub_port->child

Move child's pointer to the struct usb_hub_port since the child device
is directly associated with the port. Provide usb_get_hub_child_device()
to get child's pointer.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: add struct usb_hub_port to store port related members.
Lan Tianyu [Fri, 11 May 2012 08:08:29 +0000 (16:08 +0800)]
usb: add struct usb_hub_port to store port related members.

Add struct usb_hub_port pointer port_data in the struct usb_hub and allocate
struct usb_hub_port perspectively for each ports to store private data.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: Set device removable state based on ACPI USB data
Matthew Garrett [Fri, 11 May 2012 08:08:28 +0000 (16:08 +0800)]
usb: Set device removable state based on ACPI USB data

ACPI offers two methods that allow us to infer whether or not a USB port
is removable. The _PLD method gives us information on whether the port is
"user visible" or not. If that's not present then we can fall back to the
_UPC method which tells us whether or not a port is connectable.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: Bind devices to ACPI devices when possible
Matthew Garrett [Fri, 11 May 2012 08:08:27 +0000 (16:08 +0800)]
usb: Bind devices to ACPI devices when possible

Built-in USB devices will typically have a representation in the system
ACPI tables. Add support for binding the two together so the USB code can
make use of the associated methods.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoACPI: Add _PLD support
Matthew Garrett [Fri, 11 May 2012 08:08:26 +0000 (16:08 +0800)]
ACPI: Add _PLD support

Add a simple helper function to allow drivers to obtain the physical
device location data.

Acked-by: Len Brown <len.brown@intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoACPI: Add stubs for (un)register_acpi_bus_type
Matthew Garrett [Fri, 11 May 2012 08:08:25 +0000 (16:08 +0800)]
ACPI: Add stubs for (un)register_acpi_bus_type

It's unreasonable to have CONFIG_ACPI for these in drivers, so add some
stub functions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoMAINTAINERS: Add an entry for ChipIdea USB driver
Alexander Shishkin [Fri, 11 May 2012 14:25:59 +0000 (17:25 +0300)]
MAINTAINERS: Add an entry for ChipIdea USB driver

Now that the ChipIdea driver and related platform code has its own
location in the kernel and more contributions from the interested
parties are anticipated, add a new maintainer for it.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: remove langwell_udc
Alexander Shishkin [Fri, 11 May 2012 14:25:58 +0000 (17:25 +0300)]
usb: gadget: remove langwell_udc

We have the chipidea driver now that supports both langwell and penwell,
so there is no need for this one any more.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: drop unused field "device" from ci13xxx_ep
Alexander Shishkin [Fri, 11 May 2012 14:25:57 +0000 (17:25 +0300)]
usb: chipidea: drop unused field "device" from ci13xxx_ep

It was used as a shorthand for gadget's device in request mapping/unmapping
code, but now it's not used any more.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: use generic map/unmap routines
Alexander Shishkin [Fri, 11 May 2012 14:25:56 +0000 (17:25 +0300)]
usb: chipidea: use generic map/unmap routines

We're one of the remaining drivers to map/unmap requests by hand. Switch
to using generic gadget routines for that instead.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: add power_budget limit for ehci to platform data
Alexander Shishkin [Fri, 11 May 2012 14:25:55 +0000 (17:25 +0300)]
usb: chipidea: add power_budget limit for ehci to platform data

Some implementations need this limitation to work correctly.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: add host role
Alexander Shishkin [Fri, 11 May 2012 14:25:54 +0000 (17:25 +0300)]
usb: chipidea: add host role

This adds EHCI host support to the chipidea driver. We want it to be
part of the hdrc driver and not a standalone (sub-)driver module, as
the structure of ehci-hcd.c suggests, so for chipidea controller we
hack it to not provide platform-related code, but only the ehci hcd.

The ehci-platform driver won't work for us here too, because the
controller uses the same registers for both device and host mode and
also otg-related bits, so it's not really possible to put ehci registers
into a separate resource.

This is not a pretty solution, but the alternative is exporting symbols
from the chipidea driver to a ehci-chipidea driver and doing all the
module refcounting.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: use common definition for USBMODE bits
Alexander Shishkin [Fri, 11 May 2012 14:25:53 +0000 (17:25 +0300)]
usb: chipidea: use common definition for USBMODE bits

Some of the bits of USBMODE register are defined in <usb/ehci_def.h>,
use them instead of having our own definitions.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: drop unused msm register definitions
Alexander Shishkin [Fri, 11 May 2012 14:25:52 +0000 (17:25 +0300)]
usb: chipidea: drop unused msm register definitions

These definitions are unused, and the same registers are also defined
in <linux/usb/msm_hsusb_hw.h>.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: drop redundant NULL check
Alexander Shishkin [Fri, 11 May 2012 14:25:51 +0000 (17:25 +0300)]
usb: chipidea: drop redundant NULL check

Currently, gadget can't be NULL in _gadget_stop_activity().

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reported-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: isr_reset_handler fix missing locking
Michael Grzeschik [Fri, 11 May 2012 14:25:50 +0000 (17:25 +0300)]
usb: chipidea: isr_reset_handler fix missing locking

Move spin_lock under the done label, so the
lock will also be pulled in the error paths.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
[rebased on top of the patchset]
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: brush up structure definitions
Alexander Shishkin [Fri, 11 May 2012 14:25:49 +0000 (17:25 +0300)]
usb: chipidea: brush up structure definitions

Get rid of trailing comments in the structure definitions in favor of
kernel-doc.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: remove unused field "regs" from ci13xxx
Alexander Shishkin [Fri, 11 May 2012 14:25:48 +0000 (17:25 +0300)]
usb: chipidea: remove unused field "regs" from ci13xxx

The old implementation used global hw_bank, the new implementation uses
udc-local hw_bank. This field seems to be a leftover from previous coding
experiments.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: add support for roles
Alexander Shishkin [Fri, 11 May 2012 14:25:47 +0000 (17:25 +0300)]
usb: chipidea: add support for roles

Add some generic code for roles and implement simple role switching
based on ID pin state and/or a sysfs file. At this, we also rename
the device to ci_hdrc, which is what it is.

The "manual" switch is made into a sysfs file and not debugfs, because
it might be useful even in non-debug context. For some boards, like
sheevaplug, it seems to be the only way to switch roles without modifying
the hardware, since the ID pin is always grounded.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: chipidea: split the driver code into units
Alexander Shishkin [Fri, 11 May 2012 14:25:46 +0000 (17:25 +0300)]
usb: chipidea: split the driver code into units

Split the driver into the following parts:
  * core  -- resources, register access, capabilities, etc;
  * udc   -- device controller functionality;
  * debug -- logging events.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: move ci13xxx and related code to drivers/usb/chipidea
Alexander Shishkin [Fri, 11 May 2012 14:25:45 +0000 (17:25 +0300)]
usb: move ci13xxx and related code to drivers/usb/chipidea

Since chipidea is a dual role controller, it makes sense to move it
to its own directory, where we can also have host, otg and platform
code related to this controller. It also makes sense to break out
the driver into several compilation units like udc, host, debugging
code, etc.

Firstly, let's move the udc and platform code to drivers/usb/chipidea.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: print basic device info when probing
Alexander Shishkin [Fri, 11 May 2012 14:25:44 +0000 (17:25 +0300)]
usb: gadget: ci13xxx: print basic device info when probing

Report basic information about capabilities and register addresses on
probe.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: don't use "advance" feature when setting address
Alexander Shishkin [Fri, 11 May 2012 14:25:43 +0000 (17:25 +0300)]
usb: gadget: ci13xxx: don't use "advance" feature when setting address

Newer versions of the chipidea controller support the "advance" setting
of usb address, which means instead of setting it immediately, deferring
it till the status completion. Unfortunately, older versions of the
controller don't have this feature, so in order to support those too, we
simply don't use it. It's about 4 lines of extra code, and isn't in any
way critical to performance. While at it, change the return value of the
hw_usb_set_address() to void, since it can't fail in any measurable way.

With this patch, ci13xxx_udc driver works with the chipidea controller in
kirkwood (feroceon SoC), as found in, for example, sheevaplug.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: fix the context of register map
Alexander Shishkin [Fri, 11 May 2012 14:25:42 +0000 (17:25 +0300)]
usb: gadget: ci13xxx: fix the context of register map

The regmap field is an array of register pointers, not the other way
around.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: get rid of local tracing for good
Alexander Shishkin [Fri, 11 May 2012 14:25:41 +0000 (17:25 +0300)]
usb: gadget: ci13xxx: get rid of local tracing for good

There is no point in having tracing output in the kernel these days.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx_pci: guard against devices without driver_data
Alexander Shishkin [Fri, 11 May 2012 14:25:40 +0000 (17:25 +0300)]
usb: gadget: ci13xxx_pci: guard against devices without driver_data

Don't try to initialize devices that don't have driver_data assigned
to their pci ids.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: cdc-wdm: remove from device list on disconnect
Bjørn Mork [Wed, 9 May 2012 11:53:23 +0000 (13:53 +0200)]
USB: cdc-wdm: remove from device list on disconnect

Prevents dereferencing an invalid struct usb_interface
pointer.

Always delete entry from device list whether or not the
rest of the device state cleanup is postponed. The device
list uses desc->intf as key, and wdm_open will dereference
this key while searching for a matching device.  A device
should not appear in the list unless probe() has succeeded
and disconnect() has not finished.

Cc: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: cdc-wdm: cannot use dev_printk when device is gone
Bjørn Mork [Wed, 9 May 2012 11:53:22 +0000 (13:53 +0200)]
USB: cdc-wdm: cannot use dev_printk when device is gone

We cannot dereference a removed USB interface for
dev_printk. Use pr_debug instead where necessary.

Flush errors are expected if device is unplugged and are
therefore best ingored at this point.

Move the kill_urbs() call in wdm_release with dev_dbg()
for the non disconnect, as we know it has already been
called if WDM_DISCONNECTING is set.  This does not
actually fix anything, but keeps the code more consistent.

Cc: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: cdc-wdm: poll must return POLLHUP if device is gone
Bjørn Mork [Wed, 9 May 2012 11:53:21 +0000 (13:53 +0200)]
USB: cdc-wdm: poll must return POLLHUP if device is gone

Else the poll will be restarted indefinitely in a tight loop,
preventing final device cleanup.

Cc: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: dwc3: Fix the dwc3 dependency
joseph daniel [Fri, 11 May 2012 10:23:40 +0000 (15:53 +0530)]
usb: dwc3: Fix the dwc3 dependency

The warning shown up when ran with randconfig,

warning: (USB_DWC3) selects USB_XHCI_PLATFORM which has unmet direct dependencies (USB_SUPPORT && USB_XHCI_HCD)

Signed-off-by: joseph daniel <josephdanielwalter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: dummy_hcd: fix build when BUG is not set
Sasha Levin [Fri, 11 May 2012 04:39:37 +0000 (06:39 +0200)]
usb: gadget: dummy_hcd: fix build when BUG is not set

Use WARN_ON() instead of __WARN, which also means we won't use any
internal macros.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: host: mips: sead3: Fix for big endian.
Steven J. Hill [Fri, 11 May 2012 16:40:25 +0000 (11:40 -0500)]
usb: host: mips: sead3: Fix for big endian.

Fix driver to work properly in big endian mode.

Signed-off-by: Steven J. Hill <sjhill@mips.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: ti_usb_3410_5052: Add support for the FRI2 serial console
Darren Hart [Fri, 11 May 2012 20:56:57 +0000 (13:56 -0700)]
USB: serial: ti_usb_3410_5052: Add support for the FRI2 serial console

The Kontron M2M development board, also known as the Fish River Island II,
has an optional daughter card providing access to the PCH_UART (EG20T) via
a ti_usb_3410_5052 uart to usb chip.

http://us.kontron.com/products/systems+and+platforms/m2m/m2m+smart+services+developer+kit.html

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Al Borchers <alborchers@steinerpoint.com>
CC: Peter Berger <pberger@brimson.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: opticon: hook up suspend/resume callbacks
Greg Kroah-Hartman [Thu, 10 May 2012 21:35:21 +0000 (14:35 -0700)]
USB: serial: opticon: hook up suspend/resume callbacks

With a previous patch, the usb_driver suspend/resume callbacks got
overridden and were never called if a usb_serial driver defined them.
This patch fixes the opticon driver to move the suspend/resume callbacks
into the usb_serial_driver structure where they will be properly called.

It then removes the unused usb_driver structure.

Cc: Johan Hovold <jhovold@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serqt_usb2: remove duplicate device ids
Greg Kroah-Hartman [Thu, 10 May 2012 21:13:17 +0000 (14:13 -0700)]
USB: serqt_usb2: remove duplicate device ids

There are a number of device ids that the quatech2 driver supports that
are duplicated in the serqt_usb2 driver, so remove them from the
serqt_usb2 driver as they do not belong there.

Reported-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: remove staging quatech_usb2 driver
Greg Kroah-Hartman [Thu, 10 May 2012 21:09:16 +0000 (14:09 -0700)]
USB: remove staging quatech_usb2 driver

Now that we have a "real" driver for the quatech devices, we can remove
the drivers/staging/quatech_usb2/ driver as it is no longer needed.

Thanks to Bill Pemberton for writing the new driver.

Cc: Richard Ash <richard@audacityteam.org>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: add copyright and license to quatech2
Bill Pemberton [Thu, 10 May 2012 20:57:39 +0000 (16:57 -0400)]
USB: serial: add copyright and license to quatech2

Add a copyright and license statement to the head of quatech.c source
file.  No code change here.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: add quatech2 usb to serial driver
Bill Pemberton [Thu, 10 May 2012 19:36:02 +0000 (15:36 -0400)]
USB: serial: add quatech2 usb to serial driver

This supports the Quatech USB 2 usb to serial adapters.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: f_rndis: Set rndis vendor parameters
Benoit Goby [Thu, 10 May 2012 08:08:04 +0000 (10:08 +0200)]
usb: gadget: f_rndis: Set rndis vendor parameters

Add a variant of rndis_bind_config to let gadget drivers change
rndis vendorID and manufacturer parameters.

Signed-off-by: Benoit Goby <benoit@android.com>
[make rndis_bind_config a static inline 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: rndis: Fix re-binding f_rndis
Benoit Goby [Thu, 10 May 2012 08:08:03 +0000 (10:08 +0200)]
usb: gadget: rndis: Fix re-binding f_rndis

f_rndis checks if rndis_string_defs[0].id is null to setup rndis
and allocate string ids when it is bound to the first configuration:

/* maybe allocate device-global string IDs */
if (rndis_string_defs[0].id == 0) {

/* ... and setup RNDIS itself */
status = rndis_init();
if (status < 0)
return status;

rndis_string_defs[0].id must be reset to 0 on unbind for rndis to be
correctly initialized on the next composite_bind.

Signed-off-by: Benoit Goby <benoit@android.com>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: Add variant of gether_setup to customize the device name
Mike Lockwood [Thu, 10 May 2012 08:08:02 +0000 (10:08 +0200)]
usb: gadget: Add variant of gether_setup to customize the device name

This is needed to avoid name collisions on SoCs that have both usb
gadget and usb host, where usb0 may be the rndis interface or a usb
ethernet adapter.

Signed-off-by: Mike Lockwood <lockwood@android.com>
Signed-off-by: Benoit Goby <benoit@android.com>
[make gether_setup a static inline 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: u_serial: Allow calling gserial_setup after init
Benoit Goby [Thu, 10 May 2012 08:08:01 +0000 (10:08 +0200)]
usb: gadget: u_serial: Allow calling gserial_setup after init

Remove geserial_setup from the init section. The android gadget
driver calls it after probe, after userspace has configured the
gadget driver.

Signed-off-by: Benoit Goby <benoit@android.com>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: composite: add iSerialNumber to usb_composite_driver
Andrzej Pietrasiewicz [Thu, 10 May 2012 08:08:00 +0000 (10:08 +0200)]
usb: gadget: composite: add iSerialNumber to usb_composite_driver

Add iSerialNumber to usb_composite_driver to allow setting a default value.
This is useful when the module is compiled-in. Then the composite_bind
is executed at kernel boot and string id for iSerialNumber can be overridden
even if there is no iSerialNumber kernel commandline parameter.
If the string id is not overridden, then get_string will never attempt to
look for the alternative string contents using cdev->serial_override.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: composite: make module parameters accessible at runtime
Andrzej Pietrasiewicz [Thu, 10 May 2012 08:07:59 +0000 (10:07 +0200)]
usb: gadget: composite: make module parameters accessible at runtime

Enable module parameters to be modified at runtime, especially
if the module is compiled-in.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: composite: Initialize config->interface
Benoit Goby [Thu, 10 May 2012 08:07:58 +0000 (10:07 +0200)]
usb: gadget: composite: Initialize config->interface

Reset config->interface in usb_add_config, as it may contain pointers to
functions from a previous session if config is removed and re-added.

Signed-off-by: Benoit Goby <benoit@android.com>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: composite: Add usb_remove_config
Benoit Goby [Thu, 10 May 2012 08:07:57 +0000 (10:07 +0200)]
usb: gadget: composite: Add usb_remove_config

Add usb_remove_config to unbind a configuration and remove it from
the configs list. This allows implementing composite gadget drivers that
can disconnect themself from the bus and that will later be re-enumerated
with a different configuration.

Gadget drivers must call usb_gadget_disconnect before calling this
function to disable the pullup, disconnect the device from the host,
and prevent the host from enumerating the device while we are changing
the gadget configuration.

Signed-off-by: Benoit Goby <benoit@android.com>
[change return type of [usb_]remove_config]
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gadget: ci13xx_pci: remove unneeded check in ci13xxx_pci_probe()
Greg Kroah-Hartman [Thu, 10 May 2012 18:41:49 +0000 (11:41 -0700)]
USB: gadget: ci13xx_pci: remove unneeded check in ci13xxx_pci_probe()

As pointed out by Dan Carpenter, the check for NULL for the id variable
is no longer needed, especially as we just dereferenced it a few lines
earlier, causing an oops if it really was NULL.

This was caused by 62bb84ed0e4d: "usb: gadget: ci13xxx: convert to
platform device".

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: gadget: ci13xx_udc: fix potential crash in irq handler
Greg Kroah-Hartman [Thu, 10 May 2012 18:37:18 +0000 (11:37 -0700)]
USB: gadget: ci13xx_udc: fix potential crash in irq handler

As pointed out by Dan Carpenter, we should not be trying to call
dev_err() on a structure that was previously determined to be NULL,
that's just foolish and asking for trouble.

So just delete the message, it's not going to do anyone any good to have
it anyway.

This problem was caused by 0f089094cde5: "usb: gadget: ci13xxx: replace
home-brewed logging with dev_{err,warn,info}"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb:hsotg:samsung:cosmetic Move <linux/platform_data/s3c-hsotg.h> to proper place
Lukasz Majewski [Wed, 9 May 2012 11:16:53 +0000 (13:16 +0200)]
usb:hsotg:samsung:cosmetic Move <linux/platform_data/s3c-hsotg.h> to proper place

This commit adds a cosmetic change to the s3c-hsotg UDC driver.
It moves s3c-hsotg.h to other linux/ related inclusions.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ohci-at91: add a reset function to fix race condition
Nicolas Ferre [Wed, 9 May 2012 08:48:54 +0000 (10:48 +0200)]
USB: ohci-at91: add a reset function to fix race condition

A possible race condition appears because we are not initializing
the ohci->regs before calling usb_hcd_request_irqs().
We move the call to ohci_init() in hcd->driver->reset() instead of
hcd->driver->start() to fix this.
This was experienced when we share the same IRQ line between OHCI and EHCI
controllers.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: Christian Eggers <christian.eggers@kathrein.de>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ohci-at91: use resource_size() for memory/io resource length
Nicolas Ferre [Wed, 9 May 2012 08:49:41 +0000 (10:49 +0200)]
USB: ohci-at91: use resource_size() for memory/io resource length

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoARM: OMAP: USB: fix warning on EHCI PHY reset path
Igor Grinberg [Wed, 9 May 2012 07:31:35 +0000 (10:31 +0300)]
ARM: OMAP: USB: fix warning on EHCI PHY reset path

When PHY reset pin is connected to a GPIO on external GPIO chip
(e.g. I2C), we should not call the gpio_set_value() function, but
gpio_set_value_cansleep().

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: convert to new style
Alexander Shishkin [Tue, 8 May 2012 20:29:04 +0000 (23:29 +0300)]
usb: gadget: ci13xxx: convert to new style

Finally, convert to the new style framework, using udc_start/udc_stop
methods. Since there is no need in the global _udc pointer, remove it.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: move endpoint (de-)initialization to probe/remove
Alexander Shishkin [Tue, 8 May 2012 20:29:03 +0000 (23:29 +0300)]
usb: gadget: ci13xxx: move endpoint (de-)initialization to probe/remove

Currently, endpoints are initialized in gadget start/stop methods, however
for the new style gadgets it is expected that bind() can be called before
controller's start(), and we need endpoints already initialized at that
point. So, move endpoint initialization to controller's probe before we
switch to the "new style" gadget framework.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: replace home-brewed logging with dev_{err,warn,info}
Alexander Shishkin [Tue, 8 May 2012 20:29:02 +0000 (23:29 +0300)]
usb: gadget: ci13xxx: replace home-brewed logging with dev_{err,warn,info}

Logging output in the driver is mostly done using custom err/warn/info
macros which rely on the existence of the global variable _udc, which
is a global reference to the udc controller structure. This reference
will have to go in order to allow us to have more than one chipidea udc
in the system.

Thus, replace custom macros with dev_{err,warn,info} using the platform
device where possible. The trace() macro, which is a nop by default is
left for tracing purposes.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: convert to platform device
Alexander Shishkin [Tue, 8 May 2012 20:29:01 +0000 (23:29 +0300)]
usb: gadget: ci13xxx: convert to platform device

Let's break ci13xxx driver into a separate udc driver and platform
drivers _pci and _msm, which will create a platform device for each pci
(or msm) device found. The approach was introduced by Felipe in dwc3
driver and there seems to be no reason not to use it.

msm related code is only compile-tested.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: conversion of controllers choice to menu
Alexander Shishkin [Tue, 8 May 2012 20:29:00 +0000 (23:29 +0300)]
usb: gadget: conversion of controllers choice to menu

After the UDC class conversion, there is no reason to limit the kernel
to have only one UDC controller in the system.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: redo register access
Alexander Shishkin [Tue, 8 May 2012 20:28:59 +0000 (23:28 +0300)]
usb: gadget: ci13xxx: redo register access

Use lookup table instead of conditional macrodefinitions of register
addresses. With two different possible register layouts and different
register offsets, it's easiest to build a table with register addresses
at probe time, based on the information supplied from the platform and
device capabilities. This way we get rid of branch-per-register-access.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: move global variables inside struct ci13xxx
Alexander Shishkin [Tue, 8 May 2012 20:28:58 +0000 (23:28 +0300)]
usb: gadget: ci13xxx: move global variables inside struct ci13xxx

Make global variables that are specific for each UDC instance part of
struct ci13xxx.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: drop needless parens
Alexander Shishkin [Tue, 8 May 2012 20:28:57 +0000 (23:28 +0300)]
usb: gadget: ci13xxx: drop needless parens

Small and self-evident cleanup.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb-storage: unusual_devs entry for Yarvik PMP400 MP4 player
Alan Stern [Tue, 8 May 2012 19:15:25 +0000 (15:15 -0400)]
usb-storage: unusual_devs entry for Yarvik PMP400 MP4 player

This patch (as1553) adds an unusual_dev entrie for the Yarvik PMP400
MP4 music player.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Jesse Feddema <jdfeddema@gmail.com>
Tested-by: Jesse Feddema <jdfeddema@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: serial: rework usb_serial_register/deregister_drivers()
Greg Kroah-Hartman [Tue, 8 May 2012 22:46:14 +0000 (15:46 -0700)]
USB: serial: rework usb_serial_register/deregister_drivers()

This reworks the usb_serial_register_drivers() and
usb_serial_deregister_drivers() to not need a pointer to a struct
usb_driver anymore.  The usb_driver structure is now created dynamically
and registered and unregistered as needed.

This saves lines of code in each usb-serial driver.  All in-kernel users
of these functions were also fixed up at this time.  The pl2303 driver
was tested that everything worked properly.

Thanks for the idea to do this from Alan Stern.

Cc: Adhir Ramjiawan <adhirramjiawan0@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Aleksey Babahin <tamerlan311@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrew Worsley <amworsley@gmail.com>
Cc: Bart Hartgers <bart.hartgers@gmail.com>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: Donald Lee <donald@asix.com.tw>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Gary Brubaker <xavyer@ix.netcom.com>
Cc: Jesper Juhl <jj@chaosbits.net>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Lonnie Mendez <dignome@gmail.com>
Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com>
Cc: Matthias Urlichs <smurf@smurf.noris.de>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Michal Sroczynski <msroczyn@gmail.com>
Cc: "Michał Wróbel" <michal.wrobel@flytronic.pl>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Berger <pberger@brimson.com>
Cc: Preston Fick <preston.fick@silabs.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Rigbert Hamisch <rigbert@gmx.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Simon Arlott <simon@fire.lp0.eu>
Cc: Support Department <support@connecttech.com>
Cc: Thomas Tuttle <ttuttle@chromium.org>
Cc: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Cc: Wang YanQing <Udknight@gmail.com>
Cc: William Greathouse <wgreathouse@smva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx_pci: add langwell/penwell pci ids
Alexander Shishkin [Fri, 4 May 2012 13:47:17 +0000 (16:47 +0300)]
usb: gadget: ci13xxx_pci: add langwell/penwell pci ids

Add pci ids for ChipIdea UDC as found in langwell/penwell SoCs.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: rename register layouts
Alexander Shishkin [Fri, 4 May 2012 13:47:16 +0000 (16:47 +0300)]
usb: gadget: ci13xxx: rename register layouts

Currently, the register prefixes in the driver seem to be mixed: the
capability registers are the ones that contain capability information,
such as number of hardware endpoints, while the registers that are
used to program the controller are called operational registers.

Normally, capability registers start at 0x100 offset of the register
window and are followed by operational registers. In some versions,
however, capability registers start at 0x0 offset.

This patch renames the register and adjusts their offsets appropriately,
leaving the possibility of having a non-standard capability offset.

I couldn't find any mentions of the TESTMODE register anywhere, so I
suspect it might only be enabled in chipidea internal versions of the
controller and I'm really inclined to remove it from the driver or at
least hiding it behind a config option.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: initialize ep0{out,in} dynamically
Alexander Shishkin [Fri, 4 May 2012 13:47:15 +0000 (16:47 +0300)]
usb: gadget: ci13xxx: initialize ep0{out,in} dynamically

Change ep0{out,in} macros into dynamically assigned pointers in
gadget initialization time.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agousb: gadget: ci13xxx: fix ep list removal in gadget unregistering code
Alexander Shishkin [Fri, 4 May 2012 13:47:14 +0000 (16:47 +0300)]
usb: gadget: ci13xxx: fix ep list removal in gadget unregistering code

Since ep0{out,in} are never on gadget's ep_list, there's no need to try
to unlink them, even more so because ep_list linkage is not initialized
for these endpoints.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoohci-da8xx: set MODULE_ALIAS to allow autoloading
Jan Luebbe [Mon, 7 May 2012 08:25:16 +0000 (10:25 +0200)]
ohci-da8xx: set MODULE_ALIAS to allow autoloading

The Davinci USB platform device (in mach-davinci/usb.c) uses "ohci"
as the name. To allow autoloading of the relevant driver, the module
needs to set the MODULE_ALIAS.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: make vendor id of root hubs greppable
Paul Bolle [Sat, 5 May 2012 11:16:51 +0000 (13:16 +0200)]
USB: make vendor id of root hubs greppable

It took me surprisingly long to find the location where the Linux
Foundation vendor id (0x1d6b) is set for the root hubs. A minor update
to three comments makes those locations (trivially) greppable.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoUSB: ffs-test: fix length argument of out function call
Matthias Fend [Mon, 7 May 2012 12:37:30 +0000 (14:37 +0200)]
USB: ffs-test: fix length argument of out function call

The out functions should only handle actual available data instead of the complete buffer.
Otherwise for example the ep0_consume function will report ghost events since it tries to decode
the complete buffer - which may contain partly invalid data.

Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net>
Cc: stable <stable@vger.kernel.org>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>