From 8f1f982565b3c4728b1bfa5baabb1f16fd7b2eef Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Wed, 18 May 2016 13:44:52 +0800 Subject: 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 Original-Commit-Id: Original-Change-Id: I98e8cf15543179904295a86e9f720c2d7c8b443a Original-Signed-off-by: Lin Huang Original-Reviewed-on: https://chromium-review.googlesource.com/349701 Original-Commit-Ready: Douglas Anderson Original-Tested-by: Douglas Anderson Original-Reviewed-by: Vadim Bendebury Reviewed-on: https://review.coreboot.org/15117 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/soc/rockchip/common/include/soc/gpio.h | 2 ++ 1 file changed, 2 insertions(+) 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 #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; -- cgit v1.2.3