/linux/Documentation/driver-api/gpio/ |
H A D | drivers-on-gpio.rst | 2 Subsystem drivers using GPIO 5 Note that standard kernel drivers exist for common GPIO tasks and will provide 6 the right in-kernel and userspace APIs/ABIs for the job, and that these 10 - leds-gpio: drivers/leds/leds-gpio.c will handle LEDs connected to GPIO 13 - ledtrig-gpio: drivers/leds/trigger/ledtrig-gpio.c will provide a LED trigger, 14 i.e. a LED will turn on/off in response to a GPIO line going high or low 15 (and that LED may in turn use the leds-gpio as per above). 17 - gpio-keys: drivers/input/keyboard/gpio_keys.c is used when your GPIO line 18 can generate interrupts in response to a key press. Also supports debounce. 20 - gpio-keys-polled: drivers/input/keyboard/gpio_keys_polled.c is used when your [all …]
|
H A D | driver.rst | 2 GPIO Driver Interface 5 This document serves as a guide for writers of GPIO chip drivers. 7 Each GPIO controller driver needs to include the following header, which defines 8 the structures used to define a GPIO driver:: 10 #include <linux/gpio/driver.h> 16 A GPIO chip handles one or more GPIO lines. To be considered a GPIO chip, the 18 line is not general purpose, it is not GPIO and should not be handled by a 19 GPIO chip. The use case is the indicative: certain lines in a system may be 20 called GPIO but serve a very particular purpose thus not meeting the criteria 21 of a general purpose I/O. On the other hand a LED driver line may be used as a [all …]
|
H A D | intro.rst | 6 GPIO Interfaces 10 GPIOs in drivers, and how to write a driver for a device that provides GPIOs 14 What is a GPIO? 17 A "General Purpose Input/Output" (GPIO) is a flexible software-controlled 19 to Linux developers working with embedded and custom hardware. Each GPIO 20 represents a bit connected to a particular pin, or "ball" on Ball Grid Array 25 System-on-Chip (SOC) processors heavily rely on GPIOs. In some cases, every 26 non-dedicated pin can be configured as a GPIO; and most chips have at least 29 often have a few such pins to help with pin scarcity on SOCs; and there are 30 also "GPIO Expander" chips that connect using the I2C or SPI serial buses. [all …]
|
H A D | consumer.rst | 2 GPIO Descriptor Consumer Interface 5 This document describes the consumer interface of the GPIO framework. 11 Drivers that can't work without standard GPIO calls should have Kconfig entries 12 that depend on GPIOLIB or select GPIOLIB. The functions that allow a driver to 15 #include <linux/gpio/consumer.h> 21 - Simple compile coverage with e.g. COMPILE_TEST - it does not matter that 25 - Truly optional GPIOLIB support - where the driver does not really make use 26 of the GPIOs on certain compile-time configurations for certain systems, but 27 will use it under other compile-time configurations. In this case the 31 ``[devm_]gpiod_get_optional()`` is a *bad idea*, and will result in weird [all …]
|
H A D | board.rst | 2 GPIO Mappings 7 All platforms can enable the GPIO library, but if the platform strictly 8 requires GPIO functionality to be present, it needs to select GPIOLIB from its 14 ----------- 16 exact way to do it depends on the GPIO controller providing the GPIOs, see the 19 GPIOs mappings are defined in the consumer device's node, in a property named 20 <function>-gpios, where <function> is the function the driver will request 26 led-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>, /* red */ 27 <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */ 28 <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */ [all …]
|
/linux/Documentation/devicetree/bindings/gpio/ |
H A D | gpio.txt | 1 Specifying GPIO information for devices 5 ----------------- 7 GPIO properties should be named "[<name>-]gpios", with <name> being the purpose 8 of this GPIO for the device. While a non-existent <name> is considered valid 10 for new bindings. Also, GPIO properties named "[<name>-]gpio" are valid and old 14 GPIO properties can contain one or more GPIO phandles, but only in exceptional 16 distinct functions, reference each of them under its own property, giving it a 18 several GPIOs serve the same function (e.g. a parallel data line). 23 The following example could be used to describe GPIO pins used as device enable 24 and bit-banged data signals: [all …]
|
H A D | nvidia,tegra186-gpio.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/gpio/nvidia,tegra186-gpio.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: NVIDIA Tegra GPIO Controller (Tegra186 and later) 10 - Thierry Reding <thierry.reding@gmail.com> 11 - Jon Hunter <jonathanh@nvidia.com> 14 Tegra186 contains two GPIO controllers; a main controller and an "AON" 20 The Tegra186 GPIO controller allows software to set the IO direction of, 21 and read/write the value of, numerous GPIO signals. Routing of GPIO signals [all …]
|
H A D | gpio-mmio.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/gpio/gpio-mmio.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Generic MMIO GPIO 10 - Linus Walleij <linus.walleij@linaro.org> 11 - Bartosz Golaszewski <brgl@bgdev.pl> 14 Some simple GPIO controllers may consist of a single data register or a pair 15 of set/clear-bit registers. Such controllers are common for glue logic in 16 FPGAs or ASICs. Commonly, these controllers are accessed over memory-mapped [all …]
|
/linux/drivers/gpio/ |
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 3 # GPIO infrastructure and drivers 7 bool "GPIO Support" 9 This enables GPIO support through the generic GPIO library. 11 one or more of the GPIO drivers below. 23 using a stack allocated buffer to a dynamically allocated buffer. 47 this symbol, but new drivers should use the generic gpio-regmap 51 bool "Debug GPIO calls" 54 Say Y here to add some extra checks and diagnostics to GPIO calls. 57 non-sleeping contexts. They can make bitbanged serial protocols [all …]
|
H A D | TODO | 1 This is a place for planning the ongoing long-term work in the GPIO 5 GPIO descriptors 7 Starting with commit 79a9becda894 the GPIO subsystem embarked on a journey 8 to move away from the global GPIO numberspace and toward a descriptor-based 9 approach. This means that GPIO consumers, drivers and machine descriptions 10 ideally have no use or idea of the global GPIO numberspace that has/was 11 used in the inception of the GPIO subsystem. 16 The underlying motivation for this is that the GPIO numberspace has become 18 establish the numberspace at compile-time, making it hard to add any numbers 19 in the middle (such as if you missed a pin on a chip) without the numberspace [all …]
|
/linux/Documentation/admin-guide/gpio/ |
H A D | gpio-aggregator.rst | 1 .. SPDX-License-Identifier: GPL-2.0-only 3 GPIO Aggregator 6 The GPIO Aggregator provides a mechanism to aggregate GPIOs, and expose them as 7 a new gpio_chip. This supports the following use cases. 11 ----------------------------- 13 GPIO controllers are exported to userspace using /dev/gpiochip* character 15 system permissions, on an all-or-nothing basis: either a GPIO controller is 16 accessible for a user, or it is not. 18 The GPIO Aggregator provides access control for a set of one or more GPIOs, by 19 aggregating them into a new gpio_chip, which can be assigned to a group or user [all …]
|
H A D | gpio-virtuser.rst | 1 .. SPDX-License-Identifier: GPL-2.0-only 3 Virtual GPIO Consumer 6 The virtual GPIO Consumer module allows users to instantiate virtual devices 8 consumer devices can be instantiated from device-tree or over configfs. 10 A virtual consumer uses the driver-facing GPIO APIs and allows to cover it with 11 automated tests driven by user-space. The GPIOs are requested using 14 Creating GPIO consumers 15 ----------------------- 17 The gpio-consumer module registers a configfs subsystem called 18 ``'gpio-virtuser'``. For details of the configfs filesystem, please refer to [all …]
|
H A D | gpio-sim.rst | 1 .. SPDX-License-Identifier: GPL-2.0-or-later 3 Configfs GPIO Simulator 6 The configfs GPIO Simulator (gpio-sim) provides a way to create simulated GPIO 8 using the standard GPIO character device interface as well as manipulated 12 ------------------------ 14 The gpio-sim module registers a configfs subsystem called ``'gpio-sim'``. For 17 The user can create a hierarchy of configfs groups and items as well as modify 21 **Group:** ``/config/gpio-sim`` 23 This is the top directory of the gpio-sim configfs tree. 25 **Group:** ``/config/gpio-sim/gpio-device`` [all …]
|
/linux/arch/m68k/include/asm/ |
H A D | mcfgpio.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Coldfire generic GPIO support. 11 int __mcfgpio_get_value(unsigned gpio); 12 void __mcfgpio_set_value(unsigned gpio, int value); 13 int __mcfgpio_direction_input(unsigned gpio); 14 int __mcfgpio_direction_output(unsigned gpio, int value); 15 int __mcfgpio_request(unsigned gpio); 16 void __mcfgpio_free(unsigned gpio); 19 #include <linux/gpio.h> 23 static inline int __gpio_get_value(unsigned gpio) in __gpio_get_value() argument [all …]
|
/linux/include/linux/ |
H A D | gpio.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 5 * This is the LEGACY GPIO bulk include file, including legacy APIs. It is 6 * used for GPIO drivers still referencing the global GPIO numberspace, 9 * If you're implementing a GPIO driver, only include <linux/gpio/driver.h> 10 * If you're implementing a GPIO consumer, only include <linux/gpio/consumer.h> 19 /* make these flag values available regardless of GPIO kconfig options */ 24 /* Gpio pin is active-low */ 28 * struct gpio - a structure describing a GPIO with configuration 29 * @gpio: the GPIO number 30 * @flags: GPIO configuration as specified by GPIOF_* [all …]
|
/linux/drivers/pinctrl/ |
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 35 bool "AMD GPIO pin control" 44 The driver for memory mapped GPIO functionality on AMD platforms 46 functionality by firmware, so only a small amount is available 47 for GPIO use. 49 Requires ACPI/FDT device enumeration code to set up a platform 53 tristate "Apple SoC GPIO pin controller driver" 62 This is the driver for the GPIO controller found on Apple ARM SoCs, 65 This driver can also be built as a module. If so, the module 66 will be called pinctrl-apple-gpio. [all …]
|
/linux/Documentation/userspace-api/gpio/ |
H A D | sysfs.rst | 1 GPIO Sysfs Interface for Userspace 6 been moved to Documentation/ABI/obsolete/sysfs-gpio. 16 ---------------------- 18 configure a sysfs user interface to GPIOs. This is different from the 19 debugfs interface, since it provides control over GPIO direction and 20 value instead of just showing a gpio state summary. Plus, it could be 24 know for example that GPIO #23 controls the write protect line used to 26 may need to temporarily remove that protection, first importing a GPIO, 27 then changing its output state, then updating the code before re-enabling 28 the write protection. In normal use, GPIO #23 would never be touched, [all …]
|
H A D | chardev_v1.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 GPIO Character Device Userspace API (v1) 12 in the future. The v2 API is a functional superset of the v1 API so any 13 v1 call can be directly translated to a v2 equivalent. 20 The API is based around three major objects, the :ref:`gpio-v1-chip`, the 21 :ref:`gpio-v1-line-handle`, and the :ref:`gpio-v1-line-event`. 24 monitor a line for edge events, not the edge events themselves. 26 .. _gpio-v1-chip: 31 The Chip represents a single GPIO chip and is exposed to userspace using device 34 Each chip supports a number of GPIO lines, [all …]
|
/linux/Documentation/driver-api/ |
H A D | pin-control.rst | 9 - Enumerating and naming controllable pins 11 - Multiplexing of pins, pads, fingers (etc) see below for details 13 - Configuration of pins, pads, fingers (etc), such as software-controlled 14 biasing and driving mode specific pins, such as pull-up, pull-down, open drain, 17 Top-level interface 22 - A PIN CONTROLLER is a piece of hardware, usually a set of registers, that 26 - PINS are equal to pads, fingers, balls or whatever packaging input or 29 there may be several such number spaces in a system. This pin space may 30 be sparse - i.e. there may be gaps in the space with numbers where no 33 When a PIN CONTROLLER is instantiated, it will register a descriptor to the [all …]
|
/linux/Documentation/devicetree/bindings/pinctrl/ |
H A D | brcm,bcm2835-gpio.txt | 1 Broadcom BCM2835 GPIO (and pinmux) controller 3 The BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt 7 - compatible: "brcm,bcm2835-gpio" 8 - compatible: should be one of: 9 "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl 10 "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 11 "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl 12 "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 13 - reg: Should contain the physical address of the GPIO module's registers. 14 - gpio-controller: Marks the device node as a GPIO controller. [all …]
|
H A D | pinctrl-st.txt | 3 Each multi-function pin is controlled, driven and routed through the 4 PIO multiplexing block. Each pin supports GPIO functionality (ALT0) 5 and multiple alternate functions(ALT1 - ALTx) that directly connect 8 When a pin is in GPIO mode, Output Enable (OE), Open Drain(OD), and 12 gpio driver to configure a pin. 14 GPIO bank can have one of the two possible types of interrupt-wirings. 16 First type is via irqmux, single interrupt is used by multiple gpio banks. This 18 a single pincontroller. 20 | |----> [gpio-bank (n) ] 21 | |----> [gpio-bank (n + 1)] [all …]
|
H A D | ingenic,pinctrl.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 Please refer to pinctrl-bindings.txt in this directory for details of the 14 For the Ingenic SoCs, pin control is tightly bound with GPIO ports. All pins 16 GPIO port configuration registers and it is typical to refer to pins using the 17 naming scheme "PxN" where x is a character identifying the GPIO port with 19 pin within that GPIO port. For example PA0 is the first pin in GPIO port A, 20 and PB31 is the last pin in GPIO port B. The JZ4730, the JZ4740, the JZ4725B, 21 the X1000 and the X1830 contains 4 GPIO ports, PA to PD, for a total of 128 [all …]
|
/linux/Documentation/devicetree/bindings/power/reset/ |
H A D | gpio-restart.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/power/reset/gpio-restart.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: GPIO controlled reset 10 - Sebastian Reichel <sre@kernel.org> 13 Drive a GPIO line that can be used to restart the system from a restart handler. 16 request the given gpio line and install a restart handler. If the optional properties 17 'open-source' is not found, the GPIO line will be driven in the inactive state. Otherwise its 20 When the system is restarted, the restart handler will be invoked in priority order. The GPIO [all …]
|
/linux/Documentation/devicetree/bindings/sound/ |
H A D | cirrus,cs35l45.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> 11 - Richard Fitzgerald <rf@opensource.cirrus.com> 14 CS35L45 is a Boosted Mono Class D Amplifier with DSP 18 - $ref: dai-common.yaml# 23 - cirrus,cs35l45 31 '#sound-dai-cells': 34 reset-gpios: [all …]
|
/linux/include/linux/gpio/ |
H A D | driver.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 12 #include <linux/pinctrl/pinconf-generic.h> 48 * struct gpio_irq_chip - GPIO interrupt controller 54 * GPIO IRQ chip implementation, provided by GPIO driver. 61 * Interrupt translation domain; responsible for mapping between GPIO 78 * If non-NULL, will be set as the parent of this GPIO interrupt 79 * controller's IRQ domain to establish a hierarchical interrupt 88 * This callback translates a child hardware IRQ offset to a parent 89 * hardware IRQ offset on a hierarchical interrupt chip. The child 90 * hardware IRQs correspond to the GPIO index 0..ngpio-1 (see the [all …]
|