diff mbox

davinci: Macro to convert GPIO signal to GPIO pin number

Message ID 1250179916-31209-1-git-send-email-sudhakar.raj@ti.com (mailing list archive)
State Accepted
Headers show

Commit Message

Rajashekhara, Sudhakar Aug. 13, 2009, 4:11 p.m. UTC
Adds a macro to convert the GPIO signal passed as bank number
and signal to GPIO pin number.

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
---
 arch/arm/mach-davinci/include/mach/gpio.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Kevin Hilman Aug. 13, 2009, 11:07 p.m. UTC | #1
Sudhakar Rajashekhara <sudhakar.raj@ti.com> writes:

> Adds a macro to convert the GPIO signal passed as bank number
> and signal to GPIO pin number.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>

Thanks, pushing today.

Kevin

> ---
>  arch/arm/mach-davinci/include/mach/gpio.h |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
> index 4f032b3..f3b8ef8 100644
> --- a/arch/arm/mach-davinci/include/mach/gpio.h
> +++ b/arch/arm/mach-davinci/include/mach/gpio.h
> @@ -42,6 +42,9 @@
>   */
>  #define	GPIO(X)		(X)		/* 0 <= X <= (DAVINCI_N_GPIO - 1) */
>  
> +/* Convert GPIO signal to GPIO pin number */
> +#define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
> +
>  struct gpio_controller {
>  	u32	dir;
>  	u32	out_data;
> -- 
> 1.5.6
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 4f032b3..f3b8ef8 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -42,6 +42,9 @@ 
  */
 #define	GPIO(X)		(X)		/* 0 <= X <= (DAVINCI_N_GPIO - 1) */
 
+/* Convert GPIO signal to GPIO pin number */
+#define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
+
 struct gpio_controller {
 	u32	dir;
 	u32	out_data;