History log of /drivers/usb/host/ohci-pxa27x.c
Revision Date Author Comments
cecabe5c349b613614fbbf822e3aeb33758a22f0 16-Apr-2014 Laurent Pinchart <laurent.pinchart@ideasonboard.com> USB: ohci-pxa27x: Add support for external vbus regulators

Override the hub control operation to enable and disable external
regulators for the ports vbus power supply in response to clear/set
USB_PORT_FEAT_POWER requests.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f1080e4d90b2c0ec3ce850a9fad8ac8a79df3b23 11-Dec-2013 Jingoo Han <jg1.han@samsung.com> USB: ohci-pxa27x:Use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3c9740a117d40a74412775b5d3fe2b88a7635a0e 05-Nov-2013 Peter Chen <peter.chen@freescale.com> usb: hcd: move controller wakeup setting initialization to individual driver

Individual controller driver has different requirement for wakeup
setting, so move it from core to itself. In order to align with
current etting the default wakeup setting is enabled (except for
chipidea host).

Pass compile test with below commands:
make O=outout/all allmodconfig
make -j$CPU_NUM O=outout/all drivers/usb

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9876388edfa553960815110acae4544359b385b5 15-Nov-2013 Daniel Mack <zonque@gmail.com> usb: ohci-pxa27x: include linux/dma-mapping.h

Include linux/dma-mapping.h to make the new functions available that are
used since 22d9d8e83 ("DMA-API: usb: use dma_set_coherent_mask()").

drivers/usb/host/ohci-pxa27x.c: In function ‘ohci_pxa_of_init’:
drivers/usb/host/ohci-pxa27x.c:310:2: error: implicit declaration of function ‘dma_coerce_mask_and_coherent’ [-Werror=implicit-function-declaration]
drivers/usb/host/ohci-pxa27x.c:310:2: error: implicit declaration of function ‘DMA_BIT_MASK’ [-Werror=implicit-function-declaration]

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e1fd7341837238c6c5380c5073887d238f706cf0 27-Jun-2013 Russell King <rmk+kernel@arm.linux.org.uk> DMA-API: usb: use new dma_coerce_mask_and_coherent()

Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
22d9d8e8316d7f69046c8805ce9aa8d9c43d4e5b 10-Jun-2013 Russell King <rmk+kernel@arm.linux.org.uk> DMA-API: usb: use dma_set_coherent_mask()

The correct way for a driver to specify the coherent DMA mask is
not to directly access the field in the struct device, but to use
dma_set_coherent_mask(). Only arch and bus code should access this
member directly.

Convert all direct write accesses to using the correct API.

Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
4ceaa893be62921667bd30419e82bd74545cbc82 04-Oct-2013 Manjunath Goudar <manjunath.goudar@linaro.org> USB: OHCI: Properly handle ohci-pxa27x suspend

Suspend scenario in case of ohci-pxa27x glue was not
properly handled as it was not suspending generic part
of ohci controller. Alan Stern suggested, properly
handle ohci-pxa27x suspend scenario.

Calling explicitly the ohci_suspend() routine in
ohci_hcd_pxa27x_drv_suspend() will ensure proper
handling of suspend scenario.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b8ad5c370640886792487be7835810f204388c95 21-Sep-2013 Manjunath Goudar <manjunath.goudar@linaro.org> USB: OHCI: make ohci-pxa27x a separate driver

Separate the OHCI pxa27x/pxa3xx host controller driver from
ohci-hcd host code so that it can be built as a separate driver
module. This work is part of enabling multi-platform kernels on
ARM.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d4f09e28d7bc5c1adde8229b1e89401f23fb44f9 30-Jul-2013 Jingoo Han <jg1.han@samsung.com> USB: host: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27d4f707a167f6bc61e2d58346883c7df52c80ca 06-May-2013 Jingoo Han <jg1.han@samsung.com> USB: ohci-pxa27x: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3b9561e9d9b88eca9d4ed6aab025dec2eeeed501 08-May-2013 Stephen Warren <swarren@nvidia.com> USB: set device dma_mask without reference to global data

Many USB host drivers contain code such as:

if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &tegra_ehci_dma_mask;

... where tegra_ehci_dma_mask is a global. I suspect this code originated
in commit 4a53f4e "USB: ehci-tegra: add probing through device tree" and
was simply copied everywhere else.

This works fine when the code is built-in, but can cause a crash when the
code is in a module. The first module load sets up the dma_mask pointer,
but if the module is removed and re-inserted, the value is now non-NULL,
and hence is not updated to point at the new location, and hence points
at a stale location within the previous module load address, which in
turn causes a crash if the pointer is de-referenced.

The simplest way of solving this seems to be to copy the code from
ehci-platform.c, which uses the coherent_dma_mask as the target for the
dma_mask pointer.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41ac7b3ab7fe1d6175839947a877fdf95cbd2211 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> usb: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cfa49b4b88fe14d2b5792f2ea7ba5b88c8cd1d15 08-Oct-2012 Florian Fainelli <florian@openwrt.org> USB: ohci: merge ohci_finish_controller_resume with ohci_resume

Merge ohci_finish_controller_resume with ohci_resume as suggested by Alan
Stern. Since ohci_finish_controller_resume no longer exists, update the
various OHCI drivers to call ohci_resume() instead. Some drivers used to set
themselves the bit HCD_FLAG_HW_ACCESSIBLE, which is now handled by
ohci_resume().

Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
293b2da1b61136813fc2764f43304c66ff8040e9 24-Aug-2012 Arnd Bergmann <arnd@arndb.de> ARM: pxa: move platform_data definitions

Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the pxa include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Vinod Koul <vinod.koul@linux.intel.com>
Acked-By: Stefan Schmidt <stefan@openezx.org>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Daniel Ribeiro <drwyrm@gmail.com>
Cc: Harald Welte <laforge@openezx.org>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Tomas Cech <sleep_walker@suse.cz>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Dan Williams <djbw@fb.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: openezx-devel@lists.openezx.org
1139b4516f3927ae835ed3b0a9c69a0dfaf4cdd4 30-Jul-2012 Daniel Mack <zonque@gmail.com> USB: ohci-pxa27x: add DT bindings

Add DT bindings to the ohci-pxa27x driver and some documentation.

Successfully tested on a PXA3xx board.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ade749a6bde26511925c888d734c989c5bbec919 01-May-2012 Paul Gortmaker <paul.gortmaker@windriver.com> usb: [ARM] fix unresolved err() reference in host/ohci-pxa27x.c

Commit af4e1ee04026908086d7ed252db2619a8ceaa333 (usb-next)

"USB: remove err() macro"

was preceeded by a tree-wide cleanup of users, however this
one squeaked through the cracks because it had whitespace
between the function name and the bracket for the args.

Map it onto dev_err, just like all the "pre-commits" made
in advance of af4e1ee04026, such as the example seen in
the commit d57b177208b6ec20cacd7321ee32ef02f9f9e7fa:

"USB: ohci-xls.c: remove err() usage"

Build tested with the ARM magician_defconfig settings.

Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4bf34b8c6b10a154a7fb1fc20818e20a27d4a539 15-Mar-2012 Philipp Zabel <pzabel@gmx.de> USB: ohci-pxa27x: add clk_prepare/clk_unprepare calls

This patch adds clk_prepare/clk_unprepare calls to the ohci-pxa27x
driver by using the helper functions clk_prepare_enable and
clk_disable_unprepare.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
47168824fa71b52ca3f4c18ddf0c42ff35192235 12-Feb-2012 Rob Herring <rob.herring@calxeda.com> usb: ohci-pxa27x: add explicit include of hardware.h

ohci-pxa27x needs cpu_is_pxa3xx macro.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
60b9bd8d162174edd335c1b83dbc2bafde1e9d5f 02-Mar-2012 Rob Herring <rob.herring@calxeda.com> usb: ohci-pxa27x: add explicit include of hardware.h

ohci-pxa27x needs cpu_is_pxa3xx macro.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b7463c71fbbff7111d0c879d2f64fe2b08f51848 17-Nov-2011 Alan Stern <stern@rowland.harvard.edu> OHCI: remove uses of hcd->state

This patch (as1500) removes all uses of the objectionable hcd->state
variable from the ohci-hcd family of drivers. It is replaced by a
private ohci->rh_state field, just as in uhci-hcd and ehci-hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b5dd18d8747010e3f3eb1cc76a49f94291938559 07-Sep-2011 Yong Zhang <yong.zhang0@gmail.com> 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>
7febe2be36035e5c75128e8cc3baeb1f30fa2bc4 01-Jun-2011 Julia Lawall <julia@diku.dk> drivers/usb/host/ohci-pxa27x.c: add missing clk_put

Add a label before the call to clk_put and jump to that in the error
handling code that occurs after the call to clk_get has succeeded.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
when != clk_put(e1)
when any
if (...) { ... when != clk_put(e1)
when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
} else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6dc3ae845c56157098f8af2d793aaefac2b31840 27-Jul-2010 Igor Grinberg <grinberg@compulab.co.il> ARM: ohci-pxa27x: enable OHCI over U2DC for pxa3xx

U2D Controller of pxa3xx is able to work in host mode.
Make pxa specific ohci implementation aware of it.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
59376cc355ebe1dc89c9daea49010b8b171af404 14-Jul-2010 Eric Miao <eric.y.miao@gmail.com> [ARM] pxa: fix incorrect CONFIG_CPU_PXA27x to CONFIG_PXA27x

Reported-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
471452104b8520337ae2fb48c4e61cd4896e025d 15-Dec-2009 Alexey Dobriyan <adobriyan@gmail.com> const: constify remaining dev_pm_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
7b4361f0848193ddc36dfb2c9a7391c56a9df2ad 30-Jul-2009 Aric Blumer <aric@sdgsystems.com> USB: ohci-pxa27x: Allow NOCP and OCPM to be cleared

Some ohci-pxa27x platforms may require OCPM and NOCP in UHCRHDA to be
clear, but the existing code was only allowing setting. This patch
ensures that these bits are clear if the respective flags are not set.
This is particularly important for the PXA3xx family where the
documentation says OCPM must be cleared, but it is set after reset.

Signed-off-by: Aric Blumer <aric@sdgsystems.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a75d048e1409bb2bae0d71645c4f6247d2ce9276 30-Jul-2009 Aric D. Blumer <aric@sdgsystems.com> USB: ohci-pxa27x: Reconfigure power settings on resume

On resume, the power-related bits in UHCRHDA were not being set, so
they would default to the reset state. For PXA3xx devices, OCPM must
be cleared, but it was remaining set from resume reset.

Signed-off-by: Aric D. Blumer <aric@sdgsystems.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
b7f3f59b48112ba5ba1c1ffc093f02654e0ce97e 21-Jul-2009 Mike Rapoport <mike@compulab.co.il> [ARM] pxa: update ohci-pxa27x.c to use 'struct dev_pm_ops'

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
e0d8b13ae1e3ea747620580b6f777992148de182 11-Nov-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] pxa: don't pass a consumer clock name for devices with unique clocks

Where devices only have one consumer, passing a consumer clock ID
has no real benefit. Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
0c392ed9a78cbe0f54955ea4716ade8bc22eb00d 03-Oct-2008 Eric Miao <eric.miao@marvell.com> [ARM] ohci-pxa27x: use ioremap() and offset for register access

This avoid the pre-mapping of OHCI controller register space, and the
mapping is made only when necessary (OHCI is probed).

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
0cb0b0d3c6ebb8215500685a1f70a45bbbdc8e47 03-Oct-2008 Eric Miao <eric.miao@marvell.com> [ARM] ohci-pxa27x: introduce pxa27x_clear_otgph()

Direct access to pxa27x specific register PSSR in a generic ohci driver
is no good, introduce pxa27x_clear_otgph() and move the implementation
into processor specific code.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
84bab7393b0da5086e133b7f333b800d26f7166b 03-Oct-2008 Eric Miao <eric.miao@marvell.com> [ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource

Depending on the order of how resource is defined in the platform
device is not good, use platform_get_{irq,resource} for the IRQ
and memory resources.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
596050bc75a56ea4bd9942abafff6dca657da81c 27-Sep-2008 Eric Miao <eric.miao@marvell.com> [ARM] ohci-pxa27x: move OHCI controller specific registers into the driver

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
097b53348f34a461d2b07081eae12d823cf3d729 27-Sep-2008 Eric Miao <eric.miao@marvell.com> [ARM] ohci-pxa27x: introduce flags to avoid direct access to OHCI registers

Direct access to USB host controller registers is considered to be not
portable, and is usually a bad sign for poorly abstracted interface.
Introduce .flags and .power_on_delay to "struct pxaohci_platform_data"
so that most platforms don't bother to write their own .init/.exit()
sequences.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
b5fb454f69642f9d933b327b185a2ba06dd0945c 20-Aug-2008 Alan Stern <stern@rowland.harvard.edu> USB: automatically enable RHSC interrupts

This patch (as1069c) changes the way OHCI root-hub status-change
interrupts are enabled. Currently a special HCD method,
hub_irq_enable(), is called when the hub driver is finished using a
root hub. This approach turns out to be subject to races, resulting
in unnecessary polling.

The patch does away with the method entirely. Instead, the driver
automatically enables the RHSC interrupt when no more status changes
are present. This scheme is safe with controllers using
level-triggered semantics for their interrupt flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a09e64fbc0094e3073dbb09c3b4bfe4ab669244b 05-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach

This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
be509729356b7433f73df2b9a966674a437fbbc1 04-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead

Remove includes of asm/hardware.h in addition to asm/arch/hardware.h.
Then, since asm/hardware.h only exists to include asm/arch/hardware.h,
update everything to directly include asm/arch/hardware.h and remove
asm/hardware.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
0f8469a54f7bd65f2c740a5480c56260dc8a7ae0 03-Aug-2008 Russell King <rmk@dyn-67.arm.linux.org.uk> [ARM] Eliminate useless includes of asm/mach-types.h

There are 43 includes of asm/mach-types.h by files that don't
reference anything from that file. Remove these unnecessary
includes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
09ca8adbe9f724a7e96f512c0039c4c4a1c5dcc0 06-Jul-2008 Linus Torvalds <torvalds@linux-foundation.org> Revert "USB: don't explicitly reenable root-hub status interrupts"

This reverts commit e872154921a6b5256a3c412dd69158ac0b135176.

Andrey Borzenkov reports that it resulted in a totally hung machine for
him when loading the OHCI driver. Extensive netconsole capture with
SysRq output shows that modprobe gets stuck in ohci_hub_status_data()
when probing and enabling the OHCI controller, see for example

http://lkml.org/lkml/2008/7/5/236

for an analysis.

The problem appears to be an interrupt flood triggered by the commit
that gets reverted, and Andrey confirmed that the revert makes things
work for him again.

Reported-and-tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d438ae5796085379327bdba76114929eedf94a89 06-Jun-2008 Philipp Zabel <philipp.zabel@gmail.com> [ARM] 5080/1: touch PSSR_OTGPH only on pxa27x in ohci-pxa27x and pxa27x_udc

and include pxa2xx-regs.h as build fix since PSSR definitions
moved from pxa-regs.h into pxa2xx-regs.h.

Note: This change is temporary as pxa27x processor specific
code will be finally moved elsewhere (both drivers should
support pxa3xx, too).

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
e872154921a6b5256a3c412dd69158ac0b135176 14-Apr-2008 Alan Stern <stern@rowland.harvard.edu> USB: don't explicitly reenable root-hub status interrupts

This patch (as1069b) changes the way OHCI root-hub status-change
interrupts are enabled. Currently a special HCD method,
hub_irq_enable(), is called when the hub driver is finished using a
root hub. This approach turns out to be subject to races, resulting
in unnecessary polling.

The patch does away with the method entirely. Instead, the driver
automatically enables the RHSC interrupt when no more status changes
are present. This scheme is safe with controllers using
level-triggered semantics for their interrupt flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
43bbb7e015c4380064796c5868b536437b165615 04-Apr-2008 Alan Stern <stern@rowland.harvard.edu> USB: OHCI: host-controller resumes leave root hub suspended

Drivers in the ohci-hcd family should perform certain tasks whenever
their controller device is resumed. These include checking for loss
of power during suspend, turning on port power, and enabling interrupt
requests.

Until now these jobs have been carried out when the root hub is
resumed, not when the controller is. Many drivers work around the
resulting awkwardness by automatically resuming their root hub
whenever the controller is resumed. But this is wasteful and
unnecessary.

To simplify the situation, this patch (as1066) adds a new core
routine, ohci_finish_controller_resume(), which can be used by all the
OHCI-variant drivers. They can call the new routine instead of
resuming their root hubs. And ohci-pci.c can call it instead of using
its own special-purpose handler.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
70a1c9e086c2e267fbc4533cb870f34999b531d6 06-Mar-2008 Alan Stern <stern@rowland.harvard.edu> USB: remove dev->power.power_state

power.power_state is scheduled for removal. This patch (as1053)
removes all uses of that field from drivers/usb. Almost all of them
were write-only, the most significant exceptions being sl811-hcd.c and
u132-hcd.c.

Part of this patch was written by Pavel Machek.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f4fce61d410b96ae263b001c45f73df1863dad8d 11-Apr-2008 Kay Sievers <kay.sievers@vrfy.org> usb host: fix platform driver hotplug/coldplug

Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable USB HCDs,
to allow re-enable auto loading.

[dbrownell@users.sourceforge.net: more drivers; registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
a8bcf4108d6322ef157ae3c224a57beb8870af38 12-Dec-2007 eric miao <eric.miao@marvell.com> [ARM] USB: update pxa27x ohci driver to use clk support

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
7053acbd78336abf5d4bc3d8a875a03624cfb83f 05-Apr-2007 Eric Miao <eric.y.miao@gmail.com> [ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXX

This patch removes the unnecessary bit number from CKENnn_XXXX
definitions for PXA, so that

CKEN0_PWM0 --> CKEN_PWM0
CKEN1_PWM1 --> CKEN_PWM1
...
CKEN24_CAMERA --> CKEN_CAMERA

The reasons for the change of these defitions are:

1. they do not scale - they are currently valid for pxa2xx, but
definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
instead of bit 24

2. they are unnecessary - the peripheral name within the definition
has already announced its usage, we don't need those bit numbers
to know which peripheral we are going to enable/disable clock for

3. they are inconvenient - think about this: a driver programmer
for pxa has to remember which bit in the CKEN register to turn
on/off

Another change in the patch is to make the definitions equal to its
clock bit index, so that

#define CKEN_CAMERA (24)

instead of

#define CKEN_CAMERA (1 << 24)

this change, however, will add a run-time bit shift operation in
pxa_set_cken(), but the benefit of this change is that it scales
when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
and so that pxa_set_cken() need minimum change to adapt to that.

Signed-off-by: eric miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
5e16fabe5dbcff15de6cdcba406195fe6e4380df 13-Dec-2006 Sylvain Munaut <tnt@246tNt.com> ohci: Rework bus glue integration to allow several at once

The previous model had the module_init & module_exit function in the
bus glue .c files themselves. That's a problem if several glues need
to be selected at once and the driver is built has module. This case
is quite common in embedded system where you want to handle both the
integrated ohci controller and some extra controller on PCI.

The ohci-hcd.c file now provide the module_init & module_exit and
appropriate driver registering/unregistering is done conditionally,
using #ifdefs.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
dd9048af41d017f5f9ea18fb451a3b5dc89d6b83 05-Dec-2006 David Brownell <david-b@pacbell.net> USB: ohci whitespace/comment fixups

This is an OHCI cleanup patch ... it removes a lot of erroneous whitespace
(space before tab, at end of line) as well as the obsolete inline changelog.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
64a21d025d3a979a8715f2ec7acabca7b5406c8a 09-Aug-2006 Aleksey Gorelov <dared1st@yahoo.com> USB: Properly unregister reboot notifier in case of failure in ehci hcd

If some problem occurs during ehci startup, for instance, request_irq fails,
echi hcd driver tries it best to cleanup, but fails to unregister reboot
notifier, which in turn leads to crash on reboot/poweroff.

The following patch resolves this problem by not using reboot notifiers
anymore, but instead making ehci/ohci driver get its own shutdown method. For
PCI, it is done through pci glue, for everything else through platform driver
glue.

One downside: sa1111 does not use platform driver stuff, and does not have its
own shutdown hook, so no 'shutdown' is called for it now. I'm not sure if it
is really necessary on that platform, though.

Signed-off-by: Aleks Gorelov <dared1st@yahoo.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d413984ae936fad46678403b38d79c595e5aaafe 04-Aug-2006 David Brownell <david-b@pacbell.net> USB: OHCI avoids root hub timer polling

This teaches OHCI to use the root hub status change (RHSC) IRQ, bypassing
root hub timers most of the time and switching over to the "new" root hub
polling scheme. It's complicated by the fact that implementations of OHCI
trigger and ack that IRQ differently (the spec is vague there).

Avoiding root hub timers helps mechanisms like "dynamic tick" leave the
CPU in lowpower modes for longer intervals.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d54b5caa832caa3715a458115b6ea79ad17c4f31 02-Jul-2006 Thomas Gleixner <tglx@linutronix.de> [PATCH] irq-flags: usb: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
0c27c5d5b93339df4def7ced77ea5be26df4d84b 08-Jun-2006 Richard Purdie <rpurdie@rpsys.net> [ARM] 3547/1: PXA-OHCI: Allow platforms to specify a power budget

Patch from Richard Purdie

Add a power budget variable to the PXA OHCI platform data and add a
default value for the spitz platform(s) which prevents known failures
with certain USB devices.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
a5e36d20897ff8317e722fceb4d9eea3e4a5906b 28-Nov-2005 Richard Purdie <rpurdie@rpsys.net> [PATCH] USB: Correct ohci-pxa27x suspend/resume struct confusion

The device data in ohci-pxa27x is a struct hcd, not a struct ohci_hcd.
This correct the suspend/resume calls to account for this and adds some
code to invalidate the platform data when the module is removed.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2e1dcc1600c1d83b26479edd076866595bbd3523 12-Nov-2005 Richard Purdie <rpurdie@rpsys.net> [PATCH] USB: Add pxa27x OHCI PM functions

Add power management functions for the pxa27x USB OHCI host controller.
This is a totally rewritten version of the patch by Nicolas Pitre and
Todd Poynor which accounts for recent USB changes.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
81f280e22f14d6d976620acaa1b346a90f4e1adc 12-Nov-2005 Richard Purdie <rpurdie@rpsys.net> [PATCH] USB: pxa27x OHCI - Separate platform code from main driver

To allow multiple platforms to use the PXA27x OHCI driver, the platform
code needs to be moved into the board specific files in
arch/arm/mach-pxa. This patch does this for mainstone and adds
preliminary hooks to allow other boards to use the driver.

This has been compile tested for mainstone and successfully run on Spitz
(Sharp Zaurus SL-C3000) with the addition of an appropriate board
support file.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 09-Nov-2005 Russell King <rmk@dyn-67.arm.linux.org.uk> [DRIVER MODEL] Convert platform drivers to use struct platform_driver

This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
4e57b6817880946a3a78d5d8cad1ace363f7e449 31-Oct-2005 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] fix missing includes

I recently picked up my older work to remove unnecessary #includes of
sched.h, starting from a patch by Dave Jones to not include sched.h
from module.h. This reduces the number of indirect includes of sched.h
by ~300. Another ~400 pointless direct includes can be removed after
this disentangling (patch to follow later).
However, quite a few indirect includes need to be fixed up for this.

In order to feed the patches through -mm with as little disturbance as
possible, I've split out the fixes I accumulated up to now (complete for
i386 and x86_64, more archs to follow later) and post them before the real
patch. This way this large part of the patch is kept simple with only
adding #includes, and all hunks are independent of each other. So if any
hunk rejects or gets in the way of other patches, just drop it. My scripts
will pick it up again in the next round.

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
d052d1beff706920e82c5d55006b08e256b5df09 29-Oct-2005 Russell King <rmk@dyn-67.arm.linux.org.uk> Create platform_device.h to contain all the platform device details.
Convert everyone who uses platform_bus_type to include
linux/platform_device.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
0c0382e32d46f606951010b202382be14d180a17 13-Oct-2005 Alan Stern <stern@rowland.harvard.edu> [PATCH] USB: Rename hcd->hub_suspend to hcd->bus_suspend

This patch (as580) is perhaps the only result from the long discussion I
had with David about his changes to the root-hub suspend/resume code. It
renames the hub_suspend and hub_resume methods in struct usb_hcd to
bus_suspend and bus_resume. These are more descriptive names, since the
methods really do suspend or resume an entire USB bus, and less likely to
be confused with the hub_suspend and hub_resume routines in hub.c.

It also takes David's advice about removing the layer of bus glue, where
those methods are called. And it implements a related change that David
made to the other HCDs but forgot to put into dummy_hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9293677af3dace2645dec0d0808efa02d36bf47b 23-Sep-2005 David Brownell <david-b@pacbell.net> [PATCH] all HCDs provide root hub suspend/resume methods

This cleans up a small recent FIXME, ensuring that all the HCDs provide
root hub suspend/resume methods. It also wraps the calls to those root
suspend routines just like on the PCI "USB_SUSPEND not defined" cases,
so non-PCI bus glue won't be as tempted to behave very differently.

Several of the SOC based OHCI drivers forgot to list those methods;
the patch also adds those missing declarations.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

drivers/usb/core/hcd.c | 42 +++++++++++++++++++++++++---------------
drivers/usb/host/ohci-au1xxx.c | 5 ++++
drivers/usb/host/ohci-lh7a404.c | 5 ++++
drivers/usb/host/ohci-pxa27x.c | 1
drivers/usb/host/ohci-s3c2410.c | 1
drivers/usb/host/ohci-sa1111.c | 1
6 files changed, 40 insertions(+), 15 deletions(-)
8ad7fe16df5e07320626be83fbba6d1c6bda5ec0 14-Sep-2005 David Brownell <david-b@pacbell.net> [PATCH] remove some USB_SUSPEND dependencies

This simplifies some of the PM-related #ifdeffing by recognizing
that USB_SUSPEND depends on PM. Also, OHCI drivers were often
testing for USB_SUSPEND when they should have tested just PM.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

drivers/usb/core/hcd.c | 2 ++
drivers/usb/host/ohci-hcd.c | 2 +-
drivers/usb/host/ohci-hub.c | 4 ++--
drivers/usb/host/ohci-omap.c | 2 +-
drivers/usb/host/ohci-pci.c | 2 +-
drivers/usb/host/ohci-ppc-soc.c | 4 ++--
drivers/usb/host/ohci-pxa27x.c | 2 +-
drivers/usb/host/ohci-s3c2410.c | 3 +--
drivers/usb/host/ohci-sa1111.c | 2 +-
9 files changed, 12 insertions(+), 11 deletions(-)
9480e307cd88ef09ec9294c7d97ebec18e6d2221 28-Oct-2005 Russell King <rmk@arm.linux.org.uk> [PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks

In PM v1, all devices were called at SUSPEND_DISABLE level. Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.

Since this is obsolete infrastructure which is no longer necessary,
we can remove it. Here's an (untested) patch to do exactly that.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
155faf5e1e36ca3a6127bdfb5c624d58e520c411 31-Aug-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: OHCI, pxa27x OHCI port power tweaks

Now that it's in use on other boards, a bug in the original code needs fixing.

There is no need for the PXA27x OHCI to set usb power during init, since
the hub driver in usbcore handles that. Those platform-specific power
control functions are also incorrect, and should therefore be removed.

Add a check to clear the OTG pin hold bit until such times OTG is
properly implemented.

Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fdd13b36c4a501d8787a27e54635fbd943f2685d 31-Aug-2005 David Brownell <david-b@pacbell.net> [PATCH] USB: OHCI relies less on NDP register

Some OHCI implementations have differences in the way the NDP register
(in roothub_a) reports the number of ports present. This patch allows the
platform specific code to optionally supply the number of ports. The
driver just reads the value at init (if not supplied) instead of reading
it every time its needed (except for an AMD756 bug workaround).

It also sets the value correctly for the ARM pxa27x architecture.

Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ba9d35fb01852e195f2a4ca975fdcd6578b52c78 19-Apr-2005 Pavel Machek <pavel@suse.cz> [PATCH] USB: fix up remaining pm_message_t usages

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!