diff options
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 42 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 42 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 42 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 43 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-carmeva.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-csb337.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-csb637.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-dk.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-eb9200.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-ek.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-kafa.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-kb9202.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-picotux200.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9260ek.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9261ek.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9rlek.c | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-at91/board.h | 3 |
19 files changed, 233 insertions, 36 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 0417c165d50d..9296833f91cc 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | ||
17 | 18 | ||
18 | #include <asm/arch/board.h> | 19 | #include <asm/arch/board.h> |
19 | #include <asm/arch/gpio.h> | 20 | #include <asm/arch/gpio.h> |
@@ -435,7 +436,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
435 | * TWI (i2c) | 436 | * TWI (i2c) |
436 | * -------------------------------------------------------------------- */ | 437 | * -------------------------------------------------------------------- */ |
437 | 438 | ||
438 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 439 | /* |
440 | * Prefer the GPIO code since the TWI controller isn't robust | ||
441 | * (gets overruns and underruns under load) and can only issue | ||
442 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
443 | */ | ||
444 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
445 | |||
446 | static struct i2c_gpio_platform_data pdata = { | ||
447 | .sda_pin = AT91_PIN_PA25, | ||
448 | .sda_is_open_drain = 1, | ||
449 | .scl_pin = AT91_PIN_PA26, | ||
450 | .scl_is_open_drain = 1, | ||
451 | .udelay = 2, /* ~100 kHz */ | ||
452 | }; | ||
453 | |||
454 | static struct platform_device at91rm9200_twi_device = { | ||
455 | .name = "i2c-gpio", | ||
456 | .id = -1, | ||
457 | .dev.platform_data = &pdata, | ||
458 | }; | ||
459 | |||
460 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
461 | { | ||
462 | at91_set_GPIO_periph(AT91_PIN_PA25, 1); /* TWD (SDA) */ | ||
463 | at91_set_multi_drive(AT91_PIN_PA25, 1); | ||
464 | |||
465 | at91_set_GPIO_periph(AT91_PIN_PA26, 1); /* TWCK (SCL) */ | ||
466 | at91_set_multi_drive(AT91_PIN_PA26, 1); | ||
467 | |||
468 | i2c_register_board_info(0, devices, nr_devices); | ||
469 | platform_device_register(&at91rm9200_twi_device); | ||
470 | } | ||
471 | |||
472 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
439 | 473 | ||
440 | static struct resource twi_resources[] = { | 474 | static struct resource twi_resources[] = { |
441 | [0] = { | 475 | [0] = { |
@@ -457,7 +491,7 @@ static struct platform_device at91rm9200_twi_device = { | |||
457 | .num_resources = ARRAY_SIZE(twi_resources), | 491 | .num_resources = ARRAY_SIZE(twi_resources), |
458 | }; | 492 | }; |
459 | 493 | ||
460 | void __init at91_add_device_i2c(void) | 494 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
461 | { | 495 | { |
462 | /* pins used for TWI interface */ | 496 | /* pins used for TWI interface */ |
463 | at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ | 497 | at91_set_A_periph(AT91_PIN_PA25, 0); /* TWD */ |
@@ -466,10 +500,11 @@ void __init at91_add_device_i2c(void) | |||
466 | at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ | 500 | at91_set_A_periph(AT91_PIN_PA26, 0); /* TWCK */ |
467 | at91_set_multi_drive(AT91_PIN_PA26, 1); | 501 | at91_set_multi_drive(AT91_PIN_PA26, 1); |
468 | 502 | ||
503 | i2c_register_board_info(0, devices, nr_devices); | ||
469 | platform_device_register(&at91rm9200_twi_device); | 504 | platform_device_register(&at91rm9200_twi_device); |
470 | } | 505 | } |
471 | #else | 506 | #else |
472 | void __init at91_add_device_i2c(void) {} | 507 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
473 | #endif | 508 | #endif |
474 | 509 | ||
475 | 510 | ||
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index ffd3154c1e54..3091bf47d8c9 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
14 | 14 | ||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/i2c-gpio.h> | ||
16 | 17 | ||
17 | #include <asm/arch/board.h> | 18 | #include <asm/arch/board.h> |
18 | #include <asm/arch/gpio.h> | 19 | #include <asm/arch/gpio.h> |
@@ -352,7 +353,41 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
352 | * TWI (i2c) | 353 | * TWI (i2c) |
353 | * -------------------------------------------------------------------- */ | 354 | * -------------------------------------------------------------------- */ |
354 | 355 | ||
355 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 356 | /* |
357 | * Prefer the GPIO code since the TWI controller isn't robust | ||
358 | * (gets overruns and underruns under load) and can only issue | ||
359 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
360 | */ | ||
361 | |||
362 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
363 | |||
364 | static struct i2c_gpio_platform_data pdata = { | ||
365 | .sda_pin = AT91_PIN_PA23, | ||
366 | .sda_is_open_drain = 1, | ||
367 | .scl_pin = AT91_PIN_PA24, | ||
368 | .scl_is_open_drain = 1, | ||
369 | .udelay = 2, /* ~100 kHz */ | ||
370 | }; | ||
371 | |||
372 | static struct platform_device at91sam9260_twi_device = { | ||
373 | .name = "i2c-gpio", | ||
374 | .id = -1, | ||
375 | .dev.platform_data = &pdata, | ||
376 | }; | ||
377 | |||
378 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
379 | { | ||
380 | at91_set_GPIO_periph(AT91_PIN_PA23, 1); /* TWD (SDA) */ | ||
381 | at91_set_multi_drive(AT91_PIN_PA23, 1); | ||
382 | |||
383 | at91_set_GPIO_periph(AT91_PIN_PA24, 1); /* TWCK (SCL) */ | ||
384 | at91_set_multi_drive(AT91_PIN_PA24, 1); | ||
385 | |||
386 | i2c_register_board_info(0, devices, nr_devices); | ||
387 | platform_device_register(&at91sam9260_twi_device); | ||
388 | } | ||
389 | |||
390 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
356 | 391 | ||
357 | static struct resource twi_resources[] = { | 392 | static struct resource twi_resources[] = { |
358 | [0] = { | 393 | [0] = { |
@@ -374,7 +409,7 @@ static struct platform_device at91sam9260_twi_device = { | |||
374 | .num_resources = ARRAY_SIZE(twi_resources), | 409 | .num_resources = ARRAY_SIZE(twi_resources), |
375 | }; | 410 | }; |
376 | 411 | ||
377 | void __init at91_add_device_i2c(void) | 412 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
378 | { | 413 | { |
379 | /* pins used for TWI interface */ | 414 | /* pins used for TWI interface */ |
380 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ | 415 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ |
@@ -383,10 +418,11 @@ void __init at91_add_device_i2c(void) | |||
383 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ | 418 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ |
384 | at91_set_multi_drive(AT91_PIN_PA24, 1); | 419 | at91_set_multi_drive(AT91_PIN_PA24, 1); |
385 | 420 | ||
421 | i2c_register_board_info(0, devices, nr_devices); | ||
386 | platform_device_register(&at91sam9260_twi_device); | 422 | platform_device_register(&at91sam9260_twi_device); |
387 | } | 423 | } |
388 | #else | 424 | #else |
389 | void __init at91_add_device_i2c(void) {} | 425 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
390 | #endif | 426 | #endif |
391 | 427 | ||
392 | 428 | ||
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 3576595b4941..64979a9023c2 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -14,7 +14,9 @@ | |||
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | ||
17 | 18 | ||
19 | #include <linux/fb.h> | ||
18 | #include <video/atmel_lcdc.h> | 20 | #include <video/atmel_lcdc.h> |
19 | 21 | ||
20 | #include <asm/arch/board.h> | 22 | #include <asm/arch/board.h> |
@@ -275,7 +277,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
275 | * TWI (i2c) | 277 | * TWI (i2c) |
276 | * -------------------------------------------------------------------- */ | 278 | * -------------------------------------------------------------------- */ |
277 | 279 | ||
278 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 280 | /* |
281 | * Prefer the GPIO code since the TWI controller isn't robust | ||
282 | * (gets overruns and underruns under load) and can only issue | ||
283 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
284 | */ | ||
285 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
286 | |||
287 | static struct i2c_gpio_platform_data pdata = { | ||
288 | .sda_pin = AT91_PIN_PA7, | ||
289 | .sda_is_open_drain = 1, | ||
290 | .scl_pin = AT91_PIN_PA8, | ||
291 | .scl_is_open_drain = 1, | ||
292 | .udelay = 2, /* ~100 kHz */ | ||
293 | }; | ||
294 | |||
295 | static struct platform_device at91sam9261_twi_device = { | ||
296 | .name = "i2c-gpio", | ||
297 | .id = -1, | ||
298 | .dev.platform_data = &pdata, | ||
299 | }; | ||
300 | |||
301 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
302 | { | ||
303 | at91_set_GPIO_periph(AT91_PIN_PA7, 1); /* TWD (SDA) */ | ||
304 | at91_set_multi_drive(AT91_PIN_PA7, 1); | ||
305 | |||
306 | at91_set_GPIO_periph(AT91_PIN_PA8, 1); /* TWCK (SCL) */ | ||
307 | at91_set_multi_drive(AT91_PIN_PA8, 1); | ||
308 | |||
309 | i2c_register_board_info(0, devices, nr_devices); | ||
310 | platform_device_register(&at91sam9261_twi_device); | ||
311 | } | ||
312 | |||
313 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
279 | 314 | ||
280 | static struct resource twi_resources[] = { | 315 | static struct resource twi_resources[] = { |
281 | [0] = { | 316 | [0] = { |
@@ -297,7 +332,7 @@ static struct platform_device at91sam9261_twi_device = { | |||
297 | .num_resources = ARRAY_SIZE(twi_resources), | 332 | .num_resources = ARRAY_SIZE(twi_resources), |
298 | }; | 333 | }; |
299 | 334 | ||
300 | void __init at91_add_device_i2c(void) | 335 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
301 | { | 336 | { |
302 | /* pins used for TWI interface */ | 337 | /* pins used for TWI interface */ |
303 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ | 338 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ |
@@ -306,10 +341,11 @@ void __init at91_add_device_i2c(void) | |||
306 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ | 341 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ |
307 | at91_set_multi_drive(AT91_PIN_PA8, 1); | 342 | at91_set_multi_drive(AT91_PIN_PA8, 1); |
308 | 343 | ||
344 | i2c_register_board_info(0, devices, nr_devices); | ||
309 | platform_device_register(&at91sam9261_twi_device); | 345 | platform_device_register(&at91sam9261_twi_device); |
310 | } | 346 | } |
311 | #else | 347 | #else |
312 | void __init at91_add_device_i2c(void) {} | 348 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
313 | #endif | 349 | #endif |
314 | 350 | ||
315 | 351 | ||
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index f924bd5017de..ac329a98e959 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -13,7 +13,9 @@ | |||
13 | #include <asm/mach/map.h> | 13 | #include <asm/mach/map.h> |
14 | 14 | ||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/i2c-gpio.h> | ||
16 | 17 | ||
18 | #include <linux/fb.h> | ||
17 | #include <video/atmel_lcdc.h> | 19 | #include <video/atmel_lcdc.h> |
18 | 20 | ||
19 | #include <asm/arch/board.h> | 21 | #include <asm/arch/board.h> |
@@ -421,7 +423,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
421 | * TWI (i2c) | 423 | * TWI (i2c) |
422 | * -------------------------------------------------------------------- */ | 424 | * -------------------------------------------------------------------- */ |
423 | 425 | ||
424 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 426 | /* |
427 | * Prefer the GPIO code since the TWI controller isn't robust | ||
428 | * (gets overruns and underruns under load) and can only issue | ||
429 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
430 | */ | ||
431 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
432 | |||
433 | static struct i2c_gpio_platform_data pdata = { | ||
434 | .sda_pin = AT91_PIN_PB4, | ||
435 | .sda_is_open_drain = 1, | ||
436 | .scl_pin = AT91_PIN_PB5, | ||
437 | .scl_is_open_drain = 1, | ||
438 | .udelay = 2, /* ~100 kHz */ | ||
439 | }; | ||
440 | |||
441 | static struct platform_device at91sam9263_twi_device = { | ||
442 | .name = "i2c-gpio", | ||
443 | .id = -1, | ||
444 | .dev.platform_data = &pdata, | ||
445 | }; | ||
446 | |||
447 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
448 | { | ||
449 | at91_set_GPIO_periph(AT91_PIN_PB4, 1); /* TWD (SDA) */ | ||
450 | at91_set_multi_drive(AT91_PIN_PB4, 1); | ||
451 | |||
452 | at91_set_GPIO_periph(AT91_PIN_PB5, 1); /* TWCK (SCL) */ | ||
453 | at91_set_multi_drive(AT91_PIN_PB5, 1); | ||
454 | |||
455 | i2c_register_board_info(0, devices, nr_devices); | ||
456 | platform_device_register(&at91sam9263_twi_device); | ||
457 | } | ||
458 | |||
459 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
425 | 460 | ||
426 | static struct resource twi_resources[] = { | 461 | static struct resource twi_resources[] = { |
427 | [0] = { | 462 | [0] = { |
@@ -443,7 +478,7 @@ static struct platform_device at91sam9263_twi_device = { | |||
443 | .num_resources = ARRAY_SIZE(twi_resources), | 478 | .num_resources = ARRAY_SIZE(twi_resources), |
444 | }; | 479 | }; |
445 | 480 | ||
446 | void __init at91_add_device_i2c(void) | 481 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
447 | { | 482 | { |
448 | /* pins used for TWI interface */ | 483 | /* pins used for TWI interface */ |
449 | at91_set_A_periph(AT91_PIN_PB4, 0); /* TWD */ | 484 | at91_set_A_periph(AT91_PIN_PB4, 0); /* TWD */ |
@@ -452,10 +487,11 @@ void __init at91_add_device_i2c(void) | |||
452 | at91_set_A_periph(AT91_PIN_PB5, 0); /* TWCK */ | 487 | at91_set_A_periph(AT91_PIN_PB5, 0); /* TWCK */ |
453 | at91_set_multi_drive(AT91_PIN_PB5, 1); | 488 | at91_set_multi_drive(AT91_PIN_PB5, 1); |
454 | 489 | ||
490 | i2c_register_board_info(0, devices, nr_devices); | ||
455 | platform_device_register(&at91sam9263_twi_device); | 491 | platform_device_register(&at91sam9263_twi_device); |
456 | } | 492 | } |
457 | #else | 493 | #else |
458 | void __init at91_add_device_i2c(void) {} | 494 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
459 | #endif | 495 | #endif |
460 | 496 | ||
461 | 497 | ||
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index cd7532bcd4e5..2bd60a3dc623 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -10,8 +10,9 @@ | |||
10 | #include <asm/mach/map.h> | 10 | #include <asm/mach/map.h> |
11 | 11 | ||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/fb.h> | 13 | #include <linux/i2c-gpio.h> |
14 | 14 | ||
15 | #include <linux/fb.h> | ||
15 | #include <video/atmel_lcdc.h> | 16 | #include <video/atmel_lcdc.h> |
16 | 17 | ||
17 | #include <asm/arch/board.h> | 18 | #include <asm/arch/board.h> |
@@ -169,7 +170,40 @@ void __init at91_add_device_nand(struct at91_nand_data *data) {} | |||
169 | * TWI (i2c) | 170 | * TWI (i2c) |
170 | * -------------------------------------------------------------------- */ | 171 | * -------------------------------------------------------------------- */ |
171 | 172 | ||
172 | #if defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | 173 | /* |
174 | * Prefer the GPIO code since the TWI controller isn't robust | ||
175 | * (gets overruns and underruns under load) and can only issue | ||
176 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
177 | */ | ||
178 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
179 | |||
180 | static struct i2c_gpio_platform_data pdata = { | ||
181 | .sda_pin = AT91_PIN_PA23, | ||
182 | .sda_is_open_drain = 1, | ||
183 | .scl_pin = AT91_PIN_PA24, | ||
184 | .scl_is_open_drain = 1, | ||
185 | .udelay = 2, /* ~100 kHz */ | ||
186 | }; | ||
187 | |||
188 | static struct platform_device at91sam9rl_twi_device = { | ||
189 | .name = "i2c-gpio", | ||
190 | .id = -1, | ||
191 | .dev.platform_data = &pdata, | ||
192 | }; | ||
193 | |||
194 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
195 | { | ||
196 | at91_set_GPIO_periph(AT91_PIN_PA23, 1); /* TWD (SDA) */ | ||
197 | at91_set_multi_drive(AT91_PIN_PA23, 1); | ||
198 | |||
199 | at91_set_GPIO_periph(AT91_PIN_PA24, 1); /* TWCK (SCL) */ | ||
200 | at91_set_multi_drive(AT91_PIN_PA24, 1); | ||
201 | |||
202 | i2c_register_board_info(0, devices, nr_devices); | ||
203 | platform_device_register(&at91sam9rl_twi_device); | ||
204 | } | ||
205 | |||
206 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
173 | 207 | ||
174 | static struct resource twi_resources[] = { | 208 | static struct resource twi_resources[] = { |
175 | [0] = { | 209 | [0] = { |
@@ -191,7 +225,7 @@ static struct platform_device at91sam9rl_twi_device = { | |||
191 | .num_resources = ARRAY_SIZE(twi_resources), | 225 | .num_resources = ARRAY_SIZE(twi_resources), |
192 | }; | 226 | }; |
193 | 227 | ||
194 | void __init at91_add_device_i2c(void) | 228 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
195 | { | 229 | { |
196 | /* pins used for TWI interface */ | 230 | /* pins used for TWI interface */ |
197 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ | 231 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ |
@@ -200,10 +234,11 @@ void __init at91_add_device_i2c(void) | |||
200 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ | 234 | at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */ |
201 | at91_set_multi_drive(AT91_PIN_PA24, 1); | 235 | at91_set_multi_drive(AT91_PIN_PA24, 1); |
202 | 236 | ||
237 | i2c_register_board_info(0, devices, nr_devices); | ||
203 | platform_device_register(&at91sam9rl_twi_device); | 238 | platform_device_register(&at91sam9rl_twi_device); |
204 | } | 239 | } |
205 | #else | 240 | #else |
206 | void __init at91_add_device_i2c(void) {} | 241 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} |
207 | #endif | 242 | #endif |
208 | 243 | ||
209 | 244 | ||
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c index 76ec856cd4f9..0f0878294a67 100644 --- a/arch/arm/mach-at91/board-carmeva.c +++ b/arch/arm/mach-at91/board-carmeva.c | |||
@@ -128,7 +128,7 @@ static void __init carmeva_board_init(void) | |||
128 | /* USB Device */ | 128 | /* USB Device */ |
129 | at91_add_device_udc(&carmeva_udc_data); | 129 | at91_add_device_udc(&carmeva_udc_data); |
130 | /* I2C */ | 130 | /* I2C */ |
131 | at91_add_device_i2c(); | 131 | at91_add_device_i2c(NULL, 0); |
132 | /* SPI */ | 132 | /* SPI */ |
133 | at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices)); | 133 | at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices)); |
134 | /* Compact Flash */ | 134 | /* Compact Flash */ |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index dde089922e3b..d0aa20c9383e 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/i2c.h> | ||
27 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
28 | #include <linux/mtd/physmap.h> | 27 | #include <linux/mtd/physmap.h> |
29 | 28 | ||
@@ -85,12 +84,12 @@ static struct at91_udc_data __initdata csb337_udc_data = { | |||
85 | }; | 84 | }; |
86 | 85 | ||
87 | static struct i2c_board_info __initdata csb337_i2c_devices[] = { | 86 | static struct i2c_board_info __initdata csb337_i2c_devices[] = { |
88 | { I2C_BOARD_INFO("rtc-ds1307", 0x68), | 87 | { |
89 | .type = "ds1307", | 88 | I2C_BOARD_INFO("rtc-ds1307", 0x68), |
89 | .type = "ds1307", | ||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | |||
94 | static struct at91_cf_data __initdata csb337_cf_data = { | 93 | static struct at91_cf_data __initdata csb337_cf_data = { |
95 | /* | 94 | /* |
96 | * connector P4 on the CSB 337 mates to | 95 | * connector P4 on the CSB 337 mates to |
@@ -168,9 +167,7 @@ static void __init csb337_board_init(void) | |||
168 | /* USB Device */ | 167 | /* USB Device */ |
169 | at91_add_device_udc(&csb337_udc_data); | 168 | at91_add_device_udc(&csb337_udc_data); |
170 | /* I2C */ | 169 | /* I2C */ |
171 | at91_add_device_i2c(); | 170 | at91_add_device_i2c(csb337_i2c_devices, ARRAY_SIZE(csb337_i2c_devices)); |
172 | i2c_register_board_info(0, csb337_i2c_devices, | ||
173 | ARRAY_SIZE(csb337_i2c_devices)); | ||
174 | /* Compact Flash */ | 171 | /* Compact Flash */ |
175 | at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */ | 172 | at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */ |
176 | at91_add_device_cf(&csb337_cf_data); | 173 | at91_add_device_cf(&csb337_cf_data); |
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c index 77f04b935b3a..c5c721d27f42 100644 --- a/arch/arm/mach-at91/board-csb637.c +++ b/arch/arm/mach-at91/board-csb637.c | |||
@@ -129,7 +129,7 @@ static void __init csb637_board_init(void) | |||
129 | /* USB Device */ | 129 | /* USB Device */ |
130 | at91_add_device_udc(&csb637_udc_data); | 130 | at91_add_device_udc(&csb637_udc_data); |
131 | /* I2C */ | 131 | /* I2C */ |
132 | at91_add_device_i2c(); | 132 | at91_add_device_i2c(NULL, 0); |
133 | /* SPI */ | 133 | /* SPI */ |
134 | at91_add_device_spi(NULL, 0); | 134 | at91_add_device_spi(NULL, 0); |
135 | /* NOR flash */ | 135 | /* NOR flash */ |
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c index af497896a96c..40c9e4331706 100644 --- a/arch/arm/mach-at91/board-dk.c +++ b/arch/arm/mach-at91/board-dk.c | |||
@@ -124,6 +124,19 @@ static struct spi_board_info dk_spi_devices[] = { | |||
124 | #endif | 124 | #endif |
125 | }; | 125 | }; |
126 | 126 | ||
127 | static struct i2c_board_info __initdata dk_i2c_devices[] = { | ||
128 | { | ||
129 | I2C_BOARD_INFO("ics1523", 0x26), | ||
130 | }, | ||
131 | { | ||
132 | I2C_BOARD_INFO("x9429", 0x28), | ||
133 | }, | ||
134 | { | ||
135 | I2C_BOARD_INFO("at24c", 0x50), | ||
136 | .type = "24c1024", | ||
137 | } | ||
138 | }; | ||
139 | |||
127 | static struct mtd_partition __initdata dk_nand_partition[] = { | 140 | static struct mtd_partition __initdata dk_nand_partition[] = { |
128 | { | 141 | { |
129 | .name = "NAND Partition 1", | 142 | .name = "NAND Partition 1", |
@@ -185,7 +198,7 @@ static void __init dk_board_init(void) | |||
185 | /* Compact Flash */ | 198 | /* Compact Flash */ |
186 | at91_add_device_cf(&dk_cf_data); | 199 | at91_add_device_cf(&dk_cf_data); |
187 | /* I2C */ | 200 | /* I2C */ |
188 | at91_add_device_i2c(); | 201 | at91_add_device_i2c(dk_i2c_devices, ARRAY_SIZE(dk_i2c_devices)); |
189 | /* SPI */ | 202 | /* SPI */ |
190 | at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices)); | 203 | at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices)); |
191 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 204 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c index 20458b5548f0..b7b79bb9d6c4 100644 --- a/arch/arm/mach-at91/board-eb9200.c +++ b/arch/arm/mach-at91/board-eb9200.c | |||
@@ -91,6 +91,14 @@ static struct at91_mmc_data __initdata eb9200_mmc_data = { | |||
91 | .wire4 = 1, | 91 | .wire4 = 1, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static struct i2c_board_info __initdata eb9200_i2c_devices[] = { | ||
95 | { | ||
96 | I2C_BOARD_INFO("at24c", 0x50), | ||
97 | .type = "24c512", | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | |||
94 | static void __init eb9200_board_init(void) | 102 | static void __init eb9200_board_init(void) |
95 | { | 103 | { |
96 | /* Serial */ | 104 | /* Serial */ |
@@ -102,7 +110,7 @@ static void __init eb9200_board_init(void) | |||
102 | /* USB Device */ | 110 | /* USB Device */ |
103 | at91_add_device_udc(&eb9200_udc_data); | 111 | at91_add_device_udc(&eb9200_udc_data); |
104 | /* I2C */ | 112 | /* I2C */ |
105 | at91_add_device_i2c(); | 113 | at91_add_device_i2c(eb9200_i2c_devices, ARRAY_SIZE(eb9200_i2c_devices)); |
106 | /* Compact Flash */ | 114 | /* Compact Flash */ |
107 | at91_add_device_cf(&eb9200_cf_data); | 115 | at91_add_device_cf(&eb9200_cf_data); |
108 | /* SPI */ | 116 | /* SPI */ |
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-ek.c index 322fdd75a1e4..d05b1b2be9fb 100644 --- a/arch/arm/mach-at91/board-ek.c +++ b/arch/arm/mach-at91/board-ek.c | |||
@@ -145,7 +145,7 @@ static void __init ek_board_init(void) | |||
145 | at91_add_device_udc(&ek_udc_data); | 145 | at91_add_device_udc(&ek_udc_data); |
146 | at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | 146 | at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ |
147 | /* I2C */ | 147 | /* I2C */ |
148 | at91_add_device_i2c(); | 148 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); |
149 | /* SPI */ | 149 | /* SPI */ |
150 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); | 150 | at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); |
151 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 151 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index c77d84ce9cae..cf1b7b2f76fb 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
@@ -92,7 +92,7 @@ static void __init kafa_board_init(void) | |||
92 | /* USB Device */ | 92 | /* USB Device */ |
93 | at91_add_device_udc(&kafa_udc_data); | 93 | at91_add_device_udc(&kafa_udc_data); |
94 | /* I2C */ | 94 | /* I2C */ |
95 | at91_add_device_i2c(); | 95 | at91_add_device_i2c(NULL, 0); |
96 | /* SPI */ | 96 | /* SPI */ |
97 | at91_add_device_spi(NULL, 0); | 97 | at91_add_device_spi(NULL, 0); |
98 | } | 98 | } |
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c index 7d9b1a278fd6..4b39b9cda75b 100644 --- a/arch/arm/mach-at91/board-kb9202.c +++ b/arch/arm/mach-at91/board-kb9202.c | |||
@@ -124,7 +124,7 @@ static void __init kb9202_board_init(void) | |||
124 | /* MMC */ | 124 | /* MMC */ |
125 | at91_add_device_mmc(0, &kb9202_mmc_data); | 125 | at91_add_device_mmc(0, &kb9202_mmc_data); |
126 | /* I2C */ | 126 | /* I2C */ |
127 | at91_add_device_i2c(); | 127 | at91_add_device_i2c(NULL, 0); |
128 | /* SPI */ | 128 | /* SPI */ |
129 | at91_add_device_spi(NULL, 0); | 129 | at91_add_device_spi(NULL, 0); |
130 | /* NAND */ | 130 | /* NAND */ |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index 49cfe7ab4a85..6acb55c09ae5 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
@@ -139,7 +139,7 @@ static void __init picotux200_board_init(void) | |||
139 | // at91_add_device_udc(&picotux200_udc_data); | 139 | // at91_add_device_udc(&picotux200_udc_data); |
140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | 140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ |
141 | /* I2C */ | 141 | /* I2C */ |
142 | at91_add_device_i2c(); | 142 | at91_add_device_i2c(NULL, 0); |
143 | /* SPI */ | 143 | /* SPI */ |
144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); | 144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); |
145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | 145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD |
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index 65fa532bb4ac..b343a6c28120 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -189,7 +189,7 @@ static void __init ek_board_init(void) | |||
189 | /* MMC */ | 189 | /* MMC */ |
190 | at91_add_device_mmc(0, &ek_mmc_data); | 190 | at91_add_device_mmc(0, &ek_mmc_data); |
191 | /* I2C */ | 191 | /* I2C */ |
192 | at91_add_device_i2c(); | 192 | at91_add_device_i2c(NULL, 0); |
193 | } | 193 | } |
194 | 194 | ||
195 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") | 195 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 42e172cb0f49..b62a5e6eaa4d 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -406,7 +406,7 @@ static void __init ek_board_init(void) | |||
406 | /* USB Device */ | 406 | /* USB Device */ |
407 | at91_add_device_udc(&ek_udc_data); | 407 | at91_add_device_udc(&ek_udc_data); |
408 | /* I2C */ | 408 | /* I2C */ |
409 | at91_add_device_i2c(); | 409 | at91_add_device_i2c(NULL, 0); |
410 | /* NAND */ | 410 | /* NAND */ |
411 | at91_add_device_nand(&ek_nand_data); | 411 | at91_add_device_nand(&ek_nand_data); |
412 | /* DM9000 ethernet */ | 412 | /* DM9000 ethernet */ |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 2a1cc73390b7..ab9dcc075454 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -291,7 +291,7 @@ static void __init ek_board_init(void) | |||
291 | /* NAND */ | 291 | /* NAND */ |
292 | at91_add_device_nand(&ek_nand_data); | 292 | at91_add_device_nand(&ek_nand_data); |
293 | /* I2C */ | 293 | /* I2C */ |
294 | at91_add_device_i2c(); | 294 | at91_add_device_i2c(NULL, 0); |
295 | /* LCD Controller */ | 295 | /* LCD Controller */ |
296 | at91_add_device_lcdc(&ek_lcdc_data); | 296 | at91_add_device_lcdc(&ek_lcdc_data); |
297 | /* AC97 */ | 297 | /* AC97 */ |
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 9b61320f295a..bc0546d7245f 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -181,7 +181,7 @@ static void __init ek_board_init(void) | |||
181 | /* Serial */ | 181 | /* Serial */ |
182 | at91_add_device_serial(); | 182 | at91_add_device_serial(); |
183 | /* I2C */ | 183 | /* I2C */ |
184 | at91_add_device_i2c(); | 184 | at91_add_device_i2c(NULL, 0); |
185 | /* NAND */ | 185 | /* NAND */ |
186 | at91_add_device_nand(&ek_nand_data); | 186 | at91_add_device_nand(&ek_nand_data); |
187 | /* SPI */ | 187 | /* SPI */ |
diff --git a/include/asm-arm/arch-at91/board.h b/include/asm-arm/arch-at91/board.h index c0d7075982c1..79054965baa6 100644 --- a/include/asm-arm/arch-at91/board.h +++ b/include/asm-arm/arch-at91/board.h | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | #include <linux/i2c.h> | ||
36 | #include <linux/spi/spi.h> | 37 | #include <linux/spi/spi.h> |
37 | 38 | ||
38 | /* USB Device */ | 39 | /* USB Device */ |
@@ -94,7 +95,7 @@ struct at91_nand_data { | |||
94 | extern void __init at91_add_device_nand(struct at91_nand_data *data); | 95 | extern void __init at91_add_device_nand(struct at91_nand_data *data); |
95 | 96 | ||
96 | /* I2C*/ | 97 | /* I2C*/ |
97 | extern void __init at91_add_device_i2c(void); | 98 | extern void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices); |
98 | 99 | ||
99 | /* SPI */ | 100 | /* SPI */ |
100 | extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices); | 101 | extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices); |