#
# GPIO infrastructure and drivers
#

config ARCH_HAVE_CUSTOM_GPIO_H
	bool
	help
	  Selecting this config option from the architecture Kconfig allows
	  the architecture to provide a custom asm/gpio.h implementation
	  overriding the default implementations.  New uses of this are
	  strongly discouraged.

menuconfig GPIOLIB
	bool "GPIO Support"
	select ANON_INODES
	help
	  This enables GPIO support through the generic GPIO library.
	  You only need to enable this, if you also want to enable
	  one or more of the GPIO drivers below.

	  If unsure, say N.

if GPIOLIB

config OF_GPIO
	def_bool y
	depends on OF
	depends on HAS_IOMEM

config GPIO_ACPI
	def_bool y
	depends on ACPI

config GPIOLIB_IRQCHIP
	select IRQ_DOMAIN
	bool

config DEBUG_GPIO
	bool "Debug GPIO calls"
	depends on DEBUG_KERNEL
	help
	  Say Y here to add some extra checks and diagnostics to GPIO calls.
	  These checks help ensure that GPIOs have been properly initialized
	  before they are used, and that sleeping calls are not made from
	  non-sleeping contexts.  They can make bitbanged serial protocols
	  slower.  The diagnostics help catch the type of setup errors
	  that are most common when setting up new platforms or boards.

config GPIO_SYSFS
	bool "/sys/class/gpio/... (sysfs interface)"
	depends on SYSFS
	help
	  Say Y here to add a sysfs interface for GPIOs.

	  This is mostly useful to work around omissions in a system's
	  kernel support.  Those are common in custom and semicustom
	  hardware assembled using standard kernels with a minimum of
	  custom patches.  In those cases, userspace code may import
	  a given GPIO from the kernel, if no kernel driver requested it.

	  Kernel drivers may also request that a particular GPIO be
	  exported to userspace; this can be useful when debugging.

config GPIO_GENERIC
	depends on HAS_IOMEM # Only for IOMEM drivers
	tristate

# put drivers in the right section, in alphabetical order

# This symbol is selected by both I2C and SPI expanders
config GPIO_MAX730X
	tristate

menu "Memory mapped GPIO drivers"
	depends on HAS_IOMEM

config GPIO_74XX_MMIO
	tristate "GPIO driver for 74xx-ICs with MMIO access"
	depends on OF_GPIO
	select GPIO_GENERIC
	help
	  Say yes here to support GPIO functionality for 74xx-compatible ICs
	  with MMIO access. Compatible models include:
	    1 bit:	741G125 (Input), 741G74 (Output)
	    2 bits:	742G125 (Input), 7474 (Output)
	    4 bits:	74125 (Input), 74175 (Output)
	    6 bits:	74365 (Input), 74174 (Output)
	    8 bits:	74244 (Input), 74273 (Output)
	    16 bits:	741624 (Input), 7416374 (Output)

config GPIO_ALTERA
	tristate "Altera GPIO"
	depends on OF_GPIO
	select GPIOLIB_IRQCHIP
	help
	  Say Y or M here to build support for the Altera PIO device.

	  If driver is built as a module it will be called gpio-altera.

config GPIO_AMDPT
	tristate "AMD Promontory GPIO support"
	depends on ACPI
	select GPIO_GENERIC
	help
	  driver for GPIO functionality on Promontory IOHub
	  Require ACPI ASL code to enumerate as a platform device.

config GPIO_ASPEED
	tristate "Aspeed GPIO support"
	depends on (ARCH_ASPEED || COMPILE_TEST) && OF_GPIO
	select GPIOLIB_IRQCHIP
	help
	  Say Y here to support Aspeed AST2400 and AST2500 GPIO controllers.

config GPIO_ATH79
	tristate "Atheros AR71XX/AR724X/AR913X GPIO support"
	default y if ATH79
	depends on ATH79 || COMPILE_TEST
	select GPIO_GENERIC
	select GPIOLIB_IRQCHIP
	help
	  Select this option to enable GPIO driver for
	  Atheros AR71XX/AR724X/AR913X SoC devices.

config GPIO_AXP209
	tristate "X-Powers AXP209 PMIC GPIO Support"
	depends on MFD_AXP20X
	help
	  Say yes to enable GPIO support for the AXP209 PMIC

config GPIO_BCM_KONA
	bool "Broadcom Kona GPIO"
	depends on OF_GPIO && (ARCH_BCM_MOBILE || COMPILE_TEST)
	help
	  Turn on GPIO support for Broadcom "Kona" chips.

config GPIO_BRCMSTB
	tristate "BRCMSTB GPIO support"
	default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
	depends on OF_GPIO && (ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST)
	select GPIO_GENERIC
	select IRQ_DOMAIN
	help
	  Say yes here to enable GPIO support for Broadcom STB (BCM7XXX) SoCs.

config GPIO_CLPS711X
	tristate "CLPS711X GPIO support"
	depends on ARCH_CLPS711X || COMPILE_TEST
	select GPIO_GENERIC
	help
	  Say yes here to support GPIO on CLPS711X SoCs.

config GPIO_DAVINCI
	bool "TI Davinci/Keystone GPIO support"
	default y if ARCH_DAVINCI
	depends on ARM && (ARCH_DAVINCI || ARCH_KEYSTONE)
	help
	  Say yes here to enable GPIO support for TI Davinci/Keystone SoCs.

config GPIO_DWAPB
	tristate "Synopsys DesignWare APB GPIO driver"
	select GPIO_GENERIC
	select GENERIC_IRQ_CHIP
	help
	  Say Y or M here to build support for the Synopsys DesignWare APB
	  GPIO block.

config GPIO_EM
	tristate "Emma Mobile GPIO"
	depends on (ARCH_EMEV2 || COMPILE_TEST) && OF_GPIO
	help
	  Say yes here to support GPIO on Renesas Emma Mobile SoCs.

config GPIO_EP93XX
	def_bool y
	depends on ARCH_EP93XX
	select GPIO_GENERIC

config GPIO_ETRAXFS
	bool "Axis ETRAX FS General I/O"
	depends on CRIS || COMPILE_TEST
	depends on OF_GPIO
	select GPIO_GENERIC
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support the GPIO controller on Axis ETRAX FS SoCs.

config GPIO_EXAR
	tristate "Support for GPIO pins on XR17V352/354/358"
	depends on SERIAL_8250_EXAR
	help
	  Selecting this option will enable handling of GPIO pins present
	  on Exar XR17V352/354/358 chips.

config GPIO_GE_FPGA
	bool "GE FPGA based GPIO"
	depends on GE_FPGA
	select GPIO_GENERIC
	help
	  Support for common GPIO functionality provided on some GE Single Board
	  Computers.

	  This driver provides basic support (configure as input or output, read
	  and write pin state) for GPIO implemented in a number of GE single
	  board computers.

config GPIO_FTGPIO010
	bool "Faraday FTGPIO010 GPIO"
	depends on OF_GPIO
	select GPIO_GENERIC
	select GPIOLIB_IRQCHIP
	default (ARCH_GEMINI || ARCH_MOXART)
	help
	  Support for common GPIOs from the Faraday FTGPIO010 IP core, found in
	  Cortina systems Gemini platforms, Moxa ART and others.

config GPIO_GENERIC_PLATFORM
	tristate "Generic memory-mapped GPIO controller support (MMIO platform device)"
	select GPIO_GENERIC
	help
	  Say yes here to support basic platform_device memory-mapped GPIO controllers.

config GPIO_GRGPIO
	tristate "Aeroflex Gaisler GRGPIO support"
	depends on OF_GPIO
	select GPIO_GENERIC
	select IRQ_DOMAIN
	help
	  Select this to support Aeroflex Gaisler GRGPIO cores from the GRLIB
	  VHDL IP core library.

config GPIO_ICH
	tristate "Intel ICH GPIO"
	depends on PCI && X86
	select MFD_CORE
	select LPC_ICH
	help
	  Say yes here to support the GPIO functionality of a number of Intel
	  ICH-based chipsets.  Currently supported devices: ICH6, ICH7, ICH8
	  ICH9, ICH10, Series 5/3400 (eg Ibex Peak), Series 6/C200 (eg
	  Cougar Point), NM10 (Tiger Point), and 3100 (Whitmore Lake).

	  If unsure, say N.

config GPIO_INGENIC
	tristate "Ingenic JZ47xx SoCs GPIO support"
	depends on OF
	depends on MACH_INGENIC || COMPILE_TEST
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support the GPIO functionality present on the
	  JZ4740 and JZ4780 SoCs from Ingenic.

	  If unsure, say N.

config GPIO_IOP
	tristate "Intel IOP GPIO"
	depends on ARCH_IOP32X || ARCH_IOP33X || COMPILE_TEST
	select GPIO_GENERIC
	help
	  Say yes here to support the GPIO functionality of a number of Intel
	  IOP32X or IOP33X.

	  If unsure, say N.

config GPIO_LOONGSON
	bool "Loongson-2/3 GPIO support"
	depends on CPU_LOONGSON2 || CPU_LOONGSON3
	help
	  driver for GPIO functionality on Loongson-2F/3A/3B processors.

config GPIO_LPC18XX
	tristate "NXP LPC18XX/43XX GPIO support"
	default y if ARCH_LPC18XX
	depends on OF_GPIO && (ARCH_LPC18XX || COMPILE_TEST)
	help
	  Select this option to enable GPIO driver for
	  NXP LPC18XX/43XX devices.

config GPIO_LYNXPOINT
	tristate "Intel Lynxpoint GPIO support"
	depends on ACPI && X86
	select GPIOLIB_IRQCHIP
	help
	  driver for GPIO functionality on Intel Lynxpoint PCH chipset
	  Requires ACPI device enumeration code to set up a platform device.

config GPIO_MB86S7X
	tristate "GPIO support for Fujitsu MB86S7x Platforms"
	help
	  Say yes here to support the GPIO controller in Fujitsu MB86S70 SoCs.

config GPIO_MENZ127
	tristate "MEN 16Z127 GPIO support"
	depends on MCB
	select GPIO_GENERIC
	help
	 Say yes here to support the MEN 16Z127 GPIO Controller

config GPIO_MM_LANTIQ
	bool "Lantiq Memory mapped GPIOs"
	depends on LANTIQ && SOC_XWAY
	help
	  This enables support for memory mapped GPIOs on the External Bus Unit
	  (EBU) found on Lantiq SoCs. The gpios are output only as they are
	  created by attaching a 16bit latch to the bus.

config GPIO_MOCKUP
	tristate "GPIO Testing Driver"
	depends on GPIOLIB && SYSFS
	select GPIO_SYSFS
	select GPIOLIB_IRQCHIP
	select IRQ_SIM
	help
	  This enables GPIO Testing driver, which provides a way to test GPIO
	  subsystem through sysfs(or char device) and debugfs. GPIO_SYSFS
	  must be selected for this test.
	  User could use it through the script in
	  tools/testing/selftests/gpio/gpio-mockup.sh. Reference the usage in
	  it.

config GPIO_MPC5200
	def_bool y
	depends on PPC_MPC52xx

config GPIO_MPC8XXX
	bool "MPC512x/MPC8xxx/QorIQ GPIO support"
	depends on PPC_MPC512x || PPC_MPC831x || PPC_MPC834x || PPC_MPC837x || \
		   FSL_SOC_BOOKE || PPC_86xx || ARCH_LAYERSCAPE || ARM || \
		   COMPILE_TEST
	select GPIO_GENERIC
	select IRQ_DOMAIN
	help
	  Say Y here if you're going to use hardware that connects to the
	  MPC512x/831x/834x/837x/8572/8610/QorIQ GPIOs.

config GPIO_MVEBU
	def_bool y
	depends on PLAT_ORION || ARCH_MVEBU
	depends on OF_GPIO
	select GENERIC_IRQ_CHIP
	select REGMAP_MMIO

config GPIO_MXC
	def_bool y
	depends on ARCH_MXC
	select GPIO_GENERIC
	select GENERIC_IRQ_CHIP

config GPIO_MXS
	def_bool y
	depends on ARCH_MXS
	select GPIO_GENERIC
	select GENERIC_IRQ_CHIP

config GPIO_OCTEON
	tristate "Cavium OCTEON GPIO"
	depends on GPIOLIB && CAVIUM_OCTEON_SOC
	default y
	help
	  Say yes here to support the on-chip GPIO lines on the OCTEON
	  family of SOCs.

config GPIO_OMAP
	tristate "TI OMAP GPIO support" if ARCH_OMAP2PLUS || COMPILE_TEST
	default y if ARCH_OMAP
	depends on ARM
	select GENERIC_IRQ_CHIP
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to enable GPIO support for TI OMAP SoCs.

config GPIO_PL061
	bool "PrimeCell PL061 GPIO support"
	depends on ARM_AMBA
	select IRQ_DOMAIN
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support the PrimeCell PL061 GPIO device

config GPIO_PXA
	bool "PXA GPIO support"
	depends on ARCH_PXA || ARCH_MMP
	help
	  Say yes here to support the PXA GPIO device

config GPIO_RCAR
	tristate "Renesas R-Car GPIO"
	depends on ARCH_RENESAS || COMPILE_TEST
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support GPIO on Renesas R-Car SoCs.

config GPIO_REG
	bool
	help
	  A 32-bit single register GPIO fixed in/out implementation.  This
	  can be used to represent any register as a set of GPIO signals.

config GPIO_SPEAR_SPICS
	bool "ST SPEAr13xx SPI Chip Select as GPIO support"
	depends on PLAT_SPEAR
	select GENERIC_IRQ_CHIP
	help
	  Say yes here to support ST SPEAr SPI Chip Select as GPIO device

config GPIO_STA2X11
	bool "STA2x11/ConneXt GPIO support"
	depends on MFD_STA2X11
	select GENERIC_IRQ_CHIP
	help
	  Say yes here to support the STA2x11/ConneXt GPIO device.
	  The GPIO module has 128 GPIO pins with alternate functions.

config GPIO_STP_XWAY
	bool "XWAY STP GPIOs"
	depends on SOC_XWAY
	help
	  This enables support for the Serial To Parallel (STP) unit found on
	  XWAY SoC. The STP allows the SoC to drive a shift registers cascade,
	  that can be up to 24 bit. This peripheral is aimed at driving leds.
	  Some of the gpios/leds can be auto updated by the soc with dsl and
	  phy status.

config GPIO_SYSCON
	tristate "GPIO based on SYSCON"
	depends on MFD_SYSCON && OF
	help
	  Say yes here to support GPIO functionality though SYSCON driver.

config GPIO_TB10X
	bool
	select GENERIC_IRQ_CHIP
	select OF_GPIO

config GPIO_TEGRA
	bool "NVIDIA Tegra GPIO support"
	default ARCH_TEGRA
	depends on ARCH_TEGRA || COMPILE_TEST
	depends on OF_GPIO
	help
	  Say yes here to support GPIO pins on NVIDIA Tegra SoCs.

config GPIO_TEGRA186
	tristate "NVIDIA Tegra186 GPIO support"
	default ARCH_TEGRA_186_SOC
	depends on ARCH_TEGRA_186_SOC || COMPILE_TEST
	depends on OF_GPIO
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support GPIO pins on NVIDIA Tegra186 SoCs.

config GPIO_TS4800
	tristate "TS-4800 DIO blocks and compatibles"
	depends on OF_GPIO
	depends on SOC_IMX51 || COMPILE_TEST
	select GPIO_GENERIC
	help
	  This driver support TS-4800 FPGA GPIO controllers.

config GPIO_THUNDERX
	tristate "Cavium ThunderX/OCTEON-TX GPIO"
	depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
	depends on PCI_MSI
	select IRQ_DOMAIN_HIERARCHY
	select IRQ_FASTEOI_HIERARCHY_HANDLERS
	help
	  Say yes here to support the on-chip GPIO lines on the ThunderX
	  and OCTEON-TX families of SoCs.

config GPIO_TZ1090
	bool "Toumaz Xenif TZ1090 GPIO support"
	depends on SOC_TZ1090
	select GENERIC_IRQ_CHIP
	default y
	help
	  Say yes here to support Toumaz Xenif TZ1090 GPIOs.

config GPIO_TZ1090_PDC
	bool "Toumaz Xenif TZ1090 PDC GPIO support"
	depends on SOC_TZ1090
	default y
	help
	  Say yes here to support Toumaz Xenif TZ1090 PDC GPIOs.

config GPIO_UNIPHIER
	tristate "UniPhier GPIO support"
	depends on ARCH_UNIPHIER || COMPILE_TEST
	depends on OF_GPIO
	select IRQ_DOMAIN_HIERARCHY
	help
	  Say yes here to support UniPhier GPIOs.

config GPIO_VF610
	def_bool y
	depends on ARCH_MXC && SOC_VF610
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support Vybrid vf610 GPIOs.

config GPIO_VR41XX
	tristate "NEC VR4100 series General-purpose I/O Uint support"
	depends on CPU_VR41XX
	help
	  Say yes here to support the NEC VR4100 series General-purpose I/O Uint

config GPIO_VX855
	tristate "VIA VX855/VX875 GPIO"
	depends on (X86 || COMPILE_TEST) && PCI
	select MFD_CORE
	select MFD_VX855
	help
	  Support access to the VX855/VX875 GPIO lines through the gpio library.

	  This driver provides common support for accessing the device,
	  additional drivers must be enabled in order to use the
	  functionality of the device.

config GPIO_XGENE
	bool "APM X-Gene GPIO controller support"
	depends on ARM64 && OF_GPIO
	help
	  This driver is to support the GPIO block within the APM X-Gene SoC
	  platform's generic flash controller. The GPIO pins are muxed with
	  the generic flash controller's address and data pins. Say yes
	  here to enable the GFC GPIO functionality.

config GPIO_XGENE_SB
	tristate "APM X-Gene GPIO standby controller support"
	depends on ARCH_XGENE && OF_GPIO
	select GPIO_GENERIC
	select GPIOLIB_IRQCHIP
	select IRQ_DOMAIN_HIERARCHY
	help
	  This driver supports the GPIO block within the APM X-Gene
	  Standby Domain. Say yes here to enable the GPIO functionality.

config GPIO_XILINX
	tristate "Xilinx GPIO support"
	depends on OF_GPIO
	help
	  Say yes here to support the Xilinx FPGA GPIO device

config GPIO_XLP
	tristate "Netlogic XLP GPIO support"
	depends on OF_GPIO && (CPU_XLP || ARCH_THUNDER2 || COMPILE_TEST)
	select GPIOLIB_IRQCHIP
	help
	  This driver provides support for GPIO interface on Netlogic XLP MIPS64
	  SoCs. Currently supported XLP variants are XLP8XX, XLP3XX, XLP2XX,
	  XLP9XX and XLP5XX. The same GPIO controller block is also present in
	  Cavium's ThunderX2 CN99XX SoCs.

	  If unsure, say N.

config GPIO_XTENSA
	bool "Xtensa GPIO32 support"
	depends on XTENSA
	depends on HAVE_XTENSA_GPIO32
	depends on !SMP
	help
	  Say yes here to support the Xtensa internal GPIO32 IMPWIRE (input)
	  and EXPSTATE (output) ports

config GPIO_ZEVIO
	bool "LSI ZEVIO SoC memory mapped GPIOs"
	depends on ARM && OF_GPIO
	help
	  Say yes here to support the GPIO controller in LSI ZEVIO SoCs.

config GPIO_ZYNQ
	tristate "Xilinx Zynq GPIO support"
	depends on ARCH_ZYNQ || ARCH_ZYNQMP
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support Xilinx Zynq GPIO controller.

config GPIO_ZX
	bool "ZTE ZX GPIO support"
	depends on ARCH_ZX || COMPILE_TEST
	select GPIOLIB_IRQCHIP
	help
	  Say yes here to support the GPIO device on ZTE ZX SoCs.

config GPIO_LOONGSON1
	tristate "Loongson1 GPIO support"
	depends on MACH_LOONGSON32
	select GPIO_GENERIC
	help
	  Say Y or M here to support GPIO on Loongson1 SoCs.

endmenu

menu "Port-mapped I/O GPIO drivers"
	depends on X86 # Unconditional I/O space access

config GPIO_104_DIO_48E
	tristate "AC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            