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: I0c8c6cc0643a66e9ae1f21b02c7364c641b9805d
Signed-off-by: Martin Roth <martinroth@chromium.org>
Original-Commit-Id:
Original-Change-Id: I98e8cf15543179904295a86e9f720c2d7c8b443a
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/349701
Original-Commit-Ready: Douglas Anderson <dianders@chromium.org>
Original-Tested-by: Douglas Anderson <dianders@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/15117
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Lin Huang 2016-05-18 13:44:52 +08:00 committed by Martin Roth
parent e0667f7b54
commit 8f1f982565
1 changed files with 2 additions and 0 deletions

View File

@ -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;