rockchip: gpio: add macro so we can get gpio number
sometimes we need gpio number, so add this macro so we can get the gpio number if we need. BRANCH=None BUG=chrome-os-partner:51924 TEST=Build gru Change-Id: I98e8cf15543179904295a86e9f720c2d7c8b443a Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/349701 Commit-Ready: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
parent
af83e1bafb
commit
53844cb28b
1 changed files with 2 additions and 0 deletions
|
|
@ -19,6 +19,8 @@
|
|||
#include <types.h>
|
||||
|
||||
#define GPIO(p, b, i) ((gpio_t){.port = p, .bank = GPIO_##b, .idx = i})
|
||||
#define GET_GPIO_NUM(gpio) (gpio.port * 32 + gpio.bank * 8 + gpio.idx)
|
||||
|
||||
|
||||
struct rockchip_gpio_regs {
|
||||
u32 swporta_dr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue