aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-omap.c
diff options
context:
space:
mode:
authorKeshava Munegowda <keshava_mgowda@ti.com>2010-11-21 23:23:40 +0530
committerAnand Gadiyar <gadiyar@ti.com>2010-12-01 02:32:01 +0530
commitc072604115ab50d023eb5c33d4f3229400e441f4 (patch)
treed4ab8ddd939386b0f236362671494cd243689114 /drivers/usb/host/ehci-omap.c
parent6dba39e278b81665a838f37a75fe37b89f3ce610 (diff)
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>
Diffstat (limited to 'drivers/usb/host/ehci-omap.c')
-rw-r--r--drivers/usb/host/ehci-omap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index d042bdefa2b..d60efdc9b14 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -191,13 +191,14 @@ struct ehci_hcd_omap {
/*-------------------------------------------------------------------------*/
-static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)
+static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask,
+ u8 tll_channel_count)
{
unsigned reg;
int i;
/* Program the 3 TLL channels upfront */
- for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) {
+ for (i = 0; i < tll_channel_count; i++) {
reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i));
/* Disable AutoIdle, BitStuffing and use SDR Mode */
@@ -217,7 +218,7 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)
ehci_omap_writel(omap->tll_base, OMAP_TLL_SHARED_CONF, reg);
/* Enable channels now */
- for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) {
+ for (i = 0; i < tll_channel_count; i++) {
reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i));
/* Enable only the reg that is needed */
@@ -438,7 +439,7 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK;
/* Enable UTMI mode for required TLL channels */
- omap_usb_utmi_init(omap, tll_ch_mask);
+ omap_usb_utmi_init(omap, tll_ch_mask, OMAP_TLL_CHANNEL_COUNT);
}
if (omap->phy_reset) {