pandora-kernel.git
12 years agoMerge branch 'for-next' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb...
Greg Kroah-Hartman [Fri, 8 Jul 2011 22:30:22 +0000 (15:30 -0700)]
Merge branch 'for-next' of /linux/kernel/git/balbi/usb into usb-next

* 'for-next' of master.kernel.org:/pub/scm/linux/kernel/git/balbi/usb:
  usb: gadget: m66592-udc: add pullup function
  usb: gadget: m66592-udc: add function for external controller
  usb: gadget: r8a66597-udc: add pullup function
  usb: gadget: zero: add superspeed support
  usb: gadget: add SS descriptors to Ethernet gadget
  usb: gadget: r8a66597-udc: add support for TEST_MODE
  usb: gadget: m66592-udc: add support for TEST_MODE
  usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
  usb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver
  usb: update email address in r8a66597-udc and m66592-udc
  usb: musb: restore INDEX register in resume path
  usb: gadget: fix up depencies
  usb: gadget: fusb300_udc: fix compile warnings
  usb: gadget: ci13xx_udc.c: fix compile warning
  usb: gadget: net2272: fix compile warnings
  usb: gadget: langwell_udc: fix compile warnings
  usb: gadget: fusb300_udc: drop dead code

12 years agoMerge branch 'gadget' into for-next
Felipe Balbi [Fri, 8 Jul 2011 22:10:07 +0000 (01:10 +0300)]
Merge branch 'gadget' into for-next

* gadget:
  usb: gadget: m66592-udc: add pullup function
  usb: gadget: m66592-udc: add function for external controller
  usb: gadget: r8a66597-udc: add pullup function
  usb: gadget: zero: add superspeed support
  usb: gadget: add SS descriptors to Ethernet gadget
  usb: gadget: r8a66597-udc: add support for TEST_MODE
  usb: gadget: m66592-udc: add support for TEST_MODE
  usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
  usb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver
  usb: update email address in r8a66597-udc and m66592-udc
  usb: musb: restore INDEX register in resume path
  usb: gadget: fix up depencies
  usb: gadget: fusb300_udc: fix compile warnings
  usb: gadget: ci13xx_udc.c: fix compile warning
  usb: gadget: net2272: fix compile warnings
  usb: gadget: langwell_udc: fix compile warnings
  usb: gadget: fusb300_udc: drop dead code

12 years agousb: gadget: m66592-udc: add pullup function
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:58:50 +0000 (09:58 +0900)]
usb: gadget: m66592-udc: add pullup function

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: m66592-udc: add function for external controller
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:58:43 +0000 (09:58 +0900)]
usb: gadget: m66592-udc: add function for external controller

M66592 has the pin of WR0 and WR1. So, if one write-pin of CPU
connects to the pins, we have to change the setting of FIFOSEL
register in the controller. If we don't change the setting,
the controller cannot send the data of odd length.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: r8a66597-udc: add pullup function
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:58:20 +0000 (09:58 +0900)]
usb: gadget: r8a66597-udc: add pullup function

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: renesas_usbhs: support multi driver
Kuninori Morimoto [Mon, 4 Jul 2011 00:42:35 +0000 (17:42 -0700)]
usb: renesas_usbhs: support multi driver

Some SuperH/board has multi USBHS on it.
This patch supports multi register for renesas_usbhs

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: inaccessible pipe is not an error
Kuninori Morimoto [Mon, 4 Jul 2011 00:42:47 +0000 (17:42 -0700)]
usb: renesas_usbhs: inaccessible pipe is not an error

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: care buff alignment when dma handler
Kuninori Morimoto [Mon, 4 Jul 2011 00:42:19 +0000 (17:42 -0700)]
usb: renesas_usbhs: care buff alignment when dma handler

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: PL2303: correctly handle baudrates above 115200
Michał Sroczyński [Tue, 5 Jul 2011 19:53:35 +0000 (21:53 +0200)]
USB: PL2303: correctly handle baudrates above 115200

PL2303: correctly handle baudrates above 115200

Signed-off-by: Michal Sroczynski <msroczyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: r8a66597-hcd: fixup USB_PORT_STAT_C_SUSPEND shift
Kuninori Morimoto [Thu, 7 Jul 2011 09:36:32 +0000 (02:36 -0700)]
usb: r8a66597-hcd: fixup USB_PORT_STAT_C_SUSPEND shift

This is typo fix of
749da5f8 (USB: straighten out port feature vs. port status usage)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: compile/config are rescued
Kuninori Morimoto [Thu, 7 Jul 2011 09:17:37 +0000 (02:17 -0700)]
usb: renesas_usbhs: compile/config are rescued

This patch rescues renesas_usbhs compile from
commit 193ab2a (usb: gadget: allow multiple gadgets to be built)

CONFIG_USB_RENESAS_USBHS compile renesas_usbhs main code which
is shared between Host/Gadget.
CONFIG_USB_RENESAS_USBHS_UDC add mod_gadget to it.

It had lost USB_GADGET_DUALSPEED

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: fixup comment-out
Kuninori Morimoto [Thu, 7 Jul 2011 07:23:24 +0000 (00:23 -0700)]
usb: renesas_usbhs: fixup comment-out

This patch add/modify comment-out of renesas_usbhs.
On this process, usbhs_pkt_init was moved because it was placed under
usbhsf_null_handler which has no relationship it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: update email address in ohci-sh and r8a66597-hcd
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:58:56 +0000 (09:58 +0900)]
usb: update email address in ohci-sh and r8a66597-hcd

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: r8a66597-hcd: add function for external controller
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:57:10 +0000 (09:57 +0900)]
usb: r8a66597-hcd: add function for external controller

R8A66597 has the pin of WR0 and WR1. So, if one write-pin of CPU
connects to the pins, we have to change the setting of FIFOSEL
register in the controller. If we don't change the setting,
the controller cannot send the data of odd length.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoEHCI: only power off port if over-current is active
Sergei Shtylyov [Wed, 6 Jul 2011 19:19:38 +0000 (23:19 +0400)]
EHCI: only power off port if over-current is active

MAX4967 USB power supply chip we use on our boards signals over-current when
power is not enabled; once it's enabled, over-current signal returns to normal.
That unfortunately caused the endless stream of "over-current change on port"
messages. The EHCI root hub code reacts on every over-current signal change
with powering off the port -- such change event is generated the moment the
port power is enabled, so once enabled the power is immediately cut off.
I think we should only cut off power when we're seeing the active over-current
signal, so I'm adding such check to that code. I also think that the fact that
we've cut off the port power should be reflected in the result of GetPortStatus
request immediately, hence I'm adding a PORTSCn register readback after write...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: stable@kernel.org
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: mon: Allow to use usbmon without debugfs
Tobias Klauser [Thu, 7 Jul 2011 07:28:21 +0000 (09:28 +0200)]
USB: mon: Allow to use usbmon without debugfs

Do not bail out with an error in mon_text_init() if debugfs is not
available, instead just return 0 and let mon_init() go ahead with
loading the binary API. Return -ENOMEM in case debugfs_create_dir()
fails for other reasons. Later, it is enough to check for mon_dir
not set.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: EHCI: go back to using the system clock for QH unlinks
Alan Stern [Tue, 5 Jul 2011 16:34:05 +0000 (12:34 -0400)]
USB: EHCI: go back to using the system clock for QH unlinks

This patch (as1477) fixes a problem affecting a few types of EHCI
controller.  Contrary to what one might expect, these controllers
automatically stop their internal frame counter when no ports are
enabled.  Since ehci-hcd currently relies on the frame counter for
determining when it should unlink QHs from the async schedule, those
controllers run into trouble: The frame counter stops and the QHs
never get unlinked.

Some systems have also experienced other problems traced back to
commit b963801164618e25fbdc0cd452ce49c3628b46c8 (USB: ehci-hcd unlink
speedups), which made the original switch from using the system clock
to using the frame counter.  It never became clear what the reason was
for these problems, but evidently it is related to use of the frame
counter.

To fix all these problems, this patch more or less reverts that commit
and goes back to using the system clock.  But this can't be done
cleanly because other changes have since been made to the scan_async()
subroutine.  One of these changes involved the tricky logic that tries
to avoid rescanning QHs that have already been seen when the scanning
loop is restarted, which happens whenever an URB is given back.
Switching back to clock-based unlinks would make this logic even more
complicated.

Therefore the new code doesn't rescan the entire async list whenever a
giveback occurs.  Instead it rescans only the current QH and continues
on from there.  This requires the use of a separate pointer to keep
track of the next QH to scan, since the current QH may be unlinked
while the scanning is in progress.  That new pointer must be global,
so that it can be adjusted forward whenever the _next_ QH gets
unlinked.  (uhci-hcd uses this same trick.)

Simplification of the scanning loop removes a level of indentation,
which accounts for the size of the patch.  The amount of code changed
is relatively small, and it isn't exactly a reversion of the
b963801164 commit.

This fixes Bugzilla #32432.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: <stable@kernel.org>
Tested-by: Matej Kenda <matejken@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoehci: add pci quirk for Ordissimo and RM Slate 100 too
Anisse Astier [Tue, 5 Jul 2011 14:38:46 +0000 (16:38 +0200)]
ehci: add pci quirk for Ordissimo and RM Slate 100 too

Add another variant of the Pegatron tablet used by Ordissimo, and
apparently RM Slate 100, to the list of models that should skip the
negociation for the handoff of the EHCI controller.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoehci: refactor pci quirk to use standard dmi_check_system method
Anisse Astier [Tue, 5 Jul 2011 14:38:45 +0000 (16:38 +0200)]
ehci: refactor pci quirk to use standard dmi_check_system method

In commit 3610ea5397b80822e417aaa0e706fd803fb05680 (ehci: workaround for pci
quirk timeout on ExoPC), a workaround was added to skip the negociation for
the handoff of the EHCI controller.

Refactor the DMI detection code to use standard dmi_check_system function.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: EHCI: Allow users to override 80% max periodic bandwidth
Kirill Smelkov [Sun, 3 Jul 2011 16:36:57 +0000 (20:36 +0400)]
USB: EHCI: Allow users to override 80% max periodic bandwidth

There are cases, when 80% max isochronous bandwidth is too limiting.

For example I have two USB video capture cards which stream uncompressed
video, and to stream full NTSC + PAL videos we'd need

    NTSC 640x480 YUV422 @30fps      ~17.6 MB/s
    PAL  720x576 YUV422 @25fps      ~19.7 MB/s

isoc bandwidth.

Now, due to limited alt settings in capture devices NTSC one ends up
streaming with max_pkt_size=2688  and  PAL with max_pkt_size=2892, both
with interval=1. In terms of microframe time allocation this gives

    NTSC    ~53us
    PAL     ~57us

and together

    ~110us  >  100us == 80% of 125us uframe time.

So those two devices can't work together simultaneously because the'd
over allocate isochronous bandwidth.

80% seemed a bit arbitrary to me, and I've tried to raise it to 90% and
both devices started to work together, so I though sometimes it would be
a good idea for users to override hardcoded default of max 80% isoc
bandwidth.

After all, isn't it a user who should decide how to load the bus? If I
can live with 10% or even 5% bulk bandwidth that should be ok. I'm a USB
newcomer, but that 80% set in stone by USB 2.0 specification seems to be
chosen pretty arbitrary to me, just to serve as a reasonable default.

NOTE 1
~~~~~~

for two streams with max_pkt_size=3072 (worst case) both time
allocation would be 60us+60us=120us which is 96% periodic bandwidth
leaving 4% for bulk and control.  Alan Stern suggested that bulk then
would be problematic (less than 300*8 bittimes left per microframe), but
I think that is still enough for control traffic.

NOTE 2
~~~~~~

Sarah Sharp expressed concern that maxing out periodic bandwidth
could lead to vendor-specific hardware bugs on host controllers, because

> It's entirely possible that you'll run into
> vendor-specific bugs if you try to pack the schedule with isochronous
> transfers.  I don't think any hardware designer would seriously test or
> validate their hardware with a schedule that is basically a violation of
> the USB bus spec (more than 80% for periodic transfers).

So far I've only tested this patch on my HP Mini 5103 with N10 chipset

    kirr@mini:~$ lspci
    00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge
    00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller
    00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller
    00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
    00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
    00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 02)
    00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
    00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)
    00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)
    00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)
    00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
    00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)
    00:1f.2 SATA controller: Intel Corporation N10/ICH7 Family SATA AHCI Controller (rev 02)
    01:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
    02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8059 PCI-E Gigabit Ethernet Controller (rev 11)

and the system works stable with 110us/uframe (~88%) isoc bandwith allocated for
above-mentioned isochronous transfers.

NOTE 3
~~~~~~

This feature is off by default. I mean max periodic bandwidth is set to
100us/uframe by default exactly as it was before the patch. So only those of us
who need the extreme settings are taking the risk - normal users who do not
alter uframe_periodic_max sysfs attribute should not see any change at all.

NOTE 4
~~~~~~

I've tried to update documentation in Documentation/ABI/ thoroughly, but
only "TBD" was put into Documentation/usb/ehci.txt -- the text there seems
to be outdated and much needing refreshing, before it could be amended.

Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: EHCI: Move sysfs related bits into ehci-sysfs.c
Kirill Smelkov [Sun, 3 Jul 2011 16:36:56 +0000 (20:36 +0400)]
USB: EHCI: Move sysfs related bits into ehci-sysfs.c

The only sysfs attr implemented so far is "companion" from ehci-hub.c,
but in the next patch we are going to add another sysfs file, so prior
to that let's structure things and move already-in-there sysfs code to
separate file.

NOTE: All the code I'm moving into this new file was written by Alan
Stern (in 57e06c11 "EHCI: force high-speed devices to run at full
speed"; Jan 16 2007), that's why I'm putting

    Copyright (C) 2007 by Alan Stern

there after explicit request from the author.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agodrivers: usb: atm: ueagle-atm: Add missing const qualifier
Chris Forbes [Sat, 2 Jul 2011 23:53:34 +0000 (11:53 +1200)]
drivers: usb: atm: ueagle-atm: Add missing const qualifier

Added missing const qualifier as flagged by checkpatch.pl

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agodrivers: usb: atm: ueagle-atm: use __packed
Chris Forbes [Sat, 2 Jul 2011 23:53:33 +0000 (11:53 +1200)]
drivers: usb: atm: ueagle-atm: use __packed

Replaced __attribute__ ((packed)) with __packed;

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoehci-msm : use ehci_setup
Matthieu CASTET [Sat, 2 Jul 2011 18:59:46 +0000 (20:59 +0200)]
ehci-msm : use ehci_setup

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Tested-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: zero: add superspeed support
Amit Blay [Sun, 3 Jul 2011 14:29:31 +0000 (17:29 +0300)]
usb: gadget: zero: add superspeed support

This patch adds SuperSpeed descriptors to the
g_zero gadget.

The SuperSpeed descriptors were added both for
f_soursesink and f_loopback function drivers.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: add SS descriptors to Ethernet gadget
Paul Zimmerman [Mon, 27 Jun 2011 21:13:18 +0000 (14:13 -0700)]
usb: gadget: add SS descriptors to Ethernet gadget

Add SuperSpeed descriptors to the Network USB
function drivers.

This has been lightly tested using a Linux host.
I was able to ssh from device to host and host to
device, no obvious problems seen.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: r8a66597-udc: add support for TEST_MODE
Yoshihiro Shimoda [Fri, 8 Jul 2011 05:51:14 +0000 (14:51 +0900)]
usb: gadget: r8a66597-udc: add support for TEST_MODE

The USB high speed device must support the TEST_MODE, but the driver
didn't support it. When we sent the SET_FEATURE for TEST_MODE to
the driver, the request was successful, but the module didn't enter
the TEST_MODE.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: m66592-udc: add support for TEST_MODE
Yoshihiro Shimoda [Fri, 8 Jul 2011 05:51:33 +0000 (14:51 +0900)]
usb: gadget: m66592-udc: add support for TEST_MODE

The USB high speed device must support the TEST_MODE, but the driver
didn't support it. When we sent the SET_FEATURE for TEST_MODE to
the driver, the request was successful, but the module didn't enter
the TEST_MODE.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data
Yoshihiro Shimoda [Fri, 8 Jul 2011 05:51:27 +0000 (14:51 +0900)]
usb: gadget: r8a66597-udc: Make BUSWAIT configurable through platform data

BUSWAIT is a 4-bit-wide value that controls the number of access waits
from the CPU to on-chip USB module. b'0000 inserts 0 wait (2 access
cycles) and b'1111 inserts 15 waits (17 access cycles, hardware
initial value), respectively.

BUSWAIT value depends on peripheral clock frequency supplied to on-chip
of each CPU, hence should be configurable through platform data.

Note that this patch assumes that b'0000 (0 wait, 2 access cycles) is
rerely used and considered as invalid. If valid 'buswait' data is not
provided by platform, initial b'1111 (15 waits, 17 access cycles) will
be applied as a safe default.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver
Yoshihiro Shimoda [Fri, 8 Jul 2011 05:51:21 +0000 (14:51 +0900)]
usb: gadget: r8a66597-udc: fix cannot connect after rmmod gadget driver

When we run rmmod a gadget driver, the driver will call
disable_controller(). Then, because the bit of USBE in SYSCFG0 was
cleared in on_chip=1 mode, we could not connect the usb when we run
insmod a gadget driver next time.
This patch also cleans up probe() and ->stop() about unnecessary
init_controller().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: update email address in r8a66597-udc and m66592-udc
Yoshihiro Shimoda [Thu, 7 Jul 2011 00:59:07 +0000 (09:59 +0900)]
usb: update email address in r8a66597-udc and m66592-udc

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: musb: restore INDEX register in resume path
Ajay Kumar Gupta [Fri, 8 Jul 2011 09:36:13 +0000 (15:06 +0530)]
usb: musb: restore INDEX register in resume path

Restoring the missing INDEX register value in musb_restore_context().
Without this suspend resume functionality is broken with offmode
enabled.

Cc: stable@kernel.org
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: fix up depencies
Sebastian Andrzej Siewior [Tue, 5 Jul 2011 13:39:48 +0000 (16:39 +0300)]
usb: gadget: fix up depencies

Both fusb300 and langwell udcs seem to only
work with 32-bit address space.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: fusb300_udc: fix compile warnings
Sebastian Andrzej Siewior [Tue, 5 Jul 2011 12:59:05 +0000 (15:59 +0300)]
usb: gadget: fusb300_udc: fix compile warnings

- remove pointer u32 abuse in fusb300_fill_idma_prdtbl().
  It is assigned the dma_addr to a pointer and then back.
  Poor families may have to recycle variables but we don't

- don't free req.buf in error case. We don't do it in the
  ok case so it is probably wrong to do it in error case.

- return in error case. There is no reason to continue
  without data and performing ops on an invalid pointer.

- The if (d) statement is bogus since an invalid DMA pointer
  is ~0 on some architecutres. And since we return for the
  invalid case we don't need it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: ci13xx_udc.c: fix compile warning
Sebastian Andrzej Siewior [Tue, 5 Jul 2011 12:57:52 +0000 (15:57 +0300)]
usb: gadget: ci13xx_udc.c: fix compile warning

Fix the following compile warning:

| usb/gadget/ci13xxx_udc.c: In function 'show_registers':
| usb/gadget/ci13xxx_udc.c:1242:1: warning: the frame size of 2064 bytes is larger than 1024 bytes

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: net2272: fix compile warnings
Felipe Balbi [Mon, 4 Jul 2011 08:16:06 +0000 (11:16 +0300)]
usb: gadget: net2272: fix compile warnings

This patch fixes the following compile warnings:

drivers/usb/gadget/net2272.c: In function ‘net2272_kick_dma’:
drivers/usb/gadget/net2272.c:740:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/usb/gadget/net2272.c: In function ‘net2272_queue’:
drivers/usb/gadget/net2272.c:859:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 8 has type ‘dma_addr_t’ [-Wformat]

Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: langwell_udc: fix compile warnings
Felipe Balbi [Mon, 4 Jul 2011 08:12:32 +0000 (11:12 +0300)]
usb: gadget: langwell_udc: fix compile warnings

This patch fixes the following compile warnings:

drivers/usb/gadget/langwell_udc.c: In function ‘queue_dtd’:
drivers/usb/gadget/langwell_udc.c:596:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
drivers/usb/gadget/langwell_udc.c: In function ‘langwell_udc_probe’:
drivers/usb/gadget/langwell_udc.c:3274:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3289:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c: In function ‘langwell_udc_resume’:
drivers/usb/gadget/langwell_udc.c:3473:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3487:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat]

Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agousb: gadget: fusb300_udc: drop dead code
Felipe Balbi [Mon, 4 Jul 2011 08:09:15 +0000 (11:09 +0300)]
usb: gadget: fusb300_udc: drop dead code

that code has been dead forever. Since the
first commit (0fe6f1d1) the use of that code
has been commented out. Let's drop the dead
code already and fix the following compile
warning:

| drivers/usb/gadget/fusb300_udc.c: At top level:
| drivers/usb/gadget/fusb300_udc.c:771:13: warning: ‘fusb300_wrfifo’ defined but not used [-Wunused-function]
| drivers/usb/gadget/fusb300_udc.c:1027:13: warning: ‘fusb300_set_ep_bycnt’ defined but not used [-Wunused-function]

Signed-off-by: Felipe Balbi <balbi@ti.com>
12 years agoRealtek cr: Add autosuspend function.
edwin_rong [Fri, 17 Jun 2011 11:35:11 +0000 (19:35 +0800)]
Realtek cr: Add autosuspend function.

The autosuspend function can be disabled by unchecking the Macro
CONFIG_REALTEK_AUTOPM in kernel config file, by default, this macro is
turned on.

Signed-off-by: edwin_rong <edwin_rong@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoRealtek cr: Remove unused Macros
edwin_rong [Fri, 17 Jun 2011 11:35:10 +0000 (19:35 +0800)]
Realtek cr: Remove unused Macros

Remove Macros wait_timeout() and wait_timeout_x().

Signed-off-by: edwin_rong <edwin_rong@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoRealtek cr: clean up unnecessary whitespaces.
edwin_rong [Fri, 17 Jun 2011 11:35:09 +0000 (19:35 +0800)]
Realtek cr: clean up unnecessary whitespaces.

Signed-off-by: edwin_rong <edwin_rong@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: s3c2410_udc: fix custom UDC command handling
Viliam Mateicka [Thu, 16 Jun 2011 08:04:36 +0000 (10:04 +0200)]
USB: s3c2410_udc: fix custom UDC command handling

There is a bug in Samsung's UDC driver, which is completely disabling
the USB device when a custom UDC command is used.
Following patch seems to get the right behavior (e.g. enabling pull-up
instead of disabling then Vcc is applied).

Signed-off-by: Viliam Mateicka <viliam.mateicka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: Compilation warning fix
Tatyana Brokhman [Thu, 30 Jun 2011 05:44:42 +0000 (08:44 +0300)]
usb: gadget: Compilation warning fix

A compilation warning was added by the patch
"usb: gadget: use config_ep_by_speed() instead of ep_choose()".
This patch fixed it.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: OTG: Use work_queue in set_vbus for TWL6030 transciever
Moiz Sonasath [Mon, 27 Jun 2011 15:01:01 +0000 (10:01 -0500)]
USB: OTG: Use work_queue in set_vbus for TWL6030 transciever

With this commit: cccad6d4b103e53fb3d1fc1467f654ecb572d047
usb: otg: notifier: switch to atomic notifier

Following dumps are observed on attach/detach for MUSB HOST
mode and on a detach for MUSB Device mode.

BUG: sleeping function called from invalid context at kernel/mutex.c:85
where, the source is:
twl6030_usb_irq
->atomic_notifier_call_chain
 ->musb_otg_notifications
  ->twl6030_set_vbus
   ->twl_i2c_write_u8
    ->mutex_lock

This patch moves the i2c writes in set_vbus function to a
work-queue thereby avoiding I2C writes in atomic context.

Tested HOST and Device mode functionality on OMAP4460

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: Gadget: Webcam: Return correct result of bind
Jassi Brar [Fri, 24 Jun 2011 18:47:26 +0000 (00:17 +0530)]
USB: Gadget: Webcam: Return correct result of bind

The config bind was reported success even if usb_add_function
failed. Fix the return value.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: gadget: fix req length in sourcesink_setup()
Bob Liu [Thu, 23 Jun 2011 21:09:49 +0000 (17:09 -0400)]
USB: gadget: fix req length in sourcesink_setup()

The recent commit 2edb11cbac fixed req->length in the composite_setup()
function, but that will cause all g_zero tests to fail like:

root#> ./testusb -D /proc/bus/usb/002/021 -t14 -c 15000 -s 256 -v 1
unknown speed   /proc/bus/usb/002/021
/proc/bus/usb/002/021 test 14 --> 32 (Broken pipe)

We need to fix req->length in sourcesink_setup() as well to avoid this.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agoUSB: Documentation: Use correct character in gadget_hid.txt
Tobias Klauser [Wed, 22 Jun 2011 08:33:02 +0000 (10:33 +0200)]
USB: Documentation: Use correct character in gadget_hid.txt

Use ASCII minus sign instead of unicode EN DASH in gadget_hid.txt. Also remove
two unecessary spaces in the same file.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: use dma handler
Kuninori Morimoto [Tue, 21 Jun 2011 06:09:19 +0000 (15:09 +0900)]
usb: renesas_usbhs: use dma handler

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: renesas_usbhs: put obtained dma channel info to debug message
Kuninori Morimoto [Tue, 21 Jun 2011 00:33:43 +0000 (09:33 +0900)]
usb: renesas_usbhs: put obtained dma channel info to debug message

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agodrivers/usb/atm: use printk_ratelimited() instead of printk_ratelimit()
Manuel Zerpies [Thu, 16 Jun 2011 12:12:47 +0000 (14:12 +0200)]
drivers/usb/atm: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agowusb: use printk_ratelimited() instead of printk_ratelimit()
Manuel Zerpies [Thu, 16 Jun 2011 12:15:16 +0000 (14:15 +0200)]
wusb: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb/class: use printk_ratelimited() instead of printk_ratelimit()
Manuel Zerpies [Thu, 16 Jun 2011 12:15:54 +0000 (14:15 +0200)]
usb/class: use printk_ratelimited() instead of printk_ratelimit()

Since printk_ratelimit() shouldn't be used anymore (see comment in
include/linux/printk.h), replace it with printk_ratelimited()

Signed-off-by: Manuel Zerpies <manuel.f.zerpies@ww.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: no need to access platform_device
Felipe Balbi [Mon, 27 Jun 2011 12:57:12 +0000 (15:57 +0300)]
usb: musb: no need to access platform_device

dev_get_drvdata() is exactly the same as
platform_get_drvdata(). Drop that useless
access to the platform device.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: omap: always create musb device
Felipe Balbi [Mon, 27 Jun 2011 12:56:32 +0000 (15:56 +0300)]
usb: musb: omap: always create musb device

there's no point in not creating that device
always. It's simpler to always create, than to
keep changing that stupid ifdef.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: udc-core: wire up sysfs files
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:28:38 +0000 (14:28 +0200)]
usb: gadget: udc-core: wire up sysfs files

This was somehow forgotten.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: convert to new-style udc-probe
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:17 +0000 (14:26 +0200)]
usb: gadget: dummy_hcd: convert to new-style udc-probe

bind() and pull is moved to udc core, call callbacks are verified by the
upper layer.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: convert musb to new style bind
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:16 +0000 (14:26 +0200)]
usb: musb: convert musb to new style bind

udc-core checks for valid callbacks so there is no need for the driver
to do so. Also "can-be-bound-once" is verified by udc-core. The pull-up
callback is called by udc-core afterwords.

[ balbi@ti.com : keep holding gadget_driver pointer for now
 remove the stupid check for gadget_driver otherwise
  we don't handle IRQs ]

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: udc-core: add "new-style" registration interface
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:15 +0000 (14:26 +0200)]
usb: gadget: udc-core: add "new-style" registration interface

udc_start() should only trigger the internal state machine and make
minimal house keeping. Before that call udc-core calls the bind()
callback and after the callback the pullup().

udc_stop() is simillar, udc-core calls pullup(), unbind() and finally
udc_stop().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: move selection of speed into ->pullup()
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:14 +0000 (14:26 +0200)]
usb: gadget: dummy_hcd: move selection of speed into ->pullup()

The configuration is static however we only know the speed after we have
connected with the other side.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: init is_otg in init_dummy_udc_hw()
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:13 +0000 (14:26 +0200)]
usb: gadget: dummy_hcd: init is_otg in init_dummy_udc_hw()

This value is now assigned during bind(). The configuration depends on
static values assigned by dummy driver itself. So there is no need to
defer this assigment until one know the actuall speed since the
configuration is static and known early.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: move ep initialisation HW setup
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:12 +0000 (14:26 +0200)]
usb: gadget: dummy_hcd: move ep initialisation HW setup

This is only required to be done once. There is no counter part to this
in ->stop() so there is no need to re-do it next time. While here also
init the max_stream size to 0 on SS speed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: defer setting maxpacket till ->setup()
Sebastian Andrzej Siewior [Thu, 23 Jun 2011 12:26:11 +0000 (14:26 +0200)]
usb: gadget: defer setting maxpacket till ->setup()

maxpacket is set by the udc driver for ep0 very early. This value is
copied by the function gadget used later for the USB_DT_DEVICE and
USB_DT_DEVICE_QUALIFIER query. This seems to work fine so far. For USB3
we need set a different value here. In SS speed it is 2^x with x=9 and
in HS we set something <= 64. If the UDC starts in SS and continues in
HS after the cable has been plugged it will report a too small value.
There setting of this value is defered and taken automaticly from the
ep0 pointer where the UDC driver can update it according to the speed it
detected _after_ a cable has been plugged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: allow multiple gadgets to be built
Felipe Balbi [Wed, 22 Jun 2011 14:28:10 +0000 (17:28 +0300)]
usb: gadget: allow multiple gadgets to be built

now that we have the udc class, we can allow
multiple gadget controller drivers to be
compiled as modules. This will allow for
distro-like kernels for embedded devices.

With this patch, I managed to build an x86
kernel with support for many of the controllers
enabled:

CONFIG_USB_FUSB300=m
CONFIG_USB_R8A66597=m
CONFIG_USB_M66592=m
CONFIG_USB_AMD5536UDC=m
CONFIG_USB_CI13XXX_PCI=m
CONFIG_USB_NET2272=m
CONFIG_USB_NET2280=m
CONFIG_USB_GOKU=m
CONFIG_USB_LANGWELL=m
CONFIG_USB_EG20T=m

Also an ARM kernel with support for many controllers:

CONFIG_USB_FUSB300=m
CONFIG_USB_OMAP=m
CONFIG_USB_R8A66597=m
CONFIG_USB_GADGET_MUSB_HDRC=m
CONFIG_USB_M66592=m
CONFIG_USB_NET2272=m
CONFIG_USB_DUMMY_HCD=m

The next step would be to get rid of the
direct access to arch/ and mach/ directories
on some gadget controllers so that we can
build all of them without depending on their
respective ARCH_* symbols.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: choose correct fifo_mode
Felipe Balbi [Wed, 29 Jun 2011 09:45:03 +0000 (12:45 +0300)]
usb: musb: choose correct fifo_mode

When we start building glue layers as modules,
we need to be careful with the fifo_mode changes
otherwise that weird ifdeferry won't evaluate
correctly. Add the missing _MODULE variants for
all glue layers to prevent everybody from using
fifo_mode 2.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: drop a gigantic amount of ifdeferry
Felipe Balbi [Wed, 22 Jun 2011 14:28:09 +0000 (17:28 +0300)]
usb: musb: drop a gigantic amount of ifdeferry

the MUSB IP is always OTG, so there's no point
in adding so many ifdefs on the code. Drop those
and always compile the driver for OTG support.

This also allows us to drop the useless "driver
mode" choice. For doing that, we need to make
musb depend on both Host and Peripheral side.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: be careful when using different fifo_modes
Felipe Balbi [Mon, 27 Jun 2011 12:57:46 +0000 (15:57 +0300)]
usb: musb: be careful when using different fifo_modes

if we have more endpoints configured than
enabled on fifo_mode, then we need to be
careful on save/restore context operations,
otherwise we will try to access uninitialized
__iomem pointer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: move common bits of suspend/resume into one function
Sebastian Andrzej Siewior [Fri, 17 Jun 2011 17:43:13 +0000 (19:43 +0200)]
usb: gadget: dummy_hcd: move common bits of suspend/resume into one function

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: remove net2280_set_fifo_mode()
Sebastian Andrzej Siewior [Thu, 16 Jun 2011 18:37:00 +0000 (20:37 +0200)]
usb: gadget: remove net2280_set_fifo_mode()

This function has no user in my tree. It looks like it belongs to
net2280 but it somehow morphed into the dummy_hcd. So I remove it
before it spreads into more drivers.
After some digging I figured out that the only user was removed in

|commit 9079e91b5b5a84836e65cdc9128d2602e3beaef2
|Author: David Brownell <david-b@pacbell.net>
|Date:   Wed May 7 16:00:36 2008 -0700
|
|    USB: serial gadget: cleanup/reorg

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: use less checks for USB_SPEED_SUPER
Sebastian Andrzej Siewior [Fri, 17 Jun 2011 08:11:41 +0000 (10:11 +0200)]
usb: gadget: dummy_hcd: use less checks for USB_SPEED_SUPER

Taking the correct struct once avoids doing the speed dance.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: use gadget_to_dummy_hcd() where possible
Sebastian Andrzej Siewior [Thu, 16 Jun 2011 18:36:57 +0000 (20:36 +0200)]
usb: gadget: dummy_hcd: use gadget_to_dummy_hcd() where possible

gadget_to_dummy_hcd() already does the speed check, so
it's unnecessary to unroll that all the time.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: set gadget.is_otg before calling bind()
Sebastian Andrzej Siewior [Thu, 16 Jun 2011 18:36:56 +0000 (20:36 +0200)]
usb: gadget: dummy_hcd: set gadget.is_otg before calling bind()

Before commit 53832daea ("usb: gadget: dummy_hcd: use the shared_hcd
infrastructure") the is_otg field was set in dummy_udc_probe(). It seems
to me that this field is used in gadget's bind function. Therefore I'm
moving it before the bind() callback is called.

Cc: Tatyana Brokhman <tlinder@codeaurora.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: use dummy_pullup() instead of open coding
Sebastian Andrzej Siewior [Thu, 16 Jun 2011 18:36:55 +0000 (20:36 +0200)]
usb: gadget: dummy_hcd: use dummy_pullup() instead of open coding

The removed code does the same thing as dummy_pullup(). The only
difference is that in dummy_udc_stop() the first dummy_pullup()
did not call usb_hcd_poll_rh_status().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add missing #include's
Sergei Shtylyov [Wed, 15 Jun 2011 18:10:37 +0000 (21:10 +0300)]
usb: gadget: add missing #include's

When #include'd alone, <linux/usb/gadget.h>
causes a lot of compilation errors and warnings
-- all because it relies on the including code to
bring in the necessary #include's instead of
doing this itself.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: chips: remove ifdef trickery
Felipe Balbi [Mon, 13 Jun 2011 15:43:59 +0000 (18:43 +0300)]
usb: gadget: chips: remove ifdef trickery

the gadget controller number is only used
during bind() to update descriptors and/or
check that a particular controller can support
a particular gadget driver.

Because of that, we can remove the ifdef
trickery as it's a rather small optimization
anyway.

While at that, also sort the entries
alphabetically and add a comment stating we
want to keep the list ordered alphabetically.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: ci13xx_udc: fix usb_ep_enable() call
Felipe Balbi [Wed, 29 Jun 2011 13:41:57 +0000 (16:41 +0300)]
usb: gadget: ci13xx_udc: fix usb_ep_enable() call

commit 72c973d (usb: gadget: add usb_endpoint_descriptor
to struct usb_ep) has introduced a compile error to
ci13xxx_udc. Fix it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: s3c2410_udc: use platform ids instead
Sebastian Andrzej Siewior [Wed, 29 Jun 2011 13:41:56 +0000 (16:41 +0300)]
usb: gadget: s3c2410_udc: use platform ids instead

This also fixes the error path: If the second device fails to register
we never remove the first one.
This is compile-tested only. I don't see any difference between those
two. Maybe we should just use one name instead?

Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add platform module alias where it is missing
Sebastian Andrzej Siewior [Wed, 29 Jun 2011 13:41:55 +0000 (16:41 +0300)]
usb: gadget: add platform module alias where it is missing

Without it udev won't be able to load the driver once it notices the
device unbound.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: net2272: cleanup pci_register_driver() error path
Sebastian Andrzej Siewior [Wed, 29 Jun 2011 13:41:54 +0000 (16:41 +0300)]
usb: gadget: net2272: cleanup pci_register_driver() error path

In case pci_register_driver() fails it error will be 0 in case
platform_driver_register() was fine. Also without PCI
pci_register_driver() evaluates to 1 which is well, special. If
platform_driver_register() returns EINVAL or EBUSY we end up with 0.

Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: add 'is_high_speed' parameter
Tatyana Brokhman [Wed, 29 Jun 2011 13:41:53 +0000 (16:41 +0300)]
usb: gadget: dummy_hcd: add 'is_high_speed' parameter

This patch adds a new module parameter to dummy_hcd
called is_high_speed.

When set to false the connected device will be forced
to operate in full-speed mode. By default, this parameter
is set to 'true'.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: add SuperSpeed support
Tatyana Brokhman [Wed, 29 Jun 2011 13:41:52 +0000 (16:41 +0300)]
usb: gadget: dummy_hcd: add SuperSpeed support

This patch adds SS support to the dummy hcd module.
It may be used to test SS device when no (SS) HW is
available.

USB 3.0 hub includes 2 hubs - one HS and one SS. This
patch adds support for a SS root hub in the dummy_hcd
module.

A new module parameter was added: is_super_speed. When
set to true, a SS root hub will also be registered and
the connected device will be enumerated over the SS
root hub. The default of this parameter is false.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
[ balbi@ti.com : slight change to commit log
 fixed one coding style issue ]

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: dummy_hcd: use the shared_hcd infrastructure
Tatyana Brokhman [Wed, 29 Jun 2011 13:41:51 +0000 (16:41 +0300)]
usb: gadget: dummy_hcd: use the shared_hcd infrastructure

This patch is a preparation for adding SuperSpeed
support to dummy hcd.

It takes the master side fields out of the struct
dummy to a separate structure. The init process
was also modified to resemble the way it is
done by xHCI.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add SuperSpeed support to the Gadget Framework
Tatyana Brokhman [Wed, 29 Jun 2011 13:41:50 +0000 (16:41 +0300)]
usb: gadget: add SuperSpeed support to the Gadget Framework

SuperSpeed USB has defined a new descriptor, called
the Binary Device Object Store (BOS) Descriptor. It
has also changed a bit the definition of SET_FEATURE
and GET_STATUS requests to add USB3-specific details.

This patch implements both changes to the Composite
Gadget Framework.

[ balbi@ti.com : slight changes to commit log
 fixed a compile error on ARM ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add max_speed to usb_composite_driver
Tatyana Brokhman [Wed, 29 Jun 2011 13:41:49 +0000 (16:41 +0300)]
usb: gadget: add max_speed to usb_composite_driver

This field is used by the Gadget drivers to specify
the maximum speed they support, meaning: the maximum
speed they can provide descriptors for.

The driver speed will be set in consideration of this
value.

[ balbi@ti.com : dropped the ifdeffery ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: musb: update musb_platform_ops docs to match code
Mike Frysinger [Wed, 29 Jun 2011 13:41:48 +0000 (16:41 +0300)]
usb: musb: update musb_platform_ops docs to match code

The "channel_program" member was renamed to "adjust_channel_params",
but the documentation wasn't updated.

Reported-by: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add streams support to the gadget framework
Tatyana Brokhman [Tue, 28 Jun 2011 13:33:53 +0000 (16:33 +0300)]
usb: gadget: add streams support to the gadget framework

This patch defines necessary fields to support
streaming for USB3.0.

It implements a new function, called
usb_ep_autoconfig_ss(), to be used instead of the
existing usb_ep_autoconfig() when working in
SuperSpeed mode and there is a need to search for
an endpoint according to the number of required
streams.

[ balbi@ti.com : slight changes to commit log ]

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: coding style fix
Tatyana Brokhman [Tue, 28 Jun 2011 13:33:52 +0000 (16:33 +0300)]
usb: gadget: coding style fix

fix the coding style of a few switches on the
gadget framework.

[ balbi@ti.com : add a commit log ]

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: use config_ep_by_speed() instead of ep_choose()
Tatyana Brokhman [Tue, 28 Jun 2011 13:33:50 +0000 (16:33 +0300)]
usb: gadget: use config_ep_by_speed() instead of ep_choose()

Remove obsolete functions:
1. ep_choose()
2. usb_find_endpoint()

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: configure endpoint according to gadget speed
Tatyana Brokhman [Tue, 28 Jun 2011 13:33:49 +0000 (16:33 +0300)]
usb: gadget: configure endpoint according to gadget speed

Add config_ep_by_speed() to configure the endpoint
according to the gadget speed.

Using this function will spare the FDs from handling
the endpoint chosen descriptor.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: add usb_endpoint_descriptor to struct usb_ep
Tatyana Brokhman [Tue, 28 Jun 2011 13:33:48 +0000 (16:33 +0300)]
usb: gadget: add usb_endpoint_descriptor to struct usb_ep

Change usb_ep_enable() prototype to use endpoint
descriptor from usb_ep.

This optimization spares the FDs from saving the
endpoint chosen descriptor. This optimization is
not full though. To fully exploit this change, one
needs to update all the UDCs as well since in the
current implementation each of them saves the
endpoint descriptor in it's internal (and extended)
endpoint structure.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: convert all users to the new udc infrastructure
Sebastian Andrzej Siewior [Tue, 28 Jun 2011 13:33:47 +0000 (16:33 +0300)]
usb: gadget: convert all users to the new udc infrastructure

peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
register/unregister to the udc-core.

The udc-core will take the first available gadget driver and attach
function driver which is calling usb_gadget_register_driver(). This is
the same behaviour we have right now.

Only dummy_hcd was tested, the others were compiled tested.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Roy Huang <roy.huang@analog.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Cc: cxie4 <cxie4@marvell.com>
Cc: linux-geode@lists.infradead.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
12 years agousb: gadget: introduce UDC Class
Felipe Balbi [Tue, 28 Jun 2011 13:33:46 +0000 (16:33 +0300)]
usb: gadget: introduce UDC Class

this class will be used to abstract away several of the duplicated
operations scattered among the USB gadget controller drivers.

Later, we can add an atomic notifier to tell interested drivers about
what's happening with the controller. Notifications such as suspend,
resume, enumerated, etc. will be useful, at a minimum, for implementing
usb charger detection.

As part of the converting process usb_gadget_probe_driver() is no longer
part of each udc but pushed into the ->stap() callback. The same for his
couterpart.

The core is currently set explicit to 'n'. It will be changed to 'y' once
all users are converted since it provides functions which clash with
other drivers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: deprecate g_file_storage
Alan Stern [Wed, 15 Jun 2011 20:31:37 +0000 (16:31 -0400)]
USB: deprecate g_file_storage

This patch (as1471) deprecates the File-backed Storage Driver and
schedules its replacement for the 3.8 kernel release (about two years
from now).  Users are advised to switch to the Mass Storage Gadget
instead.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: renesas_usbhs: fixup connection fail
Kuninori Morimoto [Thu, 9 Jun 2011 07:48:25 +0000 (16:48 +0900)]
usb: renesas_usbhs: fixup connection fail

Sometimes the connection fail happen on renesas_usbhs.
This patch fix it up.

Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge 3.0-rc2 into usb-linus as it's needed by some USB patches
Greg Kroah-Hartman [Tue, 14 Jun 2011 13:51:10 +0000 (06:51 -0700)]
Merge 3.0-rc2 into usb-linus as it's needed by some USB patches

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoLinux 3.0-rc3 v3.0-rc3
Linus Torvalds [Mon, 13 Jun 2011 22:29:59 +0000 (15:29 -0700)]
Linux 3.0-rc3

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Mon, 13 Jun 2011 20:00:53 +0000 (13:00 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  SLAB: Record actual last user of freed objects.
  slub: always align cpu_slab to honor cmpxchg_double requirement

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Mon, 13 Jun 2011 18:21:50 +0000 (11:21 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/sage/ceph-client

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: unwind canceled flock state
  ceph: fix ENOENT logic in striped_read
  ceph: fix short sync reads from the OSD
  ceph: fix sync vs canceled write
  ceph: use ihold when we already have an inode ref

13 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:47:04 +0000 (10:47 -0700)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rtc: Staticize non-exported __rtc_set_alarm()
  rtc: Fix ioctl error path return
  ptp: Fix some locking bugs in ptp_read()
  ptp: Return -EFAULT on copy_to_user() errors

13 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:45:49 +0000 (10:45 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of irqs
  kprobes/trace: Fix kprobe selftest for gcc 4.6
  ftrace: Fix possible undefined return code
  oprofile, dcookies: Fix possible circular locking dependency
  oprofile: Fix locking dependency in sync_start()
  oprofile: Free potentially owned tasks in case of errors
  oprofile, x86: Add comments to IBS LVT offset initialization

13 years agoMerge branches 'x86-urgent-for-linus' and 'irq-urgent-for-linus' of git://git.kernel...
Linus Torvalds [Mon, 13 Jun 2011 17:45:10 +0000 (10:45 -0700)]
Merge branches 'x86-urgent-for-linus' and 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: devicetree: Add missing early_init_dt_setup_initrd_arch stub
  x86: cpu-hotplug: Prevent softirq wakeup on wrong CPU

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Prevent potential NULL dereference in irq_set_irq_wake()