Commit graph

9 commits

Author SHA1 Message Date
Julia Lawall a926e298b6 drivers/usb/host/ehci-sh.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-10 12:04:09 -07:00
Alan Stern 1a49e2ac96 EHCI: centralize controller initialization
This patch (as1564c) converts the EHCI platform drivers to use the
central ehci_setup() routine for generic controller initialization
rather than each having its own idiosyncratic approach.

The major point of difficulty lies in ehci-pci's many vendor- and
device-specific workarounds.  Some of them have to be applied before
calling ehci_setup() and some after, which necessitates a fair amount
of code motion.  The other platform drivers require much smaller
changes.

One point not addressed by the patch is whether ports should be
powered on or off following initialization.  The different drivers
appear to handle this pretty much at random.  In fact it shouldn't
matter, because the hub driver turns on power to all ports when it
binds to the root hub.  Straightening that out will be left for
another day.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 13:35:05 -07:00
Shimoda, Yoshihiro 5897b03829 usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL
If the platform_data is not set, pdata will be uninitialized value.
Since the driver has the following code, if the condition is true when
the pdata is uninitialized value, the driver may jump to the illegal
phy_init().

	if (pdata && pdata->phy_init)
		pdata->phy_init();

This patch also fixes the following warning:

  CC      drivers/usb/host/ehci-hcd.o
drivers/usb/host/ehci-sh.c: In function ‘ehci_hcd_sh_probe’:
drivers/usb/host/ehci-sh.c:104: warning: ‘pdata’ may be used uninitialized in this function

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 17:13:34 -07:00
Nobuhiro Iwamatsu 3e0c70d050 usb: ehci-sh: Add PHY init function with platform data
In devices using ehci-sh, initialization of the PHY may be necessary.
This adds platform data to ehci-sh and provide function to initialize PHY.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Shimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 13:52:35 -07:00
Yong Zhang b5dd18d874 USB: irq: Remove IRQF_DISABLED
This flag is a NOOP and can be removed now.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-18 01:39:36 -07:00
Jan Andersson c430131a02 USB: EHCI: Support controllers with big endian capability regs
The two first HC capability registers (CAPLENGTH and HCIVERSION)
are defined as one 8-bit and one 16-bit register. Most HC
implementations have selected to treat these registers as part
of a 32-bit register, giving the same layout for both big and
small endian systems.

This patch adds a new quirk, big_endian_capbase, to support
controllers with big endian register interfaces that treat
HCIVERSION and CAPLENGTH as individual registers.

Signed-off-by: Jan Andersson <jan@gaisler.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-03 11:43:21 -07:00
Paul Mundt 6e9d447606 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>
2010-11-26 16:48:31 +09:00
Paul Mundt c1e0774d74 usb: ehci-sh: Fix up fault in shutdown path.
We can't use the generic usb_hcd_platform_shutdown helper on account of
the fact we don't stash the hcd pointer in the driver data, so we provide
our own shutdown handler.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-26 16:43:38 +09:00
Paul Mundt 63c8455222 usb: ehci-hcd: Add support for SuperH EHCI.
This adds a trivial stub for supporting EHCI mode of the on-chip
SH USB host controllers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-01 17:03:27 -04:00