提交 1e970b7d 编写于 作者: R Rob Herring 提交者: Linus Walleij

gpio: pxa: simplify BANK_OFF macro offset calculation

The macro BANK_OFF which calculates the base offset for each GPIO port.
The macro is needlessly complex and unreadable. Simplify the
calculation to a simple math operation.
Signed-off-by: NRob Herring <robh@kernel.org>
Cc: linux-gpio@vger.kernel.org
Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 b90f8f22
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
#define GAFR_OFFSET 0x54 #define GAFR_OFFSET 0x54
#define ED_MASK_OFFSET 0x9C /* GPIO edge detection for AP side */ #define ED_MASK_OFFSET 0x9C /* GPIO edge detection for AP side */
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : ((n) > 5 ? 0x200 : 0x100) \ #define BANK_OFF(n) (((n) / 3) << 8) + (((n) % 3) << 2)
+ (((n) % 3) << 2))
int pxa_last_gpio; int pxa_last_gpio;
static int irq_base; static int irq_base;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册