netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: netdev@vger.kernel.org, Socketcan-core@lists.berlios.de,
	Andrew Victor <linux@maxim.org.za>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] at91sam9263: add at91_can device to generic device definition
Date: Thu, 17 Sep 2009 15:14:22 +0200	[thread overview]
Message-ID: <4AB2362E.3070509@grandegger.com> (raw)
In-Reply-To: <1253180254-11910-2-git-send-email-mkl@pengutronix.de>

Marc Kleine-Budde wrote:
> 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>
> ---
>  arch/arm/mach-at91/at91sam9263_devices.c |   36 ++++++++++++++++++++++++++++++
>  arch/arm/mach-at91/include/mach/board.h  |    6 +++++
>  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 b7f2332..6026c2e 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)
>  void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
>  #endif
>  
> +/* --------------------------------------------------------------------
> + *  CAN Controller
> + * -------------------------------------------------------------------- */
> +
> +#if defined(CONFIG_CAN_AT91) || defined(CONFIG_CAN_AT91_MODULE)
> +static struct resource can_resources[] = {
> +	[0] = {
> +		.start	= AT91SAM9263_BASE_CAN,
> +		.end	= AT91SAM9263_BASE_CAN + SZ_16K - 1,
> +		.flags	= IORESOURCE_MEM,
> +	},
> +	[1] = {
> +		.start	= AT91SAM9263_ID_CAN,
> +		.end	= AT91SAM9263_ID_CAN,
> +		.flags	= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static struct platform_device at91sam9263_can_device = {
> +	.name		= "at91_can",
> +	.id		= -1,
> +	.resource	= can_resources,
> +	.num_resources	= ARRAY_SIZE(can_resources),
> +};
> +
> +void __init at91_add_device_can(struct at91_can_data *data)
> +{
> +	at91_set_A_periph(AT91_PIN_PA13, 0);	/* CANTX */
> +	at91_set_A_periph(AT91_PIN_PA14, 0);	/* CANRX */
> +	at91sam9263_can_device.dev.platform_data = data;
> +
> +	platform_device_register(&at91sam9263_can_device);
> +}
> +#else
> +void __init at91_add_device_can(struct at91_can_data *data) {}
> +#endif
>  
>  /* --------------------------------------------------------------------
>   *  LCD Controller
> diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
> index e6afff8..134731c 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);
>   /* Touchscreen Controller */
>  extern void __init at91_add_device_tsadcc(void);
>  
> +/* CAN */
> +struct at91_can_data {
> +	void (*transceiver_switch)(int on);
> +};
> +extern void __init at91_add_device_can(struct at91_can_data *data);
> +
>   /* LEDs */
>  extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
>  extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);

Acked-by: Wolfgang Grandegger <wg@grandegger.com>

  parent reply	other threads:[~2009-09-17 13:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17  9:37 (unknown), Marc Kleine-Budde
     [not found] ` <1253180254-11910-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-09-17  9:37   ` [PATCH 1/3] at91sam9263: add at91_can device to generic device definition Marc Kleine-Budde
     [not found]     ` <1253180254-11910-2-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-09-17  9:37       ` [PATCH 2/3] at91sam9263ek: activate at91 CAN controller Marc Kleine-Budde
2009-09-17  9:37         ` [PATCH 3/3] at91_can: add driver for Atmel's CAN controller on AT91SAM9263 Marc Kleine-Budde
2009-09-17  9:48           ` Wolfgang Grandegger
2009-09-22 22:09             ` David Miller
2009-09-21 21:44           ` Andrew Victor
     [not found]         ` <1253180254-11910-3-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-09-17 13:14           ` [PATCH 2/3] at91sam9263ek: activate at91 CAN controller Wolfgang Grandegger
2009-09-22 22:09             ` David Miller
2009-09-21 21:27         ` Andrew Victor
2009-09-17 13:14     ` Wolfgang Grandegger [this message]
2009-09-22 22:08       ` [PATCH 1/3] at91sam9263: add at91_can device to generic device definition David Miller
2009-09-17  9:50   ` Wolfgang Grandegger
     [not found]     ` <4AB20679.2040602-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2009-09-17 10:04       ` [PATCH V2 0/3] at91_can: add support for Atmel's CAN controller on AT91SAM9263 Marc Kleine-Budde
2009-09-17 11:33         ` Marc Kleine-Budde
2009-09-21 21:31         ` Andrew Victor
2009-09-21 21:40           ` Russell King - ARM Linux
     [not found]           ` <cd73a99e0909211431k37429a70o4efaac7104f7d526-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-22 22:07             ` Marc Kleine-Budde
  -- strict thread matches above, loose matches on Subject: below --
2009-09-16  9:46 [PATCH " Marc Kleine-Budde
2009-09-16  9:46 ` [PATCH 1/3] at91sam9263: add at91_can device to generic device definition Marc Kleine-Budde
2009-09-21 21:23   ` Andrew Victor
     [not found]     ` <cd73a99e0909211423v11db220fy1a669d389646f249-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-21 21:30       ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AB2362E.3070509@grandegger.com \
    --to=wg@grandegger.com \
    --cc=Socketcan-core@lists.berlios.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@maxim.org.za \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).