Commit Graph

5 Commits

Author SHA1 Message Date
Felipe Balbi 1494a1f62b usb: common: introduce of_usb_get_maximum_speed()
this helper will be used for controllers which
want to work at a lower speed even though they
support higher USB transfer rates.

One such case is Texas Instruments' AM437x
SoC where it uses a USB3 controller without
a USB3 PHY, rendering the controller USB2-only.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-07-29 13:56:46 +03:00
Michael Grzeschik 1c9af65357 usb: add devicetree helpers for determining dr_mode and phy_type
This adds two little devicetree helper functions for determining the
dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from
the devicetree.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 13:47:09 -07:00
Felipe Balbi 7009bdd7f3 usb: otg: move usb_otg_state_string to usb-common.c
otg.c only had a single function definition
which might make more sense to be placed in
usb-common.c. While doing that, we also delete
otg.c since it's now empty.

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:18:03 +02:00
Felipe Balbi d1e3d757f7 usb: common: introduce usb_state_string()
this function will receive enum usb_device_state
and return a human-readable string from it or,
case an unknown value is passed as argument,
the string "UNKNOWN".

Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-18 11:17:11 +02:00
Michal Nazarewicz e538dfdae8 usb: Provide usb_speed_string() function
In a few places in the kernel, the code prints
a human-readable USB device speed (eg. "high speed").
This involves a switch statement sometimes wrapped
around in ({ ... }) block leading to code repetition.

To mitigate this issue, this commit introduces
usb_speed_string() function, which returns
a human-readable name of provided speed.

It also changes a few places switch was used to use
this new function.  This changes a bit the way the
speed is printed in few instances at the same time
standardising it.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-18 01:29:04 -07:00