public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change
Date: Mon, 06 Aug 2012 11:45:57 +0200	[thread overview]
Message-ID: <501F9255.4070403@denx.de> (raw)
In-Reply-To: <1344160819-18665-2-git-send-email-tremyfr@yahoo.fr>

On 05/08/2012 12:00, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
> ---
>  board/logicpd/imx27lite/imx27lite.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 

Hi Philippe,


>  {
> -	struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
> +	struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>  	struct system_control_regs *sc_regs =
>  		(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
> @@ -43,8 +44,8 @@ int board_init(void)
>  #ifdef CONFIG_FEC_MXC
>  	mx27_fec_init_pins();
>  	imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
> -	writel(readl(&regs->port[PORTC].dr) | (1 << 31),
> -				&regs->port[PORTC].dr);
> +	writel(readl(&regs->port[PORTC].gpio_dr) | (1 << 31),
> +				&regs->port[PORTC].gpio_dr);

This is not what I am expecting from the patch when it will move to
generic GPIO API.

The GPIO API uses really generic as in kernel functions, independently
from the SOC where it is running. This hides the physical registers of
the GPIOs.

Instead of that, gpio_set_value(), gpio_get_value(),
gpio_direction_input() and gpio_direction_output() should be used. You
can take a look at other iMX (MX3, MX28, MX5, MX6), that are already
using the generic API.

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2012-08-06  9:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 10:00 [U-Boot] [PATCH 1/2] gpio: add gpio api support to mx27 Philippe Reynes
2012-08-05 10:00 ` [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change Philippe Reynes
2012-08-06  9:45   ` Stefano Babic [this message]
2012-08-06 15:27     ` Philippe Reynes
2012-08-06 15:39       ` Stefano Babic

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=501F9255.4070403@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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