mfd: omap-usb-tll: Avoid creating copy of platform data

Just a pointer to the platform data should suffice.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-tll: Clean up clock handling

Every channel has a functional clock that is similarly named.
It makes sense to use a for loop to manage these clocks as OMAPs
can come with upto 3 channels.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-tll: introduce and use mode_needs_tll()

This is a handy macro to check if the port requires the
USB TLL module or not. Use it to Enable the TLL module and manage
the clocks.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-tll: Move port clock handling out of runtime ops

The port clocks are not required to access the port registers,
they are only needed when the PORT is used. So we move the port clock
handling code to omap_tll_enable/disable().

Also get of unnecessary spinlock code in probe function and check for
missing platform data.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-tll: Add OMAP5 revision and HSIC support

The TLL module on OMAP5 has 3 channels.
HSIC mode requires the TLL channel to be in Transparent UTMI mode.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: cleanup clock management code

All ports have similarly named port clocks so we can
bunch them into a port data structure and use for loop
to enable/disable the clocks.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap_usb_host: Avoid creating copy of platform_data

We can just hold the pointer to the platform data instead
of creating a copy of it.

Also get rid of the unnecessary missing platform data checks
in runtime_suspend/resume. We are already checking for missing
platform data in probe.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: know about number of ports from revision register

prevents getting clocks that don't exist on the platform.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: override number of ports from platform data

For some platforms e.g. OMAP5, we cannot rely on USBHOST revision
to determine the number of ports available. In such cases we have
to rely on platform data (or FDT) to give us the right number of
ports.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: Intialize all available ports

OMAPs till date can have upto 3 ports. We need to initialize
the port mode in HOSTCONFIG register for all of them.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: Manage HSIC clocks for HSIC mode

Enable the optional HSIC clocks (60MHz and 480MHz) for the ports
that are configured in HSIC mode.

Signed-off-by: Roger Quadros <rogerq@ti.com>
ARM: OMAP2+: clock data: Merge utmi_px_gfclk into usb_host_hs_utmi_px_clk

There is no such clock as utmi_p1_gfclk. It is only a clock selector
bit to select th the parent of usb_host_hs_utmi_p1_clk.
So we get rid of utmi_p1_gfclk and utmi_p2_gfclk by merging them into
usb_host_hs_utmi_p1_clk and usb_host_hs_utmi_p2_clk respectively.

CC: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: Get rid of unnecessary spinlock

We don't really need a spinlock here, so get rid of it.

Signed-off-by: Roger Quadros <rogerq@ti.com>
mfd: omap-usb-host: Support an auxiliary clock per port

Boards like Panda require an auxiliary clock to clock the PHY
that is connected to one of the USB ports. This patch enables
board support code to  provide the name and the rate of such
a clock for each of the USB ports. omap-usb-host driver can
then manage the clock.

Signed-off-by: Roger Quadros <rogerq@ti.com>
ARM: OMAP4: omap4panda: Don't enable USB PHY clock from board

Instead of enabling the USB PHY clock in the board file we
provide the PHY clock details to the driver via board platform
data so that driver code can manage the clock.

Signed-off-by: Roger Quadros <rogerq@ti.com>
ARM: OMAP: omap4panda: Power down the USB PHY and ETH when not in use

This patch changes the management of the two GPIO for
"hub reset" (actually controls enable of ULPI PHY and hub reset) and
"hub power" (controls power to hub + eth).

Because the only connection from the ULPI PHY output is to the hub+eth
chip, there is no meaning in having the ULPI PHY running but not the
hub+eth chip.

The patch adds two regulators, the hub power one being the parent of the
reset one, and binds the reset one to the hsusb driver by using the magic
name "hsusb.0".

The end result is the usb and eth driver may now be built modular, and
when ehci-hcd is not inserted, the ULPI PHY, hub and ethernet are all
depowered or held in reset.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
ARM: OMAP: usb-host: Device tree support for USB Host

Provides a means for the OMAP USB host subsystem to be initialized
from Device tree. This is a first step for device tree migration where
we specify only the board specific stuff. Things like I/O address space
and interrupts are not yet specified in the device tree but can be
done as a next step.

This patch will allow boards to be booted with our without device tree
and have USB host functional.

Signed-off-by: Roger Quadros <rogerq@ti.com>
ARM: OMAP4: USB: Add pin mux configuration for panda board

The port1 of omap4 panda board is used in ULPI PHY mode.
The pin mux of usbhs (usbb1) port 1 is configured accordingly.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
ARM/dts: omap4-panda: Add USB Host support

Get USB Host working. On Panda, two GPIOs are used, one for
HUB/PHY reset and other for Hub power. We model them as fixed
regulators. The regulator for RESET is made to depend on regulator
for Hub power so that the Hub power is enabled by the regulator
framework before RESET is removed.

Tested on Panda ES B1.

Signed-off-by: Roger Quadros <rogerq@ti.com>
regulator: fixed: Properly use input_supply parameter from device tree

The device tree node will provide the input supply name as
a string. Use that to populate the supply_name parameter of
the regulator descriptor.

Also correct the documentation to reflect the same.

Signed-off-by: Roger Quadros <rogerq@ti.com>
CC: Laxman Dewangan <ldewangan@nvidia.com>
CC: Mark Brown <broonie@opensource.wolfsonmicro.com>