| /linux/Documentation/userspace-api/gpio/ |
| H A D | chardev_v1.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 GPIO Character Device Userspace API (v1) 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`. 23 Where "line event" is used in this document it refers to the request that can 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, 36 ``offset`` in the range from 0 to ``chip.lines - 1``, i.e. `[0,chip.lines)`. [all …]
|
| H A D | chardev.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 GPIO Character Device Userspace API 8 ``include/uapi/linux/gpio.h.`` 18 Read Documentation/driver-api/gpio/drivers-on-gpio.rst to avoid reinventing 21 Similarly, for multi-function lines there may be other subsystems, such as 23 Documentation/driver-api/pwm.rst, Documentation/w1/index.rst etc, that 26 Basic examples using the character device API can be found in ``tools/gpio/*``. 28 The API is based around two major objects, the :ref:`gpio-v2-chip` and the 29 :ref:`gpio-v2-line-request`. 31 .. _gpio-v2-chip: [all …]
|
| H A D | gpio-get-lineinfo-watch-ioctl.rst | 1 .. SPDX-License-Identifier: GPL-2.0 11 gpio-v2-get-lineinfo-watch-ioctl.rst. 16 GPIO_GET_LINEINFO_WATCH_IOCTL - Enable watching a line for changes to its 30 The file descriptor of the GPIO character device returned by `open()`. 34 the ``offset`` set to indicate the line to watch 39 Enable watching a line for changes to its request state and configuration 40 information. Changes to line info include a line being requested, released 44 Watching line info is not generally required, and would typically only be 47 The line info does NOT include the line value. 49 The line must be requested using gpio-get-linehandle-ioctl.rst or [all …]
|
| H A D | gpio-v2-get-lineinfo-watch-ioctl.rst | 1 .. SPDX-License-Identifier: GPL-2.0 12 GPIO_V2_GET_LINEINFO_WATCH_IOCTL - Enable watching a line for changes to its 26 The file descriptor of the GPIO character device returned by `open()`. 30 the ``offset`` set to indicate the line to watch 35 Enable watching a line for changes to its request state and configuration 36 information. Changes to line info include a line being requested, released 40 Watching line info is not generally required, and would typically only be 43 The line info does NOT include the line value. 44 The line must be requested using gpio-v2-get-line-ioctl.rst to access 45 its value, and the line request can monitor a line for events using [all …]
|
| /linux/arch/arm64/boot/dts/hisilicon/ |
| H A D | hi3670-hikey970.dts | 1 // SPDX-License-Identifier: GPL-2.0 10 /dts-v1/; 11 #include <dt-bindings/gpio/gpio.h> 14 #include "hikey970-pinctrl.dtsi" 15 #include "hikey970-pmic.dtsi" 19 compatible = "hisilicon,hi3670-hikey970", "hisilicon,hi3670"; 34 stdout-path = "serial6:115200n8"; 43 wlan_en: wlan-en-1-8v { 44 compatible = "regulator-fixed"; 45 regulator-name = "wlan-en-regulator"; [all …]
|
| H A D | hi3660-hikey960.dts | 1 // SPDX-License-Identifier: GPL-2.0 9 /dts-v1/; 12 #include "hikey960-pinctrl.dtsi" 13 #include <dt-bindings/gpio/gpio.h> 14 #include <dt-bindings/input/input.h> 15 #include <dt-bindings/interrupt-controller/irq.h> 16 #include <dt-bindings/usb/pd.h> 20 compatible = "hisilicon,hi3660-hikey960", "hisilicon,hi3660"; 35 stdout-path = "serial6:115200n8"; 44 reserved-memory { [all …]
|
| H A D | hi6220-hikey.dts | 1 // SPDX-License-Identifier: GPL-2.0 9 /dts-v1/; 11 #include "hikey-pinctrl.dtsi" 12 #include <dt-bindings/gpio/gpio.h> 16 compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220"; 26 stdout-path = "serial3:115200n8"; 32 * 0x05e0,0000 - 0x05ef,ffff: MCU firmware runtime using 33 * 0x05f0,1000 - 0x05f0,1fff: Reboot reason 34 * 0x06df,f000 - 0x06df,ffff: Mailbox message data 35 * 0x0740,f000 - 0x0740,ffff: MCU firmware section [all …]
|
| H A D | hi3798cv200-poplar.dts | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd. 8 /dts-v1/; 10 #include <dt-bindings/gpio/gpio.h> 12 #include "poplar-pinctrl.dtsi" 16 compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200"; 24 stdout-path = "serial0:115200n8"; 33 compatible = "gpio-leds"; 35 user-led0 { 38 linux,default-trigger = "heartbeat"; [all …]
|
| /linux/arch/arm/boot/dts/nuvoton/ |
| H A D | nuvoton-npcm750-runbmc-olympus.dts | 1 // SPDX-License-Identifier: GPL-2.0 5 /dts-v1/; 6 #include "nuvoton-npcm750.dtsi" 7 #include "nuvoton-npcm750-runbmc-olympus-pincfg.dtsi" 9 #include <dt-bindings/i2c/i2c.h> 10 #include <dt-bindings/gpio/gpio.h> 43 stdout-path = &serial3; 50 iio-hwmon { 51 compatible = "iio-hwmon"; 52 io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, [all …]
|
| /linux/Documentation/admin-guide/gpio/ |
| 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 21 **Group:** ``/config/gpio-sim`` 23 This is the top directory of the gpio-sim configfs tree. 25 **Group:** ``/config/gpio-sim/gpio-device`` 27 **Attribute:** ``/config/gpio-sim/gpio-device/dev_name`` [all …]
|
| 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 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 18 The GPIO Aggregator provides access control for a set of one or more GPIOs, by 22 grab the full GPIO controller, and no longer needs to care about which GPIOs to 25 Aggregated GPIO controllers are instantiated and destroyed by writing to 26 write-only attribute files in sysfs. [all …]
|
| /linux/Documentation/devicetree/bindings/pinctrl/ |
| H A D | qcom,pmic-gpio.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Qualcomm PMIC GPIO block 10 - Bjorn Andersson <bjorn.andersson@linaro.org> 13 This binding describes the GPIO block(s) found in the 8xxx series of 19 - enum: 20 - qcom,pm2250-gpio 21 - qcom,pm660-gpio [all …]
|
| /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 20 - gpio-keys-polled: drivers/input/keyboard/gpio_keys_polled.c is used when your 21 GPIO line cannot generate interrupts, so it needs to be periodically polled [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ |
| H A D | base.c | 29 nvkm_gpio_drive(struct nvkm_gpio *gpio, int idx, int line, int dir, int out) in nvkm_gpio_drive() argument 31 return gpio->func->drive(gpio, line, dir, out); in nvkm_gpio_drive() 35 nvkm_gpio_sense(struct nvkm_gpio *gpio, int idx, int line) in nvkm_gpio_sense() argument 37 return gpio->func->sense(gpio, line); in nvkm_gpio_sense() 41 nvkm_gpio_reset(struct nvkm_gpio *gpio, u8 func) in nvkm_gpio_reset() argument 43 if (gpio->func->reset) in nvkm_gpio_reset() 44 gpio->func->reset(gpio, func); in nvkm_gpio_reset() 48 nvkm_gpio_find(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line, in nvkm_gpio_find() argument 51 struct nvkm_device *device = gpio->subdev.device; in nvkm_gpio_find() 52 struct nvkm_bios *bios = device->bios; in nvkm_gpio_find() [all …]
|
| H A D | nv10.c | 29 nv10_gpio_sense(struct nvkm_gpio *gpio, int line) in nv10_gpio_sense() argument 31 struct nvkm_device *device = gpio->subdev.device; in nv10_gpio_sense() 32 if (line < 2) { in nv10_gpio_sense() 33 line = line * 16; in nv10_gpio_sense() 34 line = nvkm_rd32(device, 0x600818) >> line; in nv10_gpio_sense() 35 return !!(line & 0x0100); in nv10_gpio_sense() 37 if (line < 10) { in nv10_gpio_sense() 38 line = (line - 2) * 4; in nv10_gpio_sense() 39 line = nvkm_rd32(device, 0x60081c) >> line; in nv10_gpio_sense() 40 return !!(line & 0x04); in nv10_gpio_sense() [all …]
|
| H A D | nv50.c | 27 nv50_gpio_reset(struct nvkm_gpio *gpio, u8 match) in nv50_gpio_reset() argument 29 struct nvkm_device *device = gpio->subdev.device; in nv50_gpio_reset() 30 struct nvkm_bios *bios = device->bios; in nv50_gpio_reset() 33 int ent = -1; in nv50_gpio_reset() 38 u8 line = (data & 0x0000001f); in nv50_gpio_reset() local 44 u32 reg = regs[line >> 4]; in nv50_gpio_reset() 45 u32 lsh = line & 0x0f; in nv50_gpio_reset() 51 nvkm_gpio_set(gpio, 0, func, line, defs); in nv50_gpio_reset() 58 nv50_gpio_location(int line, u32 *reg, u32 *shift) in nv50_gpio_location() argument 62 if (line >= 32) in nv50_gpio_location() [all …]
|
| /linux/include/uapi/linux/ |
| H A D | gpio.h | 1 /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ 3 * <linux/gpio.h> - userspace ABI for the GPIO character devices 21 * Must be a multiple of 8 to ensure 32/64-bit alignment of structs. 26 * struct gpiochip_info - Information about a certain GPIO chip 27 * @name: the Linux kernel name of this GPIO chip 28 * @label: a functional name for this GPIO chip, such as a product 30 * @lines: number of GPIO lines on this chip 41 * Must be no greater than 64, as bitmaps are restricted here to 64-bits 42 * for simplicity, and a multiple of 2 to ensure 32/64-bit alignment of 48 * The maximum number of configuration attributes associated with a line [all …]
|
| /linux/arch/arm/boot/dts/aspeed/ |
| H A D | aspeed-bmc-lenovo-hr630.dts | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Copyright (C) 2019-present Lenovo 8 /dts-v1/; 10 #include "aspeed-g5.dtsi" 11 #include <dt-bindings/gpio/aspeed-gpio.h> 15 compatible = "lenovo,hr630-bmc", "aspeed,ast2500"; 29 stdout-path = &uart5; 38 reserved-memory { 39 #address-cells = <1>; 40 #size-cells = <1>; [all …]
|
| /linux/drivers/gpio/ |
| H A D | gpio-aggregator.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 // GPIO Aggregator 5 // Copyright (C) 2019-2020 Glider bv 7 #define DRV_NAME "gpio-aggregator" 30 #include <linux/gpio/consumer.h> 31 #include <linux/gpio/driver.h> 32 #include <linux/gpio/forwarder.h> 33 #include <linux/gpio/machine.h> 35 #include "dev-sync-probe.h" 41 * GPIO Aggregator sysfs interface [all …]
|
| H A D | gpio-virtio.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * GPIO driver for virtio-based virtual GPIO controllers 14 #include <linux/gpio/driver.h> 25 struct mutex lock; /* Protects line operation */ 58 static int _virtio_gpio_req(struct virtio_gpio *vgpio, u16 type, u16 gpio, in _virtio_gpio_req() argument 61 struct virtio_gpio_line *line = &vgpio->lines[gpio]; in _virtio_gpio_req() local 62 struct virtio_gpio_request *req = &line->req; in _virtio_gpio_req() 65 struct device *dev = &vgpio->vdev->dev; in _virtio_gpio_req() 69 * Prevent concurrent requests for the same line since we have in _virtio_gpio_req() 70 * pre-allocated request/response buffers for each GPIO line. Moreover in _virtio_gpio_req() [all …]
|
| /linux/Documentation/firmware-guide/acpi/ |
| H A D | gpio-properties.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 _DSD Device Properties Related to GPIO 10 the corresponding GPIO, which is pretty error prone (it depends on 31 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), 34 Package () { "reset-gpios", Package () { ^BTH, 1, 1, 0 } }, 35 Package () { "shutdown-gpios", Package () { ^BTH, 0, 0, 0 } }, 40 The format of the supported GPIO property is:: 52 If 1, the GPIO is marked as active-low. 55 active-low or active-high, the "active_low" argument can be used here. 56 Setting it to 1 marks the GPIO as active-low. [all …]
|
| /linux/tools/testing/selftests/gpio/ |
| H A D | gpio-aggregator.sh | 2 # SPDX-License-Identifier: GPL-2.0 7 CONFIGFS_SIM_DIR="/sys/kernel/config/gpio-sim" 8 CONFIGFS_AGG_DIR="/sys/kernel/config/gpio-aggregator" 9 SYSFS_AGG_DIR="/sys/bus/platform/drivers/gpio-aggregator" 10 MODULE="gpio-aggregator" 14 echo "GPIO $MODULE test FAIL" 20 echo "GPIO $MODULE test SKIP" 24 # gpio-sim 38 local NOCHECK=${1:-0} 41 [ -d "$CHIP_DIR" ] || continue [all …]
|
| H A D | gpio-sim.sh | 2 # SPDX-License-Identifier: GPL-2.0 6 CONFIGFS_DIR="/sys/kernel/config/gpio-sim" 7 MODULE="gpio-sim" 11 echo "GPIO $MODULE test FAIL" 17 echo "GPIO $MODULE test SKIP" 26 if [ "$BANK" = "live" -o "$BANK" = "dev_name" ]; then 30 LINES=`ls $CONFIGFS_DIR/$CHIP/$BANK/ | grep -E ^line` 32 for LINE in $LINES; do 33 if [ -e $CONFIGFS_DIR/$CHIP/$BANK/$LINE/hog ]; then 34 rmdir $CONFIGFS_DIR/$CHIP/$BANK/$LINE/hog || \ [all …]
|
| /linux/Documentation/devicetree/bindings/gpio/ |
| H A D | gpio-zynq.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/gpio/gpio-zynq.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Xilinx Zynq GPIO controller 10 - Michal Simek <michal.simek@amd.com> 15 - xlnx,zynq-gpio-1.0 16 - xlnx,zynqmp-gpio-1.0 17 - xlnx,versal-gpio-1.0 18 - xlnx,pmc-gpio-1.0 [all …]
|
| /linux/drivers/of/unittest-data/ |
| H A D | overlay_gpio_03.dtso | 1 // SPDX-License-Identifier: GPL-2.0 2 /dts-v1/; 6 #address-cells = <1>; 7 #size-cells = <0>; 9 gpio@3 { 10 compatible = "unittest-gpio"; 12 gpio-controller; 13 #gpio-cells = <2>; 15 gpio-line-names = "line-A", "line-B", "line-C", "line-D"; 17 line-d { [all …]
|