diff options
author | Adrian Alonso <adrian.alonso@nxp.com> | 2016-03-08 14:53:31 -0600 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-04-27 02:32:29 -0700 |
commit | 3733fc85c1f29f2d0ac2af42eca64d5939902fe3 (patch) | |
tree | bc1c7a7bcd6e68a0cfe90f1c13825650d4ff87af /arch/arm/include/asm/arch-imx8 | |
parent | 71368855b63c16998ca5681984e70a913e1f4d84 (diff) |
MLK-14938-21 mxc_gpio: add support for i.MX8
Add support for iMX8 SoC platforms, and extend to support LSIO GPIO0..GPIO7 ports.
Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX platforms,
so we have to adjust the index accordingly.
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cb3eabdb56173a75495717bf88fbc1d04623f6d7)
Diffstat (limited to 'arch/arm/include/asm/arch-imx8')
-rw-r--r-- | arch/arm/include/asm/arch-imx8/gpio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-imx8/gpio.h b/arch/arm/include/asm/arch-imx8/gpio.h new file mode 100644 index 0000000000..51aa9e862f --- /dev/null +++ b/arch/arm/include/asm/arch-imx8/gpio.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2017 NXP + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __ASM_ARCH_IMX8_GPIO_H +#define __ASM_ARCH_IMX8_GPIO_H + +#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) +/* GPIO registers */ +struct gpio_regs { + u32 gpio_dr; /* data */ + u32 gpio_dir; /* direction */ + u32 gpio_psr; /* pad satus */ +}; +#endif + +/* IMX8 the GPIO index is from 0 not 1 */ +#define IMX_GPIO_NR(port, index) (((port)*32)+((index)&31)) + +#endif /* __ASM_ARCH_IMX8_GPIO_H */ |