aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorKeshava Munegowda <keshava_mgowda@ti.com>2011-03-01 09:38:16 -0500
committerFelipe Balbi <balbi@ti.com>2011-03-01 10:01:11 -0500
commit181b250cf53233a7a7c6d7e1e9df402506712e93 (patch)
tree476b60593f7b646bdc1e0d56cd38368bed31fe4d /drivers/usb
parenta8480ea0bedbf049423a4caa9b09d371614c07dc (diff)
arm: omap: usb: create common enums and structures for ehci and ohci
Create the ehci and ohci specific platform data structures. The port enum values are made common for both ehci and ohci. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-omap.c42
-rw-r--r--drivers/usb/host/ohci-omap3.c22
2 files changed, 32 insertions, 32 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 15277213f928..18df6c6a5803 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -155,9 +155,9 @@
155#define is_omap_ehci_rev1(x) (x->omap_ehci_rev == OMAP_EHCI_REV1) 155#define is_omap_ehci_rev1(x) (x->omap_ehci_rev == OMAP_EHCI_REV1)
156#define is_omap_ehci_rev2(x) (x->omap_ehci_rev == OMAP_EHCI_REV2) 156#define is_omap_ehci_rev2(x) (x->omap_ehci_rev == OMAP_EHCI_REV2)
157 157
158#define is_ehci_phy_mode(x) (x == EHCI_HCD_OMAP_MODE_PHY) 158#define is_ehci_phy_mode(x) (x == OMAP_EHCI_PORT_MODE_PHY)
159#define is_ehci_tll_mode(x) (x == EHCI_HCD_OMAP_MODE_TLL) 159#define is_ehci_tll_mode(x) (x == OMAP_EHCI_PORT_MODE_TLL)
160#define is_ehci_hsic_mode(x) (x == EHCI_HCD_OMAP_MODE_HSIC) 160#define is_ehci_hsic_mode(x) (x == OMAP_EHCI_PORT_MODE_HSIC)
161 161
162/*-------------------------------------------------------------------------*/ 162/*-------------------------------------------------------------------------*/
163 163
@@ -220,7 +220,7 @@ struct ehci_hcd_omap {
220 u32 omap_ehci_rev; 220 u32 omap_ehci_rev;
221 221
222 /* desired phy_mode: TLL, PHY */ 222 /* desired phy_mode: TLL, PHY */
223 enum ehci_hcd_omap_mode port_mode[OMAP3_HS_USB_PORTS]; 223 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
224 224
225 void __iomem *uhh_base; 225 void __iomem *uhh_base;
226 void __iomem *tll_base; 226 void __iomem *tll_base;
@@ -389,7 +389,7 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
389 */ 389 */
390 if (is_omap_ehci_rev2(omap)) { 390 if (is_omap_ehci_rev2(omap)) {
391 switch (omap->port_mode[0]) { 391 switch (omap->port_mode[0]) {
392 case EHCI_HCD_OMAP_MODE_PHY: 392 case OMAP_EHCI_PORT_MODE_PHY:
393 omap->xclk60mhsp1_ck = clk_get(omap->dev, 393 omap->xclk60mhsp1_ck = clk_get(omap->dev,
394 "xclk60mhsp1_ck"); 394 "xclk60mhsp1_ck");
395 if (IS_ERR(omap->xclk60mhsp1_ck)) { 395 if (IS_ERR(omap->xclk60mhsp1_ck)) {
@@ -413,7 +413,7 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
413 "Unable to set P1 f-clock\n"); 413 "Unable to set P1 f-clock\n");
414 } 414 }
415 break; 415 break;
416 case EHCI_HCD_OMAP_MODE_TLL: 416 case OMAP_EHCI_PORT_MODE_TLL:
417 omap->xclk60mhsp1_ck = clk_get(omap->dev, 417 omap->xclk60mhsp1_ck = clk_get(omap->dev,
418 "init_60m_fclk"); 418 "init_60m_fclk");
419 if (IS_ERR(omap->xclk60mhsp1_ck)) { 419 if (IS_ERR(omap->xclk60mhsp1_ck)) {
@@ -463,7 +463,7 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
463 break; 463 break;
464 } 464 }
465 switch (omap->port_mode[1]) { 465 switch (omap->port_mode[1]) {
466 case EHCI_HCD_OMAP_MODE_PHY: 466 case OMAP_EHCI_PORT_MODE_PHY:
467 omap->xclk60mhsp2_ck = clk_get(omap->dev, 467 omap->xclk60mhsp2_ck = clk_get(omap->dev,
468 "xclk60mhsp2_ck"); 468 "xclk60mhsp2_ck");
469 if (IS_ERR(omap->xclk60mhsp2_ck)) { 469 if (IS_ERR(omap->xclk60mhsp2_ck)) {
@@ -487,7 +487,7 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
487 "Unable to set P2 f-clock\n"); 487 "Unable to set P2 f-clock\n");
488 } 488 }
489 break; 489 break;
490 case EHCI_HCD_OMAP_MODE_TLL: 490 case OMAP_EHCI_PORT_MODE_TLL:
491 omap->xclk60mhsp2_ck = clk_get(omap->dev, 491 omap->xclk60mhsp2_ck = clk_get(omap->dev,
492 "init_60m_fclk"); 492 "init_60m_fclk");
493 if (IS_ERR(omap->xclk60mhsp2_ck)) { 493 if (IS_ERR(omap->xclk60mhsp2_ck)) {
@@ -591,11 +591,11 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
591 reg &= ~OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN; 591 reg &= ~OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN;
592 592
593 if (is_omap_ehci_rev1(omap)) { 593 if (is_omap_ehci_rev1(omap)) {
594 if (omap->port_mode[0] == EHCI_HCD_OMAP_MODE_UNKNOWN) 594 if (omap->port_mode[0] == OMAP_USBHS_PORT_MODE_UNUSED)
595 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS; 595 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS;
596 if (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_UNKNOWN) 596 if (omap->port_mode[1] == OMAP_USBHS_PORT_MODE_UNUSED)
597 reg &= ~OMAP_UHH_HOSTCONFIG_P2_CONNECT_STATUS; 597 reg &= ~OMAP_UHH_HOSTCONFIG_P2_CONNECT_STATUS;
598 if (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_UNKNOWN) 598 if (omap->port_mode[2] == OMAP_USBHS_PORT_MODE_UNUSED)
599 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS; 599 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS;
600 600
601 /* Bypass the TLL module for PHY mode operation */ 601 /* Bypass the TLL module for PHY mode operation */
@@ -656,15 +656,15 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
656 ehci_omap_writel(omap->ehci_base, EHCI_INSNREG04, 656 ehci_omap_writel(omap->ehci_base, EHCI_INSNREG04,
657 EHCI_INSNREG04_DISABLE_UNSUSPEND); 657 EHCI_INSNREG04_DISABLE_UNSUSPEND);
658 658
659 if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) || 659 if ((omap->port_mode[0] == OMAP_EHCI_PORT_MODE_TLL) ||
660 (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) || 660 (omap->port_mode[1] == OMAP_EHCI_PORT_MODE_TLL) ||
661 (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)) { 661 (omap->port_mode[2] == OMAP_EHCI_PORT_MODE_TLL)) {
662 662
663 if (omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) 663 if (omap->port_mode[0] == OMAP_EHCI_PORT_MODE_TLL)
664 tll_ch_mask |= OMAP_TLL_CHANNEL_1_EN_MASK; 664 tll_ch_mask |= OMAP_TLL_CHANNEL_1_EN_MASK;
665 if (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) 665 if (omap->port_mode[1] == OMAP_EHCI_PORT_MODE_TLL)
666 tll_ch_mask |= OMAP_TLL_CHANNEL_2_EN_MASK; 666 tll_ch_mask |= OMAP_TLL_CHANNEL_2_EN_MASK;
667 if (omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL) 667 if (omap->port_mode[2] == OMAP_EHCI_PORT_MODE_TLL)
668 tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK; 668 tll_ch_mask |= OMAP_TLL_CHANNEL_3_EN_MASK;
669 669
670 /* Enable UTMI mode for required TLL channels */ 670 /* Enable UTMI mode for required TLL channels */
@@ -686,9 +686,9 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)
686 } 686 }
687 687
688 /* Soft reset the PHY using PHY reset command over ULPI */ 688 /* Soft reset the PHY using PHY reset command over ULPI */
689 if (omap->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) 689 if (omap->port_mode[0] == OMAP_EHCI_PORT_MODE_PHY)
690 omap_ehci_soft_phy_reset(omap, 0); 690 omap_ehci_soft_phy_reset(omap, 0);
691 if (omap->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) 691 if (omap->port_mode[1] == OMAP_EHCI_PORT_MODE_PHY)
692 omap_ehci_soft_phy_reset(omap, 1); 692 omap_ehci_soft_phy_reset(omap, 1);
693 693
694 return 0; 694 return 0;
@@ -903,7 +903,7 @@ static const struct hc_driver ehci_omap_hc_driver;
903 */ 903 */
904static int ehci_hcd_omap_probe(struct platform_device *pdev) 904static int ehci_hcd_omap_probe(struct platform_device *pdev)
905{ 905{
906 struct ehci_hcd_omap_platform_data *pdata = pdev->dev.platform_data; 906 struct usbhs_omap_board_data *pdata = pdev->dev.platform_data;
907 struct ehci_hcd_omap *omap; 907 struct ehci_hcd_omap *omap;
908 struct resource *res; 908 struct resource *res;
909 struct usb_hcd *hcd; 909 struct usb_hcd *hcd;
@@ -981,7 +981,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
981 981
982 /* get ehci regulator and enable */ 982 /* get ehci regulator and enable */
983 for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { 983 for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
984 if (omap->port_mode[i] != EHCI_HCD_OMAP_MODE_PHY) { 984 if (omap->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
985 omap->regulator[i] = NULL; 985 omap->regulator[i] = NULL;
986 continue; 986 continue;
987 } 987 }
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 32f56bbec214..3f9db87fe525 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -141,7 +141,7 @@ struct ohci_hcd_omap3 {
141 struct clk *usbtll_ick; 141 struct clk *usbtll_ick;
142 142
143 /* port_mode: TLL/PHY, 2/3/4/6-PIN, DP-DM/DAT-SE0 */ 143 /* port_mode: TLL/PHY, 2/3/4/6-PIN, DP-DM/DAT-SE0 */
144 enum ohci_omap3_port_mode port_mode[OMAP3_HS_USB_PORTS]; 144 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
145 void __iomem *uhh_base; 145 void __iomem *uhh_base;
146 void __iomem *tll_base; 146 void __iomem *tll_base;
147 void __iomem *ohci_base; 147 void __iomem *ohci_base;
@@ -206,10 +206,10 @@ static int ohci_omap3_start(struct usb_hcd *hcd)
206 * convert the port-mode enum to a value we can use in the FSLSMODE 206 * convert the port-mode enum to a value we can use in the FSLSMODE
207 * field of USBTLL_CHANNEL_CONF 207 * field of USBTLL_CHANNEL_CONF
208 */ 208 */
209static unsigned ohci_omap3_fslsmode(enum ohci_omap3_port_mode mode) 209static unsigned ohci_omap3_fslsmode(enum usbhs_omap_port_mode mode)
210{ 210{
211 switch (mode) { 211 switch (mode) {
212 case OMAP_OHCI_PORT_MODE_UNUSED: 212 case OMAP_USBHS_PORT_MODE_UNUSED:
213 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: 213 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
214 return 0x0; 214 return 0x0;
215 215
@@ -266,7 +266,7 @@ static void ohci_omap3_tll_config(struct ohci_hcd_omap3 *omap)
266 for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) { 266 for (i = 0; i < OMAP_TLL_CHANNEL_COUNT; i++) {
267 267
268 /* Enable only those channels that are actually used */ 268 /* Enable only those channels that are actually used */
269 if (omap->port_mode[i] == OMAP_OHCI_PORT_MODE_UNUSED) 269 if (omap->port_mode[i] == OMAP_USBHS_PORT_MODE_UNUSED)
270 continue; 270 continue;
271 271
272 reg = ohci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i)); 272 reg = ohci_omap_readl(omap->tll_base, OMAP_TLL_CHANNEL_CONF(i));
@@ -382,11 +382,11 @@ static int omap3_start_ohci(struct ohci_hcd_omap3 *omap, struct usb_hcd *hcd)
382 * 382 *
383 * For now, turn off all the Pi_CONNECT_STATUS bits 383 * For now, turn off all the Pi_CONNECT_STATUS bits
384 * 384 *
385 if (omap->port_mode[0] == OMAP_OHCI_PORT_MODE_UNUSED) 385 if (omap->port_mode[0] == OMAP_USBHS_PORT_MODE_UNUSED)
386 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS; 386 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS;
387 if (omap->port_mode[1] == OMAP_OHCI_PORT_MODE_UNUSED) 387 if (omap->port_mode[1] == OMAP_USBHS_PORT_MODE_UNUSED)
388 reg &= ~OMAP_UHH_HOSTCONFIG_P2_CONNECT_STATUS; 388 reg &= ~OMAP_UHH_HOSTCONFIG_P2_CONNECT_STATUS;
389 if (omap->port_mode[2] == OMAP_OHCI_PORT_MODE_UNUSED) 389 if (omap->port_mode[2] == OMAP_USBHS_PORT_MODE_UNUSED)
390 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS; 390 reg &= ~OMAP_UHH_HOSTCONFIG_P3_CONNECT_STATUS;
391 */ 391 */
392 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS; 392 reg &= ~OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS;
@@ -403,17 +403,17 @@ static int omap3_start_ohci(struct ohci_hcd_omap3 *omap, struct usb_hcd *hcd)
403 reg |= OMAP_UHH_HOSTCONFIG_ULPI_BYPASS; 403 reg |= OMAP_UHH_HOSTCONFIG_ULPI_BYPASS;
404 } else { 404 } else {
405 dev_dbg(omap->dev, "OMAP3 ES version > ES2.1\n"); 405 dev_dbg(omap->dev, "OMAP3 ES version > ES2.1\n");
406 if (omap->port_mode[0] == OMAP_OHCI_PORT_MODE_UNUSED) 406 if (omap->port_mode[0] == OMAP_USBHS_PORT_MODE_UNUSED)
407 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS; 407 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS;
408 else 408 else
409 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS; 409 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS;
410 410
411 if (omap->port_mode[1] == OMAP_OHCI_PORT_MODE_UNUSED) 411 if (omap->port_mode[1] == OMAP_USBHS_PORT_MODE_UNUSED)
412 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS; 412 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS;
413 else 413 else
414 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS; 414 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS;
415 415
416 if (omap->port_mode[2] == OMAP_OHCI_PORT_MODE_UNUSED) 416 if (omap->port_mode[2] == OMAP_USBHS_PORT_MODE_UNUSED)
417 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS; 417 reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS;
418 else 418 else
419 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS; 419 reg |= OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS;
@@ -580,7 +580,7 @@ static const struct hc_driver ohci_omap3_hc_driver = {
580 */ 580 */
581static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev) 581static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
582{ 582{
583 struct ohci_hcd_omap_platform_data *pdata = pdev->dev.platform_data; 583 struct usbhs_omap_board_data *pdata = pdev->dev.platform_data;
584 struct ohci_hcd_omap3 *omap; 584 struct ohci_hcd_omap3 *omap;
585 struct resource *res; 585 struct resource *res;
586 struct usb_hcd *hcd; 586 struct usb_hcd *hcd;