linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: mx53_ard: Add flexcan support
Date: Tue, 6 Sep 2011 21:27:37 +0200	[thread overview]
Message-ID: <20110906192737.GM28816@pengutronix.de> (raw)
In-Reply-To: <1315335696-20499-4-git-send-email-rogerio.pimentel@freescale.com>

On Tue, Sep 06, 2011 at 04:01:36PM -0300, Rogerio Pimentel wrote:
> Adding flexcan support on i.MX53 ARD
> 
> Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
> ---
>  arch/arm/mach-mx5/Kconfig          |    1 +
>  arch/arm/mach-mx5/board-mx53_ard.c |   21 +++++++++++++++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
> index fb4c503..7c911d1 100644
> --- a/arch/arm/mach-mx5/Kconfig
> +++ b/arch/arm/mach-mx5/Kconfig
> @@ -205,6 +205,7 @@ config MACH_MX53_LOCO
>  config MACH_MX53_ARD
>  	bool "Support MX53 ARD platforms"
>  	select SOC_IMX53
> +	select IMX_HAVE_PLATFORM_FLEXCAN
>  	select IMX_HAVE_PLATFORM_IMX2_WDT
>  	select IMX_HAVE_PLATFORM_IMX_I2C
>  	select IMX_HAVE_PLATFORM_IMX_UART
> diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
> index 76a67c4..e5f174b 100644
> --- a/arch/arm/mach-mx5/board-mx53_ard.c
> +++ b/arch/arm/mach-mx5/board-mx53_ard.c
> @@ -44,6 +44,8 @@
>  #define ARD_BACK			IMX_GPIO_NR(5, 11)
>  #define ARD_PROG			IMX_GPIO_NR(5, 12)
>  #define ARD_VOLUMEUP		IMX_GPIO_NR(5, 13)
> +#define ARD_CAN_EN		IMX_GPIO_NR(7, 6)
> +#define ARD_CAN_STBY		IMX_GPIO_NR(4, 15)
>  
>  static iomux_v3_cfg_t mx53_ard_pads[] = {
>  	/* UART1 */
> @@ -102,6 +104,13 @@ static iomux_v3_cfg_t mx53_ard_pads[] = {
>  	MX53_PAD_DISP0_DAT18__GPIO5_12,	/* prog */
>  	MX53_PAD_DISP0_DAT19__GPIO5_13,	/* vol up */
>  	MX53_PAD_GPIO_10__GPIO4_0,		/* vol down */
> +	/* CAN */
> +	MX53_PAD_KEY_COL2__CAN1_TXCAN,
> +	MX53_PAD_KEY_ROW2__CAN1_RXCAN,
> +	MX53_PAD_PATA_RESET_B__CAN2_TXCAN,
> +	MX53_PAD_PATA_IORDY__CAN2_RXCAN,
> +	MX53_PAD_PATA_DA_0__GPIO7_6,
> +	MX53_PAD_KEY_ROW4__GPIO4_15,
>  };
>  
>  #define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake)	\
> @@ -171,6 +180,8 @@ static struct imxi2c_platform_data mx53_ard_i2c3_data = {
>  
>  static void __init mx53_ard_io_init(void)
>  {
> +	int ret;
> +
>  	mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
>  				ARRAY_SIZE(mx53_ard_pads));
>  
> @@ -179,6 +190,14 @@ static void __init mx53_ard_io_init(void)
>  
>  	gpio_request(ARD_I2CPORTEXP_B, "i2cptexp-rst");
>  	gpio_direction_output(ARD_I2CPORTEXP_B, 1);
> +
> +	ret = gpio_request_one(ARD_CAN_EN, GPIOF_OUT_INIT_HIGH, "can-en");
> +	if (ret)
> +		pr_err("Cannot request ARD_CAN_EN pin: %d\n", ret);
> +
> +	ret = gpio_request_one(ARD_CAN_STBY, GPIOF_OUT_INIT_HIGH, "can-stby");
> +	if (ret)
> +		pr_err("Cannot request ARD_CAN_STBY pin: %d\n", ret);
>  }
>  
>  /* Config CS1 settings for ethernet controller */
> @@ -234,6 +253,8 @@ static void __init mx53_ard_board_init(void)
>  	imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
>  	imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
>  	imx_add_gpio_keys(&ard_button_data);
> +	imx53_add_flexcan0(NULL);
> +	imx53_add_flexcan1(NULL);
If gpio_request_one above fails, do you really want to add the devices
then?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2011-09-06 19:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-06 19:01 [PATCH 1/4] ARM: mx53: Add pads for flexcan pins Rogerio Pimentel
2011-09-06 19:01 ` [PATCH 2/4] ARM: mx53: Add clock for flexcan Rogerio Pimentel
2011-09-06 19:01 ` [PATCH 3/4] ARM: mx53: Add resources " Rogerio Pimentel
2011-09-06 19:25   ` Uwe Kleine-König
2011-09-06 19:01 ` [PATCH 4/4] ARM: mx53_ard: Add flexcan support Rogerio Pimentel
2011-09-06 19:27   ` Uwe Kleine-König [this message]
2011-09-06 19:32 ` [PATCH 1/4] ARM: mx53: Add pads for flexcan pins Uwe Kleine-König
2011-09-08 16:30   ` Rogerio Pimentel
2011-09-08 19:07     ` Uwe Kleine-König

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=20110906192737.GM28816@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).