提交 b1466376 编写于 作者: S Sudhakar Rajashekhara 提交者: Kevin Hilman

davinci: Macro to convert GPIO signal to GPIO pin number

Adds a macro to convert the GPIO signal passed as bank number
and signal to GPIO pin number.
Signed-off-by: NSudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: NKevin Hilman <khilman@deeprootsystems.com>
上级 491214e1
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
*/ */
#define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ #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 { struct gpio_controller {
u32 dir; u32 dir;
u32 out_data; u32 out_data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册