summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-05-18 13:44:52 +0800
committerMartin Roth <martinroth@google.com>2016-06-21 22:25:29 +0200
commit8f1f982565b3c4728b1bfa5baabb1f16fd7b2eef (patch)
treeeae75017aa36c2e9e27f9cbea91458ccff06c420 /src
parente0667f7b54078870afbab0bc78afd5b3795c002f (diff)
downloadcoreboot-8f1f982565b3c4728b1bfa5baabb1f16fd7b2eef.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/soc/rockchip/common/include/soc/gpio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/soc/rockchip/common/include/soc/gpio.h b/src/soc/rockchip/common/include/soc/gpio.h
index f2e7970daa..55eb41d980 100644
--- a/src/soc/rockchip/common/include/soc/gpio.h
+++ b/src/soc/rockchip/common/include/soc/gpio.h
@@ -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;