aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ohci-pxa27x.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 7f0f35c78185..2a7d5e0965d7 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -76,6 +76,41 @@ extern int usb_disabled(void);
76 76
77/*-------------------------------------------------------------------------*/ 77/*-------------------------------------------------------------------------*/
78 78
79static inline void pxa27x_setup_hc(struct pxaohci_platform_data *inf)
80{
81 uint32_t uhchr = UHCHR;
82 uint32_t uhcrhda = UHCRHDA;
83
84 if (inf->flags & ENABLE_PORT1)
85 uhchr &= ~UHCHR_SSEP1;
86
87 if (inf->flags & ENABLE_PORT2)
88 uhchr &= ~UHCHR_SSEP2;
89
90 if (inf->flags & ENABLE_PORT3)
91 uhchr &= ~UHCHR_SSEP3;
92
93 if (inf->flags & POWER_CONTROL_LOW)
94 uhchr |= UHCHR_PCPL;
95
96 if (inf->flags & POWER_SENSE_LOW)
97 uhchr |= UHCHR_PSPL;
98
99 if (inf->flags & NO_OC_PROTECTION)
100 uhcrhda |= UHCRHDA_NOCP;
101
102 if (inf->flags & OC_MODE_PERPORT)
103 uhcrhda |= UHCRHDA_OCPM;
104
105 if (inf->power_on_delay) {
106 uhcrhda &= ~UHCRHDA_POTPGT(0xff);
107 uhcrhda |= UHCRHDA_POTPGT(inf->power_on_delay / 2);
108 }
109
110 UHCHR = uhchr;
111 UHCRHDA = uhcrhda;
112}
113
79static int pxa27x_start_hc(struct device *dev) 114static int pxa27x_start_hc(struct device *dev)
80{ 115{
81 int retval = 0; 116 int retval = 0;
@@ -93,6 +128,8 @@ static int pxa27x_start_hc(struct device *dev)
93 while (UHCHR & UHCHR_FSBIR) 128 while (UHCHR & UHCHR_FSBIR)
94 cpu_relax(); 129 cpu_relax();
95 130
131 pxa27x_setup_hc(inf);
132
96 if (inf->init) 133 if (inf->init)
97 retval = inf->init(dev); 134 retval = inf->init(dev);
98 135