drivers/gpio/Kconfig

Source file repositories/reference/linux-study-clean/drivers/gpio/Kconfig

File Facts

System
Linux kernel
Corpus path
drivers/gpio/Kconfig
Extension
[no extension]
Size
64065 bytes
Lines
2138
Domain
Driver Families
Bucket
drivers/gpio
Inferred role
Driver Families: build/configuration rule
Status
atlas-only

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0-only
#
# GPIO infrastructure and drivers
#

config GPIOLIB_LEGACY
	def_bool y

config HAVE_SHARED_GPIOS
	bool

menuconfig GPIOLIB
	bool "GPIO Support"
	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 GPIOLIB_FASTPATH_LIMIT
	int "Maximum number of GPIOs for fast path"
	range 32 512
	default 512
	help
	  This adjusts the point at which certain APIs will switch from
	  using a stack allocated buffer to a dynamically allocated buffer.

	  You shouldn't need to change this unless you really need to
	  optimize either stack space or performance. Change this carefully
	  since setting an incorrect value could cause stack corruption.

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 GPIO_SHARED
	def_bool y
	depends on HAVE_SHARED_GPIOS || COMPILE_TEST
	select AUXILIARY_BUS

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)" if EXPERT
	depends on SYSFS
	select GPIO_CDEV # We need to encourage the new ABI
	help
	  Say Y here to add the legacy sysfs interface for GPIOs.

Annotation

Implementation Notes