pandora-kernel.git
13 years agoUSB: uas: Fix up the Sense IU
Matthew Wilcox [Wed, 15 Dec 2010 20:44:02 +0000 (15:44 -0500)]
USB: uas: Fix up the Sense IU

Add a comment to the Sense IU data structure that it's also used for Read
Ready and Write Ready.  Remove the 'service response' element since it's
gone from the current draft (04).

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoMerge branch 'musb-hw' of git://gitorious.org/usb/usb into musb
Greg Kroah-Hartman [Wed, 15 Dec 2010 17:29:38 +0000 (09:29 -0800)]
Merge branch 'musb-hw' of git://gitorious.org/usb/usb into musb

* 'musb-hw' of git://gitorious.org/usb/usb: (43 commits)
  usb: musb: core: kill unneeded #include's
  DA8xx: assign name to MUSB IRQ resource
  arm: OMAP4430: musb: Configure musb to OTG mode
  usb: musb: Adding musb support for OMAP4430
  usb: otg: TWL6030: Add twl6030_usb file for compilation
  mfd: TWL6030: OMAP4: Registering the TWL6030-usb device
  usb: musb: TWL6030: Selecting TWL6030_USB transceiver
  usb: otg: Kconfig: Add Kconfig option for TWL6030 transceiver.
  usb: otg: Adding twl6030-usb transceiver driver for OMAP4430
  mfd: TWL6030: USBOTG VBUS event generation on
  usb: musb: add support for ux500 platform
  musb: am35x: fix compile error due to control apis
  arm: omap4: enable usb on 4430sdp
  usb: musb: drop board_set_vbus
  usb: musb: drop musb_platform_suspend/resume
  usb: musb: blackfin: usb dev_pm_ops structure
  usb: musb: am35x: usb dev_pm_ops structure
  usb: musb: omap2430: use dev_pm_ops structure
  usb: musb: omap2430: drop the nops
  usb: musb: mark musb_save/restore_context static
  ...

13 years agousb: musb: core: kill unneeded #include's
Sergei Shtylyov [Fri, 10 Dec 2010 19:48:28 +0000 (22:48 +0300)]
usb: musb: core: kill unneeded #include's

musb_core.c #include's a bunch of ARM and DaVinci specific headers, goodness
knows why -- it happily compiles without them...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoDA8xx: assign name to MUSB IRQ resource
Sergei Shtylyov [Fri, 10 Dec 2010 17:23:06 +0000 (20:23 +0300)]
DA8xx: assign name to MUSB IRQ resource

Commit fcf173e4511193b1efeccb0f22a8c641b464353b (usb: musb: add names for IRQs
in structure resource) forgot to assign name to the DA8xx MUSB IRQ resource.
Because of that MUSB driver fails to load on DA8xx machines.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: gadget: g_ncm added
Yauheni Kaliuta [Wed, 8 Dec 2010 11:12:06 +0000 (13:12 +0200)]
usb: gadget: g_ncm added

This patches makes possible to use composite framework and f_ncm
NCM function driver to build a standalone NCM gadget device.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: f_ncm.c added
Yauheni Kaliuta [Wed, 8 Dec 2010 11:12:05 +0000 (13:12 +0200)]
usb: gadget: f_ncm.c added

Initial submittion of NCM link function driver.

The driver's logic is based on f_ecm driver and does not
use most of the NCM advantages like frame grouping and alignment.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: u_ether: prepare for NCM
Yauheni Kaliuta [Wed, 8 Dec 2010 11:12:04 +0000 (13:12 +0200)]
usb: gadget: u_ether: prepare for NCM

NCM is a Network Control Model, subclass of USB CDC class,
specification is available at http://www.usb.org/developers/devclass_docs

This patch makes possible for u_ether to use multiply of wMaxPacketSize
predefined size transfers without ZLP (Zero Length Packet), required
by NCM spec.

Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: pch_udc: Fix setup transfers with data out
Richard Röjfors [Tue, 7 Dec 2010 16:28:33 +0000 (17:28 +0100)]
usb: pch_udc: Fix setup transfers with data out

This patch fixes an issue where the driver does not handle out data in
setup transactions.

The per endpoint cached status register is cleared in the
pch_udc_svc_control_out function. When there is out data available the
function pch_udc_svc_data_out is called which tries to pick it up the
status, which now is cleared to 0. When the status is 0, the function
doesn't start reading the data from the FIFO.

There is a second bug in all this, pch_udc_svc_data_out takes the
endpoint number (0 for EP0), while pch_udc_svc_control_out passes the
endpoint index (1 for EP0). Effectively pch_udc_svc_data_out picks up
the wrong internal ep structure.

This patch makes sure to put back the cached status and pass the
endpoint number rather than index when calling pch_udc_svc_data_out.

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: pch_udc: Fix compile error, warnings and checkpatch warnings
Richard Röjfors [Tue, 7 Dec 2010 16:28:30 +0000 (17:28 +0100)]
usb: pch_udc: Fix compile error, warnings and checkpatch warnings

Building pch_udc in linux-next fails, this patch fixes the a compile
error:

drivers/usb/gadget/pch_udc.c: In function ‘usb_gadget_register_driver’:
drivers/usb/gadget/pch_udc.c:2645: error: ‘struct usb_gadget_driver’ has no member named ‘bind’
drivers/usb/gadget/pch_udc.c:2664: error: ‘struct usb_gadget_driver’ has no member named ‘bind’

And a couple of compiler warnings and checkpatch warnings.

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: add ab8500 usb transceiver driver
Mian Yousaf Kaukab [Tue, 7 Dec 2010 14:00:09 +0000 (15:00 +0100)]
usb: add ab8500 usb transceiver driver

Basic driver for ab8500 usb otg transceiver

TODO:
-Regulators support
-Host and OTG testing
-Interface with PRCMU
-Charging support

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Implement runtime PM for MSM bus glue driver
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:05 +0000 (17:54 +0530)]
USB: gadget: Implement runtime PM for MSM bus glue driver

OTG driver takes care of putting hardware in low power mode.  Hence
not registered for any runtime PM callbacks.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Implement runtime PM for ci13xxx gadget
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:04 +0000 (17:54 +0530)]
USB: gadget: Implement runtime PM for ci13xxx gadget

The actual suspend/resume work is delegated to bus glue driver, which
is responsible for putting hardware in low power mode.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Add USB controller driver for MSM SoC
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:03 +0000 (17:54 +0530)]
USB: gadget: Add USB controller driver for MSM SoC

MSM SoC has chipidea USB controller. So use ci13xxx_udc core.
This driver depends on transceiver driver for clock control,
PHY initialization, VBUS detection.  Register for notify_event
callback to perform MSM specific quirks after controller is reset
and stopped.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Introduce ci13xxx_udc_driver struct
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:02 +0000 (17:54 +0530)]
USB: gadget: Introduce ci13xxx_udc_driver struct

Introduces ci13xxx_udc_driver struct for bus glue drivers to hint
ci13xxx_udc core about their special requirements.  The flags include
avoiding hardware register access when controller is not in peripheral
mode, enabling pull-up upon VBUS, disabling streaming mode and dependency
on transceiver driver.

Initialize gadget_ops in udc_probe so that transceiver can notify VBUS
presence even when no gadget driver is bounded.

A notify_event callback is embedded in the same struct. This patch implements
two events called CONTROLLER_RESET_EVENT and CONTROLLER_STOPPED_EVENT to
notify the bus glue driver after resetting and stopping the controller for
performing SoC specific quirks.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Initialize ci13xxx gadget device's coherent DMA mask
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:01 +0000 (17:54 +0530)]
USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask

dma_alloc_coherent() which is internally called by dma_pool_alloc()
flags a warning if device's coherent DMA mask.  Hence initialize
gadget device's coherent DMA mask to it's parent mask.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc
Pavankumar Kondeti [Tue, 7 Dec 2010 12:24:00 +0000 (17:54 +0530)]
USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc

dma_pool_alloc() require sleeping context when called with GFP_KERNEL
argument.  Hence release the spin lock before calling dma_pool_alloc().

usb_ep_alloc_request can also be called with non-atomic GFP flags.  Hence
get rid off spin lock while allocation request memory.

Use GFP_ATOMIC flag for allocating request for ep0 in interrupt handler.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: gadget: Separate out PCI bus code from ci13xxx_udc
Pavankumar Kondeti [Tue, 7 Dec 2010 12:23:59 +0000 (17:53 +0530)]
USB: gadget: Separate out PCI bus code from ci13xxx_udc

Move PCI bus code from ci13xxx_udc to a new file ci13xxx_pci.  SoC's
which has MIPS USB core can include the ci13xxx_udc and keep bus glue
code in their respective gadget controller drivers.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: OTG: msm: Add support for power management
Pavankumar Kondeti [Tue, 7 Dec 2010 12:23:58 +0000 (17:53 +0530)]
USB: OTG: msm: Add support for power management

Implement runtime and system pm ops to put hardware into low power
mode (LPM). As part of LPM, USB clocks are turned off, PHY is put
into suspend state and PHY comparators are turned off if VBUS/Id
notifications are not required from PHY.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: msm: Add support for power management
Pavankumar Kondeti [Tue, 7 Dec 2010 12:23:57 +0000 (17:53 +0530)]
USB: EHCI: msm: Add support for power management

Enable runtime PM and mark no_callbacks flag.  OTG device, parent of
HCD takes care of putting hardware into low power mode.  Adjust port
power wakeup flags during system suspend and resume.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: Add MSM Host Controller driver
Pavankumar Kondeti [Tue, 7 Dec 2010 12:23:56 +0000 (17:53 +0530)]
USB: EHCI: Add MSM Host Controller driver

This patch adds support for EHCI compliant HSUSB Host controller found
on MSM chips.  The root hub has a single port and TT is built into it.
This driver depends on OTG driver for PHY initialization, clock
management and powering up VBUS.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: Add MSM OTG Controller driver
Pavankumar Kondeti [Tue, 7 Dec 2010 12:23:55 +0000 (17:53 +0530)]
USB: Add MSM OTG Controller driver

This driver implements PHY initialization, clock management, ULPI IO ops
and simple OTG state machine to kick host/peripheral based on Id/VBUS
line status.  VBUS/Id lines are tied to a reference voltage on some boards.
Hence provide debugfs interface to select host/peripheral mode.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: EHCI: ASPM quirk of ISOC on AMD SB800
Alex He [Tue, 7 Dec 2010 02:10:08 +0000 (10:10 +0800)]
USB: EHCI: ASPM quirk of ISOC on AMD SB800

When ASPM PM Feature is enabled on UMI link, devices that use ISOC stream of
data transfer may be exposed to longer latency causing less than optimal per-
formance of the device. The longer latencies are normal and are due to link
wake time coming out of low power state which happens frequently to save
power when the link is not active.
The following code will make exception for certain features of ASPM to be by
passed and keep the logic normal state only when the ISOC device is connected
and active. This change will allow the device to run at optimal performance
yet minimize the impact on overall power savings.

Signed-off-by: Alex He <alex.he@amd.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: serial: usb_wwan: Add missing uaccess.h / fix build failure
Peter Huewe [Thu, 9 Dec 2010 22:27:35 +0000 (23:27 +0100)]
USB: serial: usb_wwan: Add missing uaccess.h / fix build failure

This patch fixes a build failure[1] by adding the missing uaccess.h needed
for copy_from_user and copy_to_user

References:
http://kisskb.ellerman.id.au/kisskb/buildresult/3607218/

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: otg: fix link breakage, when the NOP USB Xceiver is a module
Guennadi Liakhovetski [Thu, 9 Dec 2010 21:46:29 +0000 (22:46 +0100)]
USB: otg: fix link breakage, when the NOP USB Xceiver is a module

If the NOP USB OTG transceiver driver is built as a module, the otg.h
header declares external functions, but if they are referenced from the
kernel proper, as, e.g., in the OMAP3 case, where the omap3evm board is
calling the usb_nop_xceiv_register() function, linkage breaks. This patch
fixes this problem.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: f_fs: Remove redundant unlikely()
Tobias Klauser [Thu, 9 Dec 2010 14:52:39 +0000 (15:52 +0100)]
usb: gadget: f_fs: Remove redundant unlikely()

IS_ERR() already implies unlikely(), so it can be omitted here.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: host: uhci-q: Fixed minor coding style issues
Tobias Ollmann [Thu, 9 Dec 2010 13:24:27 +0000 (14:24 +0100)]
USB: host: uhci-q: Fixed minor coding style issues

Fixed coding style issues (delete trailing whitespaces, break
long line)

Signed-off-by: Tobias Ollmann <tobias.ollmann@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget/imx-udc: fix interrupt name again
Uwe Kleine-König [Mon, 6 Dec 2010 16:38:24 +0000 (17:38 +0100)]
usb: gadget/imx-udc: fix interrupt name again

Commit 06c3859 (usb: gadget/imx-udc: remove usage of deprecated symbol
USBD_INT0) was a bit precipitant because the name used instead didn't
match the usual naming scheme for irqs on arm/imx.  I renamed the irq to
the right name in e083000 (ARM: imx: dynamically allocate imx_udc
device) when 06c3859 didn't hit Linus' tree, so I missed to add a
compat #define.

This patch allows compiling imx_udc.c with and without e083000.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoUSB: whci-hcd: fix compiler warning
Namhyung Kim [Mon, 6 Dec 2010 16:03:32 +0000 (01:03 +0900)]
USB: whci-hcd: fix compiler warning

Annotate whci_hcd_id_table as '__used' to fix following warning:

  CC      drivers/usb/host/whci/hcd.o
drivers/usb/host/whci/hcd.c:359: warning: ‘whci_hcd_id_table’ defined but not used

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoarm: OMAP4430: musb: Configure musb to OTG mode
Hema HK [Fri, 10 Dec 2010 12:41:42 +0000 (18:11 +0530)]
arm: OMAP4430: musb: Configure musb to OTG mode

Enabling the musb OTG mode for SDP and PANDA boards.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: Adding musb support for OMAP4430
Hema HK [Fri, 10 Dec 2010 12:40:51 +0000 (18:10 +0530)]
usb: musb: Adding musb support for OMAP4430

OMAP4430 supports UTMI and ULPI types of transceiver interface.

In UTMI mode: The PHY is embedded within OMAP4430. The transceiver functionality
is split between the twl6030 PMIC chip and OMAP4430. The VBUS, ID pin
sensing and OTG SRP generation part is integrated in TWL6030 and UTMI PHY
functionality is embedded within the OMAP4430.

There is no direct interactions between the MUSB controller and TWL6030
chip to communicate the session-valid, session-end and ID-GND events.
It has to be done through a software by setting/resetting bits in
one of the control module register of OMAP4430 which in turn toggles
the appropriate signals to MUSB controller.

musb driver is register for blocking notifications from the transceiver
driver to get the event notifications for connect/disconnect and ID-GND.
Based on these events call the transceiver init/shutdown function to
configure the transceiver to toggle the VBUS valid, session end and ID_GND
signals to musb and power on/off the internal PHY.

For ID_GND event notifications, toggle the ID_GND signal and then wait for
musb to be configured as "A" device, and then call the transceiver function
to set the VBUS.

In OTG mode and musb as a host, When the Micro A connector used, VBUS is turned on
and session bit set. When the device is connected, enumeration goes through.
When the device disconnected from the other end of the connector(ID is still grounded),
link will detect the disconnect and end the session. When the device is connected back,
there are no events generated in the TWL6030-usb, and link is already down.
So the device is not detected. Removed the session bit disable code which
will recognize the connect of the device.

Limitation: In OTG host mode, if device is connected during boot, it does not get
detected. If disconnect and connect it back or connect after boot only it works.
Fix for this, I will submit seperate patch later.

Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: TWL6030: Add twl6030_usb file for compilation
Hema HK [Fri, 10 Dec 2010 12:40:37 +0000 (18:10 +0530)]
usb: otg: TWL6030: Add twl6030_usb file for compilation

Add the twl6030_usb transceiver file for compilation.

Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agomfd: TWL6030: OMAP4: Registering the TWL6030-usb device
Hema HK [Fri, 10 Dec 2010 12:39:52 +0000 (18:09 +0530)]
mfd: TWL6030: OMAP4: Registering the TWL6030-usb device

Registering the twl6030-usb transceiver device as a child to twl6030 core.
Removed the NOP transceiver init call from board file.

Populated twl4030_usb_data platform data structure with the function
pointers for OMAP4430 internal PHY operation to be used by twl630-usb driver.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: TWL6030: Selecting TWL6030_USB transceiver
Hema HK [Fri, 10 Dec 2010 12:39:35 +0000 (18:09 +0530)]
usb: musb: TWL6030: Selecting TWL6030_USB transceiver

Selecting the twl6030-usb for OMAP4430SDP and OMAP4PANDA boards and
adding OMAP4 internal phy code for compilation

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: Kconfig: Add Kconfig option for TWL6030 transceiver.
Hema HK [Fri, 10 Dec 2010 12:38:48 +0000 (18:08 +0530)]
usb: otg: Kconfig: Add Kconfig option for TWL6030 transceiver.

Added the TWL6030-usb transceiver option in the Kconfig

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: otg: Adding twl6030-usb transceiver driver for OMAP4430
Hema HK [Fri, 10 Dec 2010 12:28:20 +0000 (17:58 +0530)]
usb: otg: Adding twl6030-usb transceiver driver for OMAP4430

Adding the twl6030-usb transceiver support for OMAP4 musb driver.

OMAP4 supports 2 types of transceiver interface.

1. UTMI: The PHY is embedded within OMAP4. The transceiver functionality
is split between the twl6030 PMIC chip and OMAP4430. The VBUS, ID pin
sensing and OTG SRP generation part is integrated in TWL6030 and UTMI PHY
functionality is embedded within the OMAP4430.

There is no direct interactions between the MUSB controller and TWL6030
chip to communicate the session-valid, session-end and ID-GND events.
It has to be done through a software by setting/resetting bits in
one of the control module register of OMAP4430 which in turn toggles
the appropriate signals to MUSB controller.

The internal transceiver has functional clocks and
powerdown bits to powerdown the PHY for power saving.

Since there is no option available for having 2 transceiver drivers
for one USB controller, internal PHY specific APIs are passed through
plaform_data function pointers to use in the twl6030-usb transceiver
driver.

2. ULPI interface is provided for off-chip transceivers.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agomfd: TWL6030: USBOTG VBUS event generation on
Hema HK [Fri, 10 Dec 2010 12:25:37 +0000 (17:55 +0530)]
mfd: TWL6030: USBOTG VBUS event generation on

With TWL6030-usb, VBUS SESS_VLD and SESS_END events are not generated
as expected. When these interrupts are enabled, charger VBUS detection
interrupt does not get generated. So USBOTG has to be dependent on charger
VBUS interrupts.
So added one bit for USBOTG and changed the handler to call the
USBOTG handler whenever there is a charger VBUS interrpt.

VBUS SESS_VLD and SESS_END event generation issue is under debug with
HW team. This fix might not be required once after fixing the issue.

Signed-off-by: Balaji TK <balajitk@ti.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: add support for ux500 platform
Mian Yousaf Kaukab [Thu, 9 Dec 2010 12:05:01 +0000 (13:05 +0100)]
usb: musb: add support for ux500 platform

Initial support for u8500 and u5500 platform.

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agomusb: am35x: fix compile error due to control apis
Ajay Kumar Gupta [Tue, 7 Dec 2010 13:27:45 +0000 (18:57 +0530)]
musb: am35x: fix compile error due to control apis

commit 4814ced5116e3b73dc4f63eec84999739fc8ed11 (OMAP:
control: move plat-omap/control.h to mach-omap2/control.h)
moved <plat/control.h> to another location, preventing
drivers from accessing it, so we need to pass function
pointers from arch code to be able to talk to internal
PHY on AM35x.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap4: enable usb on 4430sdp
Felipe Balbi [Tue, 7 Dec 2010 07:57:59 +0000 (09:57 +0200)]
arm: omap4: enable usb on 4430sdp

Let musb work on 4430sdp as well. We can now
test any problems with multi-omap builds.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: drop board_set_vbus
Felipe Balbi [Thu, 2 Dec 2010 12:30:06 +0000 (14:30 +0200)]
usb: musb: drop board_set_vbus

that's not used anymore. So let's drop it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: drop musb_platform_suspend/resume
Felipe Balbi [Thu, 2 Dec 2010 11:17:53 +0000 (13:17 +0200)]
usb: musb: drop musb_platform_suspend/resume

all glue layers are now fully moved to the
new setup. We are now using dev_pm_ops to
implement suspend/resume functionality and
thus, musb_platform_suspend/resume has become
deprecated and useless.

This patch drops those function pointers and
its uses.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: blackfin: usb dev_pm_ops structure
Felipe Balbi [Thu, 2 Dec 2010 11:13:09 +0000 (13:13 +0200)]
usb: musb: blackfin: usb dev_pm_ops structure

instead of using musb_platform_suspend_resume,
we can use dev_pm_ops and let platform_device
core handle when to call musb_core's suspend and
glue layer's suspend.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: am35x: usb dev_pm_ops structure
Felipe Balbi [Thu, 2 Dec 2010 10:53:22 +0000 (12:53 +0200)]
usb: musb: am35x: usb dev_pm_ops structure

instead of using musb_platform_suspend_resume,
we can use dev_pm_ops and let platform_device
core handle when to call musb_core's suspend and
glue layer's suspend.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: omap2430: use dev_pm_ops structure
Felipe Balbi [Thu, 2 Dec 2010 10:44:40 +0000 (12:44 +0200)]
usb: musb: omap2430: use dev_pm_ops structure

instead of using musb_platform_suspend/resume,
we can use dev_pm_ops and let the platform_device
core handle when to call musb_core's suspend and
glue layer's suspend.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: omap2430: drop the nops
Felipe Balbi [Thu, 2 Dec 2010 10:35:59 +0000 (12:35 +0200)]
usb: musb: omap2430: drop the nops

we don't need those nops, so drop them.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: mark musb_save/restore_context static
Felipe Balbi [Thu, 2 Dec 2010 10:28:39 +0000 (12:28 +0200)]
usb: musb: mark musb_save/restore_context static

those aren't used outside musb_core.c, so mark
them as static.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: drop musb_platform_save/restore_context
Felipe Balbi [Thu, 2 Dec 2010 10:27:35 +0000 (12:27 +0200)]
usb: musb: drop musb_platform_save/restore_context

... that can be easily folded into the
musb_platform_suspend/resume calls.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: drop the set_clock magic
Felipe Balbi [Thu, 2 Dec 2010 08:55:29 +0000 (10:55 +0200)]
usb: musb: drop the set_clock magic

now that platform glue layer handles
clock completely, that function is completely
useless for us. Drop it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: move clock handling to glue layer
Felipe Balbi [Thu, 2 Dec 2010 07:57:08 +0000 (09:57 +0200)]
usb: musb: move clock handling to glue layer

musb core doesn't need to know about platform
specific details. So start moving clock
handling to platform glue layer and make
musb core agnostic about that.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: mark ->set_clock deprecated
Felipe Balbi [Thu, 2 Dec 2010 07:51:00 +0000 (09:51 +0200)]
usb: musb: mark ->set_clock deprecated

... we will completely drop that need by
moving clock handling to platform glue
layer. Marking as deprecated will allow
us to catch all users easily.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: pass platform_ops via platform_data
Felipe Balbi [Thu, 2 Dec 2010 07:48:58 +0000 (09:48 +0200)]
usb: musb: pass platform_ops via platform_data

... then we don't need to export any symbols
from glue layer to musb_core.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: blackfin: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:42:50 +0000 (09:42 +0200)]
usb: musb: blackfin: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: da8xx: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:40:34 +0000 (09:40 +0200)]
usb: musb: da8xx: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: davinci: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:38:12 +0000 (09:38 +0200)]
usb: musb: davinci: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: tusb6010: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:35:58 +0000 (09:35 +0200)]
usb: musb: tusb6010: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: am35x: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:33:24 +0000 (09:33 +0200)]
usb: musb: am35x: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: omap2430: give it a context structure
Felipe Balbi [Thu, 2 Dec 2010 07:27:29 +0000 (09:27 +0200)]
usb: musb: omap2430: give it a context structure

that structure currently only holds a device
pointer to our own platform_device and musb's
platform_device, but soon it will hold pointers
to our clock structures and glue-specific bits
and pieces.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split blackfin to its own platform_driver
Felipe Balbi [Thu, 2 Dec 2010 07:21:05 +0000 (09:21 +0200)]
usb: musb: split blackfin to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

Later patches will come to split power management
code from musb_core and move it completely to HW
glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split da8xx to its own platform_driver
Felipe Balbi [Thu, 2 Dec 2010 07:19:35 +0000 (09:19 +0200)]
usb: musb: split da8xx to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more patches
will come to split power management code from musb_core
and move it completely to HW glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split davinci to its own platform_driver
Felipe Balbi [Thu, 2 Dec 2010 07:16:55 +0000 (09:16 +0200)]
usb: musb: split davinci to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more patches
will come to split power management code from musb_core
and move it completely to HW glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split tusb6010 to its own platform_driver
Felipe Balbi [Thu, 2 Dec 2010 07:13:54 +0000 (09:13 +0200)]
usb: musb: split tusb6010 to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more patches
will come to split power management code from musb_core
and move it completely to HW glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split am35x to its own platform_driver
Felipe Balbi [Thu, 2 Dec 2010 07:06:51 +0000 (09:06 +0200)]
usb: musb: split am35x to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more patches
will come to split power management code from musb_core
and move it completely to HW glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: split omap2430 to its own platform_driver
Felipe Balbi [Wed, 1 Dec 2010 13:01:11 +0000 (15:01 +0200)]
usb: musb: split omap2430 to its own platform_driver

Just adding its own platform_driver, not really
using it yet.

When all HW glue layers are converted, more patches
will come to split power management code from musb_core
and move it completely to HW glue layer.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: trivial search and replace patch
Felipe Balbi [Thu, 2 Dec 2010 06:49:26 +0000 (08:49 +0200)]
usb: musb: trivial search and replace patch

change all ocurrences of musb_hdrc to musb-hdrc.

We will call glue layer drivers musb-<glue layer>,
so in order to keep things somewhat standard, let's
change the underscore into a dash.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: add Kconfig options for each glue layer
Felipe Balbi [Wed, 1 Dec 2010 12:23:48 +0000 (14:23 +0200)]
usb: musb: add Kconfig options for each glue layer

This will make things simpler when choosing which
glue layer to compile. It avoids a lot of magic
around the "default" Kconfig option and lets the
user choose what exactly s/he wants to compile.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: hold context on musb structure
Felipe Balbi [Wed, 1 Dec 2010 11:53:27 +0000 (13:53 +0200)]
usb: musb: hold context on musb structure

when we start splitting HW glue layer, it's
gonna make it easier to re-use that structure.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoarm: omap4: panda: initialize musb
Felipe Balbi [Wed, 1 Dec 2010 11:48:54 +0000 (13:48 +0200)]
arm: omap4: panda: initialize musb

initialize the musb port on pandaboard.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: make all glue layer export struct musb_platform_ops
Felipe Balbi [Wed, 1 Dec 2010 11:22:05 +0000 (13:22 +0200)]
usb: musb: make all glue layer export struct musb_platform_ops

preparing to a big refactor on musb code. We need
to be able to compile in all glue layers (or at
least all ARM-based ones) together and have a
working binary.

While preparing for that, we move every glue
layer to export only one symbol, which is
a struct musb_platform_ops, and make all
other functions static.

Later patches will come to allow for compiling
all glue layers together and have a working
binary.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: introduce struct musb_platform_ops
Felipe Balbi [Thu, 21 Oct 2010 10:56:40 +0000 (13:56 +0300)]
usb: musb: introduce struct musb_platform_ops

This will be passed to musb_core by platform glue
layer in order to make it easier to compile support
for several HW glue layers.

Later patches will come using this structure and
also moving HW glue layers to its own platform
driver; the idea is to be able to handle platform
peculiarities in a manner which doesn't affect one
another.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agoMerge branch 'sh/ehci' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2...
Greg Kroah-Hartman [Fri, 3 Dec 2010 20:12:29 +0000 (12:12 -0800)]
Merge branch 'sh/ehci' of /linux/kernel/git/lethal/sh-2.6 into work

* 'sh/ehci' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Convert to USB_ARCH_HAS_OHCI/EHCI selects.
  usb: ehci-sh: Add missing ehci helpers.
  usb: ehci-sh: Fix up fault in shutdown path.
  sh: Add EHCI support for SH7786.
  usb: ehci-hcd: Add support for SuperH EHCI.
  usb: ohci-sh: Set IRQ as shared.

13 years agoMerge branch 'for-next' of git://gitorious.org/usb/usb into usb-next
Greg Kroah-Hartman [Fri, 3 Dec 2010 20:10:06 +0000 (12:10 -0800)]
Merge branch 'for-next' of git://gitorious.org/usb/usb into usb-next

* 'for-next' of git://gitorious.org/usb/usb:
  usb: musb: gadget: prevent a NULL pointer dereference
  usb: musb: add names for IRQs in structure resource
  usb: musb: remove board_data parameter from musb_platform_init()

13 years agouwb: fix compiler warning on i1480_est_id_table
Namhyung Kim [Wed, 1 Dec 2010 20:52:22 +0000 (05:52 +0900)]
uwb: fix compiler warning on i1480_est_id_table

Annotate i1480_est_id_table as '__used' to fix following warning:

  CC      drivers/uwb/i1480/i1480-est.o
drivers/uwb/i1480/i1480-est.c:94: warning: ‘i1480_est_id_table’ defined but not used

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agouwb: fix compiler warning on whcrc_id_table
Namhyung Kim [Wed, 1 Dec 2010 20:52:21 +0000 (05:52 +0900)]
uwb: fix compiler warning on whcrc_id_table

Annotate whcrc_id_table as '__used' to fix following warning:

  CC      drivers/uwb/whc-rc.o
drivers/uwb/whc-rc.c:452: warning: ‘whcrc_id_table’ defined but not used

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: g_audio: Fix crash at driver removal
Richard Röjfors [Wed, 1 Dec 2010 10:53:00 +0000 (11:53 +0100)]
usb: g_audio: Fix crash at driver removal

If g_audio fails to open the sound control device, it crashes at removal:

Insertion:
[ 4143.836536] g_audio gadget: unable to open sound control device file: /dev/snd/controlC0
[ 4143.836543] g_audio gadget: we need at least one control device
[ 4143.836551] g_audio gadget: Linux USB Audio Gadget, version: Dec 18, 2008
[ 4143.836558] g_audio gadget: g_audio ready

Removal:
[ 4146.802643] BUG: unable to handle kernel paging request at 00023018
[ 4146.802655] IP: [<c10af9f5>] filp_close+0xa/0x5b
[ 4146.802674] *pdpt = 0000000015426001 *pde = 0000000000000000
[ 4146.802684] Oops: 0000 [#1] PREEMPT SMP
[ 4146.802692] last sysfs file: /sys/power/state
[ 4146.802701] Modules linked in: g_audio(-) ioh_udc fuse asix usbnet [last unloaded: g_audio]
[ 4146.802719]
[ 4146.802728] Pid: 1394, comm: rmmod Not tainted 2.6.33.5-26.1-ivi #1 To be filled by O.E.M./To be filled by O.E.M.
[ 4146.802738] EIP: 0060:[<c10af9f5>] EFLAGS: 00010206 CPU: 0
[ 4146.802746] EIP is at filp_close+0xa/0x5b
[ 4146.802753] EAX: 00023000 EBX: 00023000 ECX: 00000046 EDX: df842680
[ 4146.802760] ESI: e071cd4c EDI: df842680 EBP: ddbbbef0 ESP: ddbbbee4
[ 4146.802768]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 4146.802776] Process rmmod (pid: 1394, ti=ddbba000 task=dd95a4f0 task.ti=ddbba000)
[ 4146.802782] Stack:
[ 4146.802787]  d540c280 e071cd4c df2bc000 ddbbbefc e071b82c df11e440 ddbbbf04 e071c622
[ 4146.802804] <0> ddbbbf28 e071c47f 00000008 e071cd74 df11e464 df2bc01c df2bc000 e071ce68
[ 4146.802822] <0> 00000880 ddbbbf38 e07fd1b8 e071cef0 00000000 ddbbbf40 e071b9f4 ddbbbf48
[ 4146.802842] Call Trace:
[ 4146.802857]  [<e071b82c>] ? gaudio_cleanup+0x87/0xe0 [g_audio]
[ 4146.802869]  [<e071c622>] ? audio_unbind+0x8/0xc [g_audio]
[ 4146.802881]  [<e071c47f>] ? composite_unbind+0x8d/0xcb [g_audio]
[ 4146.802895]  [<e07fd1b8>] ? usb_gadget_unregister_driver+0x7b/0xc0 [ioh_udc]
[ 4146.802908]  [<e071b9f4>] ? usb_composite_unregister+0x15/0x17 [g_audio]
[ 4146.802920]  [<e071c633>] ? cleanup+0xd/0xf [g_audio]
[ 4146.802932]  [<c105a938>] ? sys_delete_module+0x185/0x1dd
[ 4146.802944]  [<c101c3ea>] ? do_page_fault+0x248/0x276
[ 4146.802956]  [<c10027d0>] ? sysenter_do_call+0x12/0x26
[ 4146.802962] Code: 12 5f 3a 00 8b 43 04 8b 40 0c 0f b3 30 3b 73 44 73 03 89 73 44 89 f8 e8 f1 61 3a 00 5b 5e 5f 5d c3 55 89 e5 57 89 d7 56 53 89 c3 <8b> 40 18 85 c0 75 0f 68 32 15 5e c1 31 f6 e8 52 39 3a 00 5a eb
[ 4146.803058] EIP: [<c10af9f5>] filp_close+0xa/0x5b SS:ESP 0068:ddbbbee4
[ 4146.803071] CR2: 0000000000023018
[ 4146.803112] ---[ end trace 0989a7e023da0434 ]---

This patch makes sure not to assign the_card if gaudio_open_snd_dev fails,
since the parent function will deallocate the card.

Also make sure all filp's in gaudio_open_snd_dev is assigned NULL upon error
and gaudio_close_snd_dev only cleanups when the filp's are non-NULL.

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: musb: gadget: prevent a NULL pointer dereference
Felipe Balbi [Wed, 1 Dec 2010 09:03:54 +0000 (11:03 +0200)]
usb: musb: gadget: prevent a NULL pointer dereference

Case we can't allocate struct musb_request,
prevent a NULL pointer dereference by returning
early.

Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: add names for IRQs in structure resource
Hema Kalliguddi [Wed, 29 Sep 2010 16:26:39 +0000 (11:26 -0500)]
usb: musb: add names for IRQs in structure resource

Soon resource data will get automatically
populated from a set of autogenerated data
from TI's hardware database for the OMAP
platform.

Such database, might not have resources at
the expected order by the current drivers.

While we could hack in some exceptions to
that tool to generate resources in a specific
order, it seems less fragile to use the
resource name instead. That way, no matter
what order the resources are generated, the
driver still work.

Modified the OMAP, Blackfin and Davinci
architecture files to add the name of the IRQs
in the resource structures and musb driver to
use the platform_get_irq_byname() api to get
the device and dma irq numbers instead of using
the index.

Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: musb: remove board_data parameter from musb_platform_init()
Hema Kalliguddi [Thu, 23 Sep 2010 00:27:40 +0000 (19:27 -0500)]
usb: musb: remove board_data parameter from musb_platform_init()

Removed the board_data parameter being
passed to musb_platform_init function
as board_data can be extracted from
device structure which is already member
of musb structure.

Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Hema HK <hemahk@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agosh: Convert to USB_ARCH_HAS_OHCI/EHCI selects.
Paul Mundt [Wed, 1 Dec 2010 06:58:58 +0000 (15:58 +0900)]
sh: Convert to USB_ARCH_HAS_OHCI/EHCI selects.

This switches over to selects for the subtypes to enable OHCI/EHCI
support explicitly rather than littering the usb Kconfig with subtype
dependencies.

Suggested-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agoMerge branch 'omap4-ehci-for-greg' of git://dev.omapzoom.org/pub/scm/anand/linux...
Greg Kroah-Hartman [Wed, 1 Dec 2010 01:04:33 +0000 (17:04 -0800)]
Merge branch 'omap4-ehci-for-greg' of git://dev.omapzoom.org/anand/linux-omap-usb into usb-next

* 'omap4-ehci-for-greg' of git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb:
  omap4: 4430sdp: enable the ehci port on 4430SDP
  arm: omap4: select USB_ARCH_HAS_EHCI
  arm: omap4: usb: add platform init code for EHCI
  arm: omap4: add USBHOST and related base addresses
  usb: ehci-omap: Add OMAP4 support
  omap: usb: ehci: introduce HSIC mode
  usb: ehci-omap: add helpers for checking port mode
  usb: ehci-omap: use clkdev aliases for functional clocks
  omap: clock: add clkdev aliases for EHCI clocks
  usb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAP
  usb: ehci-omap: don't hard-code TLL channel count
  usb: ehci-omap: update clock names to be more generic

13 years agoUSB: pxa: Add USB client support for Marvell PXA9xx/PXA168 chips
cxie4 [Tue, 30 Nov 2010 05:35:15 +0000 (13:35 +0800)]
USB: pxa: Add USB client support for Marvell PXA9xx/PXA168 chips

This patch add USB client support Marvell PXA9xx/PXA168 chips. The USB
controller in PXA9xx/PXA168 is a High-Speed OTG controller. The available
endpoints is different between PXA9xx and PXA168.

NOTE:
It is the first version of Marvell PXA9xx/PXA168 USB controller driver.
The support for OTG mode will be added in later patch.
PXA9xx and PXA168 has integrated UTMI PHY in the chips. The initialization
for the PHY is a little different between PXA9xx and PXA168.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: Add in missing EHCI helpers.
Paul Mundt [Tue, 30 Nov 2010 08:57:02 +0000 (17:57 +0900)]
usb: Add in missing EHCI helpers.

Several of the EHCI glue drivers either predate or were merged in the
same timeframe as API changes at the USB core level, resulting in some
missing endpoint_reset and clear_tt_buffer_complete callbacks.

This fixes up all of ehci-atmel, mxc, w90x900, and xilinx-of to tie in
the new helpers, which brings them in line with everyone else.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: langwell_udc: add usb test mode support
Luo Andy [Tue, 23 Nov 2010 02:41:21 +0000 (10:41 +0800)]
usb: gadget: langwell_udc: add usb test mode support

This patch adds test mode support for Langwell gadget driver.

Signed-off-by: Henry Yuan <hang.yuan@intel.com>
Signed-off-by: Andy Luo <yifei.luo@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: composite gadget: set vbus_draw current limitation during suspend
Hao Wu [Mon, 29 Nov 2010 07:17:03 +0000 (15:17 +0800)]
usb: composite gadget: set vbus_draw current limitation during suspend

This patch modifies the composite gadget to set vbus_draw current limitation
during suspend state. This current limitation in suspend state shouldn't be
more than 2.5mA

Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: otg: twl4030-usb: Fix unbalanced regulator disables at module removal
Jarkko Nikula [Tue, 30 Nov 2010 15:58:25 +0000 (17:58 +0200)]
usb: otg: twl4030-usb: Fix unbalanced regulator disables at module removal

Function twl4030_usb_remove can cause unbalanced regulator disables in
twl4030_phy_power if the cable is not connected. Regulator enable/disable
calls are in balance only if the twl4030_phy_resume was called prior the
twl4030_usb_remove, that is, the cable was connected.

Fix this by checking the 'asleep' variable in twl4030_usb_remove since that
variable is used to check state in other functions.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb-wwan: implement TIOCGSERIAL and TIOCSSERIAL to avoid blocking close(2)
Dan Williams [Fri, 19 Nov 2010 22:04:00 +0000 (16:04 -0600)]
usb-wwan: implement TIOCGSERIAL and TIOCSSERIAL to avoid blocking close(2)

Some devices (ex ZTE 2726) simply don't respond at all when data is sent
to some of their USB interfaces.  The data gets stuck in the TTYs queue
and sits there until close(2), which them blocks because closing_wait
defaults to 30 seconds (even though the fd is O_NONBLOCK).  This is
rarely desired.  Implement the standard mechanism to adjust closing_wait
and let applications handle it how they want to.

Signed-off-by: Dan Williams <dcbw@redhat.com>
13 years agoUSB: Remove unnecessary casts of void ptr returning alloc function return values
Jesper Juhl [Mon, 8 Nov 2010 23:10:52 +0000 (00:10 +0100)]
USB: Remove unnecessary casts of void ptr returning alloc function return values

Hi,

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/usb/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
13 years agousbmon: correct length for isochronous
Pete Zaitcev [Wed, 17 Nov 2010 04:51:19 +0000 (21:51 -0700)]
usbmon: correct length for isochronous

Usually the usbmon returns the amount of data specified in
urb->transfer_buffer_length for output submissions and urb->actual_length
for input callbacks. However, for Isochronous input transfers, this is
not enough, since the returned data buffer may contain "holes".

One easy way to fix this is to use urb->transfer_buffer_length,
but this often transfers a whole lot of unused data, so we find
how much was actually used instead.

Original patch by Márton Németh. See also kernel bug 22182.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoomap4: 4430sdp: enable the ehci port on 4430SDP
Keshava Munegowda [Sun, 21 Nov 2010 17:53:42 +0000 (23:23 +0530)]
omap4: 4430sdp: enable the ehci port on 4430SDP

The OMAP4 SDP has an SMSC3320 PHY hooked up to EHCI on Port1.
The PHY power is controlled by GPIO 157.

Turn on the PHY power, and register the controller at init.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agoarm: omap4: select USB_ARCH_HAS_EHCI
Anand Gadiyar [Sun, 21 Nov 2010 17:53:42 +0000 (23:23 +0530)]
arm: omap4: select USB_ARCH_HAS_EHCI

The OMAP4 has an on-chip EHCI controller. Select USB_ARCH_HAS_EHCI
to allow the EHCI driver to be built on OMAP4.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agoarm: omap4: usb: add platform init code for EHCI
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
arm: omap4: usb: add platform init code for EHCI

- Add platform init code for EHCI on OMAP4
- Add pad configuration for PHY and TLL modes

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agoarm: omap4: add USBHOST and related base addresses
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
arm: omap4: add USBHOST and related base addresses

Add base addresses for USBHOST, USBTLL, EHCI and OHCI to
the header file.

This will disappear when the drivers are converted to use
the hwmod database, however this patch is needed until then.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agousb: ehci-omap: Add OMAP4 support
Anand Gadiyar [Sun, 21 Nov 2010 17:53:42 +0000 (23:23 +0530)]
usb: ehci-omap: Add OMAP4 support

Update the ehci-omap glue layer to support the controller in the
OMAP4. Major differences from OMAP3 is that the OMAP4 has per-port
clocking, and supports ULPI output clocking mode. The old input
clocking mode is not supported.

Also, there are only 2 externally available ports as against 3
in the OMAP3. The third port is internally tied off and should
not be used.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agoomap: usb: ehci: introduce HSIC mode
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
omap: usb: ehci: introduce HSIC mode

The EHCI controller in OMAP4 supports a new interface mode - HSIC.
Add this to the list of modes supported on OMAP3.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agousb: ehci-omap: add helpers for checking port mode
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
usb: ehci-omap: add helpers for checking port mode

Introduce helper functions to test port mode. These checks are
performed in several places in the driver, and these helpers
improve readability.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agousb: ehci-omap: use clkdev aliases for functional clocks
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
usb: ehci-omap: use clkdev aliases for functional clocks

Use the recently updated aliases to get functional clocks needed by
the driver. This allows the driver to acquire OMAP4-specific clocks
without having to use different clock names for OMAP3 and OMAP4.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agoomap: clock: add clkdev aliases for EHCI clocks
Anand Gadiyar [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
omap: clock: add clkdev aliases for EHCI clocks

Add clkdev aliases for the USBHOST and USBTLL clocks on OMAP3 and
OMAP4, so that the driver can refer to the clocks using a common alias.

This will disappear when the driver is converted to use the hwmod
database, but until then this patch is needed.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Tony Lindgren <tony@atomide.com>
13 years agousb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAP
Keshava Munegowda [Sun, 21 Nov 2010 17:53:41 +0000 (23:23 +0530)]
usb: ehci: introduce CONFIG_USB_EHCI_HCD_OMAP

Introduce the CONFIG_USB_EHCI_HCD_OMAP option to select
EHCI support on OMAP3 and later chips. This scales better
than having a long line of dependencies for each new OMAP
with EHCI support.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agousb: ehci-omap: don't hard-code TLL channel count
Keshava Munegowda [Sun, 21 Nov 2010 17:53:40 +0000 (23:23 +0530)]
usb: ehci-omap: don't hard-code TLL channel count

Make the TLL channel count a parameter instead of a hardcoded
value. This allows us to be flexible with future OMAP revisions
which could have a different number of channels.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agousb: ehci-omap: update clock names to be more generic
Keshava Munegowda [Sun, 21 Nov 2010 17:53:40 +0000 (23:23 +0530)]
usb: ehci-omap: update clock names to be more generic

Rename usbhost2_120m_fck to usbhost_hs_fck and usbhost1_48m_fck
to usbhost_fs_fck, to better reflect the clocks' functionalities.

In OMAP4, the frequencies for the corresponding clocks are not
necessarily the same as with OMAP3, however the functionalities
are.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
13 years agousb: ehci-sh: Add missing ehci helpers.
Paul Mundt [Fri, 26 Nov 2010 07:48:31 +0000 (16:48 +0900)]
usb: ehci-sh: Add missing ehci helpers.

The ehci-sh driver was missing tie-ins for endpoint_reset and
clear_tt_buffer_complete, add them in.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>