/openbmc/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 | legacy.rst | 2 Legacy GPIO Interfaces 5 This provides an overview of GPIO access conventions on Linux. 11 What is a GPIO? 13 A "General Purpose Input/Output" (GPIO) is a flexible software-controlled 15 to Linux developers working with embedded and custom hardware. Each GPIO 16 represents a bit connected to a particular pin, or "ball" on Ball Grid Array 21 System-on-Chip (SOC) processors heavily rely on GPIOs. In some cases, every 22 non-dedicated pin can be configured as a GPIO; and most chips have at least 25 often have a few such pins to help with pin scarcity on SOCs; and there are 26 also "GPIO Expander" chips that connect using the I2C or SPI serial busses. [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 13 Due to the history of GPIO interfaces in the kernel, there are two different 16 - The descriptor-based interface is the preferred way to manipulate GPIOs, 18 - The legacy integer-based interface which is considered deprecated (but still 21 The remainder of this document applies to the new descriptor-based interface. 23 integer-based interface. 26 What is a GPIO? 29 A "General Purpose Input/Output" (GPIO) is a flexible software-controlled 31 to Linux developers working with embedded and custom hardware. Each GPIO [all …]
|
H A D | consumer.rst | 2 GPIO Descriptor Consumer Interface 5 This document describes the consumer interface of the GPIO framework. Note that 6 it describes the new descriptor-based interface. For a description of the 7 deprecated integer-based GPIO interface please refer to legacy.rst. 13 Drivers that can't work without standard GPIO calls should have Kconfig entries 14 that depend on GPIOLIB or select GPIOLIB. The functions that allow a driver to 17 #include <linux/gpio/consumer.h> 23 - Simple compile coverage with e.g. COMPILE_TEST - it does not matter that 27 - Truly optional GPIOLIB support - where the driver does not really make use 28 of the GPIOs on certain compile-time configurations for certain systems, but [all …]
|
H A D | board.rst | 2 GPIO Mappings 7 Note that it only applies to the new descriptor-based interface. For a 8 description of the deprecated integer-based GPIO interface please refer to 11 corresponding GPIO). 13 All platforms can enable the GPIO library, but if the platform strictly 14 requires GPIO functionality to be present, it needs to select GPIOLIB from its 20 ----------- 22 exact way to do it depends on the GPIO controller providing the GPIOs, see the 25 GPIOs mappings are defined in the consumer device's node, in a property named 26 <function>-gpios, where <function> is the function the driver will request [all …]
|
/openbmc/u-boot/doc/device-tree-bindings/gpio/ |
H A D | gpio.txt | 1 Specifying GPIO information for devices 5 ----------------- 8 properties, each containing a 'gpio-list': 10 gpio-list ::= <single-gpio> [gpio-list] 11 single-gpio ::= <gpio-phandle> <gpio-specifier> 12 gpio-phandle : phandle to gpio controller node 13 gpio-specifier : Array of #gpio-cells specifying specific gpio 16 GPIO properties should be named "[<name>-]gpios", with <name> being the purpose 17 of this GPIO for the device. While a non-existent <name> is considered valid 21 GPIO properties can contain one or more GPIO phandles, but only in exceptional [all …]
|
H A D | nvidia,tegra186-gpio.txt | 1 NVIDIA Tegra186 GPIO controllers 3 Tegra186 contains two GPIO controllers; a main controller and an "AON" 9 The Tegra186 GPIO controller allows software to set the IO direction of, and 10 read/write the value of, numerous GPIO signals. Routing of GPIO signals to 11 package balls is under the control of a separate pin controller HW block. Two 14 a) Security registers, which allow configuration of allowed access to the GPIO 15 register set. These registers exist in a single contiguous block of physical 17 varies between the different GPIO controllers. 20 that wishes to configure access to the GPIO registers needs access to these 21 registers to do so. Code which simply wishes to read or write GPIO data does not [all …]
|
/openbmc/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 …]
|
/openbmc/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 …]
|
H A D | gpiolib-devres.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * devres.c - managed gpio resources 11 #include <linux/gpio.h> 12 #include <linux/gpio/consumer.h> 27 struct gpio_desc **this = res, **gpio = data; in devm_gpiod_match() local 29 return *this == *gpio; in devm_gpiod_match() 47 * devm_gpiod_get - Resource-managed gpiod_get() 48 * @dev: GPIO consumer 49 * @con_id: function within the GPIO consumer 50 * @flags: optional GPIO initialization flags [all …]
|
/openbmc/u-boot/include/asm-generic/ |
H A D | gpio.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 15 * Generic GPIO API for U-Boot 17 * -- 20 * - gpio_request_by_name() 21 * - dm_gpio_get_value() etc. 23 * For now we need a dm_ prefix on some functions to avoid name collision. 24 * -- 26 * GPIOs are numbered from 0 to GPIO_COUNT-1 which value is defined 29 * Each GPIO can be an input or output. If an input then its value can 35 * In some cases the operation may fail, for example if the GPIO number [all …]
|
/openbmc/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-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 …]
|
H A D | sysfs.rst | 1 GPIO Sysfs Interface for Userspace 7 Documentation/ABI/obsolete/sysfs-gpio AND NEW USERSPACE CONSUMERS 11 Refer to the examples in tools/gpio/* for an introduction to the new 13 include/uapi/linux/gpio.h 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, [all …]
|
/openbmc/u-boot/drivers/gpio/ |
H A D | Kconfig | 2 # GPIO infrastructure and drivers 5 menu "GPIO Support" 8 bool "Enable Driver Model for GPIO drivers" 11 Enable driver model for GPIO access. The standard GPIO 13 the GPIO uclass. Drivers provide methods to query the 15 is defined in include/asm-generic/gpio.h. 18 bool "Enable GPIO hog support" 22 Enable gpio hog support 23 The GPIO chip may contain GPIO hog definitions. GPIO hogging 24 is a mechanism providing automatic GPIO request and config- [all …]
|
/openbmc/openbmc/meta-yadro/meta-nicole/recipes-bsp/u-boot/files/ |
H A D | 0003-aspeed-add-gpio-support.patch | 2 From: Alexander Filippov <a.filippov@yadro.com> 4 Subject: [PATCH] aspeed: add gpio support 6 This is an initial support for the parallel GPIO pins directly connected 9 This brings the functions and a shell command to manipulate the GPIO 10 state. The GPIO value reading and writing work in non interrupt mode 13 Signed-off-by: Alexander Filippov <a.filippov@yadro.com> 14 --- 15 arch/arm/include/asm/arch-aspeed/gpio.h | 65 ++++ 16 arch/arm/include/asm/arch-aspeed/platform.h | 1 + 17 drivers/gpio/Makefile | 2 + [all …]
|
/openbmc/u-boot/include/ |
H A D | spl_gpio.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 3 * Simple GPIO access from SPL. This only supports a single GPIO space, 4 * typically the SoC GPIO banks. 12 #include <asm/gpio.h> 15 * The functions listed here should be implemented in the SoC GPIO driver. 16 * They correspond to the normal GPIO API (asm-generic/gpio.h). The GPIO 17 * number is encoded in an unsigned int by an SoC-specific means. Pull 18 * values are also SoC-specific. 20 * This API should only be used in TPL/SPL where GPIO access is needed but 23 * The caller must supply the GPIO register base since this information is [all …]
|
/openbmc/phosphor-gpio-monitor/ |
H A D | README.md | 1 # GPIO Monitoring 5 ### `phosphor-gpio-monitor` 7 This daemon accepts a command line parameter for monitoring single gpio line and 8 take action if requested. This implementation uses GPIO keys and only supports 9 monitoring single GPIO line, for multiple lines, user has to run this daemon 10 seperately for each gpio line. 12 ### `phosphor-multi-gpio-monitor` 14 This daemon accepts command line parameter as a well-defined GPIO configuration 16 defined in config based on gpio state change. It uses libgpiod library. 20 New implementation (phosphor-multi-gpio-monitor) provides multiple gpio line [all …]
|
/openbmc/qemu/tests/qtest/ |
H A D | stm32l4x5_gpio-test.c | 4 * Copyright (c) 2024 Arnaud Minier <arnaud.minier@telecom-paris.fr> 5 * Copyright (c) 2024 Inès Varhol <ines.varhol@telecom-paris.fr> 8 * See the COPYING file in the top-level directory. 12 #include "libqtest-single.h" 84 #define GPIO_ADDR_MASK (~(GPIO_SIZE - 1)) 94 static uint32_t gpio_readl(unsigned int gpio, unsigned int offset) in gpio_readl() argument 96 return readl(gpio + offset); in gpio_readl() 99 static void gpio_writel(unsigned int gpio, unsigned int offset, uint32_t value) in gpio_writel() argument 101 writel(gpio + offset, value); in gpio_writel() 104 static void gpio_set_bit(unsigned int gpio, unsigned int reg, in gpio_set_bit() argument [all …]
|
/openbmc/linux/arch/m68k/include/asm/ |
H A D | mcfgpio.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Coldfire generic GPIO support. 12 #include <linux/gpio.h> 15 int __mcfgpio_get_value(unsigned gpio); 16 void __mcfgpio_set_value(unsigned gpio, int value); 17 int __mcfgpio_direction_input(unsigned gpio); 18 int __mcfgpio_direction_output(unsigned gpio, int value); 19 int __mcfgpio_request(unsigned gpio); 20 void __mcfgpio_free(unsigned gpio); 23 static inline int __gpio_get_value(unsigned gpio) in __gpio_get_value() argument [all …]
|
/openbmc/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 …]
|