imx: add IMX_GPIO_NR macro.
Subsystems (3)
PATCH 1/1 imx: add IMX_GPIO_NR macro.
Simplifies specifying gpio numbers from bank/number info. From linux kernel.
Signed-off-by Marc Reilly <[email protected]>
--- arch/arm/mach-imx/include/mach/imx-regs.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-imx/include/mach/imx-regs.h +4 -0
@@ -57,6 +57,10 @@# error "unknown i.MX soc type"#endif +/* There's a off-by-one betweem the gpio bank number and the gpiochip */ +/* range e.g. GPIO_1_5 is gpio 5 under linux */ +#define IMX_GPIO_NR (bank, nr) (((bank) - 1) * 32 + (nr)) +#define GPIO_PIN_MASK 0x1f#define GPIO_PORT_SHIFT 5
Signature · 7 lines
1.7.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox