Skip to content

Commit

Permalink
at91sam9263ek: activate at91 CAN controller
Browse files Browse the repository at this point in the history
This patch activates the at91 CAN controller for the at91sam9263ek
development board.

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>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marc Kleine-Budde authored and David S. Miller committed Sep 22, 2009
1 parent 58a587d commit a7a1a05
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions arch/arm/mach-at91/board-sam9263ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,23 @@ static struct gpio_led ek_pwm_led[] = {
}
};

/*
* CAN
*/
static void sam9263ek_transceiver_switch(int on)
{
if (on) {
at91_set_gpio_output(AT91_PIN_PA18, 1); /* CANRXEN */
at91_set_gpio_output(AT91_PIN_PA19, 0); /* CANRS */
} else {
at91_set_gpio_output(AT91_PIN_PA18, 0); /* CANRXEN */
at91_set_gpio_output(AT91_PIN_PA19, 1); /* CANRS */
}
}

static struct at91_can_data ek_can_data = {
.transceiver_switch = sam9263ek_transceiver_switch,
};

static void __init ek_board_init(void)
{
Expand Down Expand Up @@ -431,6 +448,8 @@ static void __init ek_board_init(void)
/* LEDs */
at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led));
/* CAN */
at91_add_device_can(&ek_can_data);
}

MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
Expand Down

0 comments on commit a7a1a05

Please sign in to comment.