aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c92
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c84
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c60
-rw-r--r--arch/arm/mach-at91/at91sam9263.c4
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c161
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c60
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c14
-rw-r--r--arch/arm/mach-at91/board-carmeva.c14
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c17
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c13
-rw-r--r--arch/arm/mach-at91/board-csb337.c16
-rw-r--r--arch/arm/mach-at91/board-eb9200.c14
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c32
-rw-r--r--arch/arm/mach-at91/board-eco920.c36
-rw-r--r--arch/arm/mach-at91/board-flexibity.c14
-rw-r--r--arch/arm/mach-at91/board-foxg20.c16
-rw-r--r--arch/arm/mach-at91/board-kafa.c17
-rw-r--r--arch/arm/mach-at91/board-kb9202.c37
-rw-r--r--arch/arm/mach-at91/board-neocore926.c13
-rw-r--r--arch/arm/mach-at91/board-picotux200.c14
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c14
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c17
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c17
-rw-r--r--arch/arm/mach-at91/board-rsi-ews.c16
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c39
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c16
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c13
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c14
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c2
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c16
-rw-r--r--arch/arm/mach-at91/include/mach/board.h1
-rw-r--r--arch/arm/mach-at91/leds.c105
35 files changed, 465 insertions, 578 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 01fb7325fecc..9ac427a702da 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -294,9 +294,9 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {}
294 * MMC / SD 294 * MMC / SD
295 * -------------------------------------------------------------------- */ 295 * -------------------------------------------------------------------- */
296 296
297#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 297#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 298static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct at91_mmc_data mmc_data; 299static struct mci_platform_data mmc_data;
300 300
301static struct resource mmc_resources[] = { 301static struct resource mmc_resources[] = {
302 [0] = { 302 [0] = {
@@ -312,7 +312,7 @@ static struct resource mmc_resources[] = {
312}; 312};
313 313
314static struct platform_device at91rm9200_mmc_device = { 314static struct platform_device at91rm9200_mmc_device = {
315 .name = "at91_mci", 315 .name = "atmel_mci",
316 .id = -1, 316 .id = -1,
317 .dev = { 317 .dev = {
318 .dma_mask = &mmc_dmamask, 318 .dma_mask = &mmc_dmamask,
@@ -323,53 +323,69 @@ static struct platform_device at91rm9200_mmc_device = {
323 .num_resources = ARRAY_SIZE(mmc_resources), 323 .num_resources = ARRAY_SIZE(mmc_resources),
324}; 324};
325 325
326void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 326void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
327{ 327{
328 unsigned int i;
329 unsigned int slot_count = 0;
330
328 if (!data) 331 if (!data)
329 return; 332 return;
330 333
331 /* input/irq */ 334 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
332 if (gpio_is_valid(data->det_pin)) {
333 at91_set_gpio_input(data->det_pin, 1);
334 at91_set_deglitch(data->det_pin, 1);
335 }
336 if (gpio_is_valid(data->wp_pin))
337 at91_set_gpio_input(data->wp_pin, 1);
338 if (gpio_is_valid(data->vcc_pin))
339 at91_set_gpio_output(data->vcc_pin, 0);
340
341 /* CLK */
342 at91_set_A_periph(AT91_PIN_PA27, 0);
343 335
344 if (data->slot_b) { 336 if (!data->slot[i].bus_width)
345 /* CMD */ 337 continue;
346 at91_set_B_periph(AT91_PIN_PA8, 1);
347 338
348 /* DAT0, maybe DAT1..DAT3 */ 339 /* input/irq */
349 at91_set_B_periph(AT91_PIN_PA9, 1); 340 if (gpio_is_valid(data->slot[i].detect_pin)) {
350 if (data->wire4) { 341 at91_set_gpio_input(data->slot[i].detect_pin, 1);
351 at91_set_B_periph(AT91_PIN_PA10, 1); 342 at91_set_deglitch(data->slot[i].detect_pin, 1);
352 at91_set_B_periph(AT91_PIN_PA11, 1);
353 at91_set_B_periph(AT91_PIN_PA12, 1);
354 } 343 }
355 } else { 344 if (gpio_is_valid(data->slot[i].wp_pin))
356 /* CMD */ 345 at91_set_gpio_input(data->slot[i].wp_pin, 1);
357 at91_set_A_periph(AT91_PIN_PA28, 1); 346
358 347 switch (i) {
359 /* DAT0, maybe DAT1..DAT3 */ 348 case 0: /* slot A */
360 at91_set_A_periph(AT91_PIN_PA29, 1); 349 /* CMD */
361 if (data->wire4) { 350 at91_set_A_periph(AT91_PIN_PA28, 1);
362 at91_set_B_periph(AT91_PIN_PB3, 1); 351 /* DAT0, maybe DAT1..DAT3 */
363 at91_set_B_periph(AT91_PIN_PB4, 1); 352 at91_set_A_periph(AT91_PIN_PA29, 1);
364 at91_set_B_periph(AT91_PIN_PB5, 1); 353 if (data->slot[i].bus_width == 4) {
354 at91_set_B_periph(AT91_PIN_PB3, 1);
355 at91_set_B_periph(AT91_PIN_PB4, 1);
356 at91_set_B_periph(AT91_PIN_PB5, 1);
357 }
358 slot_count++;
359 break;
360 case 1: /* slot B */
361 /* CMD */
362 at91_set_B_periph(AT91_PIN_PA8, 1);
363 /* DAT0, maybe DAT1..DAT3 */
364 at91_set_B_periph(AT91_PIN_PA9, 1);
365 if (data->slot[i].bus_width == 4) {
366 at91_set_B_periph(AT91_PIN_PA10, 1);
367 at91_set_B_periph(AT91_PIN_PA11, 1);
368 at91_set_B_periph(AT91_PIN_PA12, 1);
369 }
370 slot_count++;
371 break;
372 default:
373 printk(KERN_ERR
374 "AT91: SD/MMC slot %d not available\n", i);
375 break;
376 }
377 if (slot_count) {
378 /* CLK */
379 at91_set_A_periph(AT91_PIN_PA27, 0);
380
381 mmc_data = *data;
382 platform_device_register(&at91rm9200_mmc_device);
365 } 383 }
366 } 384 }
367 385
368 mmc_data = *data;
369 platform_device_register(&at91rm9200_mmc_device);
370} 386}
371#else 387#else
372void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 388void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
373#endif 389#endif
374 390
375 391
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index bce572a530ef..af50ff3281c7 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -209,92 +209,10 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
209 209
210 210
211/* -------------------------------------------------------------------- 211/* --------------------------------------------------------------------
212 * MMC / SD
213 * -------------------------------------------------------------------- */
214
215#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
216static u64 mmc_dmamask = DMA_BIT_MASK(32);
217static struct at91_mmc_data mmc_data;
218
219static struct resource mmc_resources[] = {
220 [0] = {
221 .start = AT91SAM9260_BASE_MCI,
222 .end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 [1] = {
226 .start = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
227 .end = NR_IRQS_LEGACY + AT91SAM9260_ID_MCI,
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct platform_device at91sam9260_mmc_device = {
233 .name = "at91_mci",
234 .id = -1,
235 .dev = {
236 .dma_mask = &mmc_dmamask,
237 .coherent_dma_mask = DMA_BIT_MASK(32),
238 .platform_data = &mmc_data,
239 },
240 .resource = mmc_resources,
241 .num_resources = ARRAY_SIZE(mmc_resources),
242};
243
244void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
245{
246 if (!data)
247 return;
248
249 /* input/irq */
250 if (gpio_is_valid(data->det_pin)) {
251 at91_set_gpio_input(data->det_pin, 1);
252 at91_set_deglitch(data->det_pin, 1);
253 }
254 if (gpio_is_valid(data->wp_pin))
255 at91_set_gpio_input(data->wp_pin, 1);
256 if (gpio_is_valid(data->vcc_pin))
257 at91_set_gpio_output(data->vcc_pin, 0);
258
259 /* CLK */
260 at91_set_A_periph(AT91_PIN_PA8, 0);
261
262 if (data->slot_b) {
263 /* CMD */
264 at91_set_B_periph(AT91_PIN_PA1, 1);
265
266 /* DAT0, maybe DAT1..DAT3 */
267 at91_set_B_periph(AT91_PIN_PA0, 1);
268 if (data->wire4) {
269 at91_set_B_periph(AT91_PIN_PA5, 1);
270 at91_set_B_periph(AT91_PIN_PA4, 1);
271 at91_set_B_periph(AT91_PIN_PA3, 1);
272 }
273 } else {
274 /* CMD */
275 at91_set_A_periph(AT91_PIN_PA7, 1);
276
277 /* DAT0, maybe DAT1..DAT3 */
278 at91_set_A_periph(AT91_PIN_PA6, 1);
279 if (data->wire4) {
280 at91_set_A_periph(AT91_PIN_PA9, 1);
281 at91_set_A_periph(AT91_PIN_PA10, 1);
282 at91_set_A_periph(AT91_PIN_PA11, 1);
283 }
284 }
285
286 mmc_data = *data;
287 platform_device_register(&at91sam9260_mmc_device);
288}
289#else
290void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
291#endif
292
293/* --------------------------------------------------------------------
294 * MMC / SD Slot for Atmel MCI Driver 212 * MMC / SD Slot for Atmel MCI Driver
295 * -------------------------------------------------------------------- */ 213 * -------------------------------------------------------------------- */
296 214
297#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) 215#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
298static u64 mmc_dmamask = DMA_BIT_MASK(32); 216static u64 mmc_dmamask = DMA_BIT_MASK(32);
299static struct mci_platform_data mmc_data; 217static struct mci_platform_data mmc_data;
300 218
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index bc2590d712d0..11e9fa835cde 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -137,9 +137,9 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
137 * MMC / SD 137 * MMC / SD
138 * -------------------------------------------------------------------- */ 138 * -------------------------------------------------------------------- */
139 139
140#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 140#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
141static u64 mmc_dmamask = DMA_BIT_MASK(32); 141static u64 mmc_dmamask = DMA_BIT_MASK(32);
142static struct at91_mmc_data mmc_data; 142static struct mci_platform_data mmc_data;
143 143
144static struct resource mmc_resources[] = { 144static struct resource mmc_resources[] = {
145 [0] = { 145 [0] = {
@@ -155,7 +155,7 @@ static struct resource mmc_resources[] = {
155}; 155};
156 156
157static struct platform_device at91sam9261_mmc_device = { 157static struct platform_device at91sam9261_mmc_device = {
158 .name = "at91_mci", 158 .name = "atmel_mci",
159 .id = -1, 159 .id = -1,
160 .dev = { 160 .dev = {
161 .dma_mask = &mmc_dmamask, 161 .dma_mask = &mmc_dmamask,
@@ -166,40 +166,40 @@ static struct platform_device at91sam9261_mmc_device = {
166 .num_resources = ARRAY_SIZE(mmc_resources), 166 .num_resources = ARRAY_SIZE(mmc_resources),
167}; 167};
168 168
169void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 169void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
170{ 170{
171 if (!data) 171 if (!data)
172 return; 172 return;
173 173
174 /* input/irq */ 174 if (data->slot[0].bus_width) {
175 if (gpio_is_valid(data->det_pin)) { 175 /* input/irq */
176 at91_set_gpio_input(data->det_pin, 1); 176 if (gpio_is_valid(data->slot[0].detect_pin)) {
177 at91_set_deglitch(data->det_pin, 1); 177 at91_set_gpio_input(data->slot[0].detect_pin, 1);
178 } 178 at91_set_deglitch(data->slot[0].detect_pin, 1);
179 if (gpio_is_valid(data->wp_pin)) 179 }
180 at91_set_gpio_input(data->wp_pin, 1); 180 if (gpio_is_valid(data->slot[0].wp_pin))
181 if (gpio_is_valid(data->vcc_pin)) 181 at91_set_gpio_input(data->slot[0].wp_pin, 1);
182 at91_set_gpio_output(data->vcc_pin, 0); 182
183 183 /* CLK */
184 /* CLK */ 184 at91_set_B_periph(AT91_PIN_PA2, 0);
185 at91_set_B_periph(AT91_PIN_PA2, 0);
186
187 /* CMD */
188 at91_set_B_periph(AT91_PIN_PA1, 1);
189
190 /* DAT0, maybe DAT1..DAT3 */
191 at91_set_B_periph(AT91_PIN_PA0, 1);
192 if (data->wire4) {
193 at91_set_B_periph(AT91_PIN_PA4, 1);
194 at91_set_B_periph(AT91_PIN_PA5, 1);
195 at91_set_B_periph(AT91_PIN_PA6, 1);
196 }
197 185
198 mmc_data = *data; 186 /* CMD */
199 platform_device_register(&at91sam9261_mmc_device); 187 at91_set_B_periph(AT91_PIN_PA1, 1);
188
189 /* DAT0, maybe DAT1..DAT3 */
190 at91_set_B_periph(AT91_PIN_PA0, 1);
191 if (data->slot[0].bus_width == 4) {
192 at91_set_B_periph(AT91_PIN_PA4, 1);
193 at91_set_B_periph(AT91_PIN_PA5, 1);
194 at91_set_B_periph(AT91_PIN_PA6, 1);
195 }
196
197 mmc_data = *data;
198 platform_device_register(&at91sam9261_mmc_device);
199 }
200} 200}
201#else 201#else
202void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 202void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
203#endif 203#endif
204 204
205 205
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 84b38105231e..144ef5de51b6 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -188,8 +188,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
188 CLKDEV_CON_ID("hclk", &macb_clk), 188 CLKDEV_CON_ID("hclk", &macb_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 189 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 190 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
191 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), 191 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
192 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), 192 CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), 193 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 194 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), 195 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 9b6ca734f1a9..7c0898fe20fa 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -218,9 +218,9 @@ void __init at91_add_device_eth(struct macb_platform_data *data) {}
218 * MMC / SD 218 * MMC / SD
219 * -------------------------------------------------------------------- */ 219 * -------------------------------------------------------------------- */
220 220
221#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 221#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
222static u64 mmc_dmamask = DMA_BIT_MASK(32); 222static u64 mmc_dmamask = DMA_BIT_MASK(32);
223static struct at91_mmc_data mmc0_data, mmc1_data; 223static struct mci_platform_data mmc0_data, mmc1_data;
224 224
225static struct resource mmc0_resources[] = { 225static struct resource mmc0_resources[] = {
226 [0] = { 226 [0] = {
@@ -236,7 +236,7 @@ static struct resource mmc0_resources[] = {
236}; 236};
237 237
238static struct platform_device at91sam9263_mmc0_device = { 238static struct platform_device at91sam9263_mmc0_device = {
239 .name = "at91_mci", 239 .name = "atmel_mci",
240 .id = 0, 240 .id = 0,
241 .dev = { 241 .dev = {
242 .dma_mask = &mmc_dmamask, 242 .dma_mask = &mmc_dmamask,
@@ -261,7 +261,7 @@ static struct resource mmc1_resources[] = {
261}; 261};
262 262
263static struct platform_device at91sam9263_mmc1_device = { 263static struct platform_device at91sam9263_mmc1_device = {
264 .name = "at91_mci", 264 .name = "atmel_mci",
265 .id = 1, 265 .id = 1,
266 .dev = { 266 .dev = {
267 .dma_mask = &mmc_dmamask, 267 .dma_mask = &mmc_dmamask,
@@ -272,85 +272,110 @@ static struct platform_device at91sam9263_mmc1_device = {
272 .num_resources = ARRAY_SIZE(mmc1_resources), 272 .num_resources = ARRAY_SIZE(mmc1_resources),
273}; 273};
274 274
275void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 275void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
276{ 276{
277 unsigned int i;
278 unsigned int slot_count = 0;
279
277 if (!data) 280 if (!data)
278 return; 281 return;
279 282
280 /* input/irq */ 283 for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
281 if (gpio_is_valid(data->det_pin)) {
282 at91_set_gpio_input(data->det_pin, 1);
283 at91_set_deglitch(data->det_pin, 1);
284 }
285 if (gpio_is_valid(data->wp_pin))
286 at91_set_gpio_input(data->wp_pin, 1);
287 if (gpio_is_valid(data->vcc_pin))
288 at91_set_gpio_output(data->vcc_pin, 0);
289 284
290 if (mmc_id == 0) { /* MCI0 */ 285 if (!data->slot[i].bus_width)
291 /* CLK */ 286 continue;
292 at91_set_A_periph(AT91_PIN_PA12, 0);
293 287
294 if (data->slot_b) { 288 /* input/irq */
295 /* CMD */ 289 if (gpio_is_valid(data->slot[i].detect_pin)) {
296 at91_set_A_periph(AT91_PIN_PA16, 1); 290 at91_set_gpio_input(data->slot[i].detect_pin,
291 1);
292 at91_set_deglitch(data->slot[i].detect_pin,
293 1);
294 }
295 if (gpio_is_valid(data->slot[i].wp_pin))
296 at91_set_gpio_input(data->slot[i].wp_pin, 1);
297
298 if (mmc_id == 0) { /* MCI0 */
299 switch (i) {
300 case 0: /* slot A */
301 /* CMD */
302 at91_set_A_periph(AT91_PIN_PA1, 1);
303 /* DAT0, maybe DAT1..DAT3 */
304 at91_set_A_periph(AT91_PIN_PA0, 1);
305 if (data->slot[i].bus_width == 4) {
306 at91_set_A_periph(AT91_PIN_PA3, 1);
307 at91_set_A_periph(AT91_PIN_PA4, 1);
308 at91_set_A_periph(AT91_PIN_PA5, 1);
309 }
310 slot_count++;
311 break;
312 case 1: /* slot B */
313 /* CMD */
314 at91_set_A_periph(AT91_PIN_PA16, 1);
315 /* DAT0, maybe DAT1..DAT3 */
316 at91_set_A_periph(AT91_PIN_PA17, 1);
317 if (data->slot[i].bus_width == 4) {
318 at91_set_A_periph(AT91_PIN_PA18, 1);
319 at91_set_A_periph(AT91_PIN_PA19, 1);
320 at91_set_A_periph(AT91_PIN_PA20, 1);
321 }
322 slot_count++;
323 break;
324 default:
325 printk(KERN_ERR
326 "AT91: SD/MMC slot %d not available\n", i);
327 break;
328 }
329 if (slot_count) {
330 /* CLK */
331 at91_set_A_periph(AT91_PIN_PA12, 0);
297 332
298 /* DAT0, maybe DAT1..DAT3 */ 333 mmc0_data = *data;
299 at91_set_A_periph(AT91_PIN_PA17, 1); 334 platform_device_register(&at91sam9263_mmc0_device);
300 if (data->wire4) {
301 at91_set_A_periph(AT91_PIN_PA18, 1);
302 at91_set_A_periph(AT91_PIN_PA19, 1);
303 at91_set_A_periph(AT91_PIN_PA20, 1);
304 } 335 }
305 } else { 336 } else if (mmc_id == 1) { /* MCI1 */
306 /* CMD */ 337 switch (i) {
307 at91_set_A_periph(AT91_PIN_PA1, 1); 338 case 0: /* slot A */
308 339 /* CMD */
309 /* DAT0, maybe DAT1..DAT3 */ 340 at91_set_A_periph(AT91_PIN_PA7, 1);
310 at91_set_A_periph(AT91_PIN_PA0, 1); 341 /* DAT0, maybe DAT1..DAT3 */
311 if (data->wire4) { 342 at91_set_A_periph(AT91_PIN_PA8, 1);
312 at91_set_A_periph(AT91_PIN_PA3, 1); 343 if (data->slot[i].bus_width == 4) {
313 at91_set_A_periph(AT91_PIN_PA4, 1); 344 at91_set_A_periph(AT91_PIN_PA9, 1);
314 at91_set_A_periph(AT91_PIN_PA5, 1); 345 at91_set_A_periph(AT91_PIN_PA10, 1);
346 at91_set_A_periph(AT91_PIN_PA11, 1);
347 }
348 slot_count++;
349 break;
350 case 1: /* slot B */
351 /* CMD */
352 at91_set_A_periph(AT91_PIN_PA21, 1);
353 /* DAT0, maybe DAT1..DAT3 */
354 at91_set_A_periph(AT91_PIN_PA22, 1);
355 if (data->slot[i].bus_width == 4) {
356 at91_set_A_periph(AT91_PIN_PA23, 1);
357 at91_set_A_periph(AT91_PIN_PA24, 1);
358 at91_set_A_periph(AT91_PIN_PA25, 1);
359 }
360 slot_count++;
361 break;
362 default:
363 printk(KERN_ERR
364 "AT91: SD/MMC slot %d not available\n", i);
365 break;
315 } 366 }
316 } 367 if (slot_count) {
368 /* CLK */
369 at91_set_A_periph(AT91_PIN_PA6, 0);
317 370
318 mmc0_data = *data; 371 mmc1_data = *data;
319 platform_device_register(&at91sam9263_mmc0_device); 372 platform_device_register(&at91sam9263_mmc1_device);
320 } else { /* MCI1 */
321 /* CLK */
322 at91_set_A_periph(AT91_PIN_PA6, 0);
323
324 if (data->slot_b) {
325 /* CMD */
326 at91_set_A_periph(AT91_PIN_PA21, 1);
327
328 /* DAT0, maybe DAT1..DAT3 */
329 at91_set_A_periph(AT91_PIN_PA22, 1);
330 if (data->wire4) {
331 at91_set_A_periph(AT91_PIN_PA23, 1);
332 at91_set_A_periph(AT91_PIN_PA24, 1);
333 at91_set_A_periph(AT91_PIN_PA25, 1);
334 }
335 } else {
336 /* CMD */
337 at91_set_A_periph(AT91_PIN_PA7, 1);
338
339 /* DAT0, maybe DAT1..DAT3 */
340 at91_set_A_periph(AT91_PIN_PA8, 1);
341 if (data->wire4) {
342 at91_set_A_periph(AT91_PIN_PA9, 1);
343 at91_set_A_periph(AT91_PIN_PA10, 1);
344 at91_set_A_periph(AT91_PIN_PA11, 1);
345 } 373 }
346 } 374 }
347
348 mmc1_data = *data;
349 platform_device_register(&at91sam9263_mmc1_device);
350 } 375 }
351} 376}
352#else 377#else
353void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 378void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
354#endif 379#endif
355 380
356/* -------------------------------------------------------------------- 381/* --------------------------------------------------------------------
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index b3d365dadef5..1fad22f7e21f 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -161,9 +161,9 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
161 * MMC / SD 161 * MMC / SD
162 * -------------------------------------------------------------------- */ 162 * -------------------------------------------------------------------- */
163 163
164#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 164#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
165static u64 mmc_dmamask = DMA_BIT_MASK(32); 165static u64 mmc_dmamask = DMA_BIT_MASK(32);
166static struct at91_mmc_data mmc_data; 166static struct mci_platform_data mmc_data;
167 167
168static struct resource mmc_resources[] = { 168static struct resource mmc_resources[] = {
169 [0] = { 169 [0] = {
@@ -179,7 +179,7 @@ static struct resource mmc_resources[] = {
179}; 179};
180 180
181static struct platform_device at91sam9rl_mmc_device = { 181static struct platform_device at91sam9rl_mmc_device = {
182 .name = "at91_mci", 182 .name = "atmel_mci",
183 .id = -1, 183 .id = -1,
184 .dev = { 184 .dev = {
185 .dma_mask = &mmc_dmamask, 185 .dma_mask = &mmc_dmamask,
@@ -190,40 +190,40 @@ static struct platform_device at91sam9rl_mmc_device = {
190 .num_resources = ARRAY_SIZE(mmc_resources), 190 .num_resources = ARRAY_SIZE(mmc_resources),
191}; 191};
192 192
193void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) 193void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
194{ 194{
195 if (!data) 195 if (!data)
196 return; 196 return;
197 197
198 /* input/irq */ 198 if (data->slot[0].bus_width) {
199 if (gpio_is_valid(data->det_pin)) { 199 /* input/irq */
200 at91_set_gpio_input(data->det_pin, 1); 200 if (gpio_is_valid(data->slot[0].detect_pin)) {
201 at91_set_deglitch(data->det_pin, 1); 201 at91_set_gpio_input(data->slot[0].detect_pin, 1);
202 } 202 at91_set_deglitch(data->slot[0].detect_pin, 1);
203 if (gpio_is_valid(data->wp_pin)) 203 }
204 at91_set_gpio_input(data->wp_pin, 1); 204 if (gpio_is_valid(data->slot[0].wp_pin))
205 if (gpio_is_valid(data->vcc_pin)) 205 at91_set_gpio_input(data->slot[0].wp_pin, 1);
206 at91_set_gpio_output(data->vcc_pin, 0); 206
207 207 /* CLK */
208 /* CLK */ 208 at91_set_A_periph(AT91_PIN_PA2, 0);
209 at91_set_A_periph(AT91_PIN_PA2, 0); 209
210 210 /* CMD */
211 /* CMD */ 211 at91_set_A_periph(AT91_PIN_PA1, 1);
212 at91_set_A_periph(AT91_PIN_PA1, 1); 212
213 213 /* DAT0, maybe DAT1..DAT3 */
214 /* DAT0, maybe DAT1..DAT3 */ 214 at91_set_A_periph(AT91_PIN_PA0, 1);
215 at91_set_A_periph(AT91_PIN_PA0, 1); 215 if (data->slot[0].bus_width == 4) {
216 if (data->wire4) { 216 at91_set_A_periph(AT91_PIN_PA3, 1);
217 at91_set_A_periph(AT91_PIN_PA3, 1); 217 at91_set_A_periph(AT91_PIN_PA4, 1);
218 at91_set_A_periph(AT91_PIN_PA4, 1); 218 at91_set_A_periph(AT91_PIN_PA5, 1);
219 at91_set_A_periph(AT91_PIN_PA5, 1); 219 }
220
221 mmc_data = *data;
222 platform_device_register(&at91sam9rl_mmc_device);
220 } 223 }
221
222 mmc_data = *data;
223 platform_device_register(&at91sam9rl_mmc_device);
224} 224}
225#else 225#else
226void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} 226void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data) {}
227#endif 227#endif
228 228
229 229
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index de7be1931817..93a832f70232 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -133,12 +133,12 @@ static struct atmel_nand_data __initdata afeb9260_nand_data = {
133/* 133/*
134 * MCI (SD/MMC) 134 * MCI (SD/MMC)
135 */ 135 */
136static struct at91_mmc_data __initdata afeb9260_mmc_data = { 136static struct mci_platform_data __initdata afeb9260_mci0_data = {
137 .det_pin = AT91_PIN_PC9, 137 .slot[1] = {
138 .wp_pin = AT91_PIN_PC4, 138 .bus_width = 4,
139 .slot_b = 1, 139 .detect_pin = AT91_PIN_PC9,
140 .wire4 = 1, 140 .wp_pin = AT91_PIN_PC4,
141 .vcc_pin = -EINVAL, 141 },
142}; 142};
143 143
144 144
@@ -199,7 +199,7 @@ static void __init afeb9260_board_init(void)
199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */ 199 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */ 200 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
201 /* MMC */ 201 /* MMC */
202 at91_add_device_mmc(0, &afeb9260_mmc_data); 202 at91_add_device_mci(0, &afeb9260_mci0_data);
203 /* I2C */ 203 /* I2C */
204 at91_add_device_i2c(afeb9260_i2c_devices, 204 at91_add_device_i2c(afeb9260_i2c_devices,
205 ARRAY_SIZE(afeb9260_i2c_devices)); 205 ARRAY_SIZE(afeb9260_i2c_devices));
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index a5b002f32a61..71d8f362a1d5 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -71,12 +71,12 @@ static struct at91_udc_data __initdata carmeva_udc_data = {
71 // .vcc_pin = -EINVAL, 71 // .vcc_pin = -EINVAL,
72// }; 72// };
73 73
74static struct at91_mmc_data __initdata carmeva_mmc_data = { 74static struct mci_platform_data __initdata carmeva_mci0_data = {
75 .slot_b = 0, 75 .slot[0] = {
76 .wire4 = 1, 76 .bus_width = 4,
77 .det_pin = AT91_PIN_PB10, 77 .detect_pin = AT91_PIN_PB10,
78 .wp_pin = AT91_PIN_PC14, 78 .wp_pin = AT91_PIN_PC14,
79 .vcc_pin = -EINVAL, 79 },
80}; 80};
81 81
82static struct spi_board_info carmeva_spi_devices[] = { 82static struct spi_board_info carmeva_spi_devices[] = {
@@ -150,7 +150,7 @@ static void __init carmeva_board_init(void)
150 /* Compact Flash */ 150 /* Compact Flash */
151// at91_add_device_cf(&carmeva_cf_data); 151// at91_add_device_cf(&carmeva_cf_data);
152 /* MMC */ 152 /* MMC */
153 at91_add_device_mmc(0, &carmeva_mmc_data); 153 at91_add_device_mci(0, &carmeva_mci0_data);
154 /* LEDs */ 154 /* LEDs */
155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds)); 155 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
156} 156}
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index ecbc13b594de..e71c473316e3 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -254,8 +254,7 @@ static struct gpio_led cpu9krea_leds[] = {
254 254
255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = { 255static struct i2c_board_info __initdata cpu9krea_i2c_devices[] = {
256 { 256 {
257 I2C_BOARD_INFO("rtc-ds1307", 0x68), 257 I2C_BOARD_INFO("ds1339", 0x68),
258 .type = "ds1339",
259 }, 258 },
260}; 259};
261 260
@@ -312,12 +311,12 @@ static void __init cpu9krea_add_device_buttons(void)
312/* 311/*
313 * MCI (SD/MMC) 312 * MCI (SD/MMC)
314 */ 313 */
315static struct at91_mmc_data __initdata cpu9krea_mmc_data = { 314static struct mci_platform_data __initdata cpu9krea_mci0_data = {
316 .slot_b = 0, 315 .slot[0] = {
317 .wire4 = 1, 316 .bus_width = 4,
318 .det_pin = AT91_PIN_PA29, 317 .detect_pin = AT91_PIN_PA29,
319 .wp_pin = -EINVAL, 318 .wp_pin = -EINVAL,
320 .vcc_pin = -EINVAL, 319 },
321}; 320};
322 321
323static void __init cpu9krea_board_init(void) 322static void __init cpu9krea_board_init(void)
@@ -359,7 +358,7 @@ static void __init cpu9krea_board_init(void)
359 /* Ethernet */ 358 /* Ethernet */
360 at91_add_device_eth(&cpu9krea_macb_data); 359 at91_add_device_eth(&cpu9krea_macb_data);
361 /* MMC */ 360 /* MMC */
362 at91_add_device_mmc(0, &cpu9krea_mmc_data); 361 at91_add_device_mci(0, &cpu9krea_mci0_data);
363 /* I2C */ 362 /* I2C */
364 at91_add_device_i2c(cpu9krea_i2c_devices, 363 at91_add_device_i2c(cpu9krea_i2c_devices,
365 ARRAY_SIZE(cpu9krea_i2c_devices)); 364 ARRAY_SIZE(cpu9krea_i2c_devices));
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 2e6d043c82f2..2cbd1a2b6c35 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -78,11 +78,12 @@ static struct at91_udc_data __initdata cpuat91_udc_data = {
78 .pullup_pin = AT91_PIN_PC14, 78 .pullup_pin = AT91_PIN_PC14,
79}; 79};
80 80
81static struct at91_mmc_data __initdata cpuat91_mmc_data = { 81static struct mci_platform_data __initdata cpuat91_mci0_data = {
82 .det_pin = AT91_PIN_PC2, 82 .slot[0] = {
83 .wire4 = 1, 83 .bus_width = 4,
84 .wp_pin = -EINVAL, 84 .detect_pin = AT91_PIN_PC2,
85 .vcc_pin = -EINVAL, 85 .wp_pin = -EINVAL,
86 },
86}; 87};
87 88
88static struct physmap_flash_data cpuat91_flash_data = { 89static struct physmap_flash_data cpuat91_flash_data = {
@@ -168,7 +169,7 @@ static void __init cpuat91_board_init(void)
168 /* USB Device */ 169 /* USB Device */
169 at91_add_device_udc(&cpuat91_udc_data); 170 at91_add_device_udc(&cpuat91_udc_data);
170 /* MMC */ 171 /* MMC */
171 at91_add_device_mmc(0, &cpuat91_mmc_data); 172 at91_add_device_mci(0, &cpuat91_mci0_data);
172 /* I2C */ 173 /* I2C */
173 at91_add_device_i2c(NULL, 0); 174 at91_add_device_i2c(NULL, 0);
174 /* Platform devices */ 175 /* Platform devices */
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 462bc319cbc5..3e37437a7a61 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -87,12 +87,12 @@ static struct at91_cf_data __initdata csb337_cf_data = {
87 .rst_pin = AT91_PIN_PD2, 87 .rst_pin = AT91_PIN_PD2,
88}; 88};
89 89
90static struct at91_mmc_data __initdata csb337_mmc_data = { 90static struct mci_platform_data __initdata csb337_mci0_data = {
91 .det_pin = AT91_PIN_PD5, 91 .slot[0] = {
92 .slot_b = 0, 92 .bus_width = 4,
93 .wire4 = 1, 93 .detect_pin = AT91_PIN_PD5,
94 .wp_pin = AT91_PIN_PD6, 94 .wp_pin = AT91_PIN_PD6,
95 .vcc_pin = -EINVAL, 95 },
96}; 96};
97 97
98static struct spi_board_info csb337_spi_devices[] = { 98static struct spi_board_info csb337_spi_devices[] = {
@@ -220,8 +220,6 @@ static struct gpio_led csb_leds[] = {
220 220
221static void __init csb337_board_init(void) 221static void __init csb337_board_init(void)
222{ 222{
223 /* Setup the LEDs */
224 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
225 /* Serial */ 223 /* Serial */
226 /* DBGU on ttyS0 */ 224 /* DBGU on ttyS0 */
227 at91_register_uart(0, 0, 0); 225 at91_register_uart(0, 0, 0);
@@ -240,7 +238,7 @@ static void __init csb337_board_init(void)
240 /* SPI */ 238 /* SPI */
241 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); 239 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
242 /* MMC */ 240 /* MMC */
243 at91_add_device_mmc(0, &csb337_mmc_data); 241 at91_add_device_mci(0, &csb337_mci0_data);
244 /* NOR flash */ 242 /* NOR flash */
245 platform_device_register(&csb_flash); 243 platform_device_register(&csb_flash);
246 /* LEDs */ 244 /* LEDs */
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index d1e1f3fc0a47..0cfac16ee9d5 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -70,12 +70,12 @@ static struct at91_cf_data __initdata eb9200_cf_data = {
70 .rst_pin = AT91_PIN_PC5, 70 .rst_pin = AT91_PIN_PC5,
71}; 71};
72 72
73static struct at91_mmc_data __initdata eb9200_mmc_data = { 73static struct mci_platform_data __initdata eb9200_mci0_data = {
74 .slot_b = 0, 74 .slot[0] = {
75 .wire4 = 1, 75 .bus_width = 4,
76 .det_pin = -EINVAL, 76 .detect_pin = -EINVAL,
77 .wp_pin = -EINVAL, 77 .wp_pin = -EINVAL,
78 .vcc_pin = -EINVAL, 78 },
79}; 79};
80 80
81static struct i2c_board_info __initdata eb9200_i2c_devices[] = { 81static struct i2c_board_info __initdata eb9200_i2c_devices[] = {
@@ -113,7 +113,7 @@ static void __init eb9200_board_init(void)
113 at91_add_device_spi(NULL, 0); 113 at91_add_device_spi(NULL, 0);
114 /* MMC */ 114 /* MMC */
115 /* only supports 1 or 4 bit interface, not wired through to SPI */ 115 /* only supports 1 or 4 bit interface, not wired through to SPI */
116 at91_add_device_mmc(0, &eb9200_mmc_data); 116 at91_add_device_mci(0, &eb9200_mci0_data);
117} 117}
118 118
119MACHINE_START(ATEB9200, "Embest ATEB9200") 119MACHINE_START(ATEB9200, "Embest ATEB9200")
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index 9c24cb25707c..3d931ffac4bf 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -64,12 +64,12 @@ static struct at91_usbh_data __initdata ecb_at91usbh_data = {
64 .overcurrent_pin= {-EINVAL, -EINVAL}, 64 .overcurrent_pin= {-EINVAL, -EINVAL},
65}; 65};
66 66
67static struct at91_mmc_data __initdata ecb_at91mmc_data = { 67static struct mci_platform_data __initdata ecbat91_mci0_data = {
68 .slot_b = 0, 68 .slot[0] = {
69 .wire4 = 1, 69 .bus_width = 4,
70 .det_pin = -EINVAL, 70 .detect_pin = -EINVAL,
71 .wp_pin = -EINVAL, 71 .wp_pin = -EINVAL,
72 .vcc_pin = -EINVAL, 72 },
73}; 73};
74 74
75 75
@@ -138,11 +138,20 @@ static struct spi_board_info __initdata ecb_at91spi_devices[] = {
138 }, 138 },
139}; 139};
140 140
141/*
142 * LEDs
143 */
144static struct gpio_led ecb_leds[] = {
145 { /* D1 */
146 .name = "led1",
147 .gpio = AT91_PIN_PC7,
148 .active_low = 1,
149 .default_trigger = "heartbeat",
150 }
151};
152
141static void __init ecb_at91board_init(void) 153static void __init ecb_at91board_init(void)
142{ 154{
143 /* Setup the LEDs */
144 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
145
146 /* Serial */ 155 /* Serial */
147 /* DBGU on ttyS0. (Rx & Tx only) */ 156 /* DBGU on ttyS0. (Rx & Tx only) */
148 at91_register_uart(0, 0, 0); 157 at91_register_uart(0, 0, 0);
@@ -161,10 +170,13 @@ static void __init ecb_at91board_init(void)
161 at91_add_device_i2c(NULL, 0); 170 at91_add_device_i2c(NULL, 0);
162 171
163 /* MMC */ 172 /* MMC */
164 at91_add_device_mmc(0, &ecb_at91mmc_data); 173 at91_add_device_mci(0, &ecbat91_mci0_data);
165 174
166 /* SPI */ 175 /* SPI */
167 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices)); 176 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
177
178 /* LEDs */
179 at91_gpio_leds(ecb_leds, ARRAY_SIZE(ecb_leds));
168} 180}
169 181
170MACHINE_START(ECBAT91, "emQbit's ECB_AT91") 182MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index 82bdfde3405f..d93658a2b128 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -56,12 +56,12 @@ static struct at91_udc_data __initdata eco920_udc_data = {
56 .pullup_pin = AT91_PIN_PB13, 56 .pullup_pin = AT91_PIN_PB13,
57}; 57};
58 58
59static struct at91_mmc_data __initdata eco920_mmc_data = { 59static struct mci_platform_data __initdata eco920_mci0_data = {
60 .slot_b = 0, 60 .slot[0] = {
61 .wire4 = 0, 61 .bus_width = 1,
62 .det_pin = -EINVAL, 62 .detect_pin = -EINVAL,
63 .wp_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 .vcc_pin = -EINVAL, 64 },
65}; 65};
66 66
67static struct physmap_flash_data eco920_flash_data = { 67static struct physmap_flash_data eco920_flash_data = {
@@ -93,10 +93,26 @@ static struct spi_board_info eco920_spi_devices[] = {
93 }, 93 },
94}; 94};
95 95
96/*
97 * LEDs
98 */
99static struct gpio_led eco920_leds[] = {
100 { /* D1 */
101 .name = "led1",
102 .gpio = AT91_PIN_PB0,
103 .active_low = 1,
104 .default_trigger = "heartbeat",
105 },
106 { /* D2 */
107 .name = "led2",
108 .gpio = AT91_PIN_PB1,
109 .active_low = 1,
110 .default_trigger = "timer",
111 }
112};
113
96static void __init eco920_board_init(void) 114static void __init eco920_board_init(void)
97{ 115{
98 /* Setup the LEDs */
99 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
100 /* DBGU on ttyS0. (Rx & Tx only */ 116 /* DBGU on ttyS0. (Rx & Tx only */
101 at91_register_uart(0, 0, 0); 117 at91_register_uart(0, 0, 0);
102 at91_add_device_serial(); 118 at91_add_device_serial();
@@ -104,7 +120,7 @@ static void __init eco920_board_init(void)
104 at91_add_device_usbh(&eco920_usbh_data); 120 at91_add_device_usbh(&eco920_usbh_data);
105 at91_add_device_udc(&eco920_udc_data); 121 at91_add_device_udc(&eco920_udc_data);
106 122
107 at91_add_device_mmc(0, &eco920_mmc_data); 123 at91_add_device_mci(0, &eco920_mci0_data);
108 platform_device_register(&eco920_flash); 124 platform_device_register(&eco920_flash);
109 125
110 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1) 126 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
@@ -127,6 +143,8 @@ static void __init eco920_board_init(void)
127 ); 143 );
128 144
129 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices)); 145 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
146 /* LEDs */
147 at91_gpio_leds(eco920_leds, ARRAY_SIZE(eco920_leds));
130} 148}
131 149
132MACHINE_START(ECO920, "eco920") 150MACHINE_START(ECO920, "eco920")
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index 6cc83a87d77c..fa98abacb1ba 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -75,12 +75,12 @@ static struct spi_board_info flexibity_spi_devices[] = {
75}; 75};
76 76
77/* MCI (SD/MMC) */ 77/* MCI (SD/MMC) */
78static struct at91_mmc_data __initdata flexibity_mmc_data = { 78static struct mci_platform_data __initdata flexibity_mci0_data = {
79 .slot_b = 0, 79 .slot[0] = {
80 .wire4 = 1, 80 .bus_width = 4,
81 .det_pin = AT91_PIN_PC9, 81 .detect_pin = AT91_PIN_PC9,
82 .wp_pin = AT91_PIN_PC4, 82 .wp_pin = AT91_PIN_PC4,
83 .vcc_pin = -EINVAL, 83 },
84}; 84};
85 85
86/* LEDs */ 86/* LEDs */
@@ -152,7 +152,7 @@ static void __init flexibity_board_init(void)
152 at91_add_device_spi(flexibity_spi_devices, 152 at91_add_device_spi(flexibity_spi_devices,
153 ARRAY_SIZE(flexibity_spi_devices)); 153 ARRAY_SIZE(flexibity_spi_devices));
154 /* MMC */ 154 /* MMC */
155 at91_add_device_mmc(0, &flexibity_mmc_data); 155 at91_add_device_mci(0, &flexibity_mci0_data);
156 /* LEDs */ 156 /* LEDs */
157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); 157 at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
158} 158}
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index 69ab1247ef81..6e47071d8206 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -86,7 +86,7 @@ static struct at91_udc_data __initdata foxg20_udc_data = {
86 * SPI devices. 86 * SPI devices.
87 */ 87 */
88static struct spi_board_info foxg20_spi_devices[] = { 88static struct spi_board_info foxg20_spi_devices[] = {
89#if !defined(CONFIG_MMC_AT91) 89#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
90 { 90 {
91 .modalias = "mtd_dataflash", 91 .modalias = "mtd_dataflash",
92 .chip_select = 1, 92 .chip_select = 1,
@@ -109,12 +109,12 @@ static struct macb_platform_data __initdata foxg20_macb_data = {
109 * MCI (SD/MMC) 109 * MCI (SD/MMC)
110 * det_pin, wp_pin and vcc_pin are not connected 110 * det_pin, wp_pin and vcc_pin are not connected
111 */ 111 */
112static struct at91_mmc_data __initdata foxg20_mmc_data = { 112static struct mci_platform_data __initdata foxg20_mci0_data = {
113 .slot_b = 1, 113 .slot[1] = {
114 .wire4 = 1, 114 .bus_width = 4,
115 .det_pin = -EINVAL, 115 .detect_pin = -EINVAL,
116 .wp_pin = -EINVAL, 116 .wp_pin = -EINVAL,
117 .vcc_pin = -EINVAL, 117 },
118}; 118};
119 119
120 120
@@ -247,7 +247,7 @@ static void __init foxg20_board_init(void)
247 /* Ethernet */ 247 /* Ethernet */
248 at91_add_device_eth(&foxg20_macb_data); 248 at91_add_device_eth(&foxg20_macb_data);
249 /* MMC */ 249 /* MMC */
250 at91_add_device_mmc(0, &foxg20_mmc_data); 250 at91_add_device_mci(0, &foxg20_mci0_data);
251 /* I2C */ 251 /* I2C */
252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); 252 at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices));
253 /* LEDs */ 253 /* LEDs */
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index 64c1dbf88a07..86050da3ba53 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -66,11 +66,20 @@ static struct at91_udc_data __initdata kafa_udc_data = {
66 .pullup_pin = AT91_PIN_PB7, 66 .pullup_pin = AT91_PIN_PB7,
67}; 67};
68 68
69/*
70 * LEDs
71 */
72static struct gpio_led kafa_leds[] = {
73 { /* D1 */
74 .name = "led1",
75 .gpio = AT91_PIN_PB4,
76 .active_low = 1,
77 .default_trigger = "heartbeat",
78 },
79};
80
69static void __init kafa_board_init(void) 81static void __init kafa_board_init(void)
70{ 82{
71 /* Set up the LEDs */
72 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
73
74 /* Serial */ 83 /* Serial */
75 /* DBGU on ttyS0. (Rx & Tx only) */ 84 /* DBGU on ttyS0. (Rx & Tx only) */
76 at91_register_uart(0, 0, 0); 85 at91_register_uart(0, 0, 0);
@@ -88,6 +97,8 @@ static void __init kafa_board_init(void)
88 at91_add_device_i2c(NULL, 0); 97 at91_add_device_i2c(NULL, 0);
89 /* SPI */ 98 /* SPI */
90 at91_add_device_spi(NULL, 0); 99 at91_add_device_spi(NULL, 0);
100 /* LEDs */
101 at91_gpio_leds(kafa_leds, ARRAY_SIZE(kafa_leds));
91} 102}
92 103
93MACHINE_START(KAFA, "Sperry-Sun KAFA") 104MACHINE_START(KAFA, "Sperry-Sun KAFA")
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index 5d96cb85175f..abe9fed7a3e0 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -69,12 +69,12 @@ static struct at91_udc_data __initdata kb9202_udc_data = {
69 .pullup_pin = AT91_PIN_PB22, 69 .pullup_pin = AT91_PIN_PB22,
70}; 70};
71 71
72static struct at91_mmc_data __initdata kb9202_mmc_data = { 72static struct mci_platform_data __initdata kb9202_mci0_data = {
73 .det_pin = AT91_PIN_PB2, 73 .slot[0] = {
74 .slot_b = 0, 74 .bus_width = 4,
75 .wire4 = 1, 75 .detect_pin = AT91_PIN_PB2,
76 .wp_pin = -EINVAL, 76 .wp_pin = -EINVAL,
77 .vcc_pin = -EINVAL, 77 },
78}; 78};
79 79
80static struct mtd_partition __initdata kb9202_nand_partition[] = { 80static struct mtd_partition __initdata kb9202_nand_partition[] = {
@@ -96,11 +96,26 @@ static struct atmel_nand_data __initdata kb9202_nand_data = {
96 .num_parts = ARRAY_SIZE(kb9202_nand_partition), 96 .num_parts = ARRAY_SIZE(kb9202_nand_partition),
97}; 97};
98 98
99/*
100 * LEDs
101 */
102static struct gpio_led kb9202_leds[] = {
103 { /* D1 */
104 .name = "led1",
105 .gpio = AT91_PIN_PC19,
106 .active_low = 1,
107 .default_trigger = "heartbeat",
108 },
109 { /* D2 */
110 .name = "led2",
111 .gpio = AT91_PIN_PC18,
112 .active_low = 1,
113 .default_trigger = "timer",
114 }
115};
116
99static void __init kb9202_board_init(void) 117static void __init kb9202_board_init(void)
100{ 118{
101 /* Set up the LEDs */
102 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
103
104 /* Serial */ 119 /* Serial */
105 /* DBGU on ttyS0. (Rx & Tx only) */ 120 /* DBGU on ttyS0. (Rx & Tx only) */
106 at91_register_uart(0, 0, 0); 121 at91_register_uart(0, 0, 0);
@@ -121,13 +136,15 @@ static void __init kb9202_board_init(void)
121 /* USB Device */ 136 /* USB Device */
122 at91_add_device_udc(&kb9202_udc_data); 137 at91_add_device_udc(&kb9202_udc_data);
123 /* MMC */ 138 /* MMC */
124 at91_add_device_mmc(0, &kb9202_mmc_data); 139 at91_add_device_mci(0, &kb9202_mci0_data);
125 /* I2C */ 140 /* I2C */
126 at91_add_device_i2c(NULL, 0); 141 at91_add_device_i2c(NULL, 0);
127 /* SPI */ 142 /* SPI */
128 at91_add_device_spi(NULL, 0); 143 at91_add_device_spi(NULL, 0);
129 /* NAND */ 144 /* NAND */
130 at91_add_device_nand(&kb9202_nand_data); 145 at91_add_device_nand(&kb9202_nand_data);
146 /* LEDs */
147 at91_gpio_leds(kb9202_leds, ARRAY_SIZE(kb9202_leds));
131} 148}
132 149
133MACHINE_START(KB9200, "KB920x") 150MACHINE_START(KB9200, "KB920x")
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 18103c5d993c..9cda3fd346ae 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -138,11 +138,12 @@ static struct spi_board_info neocore926_spi_devices[] = {
138/* 138/*
139 * MCI (SD/MMC) 139 * MCI (SD/MMC)
140 */ 140 */
141static struct at91_mmc_data __initdata neocore926_mmc_data = { 141static struct mci_platform_data __initdata neocore926_mci0_data = {
142 .wire4 = 1, 142 .slot[0] = {
143 .det_pin = AT91_PIN_PE18, 143 .bus_width = 4,
144 .wp_pin = AT91_PIN_PE19, 144 .detect_pin = AT91_PIN_PE18,
145 .vcc_pin = -EINVAL, 145 .wp_pin = AT91_PIN_PE19,
146 },
146}; 147};
147 148
148 149
@@ -354,7 +355,7 @@ static void __init neocore926_board_init(void)
354 neocore926_add_device_ts(); 355 neocore926_add_device_ts();
355 356
356 /* MMC */ 357 /* MMC */
357 at91_add_device_mmc(1, &neocore926_mmc_data); 358 at91_add_device_mci(0, &neocore926_mci0_data);
358 359
359 /* Ethernet */ 360 /* Ethernet */
360 at91_add_device_eth(&neocore926_macb_data); 361 at91_add_device_eth(&neocore926_macb_data);
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 127065504508..f83e1de699e6 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -62,12 +62,12 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = {
62 .overcurrent_pin= {-EINVAL, -EINVAL}, 62 .overcurrent_pin= {-EINVAL, -EINVAL},
63}; 63};
64 64
65static struct at91_mmc_data __initdata picotux200_mmc_data = { 65static struct mci_platform_data __initdata picotux200_mci0_data = {
66 .det_pin = AT91_PIN_PB27, 66 .slot[0] = {
67 .slot_b = 0, 67 .bus_width = 4,
68 .wire4 = 1, 68 .detect_pin = AT91_PIN_PB27,
69 .wp_pin = AT91_PIN_PA17, 69 .wp_pin = AT91_PIN_PA17,
70 .vcc_pin = -EINVAL, 70 },
71}; 71};
72 72
73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 73#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
@@ -112,7 +112,7 @@ static void __init picotux200_board_init(void)
112 at91_add_device_i2c(NULL, 0); 112 at91_add_device_i2c(NULL, 0);
113 /* MMC */ 113 /* MMC */
114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 114 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
115 at91_add_device_mmc(0, &picotux200_mmc_data); 115 at91_add_device_mci(0, &picotux200_mci0_data);
116 /* NOR Flash */ 116 /* NOR Flash */
117 platform_device_register(&picotux200_flash); 117 platform_device_register(&picotux200_flash);
118} 118}
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index bf351e285422..799f214edebe 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -156,12 +156,12 @@ static void __init ek_add_device_nand(void)
156/* 156/*
157 * MCI (SD/MMC) 157 * MCI (SD/MMC)
158 */ 158 */
159static struct at91_mmc_data __initdata ek_mmc_data = { 159static struct mci_platform_data __initdata ek_mci0_data = {
160 .slot_b = 0, 160 .slot[0] = {
161 .wire4 = 1, 161 .bus_width = 4,
162 .det_pin = -EINVAL, 162 .detect_pin = -EINVAL,
163 .wp_pin = -EINVAL, 163 .wp_pin = -EINVAL,
164 .vcc_pin = -EINVAL, 164 },
165}; 165};
166 166
167/* 167/*
@@ -245,7 +245,7 @@ static void __init ek_board_init(void)
245 /* Ethernet */ 245 /* Ethernet */
246 at91_add_device_eth(&ek_macb_data); 246 at91_add_device_eth(&ek_macb_data);
247 /* MMC */ 247 /* MMC */
248 at91_add_device_mmc(0, &ek_mmc_data); 248 at91_add_device_mci(0, &ek_mci0_data);
249 /* Push Buttons */ 249 /* Push Buttons */
250 ek_add_device_buttons(); 250 ek_add_device_buttons();
251 /* LEDs */ 251 /* LEDs */
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index cc2bf9796073..66338e7ebfba 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -77,12 +77,12 @@ static struct at91_cf_data __initdata dk_cf_data = {
77}; 77};
78 78
79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 79#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
80static struct at91_mmc_data __initdata dk_mmc_data = { 80static struct mci_platform_data __initdata dk_mci0_data = {
81 .slot_b = 0, 81 .slot[0] = {
82 .wire4 = 1, 82 .bus_width = 4,
83 .det_pin = -EINVAL, 83 .detect_pin = -EINVAL,
84 .wp_pin = -EINVAL, 84 .wp_pin = -EINVAL,
85 .vcc_pin = -EINVAL, 85 },
86}; 86};
87#endif 87#endif
88 88
@@ -177,9 +177,6 @@ static struct gpio_led dk_leds[] = {
177 177
178static void __init dk_board_init(void) 178static void __init dk_board_init(void)
179{ 179{
180 /* Setup the LEDs */
181 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
182
183 /* Serial */ 180 /* Serial */
184 /* DBGU on ttyS0. (Rx & Tx only) */ 181 /* DBGU on ttyS0. (Rx & Tx only) */
185 at91_register_uart(0, 0, 0); 182 at91_register_uart(0, 0, 0);
@@ -208,7 +205,7 @@ static void __init dk_board_init(void)
208#else 205#else
209 /* MMC */ 206 /* MMC */
210 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 207 at91_set_gpio_output(AT91_PIN_PB7, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
211 at91_add_device_mmc(0, &dk_mmc_data); 208 at91_add_device_mci(0, &dk_mci0_data);
212#endif 209#endif
213 /* NAND */ 210 /* NAND */
214 at91_add_device_nand(&dk_nand_data); 211 at91_add_device_nand(&dk_nand_data);
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 62e19e64c9d3..5d1b5729dc69 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -70,12 +70,12 @@ static struct at91_udc_data __initdata ek_udc_data = {
70}; 70};
71 71
72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD 72#ifndef CONFIG_MTD_AT91_DATAFLASH_CARD
73static struct at91_mmc_data __initdata ek_mmc_data = { 73static struct mci_platform_data __initdata ek_mci0_data = {
74 .det_pin = AT91_PIN_PB27, 74 .slot[0] = {
75 .slot_b = 0, 75 .bus_width = 4,
76 .wire4 = 1, 76 .detect_pin = AT91_PIN_PB27,
77 .wp_pin = AT91_PIN_PA17, 77 .wp_pin = AT91_PIN_PA17,
78 .vcc_pin = -EINVAL, 78 }
79}; 79};
80#endif 80#endif
81 81
@@ -148,9 +148,6 @@ static struct gpio_led ek_leds[] = {
148 148
149static void __init ek_board_init(void) 149static void __init ek_board_init(void)
150{ 150{
151 /* Setup the LEDs */
152 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
153
154 /* Serial */ 151 /* Serial */
155 /* DBGU on ttyS0. (Rx & Tx only) */ 152 /* DBGU on ttyS0. (Rx & Tx only) */
156 at91_register_uart(0, 0, 0); 153 at91_register_uart(0, 0, 0);
@@ -177,7 +174,7 @@ static void __init ek_board_init(void)
177#else 174#else
178 /* MMC */ 175 /* MMC */
179 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 176 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
180 at91_add_device_mmc(0, &ek_mmc_data); 177 at91_add_device_mci(0, &ek_mci0_data);
181#endif 178#endif
182 /* NOR Flash */ 179 /* NOR Flash */
183 platform_device_register(&ek_flash); 180 platform_device_register(&ek_flash);
diff --git a/arch/arm/mach-at91/board-rsi-ews.c b/arch/arm/mach-at91/board-rsi-ews.c
index c3b43aefdb75..a0ecf04e9ae3 100644
--- a/arch/arm/mach-at91/board-rsi-ews.c
+++ b/arch/arm/mach-at91/board-rsi-ews.c
@@ -58,11 +58,12 @@ static struct at91_usbh_data rsi_ews_usbh_data __initdata = {
58/* 58/*
59 * SD/MC 59 * SD/MC
60 */ 60 */
61static struct at91_mmc_data rsi_ews_mmc_data __initdata = { 61static struct mci_platform_data __initdata rsi_ews_mci0_data = {
62 .slot_b = 0, 62 .slot[0] = {
63 .wire4 = 1, 63 .bus_width = 4,
64 .det_pin = AT91_PIN_PB27, 64 .detect_pin = AT91_PIN_PB27,
65 .wp_pin = AT91_PIN_PB29, 65 .wp_pin = AT91_PIN_PB29,
66 },
66}; 67};
67 68
68/* 69/*
@@ -185,9 +186,6 @@ static struct platform_device rsiews_nor_flash = {
185 */ 186 */
186static void __init rsi_ews_board_init(void) 187static void __init rsi_ews_board_init(void)
187{ 188{
188 /* Setup the LEDs */
189 at91_init_leds(AT91_PIN_PB6, AT91_PIN_PB9);
190
191 /* Serial */ 189 /* Serial */
192 /* DBGU on ttyS0. (Rx & Tx only) */ 190 /* DBGU on ttyS0. (Rx & Tx only) */
193 /* This one is for debugging */ 191 /* This one is for debugging */
@@ -215,7 +213,7 @@ static void __init rsi_ews_board_init(void)
215 at91_add_device_spi(rsi_ews_spi_devices, 213 at91_add_device_spi(rsi_ews_spi_devices,
216 ARRAY_SIZE(rsi_ews_spi_devices)); 214 ARRAY_SIZE(rsi_ews_spi_devices));
217 /* MMC */ 215 /* MMC */
218 at91_add_device_mmc(0, &rsi_ews_mmc_data); 216 at91_add_device_mci(0, &rsi_ews_mci0_data);
219 /* NOR Flash */ 217 /* NOR Flash */
220 platform_device_register(&rsiews_nor_flash); 218 platform_device_register(&rsiews_nor_flash);
221 /* LEDs */ 219 /* LEDs */
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 7bf6da70d7d5..c5f01acce3c0 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -73,7 +73,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
73 * SPI devices. 73 * SPI devices.
74 */ 74 */
75static struct spi_board_info ek_spi_devices[] = { 75static struct spi_board_info ek_spi_devices[] = {
76#if !defined(CONFIG_MMC_AT91) 76#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
77 { /* DataFlash chip */ 77 { /* DataFlash chip */
78 .modalias = "mtd_dataflash", 78 .modalias = "mtd_dataflash",
79 .chip_select = 1, 79 .chip_select = 1,
@@ -158,19 +158,34 @@ static void __init ek_add_device_nand(void)
158/* 158/*
159 * MCI (SD/MMC) 159 * MCI (SD/MMC)
160 */ 160 */
161static struct at91_mmc_data __initdata ek_mmc_data = { 161static struct mci_platform_data __initdata ek_mci0_data = {
162 .slot_b = 1, 162 .slot[1] = {
163 .wire4 = 1, 163 .bus_width = 4,
164 .det_pin = AT91_PIN_PC8, 164 .detect_pin = AT91_PIN_PC8,
165 .wp_pin = AT91_PIN_PC4, 165 .wp_pin = AT91_PIN_PC4,
166 .vcc_pin = -EINVAL, 166 },
167};
168
169/*
170 * LEDs
171 */
172static struct gpio_led ek_leds[] = {
173 { /* D1 */
174 .name = "led1",
175 .gpio = AT91_PIN_PA9,
176 .active_low = 1,
177 .default_trigger = "heartbeat",
178 },
179 { /* D2 */
180 .name = "led2",
181 .gpio = AT91_PIN_PA6,
182 .active_low = 1,
183 .default_trigger = "timer",
184 }
167}; 185};
168 186
169static void __init ek_board_init(void) 187static void __init ek_board_init(void)
170{ 188{
171 /* Setup the LEDs */
172 at91_init_leds(AT91_PIN_PA9, AT91_PIN_PA6);
173
174 /* Serial */ 189 /* Serial */
175 /* DBGU on ttyS0. (Rx & Tx only) */ 190 /* DBGU on ttyS0. (Rx & Tx only) */
176 at91_register_uart(0, 0, 0); 191 at91_register_uart(0, 0, 0);
@@ -194,9 +209,11 @@ static void __init ek_board_init(void)
194 /* Ethernet */ 209 /* Ethernet */
195 at91_add_device_eth(&ek_macb_data); 210 at91_add_device_eth(&ek_macb_data);
196 /* MMC */ 211 /* MMC */
197 at91_add_device_mmc(0, &ek_mmc_data); 212 at91_add_device_mci(0, &ek_mci0_data);
198 /* I2C */ 213 /* I2C */
199 at91_add_device_i2c(NULL, 0); 214 at91_add_device_i2c(NULL, 0);
215 /* LEDs */
216 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
200} 217}
201 218
202MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") 219MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 889c1bf71eb5..8cd6e679fbe0 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -108,7 +108,7 @@ static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
108 * SPI devices. 108 * SPI devices.
109 */ 109 */
110static struct spi_board_info ek_spi_devices[] = { 110static struct spi_board_info ek_spi_devices[] = {
111#if !defined(CONFIG_MMC_AT91) 111#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
112 { /* DataFlash chip */ 112 { /* DataFlash chip */
113 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
114 .chip_select = 1, 114 .chip_select = 1,
@@ -211,12 +211,12 @@ static void __init ek_add_device_nand(void)
211/* 211/*
212 * MCI (SD/MMC) 212 * MCI (SD/MMC)
213 */ 213 */
214static struct at91_mmc_data __initdata ek_mmc_data = { 214static struct mci_platform_data __initdata ek_mci0_data = {
215 .slot_b = 1, 215 .slot[1] = {
216 .wire4 = 1, 216 .bus_width = 4,
217 .det_pin = -EINVAL, 217 .detect_pin = -EINVAL,
218 .wp_pin = -EINVAL, 218 .wp_pin = -EINVAL,
219 .vcc_pin = -EINVAL, 219 },
220}; 220};
221 221
222 222
@@ -329,7 +329,7 @@ static void __init ek_board_init(void)
329 /* Ethernet */ 329 /* Ethernet */
330 at91_add_device_eth(&ek_macb_data); 330 at91_add_device_eth(&ek_macb_data);
331 /* MMC */ 331 /* MMC */
332 at91_add_device_mmc(0, &ek_mmc_data); 332 at91_add_device_mci(0, &ek_mci0_data);
333 /* I2C */ 333 /* I2C */
334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 334 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
335 /* SSC (to AT73C213) */ 335 /* SSC (to AT73C213) */
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 2269be5fa384..27b3af1a3047 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -340,11 +340,12 @@ static struct spi_board_info ek_spi_devices[] = {
340 * MCI (SD/MMC) 340 * MCI (SD/MMC)
341 * det_pin, wp_pin and vcc_pin are not connected 341 * det_pin, wp_pin and vcc_pin are not connected
342 */ 342 */
343static struct at91_mmc_data __initdata ek_mmc_data = { 343static struct mci_platform_data __initdata mci0_data = {
344 .wire4 = 1, 344 .slot[0] = {
345 .det_pin = -EINVAL, 345 .bus_width = 4,
346 .wp_pin = -EINVAL, 346 .detect_pin = -EINVAL,
347 .vcc_pin = -EINVAL, 347 .wp_pin = -EINVAL,
348 },
348}; 349};
349 350
350#endif /* CONFIG_SPI_ATMEL_* */ 351#endif /* CONFIG_SPI_ATMEL_* */
@@ -569,9 +570,6 @@ static struct gpio_led ek_leds[] = {
569 570
570static void __init ek_board_init(void) 571static void __init ek_board_init(void)
571{ 572{
572 /* Setup the LEDs */
573 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
574
575 /* Serial */ 573 /* Serial */
576 /* DBGU on ttyS0. (Rx & Tx only) */ 574 /* DBGU on ttyS0. (Rx & Tx only) */
577 at91_register_uart(0, 0, 0); 575 at91_register_uart(0, 0, 0);
@@ -598,7 +596,7 @@ static void __init ek_board_init(void)
598 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX); 596 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
599#else 597#else
600 /* MMC */ 598 /* MMC */
601 at91_add_device_mmc(0, &ek_mmc_data); 599 at91_add_device_mci(0, &mci0_data);
602#endif 600#endif
603 /* LCD Controller */ 601 /* LCD Controller */
604 at91_add_device_lcdc(&ek_lcdc_data); 602 at91_add_device_lcdc(&ek_lcdc_data);
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 82adf581afc2..073e17403d98 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -141,11 +141,12 @@ static struct spi_board_info ek_spi_devices[] = {
141/* 141/*
142 * MCI (SD/MMC) 142 * MCI (SD/MMC)
143 */ 143 */
144static struct at91_mmc_data __initdata ek_mmc_data = { 144static struct mci_platform_data __initdata mci1_data = {
145 .wire4 = 1, 145 .slot[0] = {
146 .det_pin = AT91_PIN_PE18, 146 .bus_width = 4,
147 .wp_pin = AT91_PIN_PE19, 147 .detect_pin = AT91_PIN_PE18,
148 .vcc_pin = -EINVAL, 148 .wp_pin = AT91_PIN_PE19,
149 },
149}; 150};
150 151
151 152
@@ -420,7 +421,7 @@ static void __init ek_board_init(void)
420 /* Touchscreen */ 421 /* Touchscreen */
421 ek_add_device_ts(); 422 ek_add_device_ts();
422 /* MMC */ 423 /* MMC */
423 at91_add_device_mmc(1, &ek_mmc_data); 424 at91_add_device_mci(1, &mci1_data);
424 /* Ethernet */ 425 /* Ethernet */
425 at91_add_device_eth(&ek_macb_data); 426 at91_add_device_eth(&ek_macb_data);
426 /* NAND */ 427 /* NAND */
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 4ea4ee00364b..3ab2b86a3762 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -92,7 +92,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
92 * SPI devices. 92 * SPI devices.
93 */ 93 */
94static struct spi_board_info ek_spi_devices[] = { 94static struct spi_board_info ek_spi_devices[] = {
95#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91)) 95#if !IS_ENABLED(CONFIG_MMC_ATMELMCI)
96 { /* DataFlash chip */ 96 { /* DataFlash chip */
97 .modalias = "mtd_dataflash", 97 .modalias = "mtd_dataflash",
98 .chip_select = 1, 98 .chip_select = 1,
@@ -199,7 +199,6 @@ static void __init ek_add_device_nand(void)
199 * MCI (SD/MMC) 199 * MCI (SD/MMC)
200 * wp_pin and vcc_pin are not connected 200 * wp_pin and vcc_pin are not connected
201 */ 201 */
202#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
203static struct mci_platform_data __initdata ek_mmc_data = { 202static struct mci_platform_data __initdata ek_mmc_data = {
204 .slot[1] = { 203 .slot[1] = {
205 .bus_width = 4, 204 .bus_width = 4,
@@ -208,28 +207,15 @@ static struct mci_platform_data __initdata ek_mmc_data = {
208 }, 207 },
209 208
210}; 209};
211#else
212static struct at91_mmc_data __initdata ek_mmc_data = {
213 .slot_b = 1, /* Only one slot so use slot B */
214 .wire4 = 1,
215 .det_pin = AT91_PIN_PC9,
216 .wp_pin = -EINVAL,
217 .vcc_pin = -EINVAL,
218};
219#endif
220 210
221static void __init ek_add_device_mmc(void) 211static void __init ek_add_device_mmc(void)
222{ 212{
223#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
224 if (ek_have_2mmc()) { 213 if (ek_have_2mmc()) {
225 ek_mmc_data.slot[0].bus_width = 4; 214 ek_mmc_data.slot[0].bus_width = 4;
226 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2; 215 ek_mmc_data.slot[0].detect_pin = AT91_PIN_PC2;
227 ek_mmc_data.slot[0].wp_pin = -1; 216 ek_mmc_data.slot[0].wp_pin = -1;
228 } 217 }
229 at91_add_device_mci(0, &ek_mmc_data); 218 at91_add_device_mci(0, &ek_mmc_data);
230#else
231 at91_add_device_mmc(0, &ek_mmc_data);
232#endif
233} 219}
234 220
235/* 221/*
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index e7dc3ead7045..fb89ea92e3f2 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -56,11 +56,12 @@ static struct usba_platform_data __initdata ek_usba_udc_data = {
56/* 56/*
57 * MCI (SD/MMC) 57 * MCI (SD/MMC)
58 */ 58 */
59static struct at91_mmc_data __initdata ek_mmc_data = { 59static struct mci_platform_data __initdata mci0_data = {
60 .wire4 = 1, 60 .slot[0] = {
61 .det_pin = AT91_PIN_PA15, 61 .bus_width = 4,
62 .wp_pin = -EINVAL, 62 .detect_pin = AT91_PIN_PA15,
63 .vcc_pin = -EINVAL, 63 .wp_pin = -EINVAL,
64 },
64}; 65};
65 66
66 67
@@ -303,7 +304,7 @@ static void __init ek_board_init(void)
303 /* SPI */ 304 /* SPI */
304 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 305 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
305 /* MMC */ 306 /* MMC */
306 at91_add_device_mmc(0, &ek_mmc_data); 307 at91_add_device_mci(0, &mci0_data);
307 /* LCD Controller */ 308 /* LCD Controller */
308 at91_add_device_lcdc(&ek_lcdc_data); 309 at91_add_device_lcdc(&ek_lcdc_data);
309 /* AC97 */ 310 /* AC97 */
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 29eae1626bf7..c3fb31d5116e 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -83,7 +83,6 @@ static void __init add_device_nand(void)
83 * MCI (SD/MMC) 83 * MCI (SD/MMC)
84 * det_pin, wp_pin and vcc_pin are not connected 84 * det_pin, wp_pin and vcc_pin are not connected
85 */ 85 */
86#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
87static struct mci_platform_data __initdata mmc_data = { 86static struct mci_platform_data __initdata mmc_data = {
88 .slot[0] = { 87 .slot[0] = {
89 .bus_width = 4, 88 .bus_width = 4,
@@ -91,15 +90,6 @@ static struct mci_platform_data __initdata mmc_data = {
91 .wp_pin = -1, 90 .wp_pin = -1,
92 }, 91 },
93}; 92};
94#else
95static struct at91_mmc_data __initdata mmc_data = {
96 .slot_b = 0,
97 .wire4 = 1,
98 .det_pin = -EINVAL,
99 .wp_pin = -EINVAL,
100 .vcc_pin = -EINVAL,
101};
102#endif
103 93
104 94
105/* 95/*
@@ -223,11 +213,7 @@ void __init stamp9g20_board_init(void)
223 /* NAND */ 213 /* NAND */
224 add_device_nand(); 214 add_device_nand();
225 /* MMC */ 215 /* MMC */
226#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
227 at91_add_device_mci(0, &mmc_data); 216 at91_add_device_mci(0, &mmc_data);
228#else
229 at91_add_device_mmc(0, &mmc_data);
230#endif
231 /* W1 */ 217 /* W1 */
232 add_w1(); 218 add_w1();
233} 219}
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index c1476b9fe7b9..6ea069b57335 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -109,14 +109,12 @@ static struct mmc_spi_platform_data at91_mmc_spi_pdata = {
109 * SPI devices. 109 * SPI devices.
110 */ 110 */
111static struct spi_board_info usb_a9263_spi_devices[] = { 111static struct spi_board_info usb_a9263_spi_devices[] = {
112#if !defined(CONFIG_MMC_AT91)
113 { /* DataFlash chip */ 112 { /* DataFlash chip */
114 .modalias = "mtd_dataflash", 113 .modalias = "mtd_dataflash",
115 .chip_select = 0, 114 .chip_select = 0,
116 .max_speed_hz = 15 * 1000 * 1000, 115 .max_speed_hz = 15 * 1000 * 1000,
117 .bus_num = 0, 116 .bus_num = 0,
118 } 117 }
119#endif
120}; 118};
121 119
122static struct spi_board_info usb_a9g20_spi_devices[] = { 120static struct spi_board_info usb_a9g20_spi_devices[] = {
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 516d340549d8..f162fdfd66eb 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -119,11 +119,12 @@ static struct at91_udc_data __initdata yl9200_udc_data = {
119/* 119/*
120 * MMC 120 * MMC
121 */ 121 */
122static struct at91_mmc_data __initdata yl9200_mmc_data = { 122static struct mci_platform_data __initdata yl9200_mci0_data = {
123 .det_pin = AT91_PIN_PB9, 123 .slot[0] = {
124 .wire4 = 1, 124 .bus_width = 4,
125 .wp_pin = -EINVAL, 125 .detect_pin = AT91_PIN_PB9,
126 .vcc_pin = -EINVAL, 126 .wp_pin = -EINVAL,
127 },
127}; 128};
128 129
129/* 130/*
@@ -541,9 +542,6 @@ void __init yl9200_add_device_video(void) {}
541 542
542static void __init yl9200_board_init(void) 543static void __init yl9200_board_init(void)
543{ 544{
544 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */
545 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17);
546
547 /* Serial */ 545 /* Serial */
548 /* DBGU on ttyS0. (Rx & Tx only) */ 546 /* DBGU on ttyS0. (Rx & Tx only) */
549 at91_register_uart(0, 0, 0); 547 at91_register_uart(0, 0, 0);
@@ -568,7 +566,7 @@ static void __init yl9200_board_init(void)
568 /* I2C */ 566 /* I2C */
569 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices)); 567 at91_add_device_i2c(yl9200_i2c_devices, ARRAY_SIZE(yl9200_i2c_devices));
570 /* MMC */ 568 /* MMC */
571 at91_add_device_mmc(0, &yl9200_mmc_data); 569 at91_add_device_mci(0, &yl9200_mci0_data);
572 /* NAND */ 570 /* NAND */
573 at91_add_device_nand(&yl9200_nand_data); 571 at91_add_device_nand(&yl9200_nand_data);
574 /* NOR Flash */ 572 /* NOR Flash */
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 369afc2ffc5b..c55a4364ffb4 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -187,7 +187,6 @@ struct at91_can_data {
187extern void __init at91_add_device_can(struct at91_can_data *data); 187extern void __init at91_add_device_can(struct at91_can_data *data);
188 188
189 /* LEDs */ 189 /* LEDs */
190extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
191extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 190extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
192extern void __init at91_pwm_leds(struct gpio_led *leds, int nr); 191extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
193 192
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c
index 8dfafe76ffe6..1b1e62b5f41b 100644
--- a/arch/arm/mach-at91/leds.c
+++ b/arch/arm/mach-at91/leds.c
@@ -90,108 +90,3 @@ void __init at91_pwm_leds(struct gpio_led *leds, int nr)
90#else 90#else
91void __init at91_pwm_leds(struct gpio_led *leds, int nr){} 91void __init at91_pwm_leds(struct gpio_led *leds, int nr){}
92#endif 92#endif
93
94
95/* ------------------------------------------------------------------------- */
96
97#if defined(CONFIG_LEDS)
98
99#include <asm/leds.h>
100
101/*
102 * Old ARM-specific LED framework; not fully functional when generic time is
103 * in use.
104 */
105
106static u8 at91_leds_cpu;
107static u8 at91_leds_timer;
108
109static inline void at91_led_on(unsigned int led)
110{
111 at91_set_gpio_value(led, 0);
112}
113
114static inline void at91_led_off(unsigned int led)
115{
116 at91_set_gpio_value(led, 1);
117}
118
119static inline void at91_led_toggle(unsigned int led)
120{
121 unsigned long is_off = at91_get_gpio_value(led);
122 if (is_off)
123 at91_led_on(led);
124 else
125 at91_led_off(led);
126}
127
128
129/*
130 * Handle LED events.
131 */
132static void at91_leds_event(led_event_t evt)
133{
134 unsigned long flags;
135
136 local_irq_save(flags);
137
138 switch(evt) {
139 case led_start: /* System startup */
140 at91_led_on(at91_leds_cpu);
141 break;
142
143 case led_stop: /* System stop / suspend */
144 at91_led_off(at91_leds_cpu);
145 break;
146
147#ifdef CONFIG_LEDS_TIMER
148 case led_timer: /* Every 50 timer ticks */
149 at91_led_toggle(at91_leds_timer);
150 break;
151#endif
152
153#ifdef CONFIG_LEDS_CPU
154 case led_idle_start: /* Entering idle state */
155 at91_led_off(at91_leds_cpu);
156 break;
157
158 case led_idle_end: /* Exit idle state */
159 at91_led_on(at91_leds_cpu);
160 break;
161#endif
162
163 default:
164 break;
165 }
166
167 local_irq_restore(flags);
168}
169
170
171static int __init leds_init(void)
172{
173 if (!at91_leds_timer || !at91_leds_cpu)
174 return -ENODEV;
175
176 leds_event = at91_leds_event;
177
178 leds_event(led_start);
179 return 0;
180}
181
182__initcall(leds_init);
183
184
185void __init at91_init_leds(u8 cpu_led, u8 timer_led)
186{
187 /* Enable GPIO to access the LEDs */
188 at91_set_gpio_output(cpu_led, 1);
189 at91_set_gpio_output(timer_led, 1);
190
191 at91_leds_cpu = cpu_led;
192 at91_leds_timer = timer_led;
193}
194
195#else
196void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
197#endif