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 1/3] imx: Add GPIO_TO_PORT macro
Date: Fri, 06 Apr 2012 10:56:10 +0200	[thread overview]
Message-ID: <4F7EAFAA.9020502@denx.de> (raw)
In-Reply-To: <4F7C7153.3040601@gmail.com>

On 04/04/2012 18:05, Vikram Narayanan wrote:
> imx: Add GPIO_TO_PORT macro
> 
> Signed-off-by: Vikram Narayanan <vikram186@gmail.com>

Hi,

> ---
>  arch/arm/include/asm/arch-mx5/gpio.h |    2 ++
>  arch/arm/include/asm/arch-mx6/gpio.h |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
>   50.0% arch/arm/include/asm/arch-mx5/
>   50.0% arch/arm/include/asm/arch-mx6/
> 
> diff --git a/arch/arm/include/asm/arch-mx5/gpio.h b/arch/arm/include/asm/arch-mx5/gpio.h
> index 1dc34e9..bcb5edb 100644
> --- a/arch/arm/include/asm/arch-mx5/gpio.h
> +++ b/arch/arm/include/asm/arch-mx5/gpio.h
> @@ -25,6 +25,8 @@
>  #ifndef __ASM_ARCH_MX5_GPIO_H
>  #define __ASM_ARCH_MX5_GPIO_H
>  
> +#define GPIO_TO_PORT(number)		(number/32)
> +
>  /* GPIO registers */
>  struct gpio_regs {
>  	u32	gpio_dr;
> diff --git a/arch/arm/include/asm/arch-mx6/gpio.h b/arch/arm/include/asm/arch-mx6/gpio.h
> index 20c4e57..385d12d 100644
> --- a/arch/arm/include/asm/arch-mx6/gpio.h
> +++ b/arch/arm/include/asm/arch-mx6/gpio.h
> @@ -25,6 +25,8 @@
>  #ifndef __ASM_ARCH_MX6_GPIO_H
>  #define __ASM_ARCH_MX6_GPIO_H
>  
> +#define GPIO_TO_PORT(number)		(number/32)
> +
>  /* GPIO registers */
>  struct gpio_regs {
>  	u32	gpio_dr;

NAK. We have already (and probably too many) GPIO_TO_PORT:

arch/arm/include/asm/arch-mx6/imx-regs.h:#define GPIO_TO_PORT(number)	
(((number)/32)+1)
arch/arm/include/asm/arch-mx5/mx5x_pins.h:#define GPIO_TO_PORT(n)
  (n / GPIO_NUM_PIN)

Are they not enough ?

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-04-06  8:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 16:05 [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro Vikram Narayanan
2012-04-06  8:56 ` Stefano Babic [this message]
2012-04-09  5:33   ` Dirk Behme
2012-04-09 14:30     ` Vikram Narayanan
2012-04-09 16:09   ` Vikram Narayanan
2012-04-09 22:31     ` stefano babic
2012-04-10  2:47       ` Vikram Narayanan

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=4F7EAFAA.9020502@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