diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-08-29 21:29:28 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-09-10 17:03:13 -0400 |
commit | 0af4316babb64c6703c113a89462ff7843767f24 (patch) | |
tree | 0e35e9edb39662572649ebcbe71c96017017ecf3 | |
parent | c6a389f123b9f68d605bb7e0f9b32ec1e3e14132 (diff) |
at91: ohci-at91: always provide all the clocks
Remove the cpu_is_at91xxxx() macros in the ohci-at91 driver.
SoCs at91sam9261 and at91sam9g10 expect one additional clock: hck0.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r-- | arch/arm/mach-at91/at91cap9.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91rm9200.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 15 |
7 files changed, 30 insertions, 24 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c index bfc684441ef8..ecdd54dd68c6 100644 --- a/arch/arm/mach-at91/at91cap9.c +++ b/arch/arm/mach-at91/at91cap9.c | |||
@@ -219,6 +219,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
219 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | 219 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
220 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 220 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
221 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 221 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
222 | /* fake hclk clock */ | ||
223 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | ||
222 | }; | 224 | }; |
223 | 225 | ||
224 | static struct clk_lookup usart_clocks_lookups[] = { | 226 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index f73302dbc6a5..713d3bdbd284 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -193,6 +193,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
193 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 193 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
194 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 194 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
195 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 195 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
196 | /* fake hclk clock */ | ||
197 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | ||
196 | }; | 198 | }; |
197 | 199 | ||
198 | static struct clk_lookup usart_clocks_lookups[] = { | 200 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index cb397be14448..a9be75825e34 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -199,6 +199,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
199 | CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk), | 199 | CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk), |
200 | CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk), | 200 | CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk), |
201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), | 201 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), |
202 | /* fake hclk clock */ | ||
203 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | ||
202 | }; | 204 | }; |
203 | 205 | ||
204 | static struct clk_lookup usart_clocks_lookups[] = { | 206 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index d522b47e30b5..176838cf2e78 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -129,6 +129,20 @@ static struct clk lcdc_clk = { | |||
129 | .type = CLK_TYPE_PERIPHERAL, | 129 | .type = CLK_TYPE_PERIPHERAL, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | /* HClocks */ | ||
133 | static struct clk hck0 = { | ||
134 | .name = "hck0", | ||
135 | .pmc_mask = AT91_PMC_HCK0, | ||
136 | .type = CLK_TYPE_SYSTEM, | ||
137 | .id = 0, | ||
138 | }; | ||
139 | static struct clk hck1 = { | ||
140 | .name = "hck1", | ||
141 | .pmc_mask = AT91_PMC_HCK1, | ||
142 | .type = CLK_TYPE_SYSTEM, | ||
143 | .id = 1, | ||
144 | }; | ||
145 | |||
132 | static struct clk *periph_clocks[] __initdata = { | 146 | static struct clk *periph_clocks[] __initdata = { |
133 | &pioA_clk, | 147 | &pioA_clk, |
134 | &pioB_clk, | 148 | &pioB_clk, |
@@ -161,6 +175,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
161 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 175 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
162 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 176 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
163 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 177 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
178 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), | ||
164 | }; | 179 | }; |
165 | 180 | ||
166 | static struct clk_lookup usart_clocks_lookups[] = { | 181 | static struct clk_lookup usart_clocks_lookups[] = { |
@@ -199,20 +214,6 @@ static struct clk pck3 = { | |||
199 | .id = 3, | 214 | .id = 3, |
200 | }; | 215 | }; |
201 | 216 | ||
202 | /* HClocks */ | ||
203 | static struct clk hck0 = { | ||
204 | .name = "hck0", | ||
205 | .pmc_mask = AT91_PMC_HCK0, | ||
206 | .type = CLK_TYPE_SYSTEM, | ||
207 | .id = 0, | ||
208 | }; | ||
209 | static struct clk hck1 = { | ||
210 | .name = "hck1", | ||
211 | .pmc_mask = AT91_PMC_HCK1, | ||
212 | .type = CLK_TYPE_SYSTEM, | ||
213 | .id = 1, | ||
214 | }; | ||
215 | |||
216 | static void __init at91sam9261_register_clocks(void) | 217 | static void __init at91sam9261_register_clocks(void) |
217 | { | 218 | { |
218 | int i; | 219 | int i; |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 044f3c927e64..f83fbb0ee0c5 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -189,6 +189,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
189 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | 189 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), |
190 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 190 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
191 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | 191 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
192 | /* fake hclk clock */ | ||
193 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | ||
192 | }; | 194 | }; |
193 | 195 | ||
194 | static struct clk_lookup usart_clocks_lookups[] = { | 196 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index e04c5fb6f1ee..8f5db7b9e6ea 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -215,6 +215,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
215 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), | 215 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), |
216 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 216 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
217 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 217 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
218 | /* fake hclk clock */ | ||
219 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), | ||
218 | }; | 220 | }; |
219 | 221 | ||
220 | static struct clk_lookup usart_clocks_lookups[] = { | 222 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 944291e10f97..e08cb10d1aca 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -35,8 +35,7 @@ extern int usb_disabled(void); | |||
35 | 35 | ||
36 | static void at91_start_clock(void) | 36 | static void at91_start_clock(void) |
37 | { | 37 | { |
38 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) | 38 | clk_enable(hclk); |
39 | clk_enable(hclk); | ||
40 | clk_enable(iclk); | 39 | clk_enable(iclk); |
41 | clk_enable(fclk); | 40 | clk_enable(fclk); |
42 | clocked = 1; | 41 | clocked = 1; |
@@ -46,8 +45,7 @@ static void at91_stop_clock(void) | |||
46 | { | 45 | { |
47 | clk_disable(fclk); | 46 | clk_disable(fclk); |
48 | clk_disable(iclk); | 47 | clk_disable(iclk); |
49 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) | 48 | clk_disable(hclk); |
50 | clk_disable(hclk); | ||
51 | clocked = 0; | 49 | clocked = 0; |
52 | } | 50 | } |
53 | 51 | ||
@@ -142,8 +140,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
142 | 140 | ||
143 | iclk = clk_get(&pdev->dev, "ohci_clk"); | 141 | iclk = clk_get(&pdev->dev, "ohci_clk"); |
144 | fclk = clk_get(&pdev->dev, "uhpck"); | 142 | fclk = clk_get(&pdev->dev, "uhpck"); |
145 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) | 143 | hclk = clk_get(&pdev->dev, "hclk"); |
146 | hclk = clk_get(&pdev->dev, "hck0"); | ||
147 | 144 | ||
148 | at91_start_hc(pdev); | 145 | at91_start_hc(pdev); |
149 | ohci_hcd_init(hcd_to_ohci(hcd)); | 146 | ohci_hcd_init(hcd_to_ohci(hcd)); |
@@ -155,8 +152,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
155 | /* Error handling */ | 152 | /* Error handling */ |
156 | at91_stop_hc(pdev); | 153 | at91_stop_hc(pdev); |
157 | 154 | ||
158 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) | 155 | clk_put(hclk); |
159 | clk_put(hclk); | ||
160 | clk_put(fclk); | 156 | clk_put(fclk); |
161 | clk_put(iclk); | 157 | clk_put(iclk); |
162 | 158 | ||
@@ -192,8 +188,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd, | |||
192 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 188 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
193 | usb_put_hcd(hcd); | 189 | usb_put_hcd(hcd); |
194 | 190 | ||
195 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) | 191 | clk_put(hclk); |
196 | clk_put(hclk); | ||
197 | clk_put(fclk); | 192 | clk_put(fclk); |
198 | clk_put(iclk); | 193 | clk_put(iclk); |
199 | fclk = iclk = hclk = NULL; | 194 | fclk = iclk = hclk = NULL; |