aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorKeshava Munegowda <keshava_mgowda@ti.com>2010-11-21 12:53:40 -0500
committerAnand Gadiyar <gadiyar@ti.com>2010-11-30 16:02:01 -0500
commitc072604115ab50d023eb5c33d4f3229400e441f4 (patch)
treed4ab8ddd939386b0f236362671494cd243689114 /drivers/usb/host
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')
-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 d042bdefa2bd..d60efdc9b142 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -191,13 +191,14 @@ struct ehci_hcd_omap {
191 191
192/*-------------------------------------------------------------------------*/ 192/*-------------------------------------------------------------------------*/
193 193
194static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask) 194static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask,
195 u8 tll_channel_count)
195{ 196{
196 unsigned reg; 197 unsigned reg;
197 int i; 198 int i;
198 199
199 /* Program the 3 TLL channels upfront */ 200 /* Program the 3 TLL channels upfront */
200 for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) { 201 for (i = 0; i < tll_channel_count; i++) {
201 reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i)); 202 reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i));
202 203
203 /* Disable AutoIdle, BitStuffing and use SDR Mode */ 204 /* 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)
217 ehci_omap_writel(omap->tll_base, OMAP_TLL_SHARED_CONF, reg); 218 ehci_omap_writel(omap->tll_base, OMAP_TLL_SHARED_CONF, reg);
218 219
219 /* Enable channels now */ 220 /* Enable channels now */
220 for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) { 221 for (i = 0; i < tll_channel_count; i++) {
221 reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i)); 222 reg = ehci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i));
222 223
223 /* Enable only the reg that is needed */ 224 /* 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)
438 tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK; 439 tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK;
439 440
440 /* Enable UTMI mode for required TLL channels */ 441 /* Enable UTMI mode for required TLL channels */
441 omap_usb_utmi_init(omap, tll_ch_mask); 442 omap_usb_utmi_init(omap, tll_ch_mask, OMAP_TLL_CHANNEL_COUNT);
442 } 443 }
443 444
444 if (omap->phy_reset) { 445 if (omap->phy_reset) {