aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2009-09-16 19:37:32 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-22 17:45:06 -0400
commit58a587dc2abd436a6a8d0de729d9ed7e40ce0ac9 (patch)
tree64a821e8fa0ea28b35a5f0994707fef2b6d86d17 /arch/arm
parentec4756238239f1a331d9fb95bad8b281dad56855 (diff)
at91sam9263: add at91_can device to generic device definition
This patch adds the device definition for the at91_can device to the generic device definiton file for the at91sam9263. Signed-off-by: Hans J. Koch <hjk@linutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c36
-rw-r--r--arch/arm/mach-at91/include/mach/board.h6
2 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index b7f233242315..6026c2e0d5cc 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -757,6 +757,42 @@ void __init at91_add_device_ac97(struct atmel_ac97_data *data)
757void __init at91_add_device_ac97(struct atmel_ac97_data *data) {} 757void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
758#endif 758#endif
759 759
760/* --------------------------------------------------------------------
761 * CAN Controller
762 * -------------------------------------------------------------------- */
763
764#if defined(CONFIG_CAN_AT91) || defined(CONFIG_CAN_AT91_MODULE)
765static struct resource can_resources[] = {
766 [0] = {
767 .start = AT91SAM9263_BASE_CAN,
768 .end = AT91SAM9263_BASE_CAN + SZ_16K - 1,
769 .flags = IORESOURCE_MEM,
770 },
771 [1] = {
772 .start = AT91SAM9263_ID_CAN,
773 .end = AT91SAM9263_ID_CAN,
774 .flags = IORESOURCE_IRQ,
775 },
776};
777
778static struct platform_device at91sam9263_can_device = {
779 .name = "at91_can",
780 .id = -1,
781 .resource = can_resources,
782 .num_resources = ARRAY_SIZE(can_resources),
783};
784
785void __init at91_add_device_can(struct at91_can_data *data)
786{
787 at91_set_A_periph(AT91_PIN_PA13, 0); /* CANTX */
788 at91_set_A_periph(AT91_PIN_PA14, 0); /* CANRX */
789 at91sam9263_can_device.dev.platform_data = data;
790
791 platform_device_register(&at91sam9263_can_device);
792}
793#else
794void __init at91_add_device_can(struct at91_can_data *data) {}
795#endif
760 796
761/* -------------------------------------------------------------------- 797/* --------------------------------------------------------------------
762 * LCD Controller 798 * LCD Controller
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index e6afff849b85..134731cd9fdf 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -179,6 +179,12 @@ extern void __init at91_add_device_isi(void);
179 /* Touchscreen Controller */ 179 /* Touchscreen Controller */
180extern void __init at91_add_device_tsadcc(void); 180extern void __init at91_add_device_tsadcc(void);
181 181
182/* CAN */
183struct at91_can_data {
184 void (*transceiver_switch)(int on);
185};
186extern void __init at91_add_device_can(struct at91_can_data *data);
187
182 /* LEDs */ 188 /* LEDs */
183extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); 189extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
184extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 190extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);