1 ============================ 1 ============================ 2 Subsystem drivers using GPIO 2 Subsystem drivers using GPIO 3 ============================ 3 ============================ 4 4 5 Note that standard kernel drivers exist for co 5 Note that standard kernel drivers exist for common GPIO tasks and will provide 6 the right in-kernel and userspace APIs/ABIs fo 6 the right in-kernel and userspace APIs/ABIs for the job, and that these 7 drivers can quite easily interconnect with oth 7 drivers can quite easily interconnect with other kernel subsystems using 8 hardware descriptions such as device tree or A 8 hardware descriptions such as device tree or ACPI: 9 9 10 - leds-gpio: drivers/leds/leds-gpio.c will han 10 - leds-gpio: drivers/leds/leds-gpio.c will handle LEDs connected to GPIO 11 lines, giving you the LED sysfs interface 11 lines, giving you the LED sysfs interface 12 12 13 - ledtrig-gpio: drivers/leds/trigger/ledtrig-g 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 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 15 (and that LED may in turn use the leds-gpio as per above). 16 16 17 - gpio-keys: drivers/input/keyboard/gpio_keys. 17 - gpio-keys: drivers/input/keyboard/gpio_keys.c is used when your GPIO line 18 can generate interrupts in response to a key 18 can generate interrupts in response to a key press. Also supports debounce. 19 19 20 - gpio-keys-polled: drivers/input/keyboard/gpi 20 - gpio-keys-polled: drivers/input/keyboard/gpio_keys_polled.c is used when your 21 GPIO line cannot generate interrupts, so it 21 GPIO line cannot generate interrupts, so it needs to be periodically polled 22 by a timer. 22 by a timer. 23 23 24 - gpio_mouse: drivers/input/mouse/gpio_mouse.c 24 - gpio_mouse: drivers/input/mouse/gpio_mouse.c is used to provide a mouse with 25 up to three buttons by simply using GPIOs an 25 up to three buttons by simply using GPIOs and no mouse port. You can cut the 26 mouse cable and connect the wires to GPIO li 26 mouse cable and connect the wires to GPIO lines or solder a mouse connector 27 to the lines for a more permanent solution o 27 to the lines for a more permanent solution of this type. 28 28 29 - gpio-beeper: drivers/input/misc/gpio-beeper. 29 - gpio-beeper: drivers/input/misc/gpio-beeper.c is used to provide a beep from 30 an external speaker connected to a GPIO line !! 30 an external speaker connected to a GPIO line. 31 off/on, for an actual PWM waveform, see pwm- << 32 << 33 - pwm-gpio: drivers/pwm/pwm-gpio.c is used to << 34 resolution timer producing a PWM waveform on << 35 Linux high resolution timers can do. << 36 31 37 - extcon-gpio: drivers/extcon/extcon-gpio.c is 32 - extcon-gpio: drivers/extcon/extcon-gpio.c is used when you need to read an 38 external connector status, such as a headset 33 external connector status, such as a headset line for an audio driver or an 39 HDMI connector. It will provide a better use 34 HDMI connector. It will provide a better userspace sysfs interface than GPIO. 40 35 41 - restart-gpio: drivers/power/reset/gpio-resta 36 - restart-gpio: drivers/power/reset/gpio-restart.c is used to restart/reboot 42 the system by pulling a GPIO line and will r 37 the system by pulling a GPIO line and will register a restart handler so 43 userspace can issue the right system call to 38 userspace can issue the right system call to restart the system. 44 39 45 - poweroff-gpio: drivers/power/reset/gpio-powe 40 - poweroff-gpio: drivers/power/reset/gpio-poweroff.c is used to power the 46 system down by pulling a GPIO line and will 41 system down by pulling a GPIO line and will register a pm_power_off() 47 callback so that userspace can issue the rig 42 callback so that userspace can issue the right system call to power down the 48 system. 43 system. 49 44 50 - gpio-gate-clock: drivers/clk/clk-gpio.c is u 45 - gpio-gate-clock: drivers/clk/clk-gpio.c is used to control a gated clock 51 (off/on) that uses a GPIO, and integrated wi 46 (off/on) that uses a GPIO, and integrated with the clock subsystem. 52 47 53 - i2c-gpio: drivers/i2c/busses/i2c-gpio.c is u 48 - i2c-gpio: drivers/i2c/busses/i2c-gpio.c is used to drive an I2C bus 54 (two wires, SDA and SCL lines) by hammering 49 (two wires, SDA and SCL lines) by hammering (bitbang) two GPIO lines. It will 55 appear as any other I2C bus to the system an 50 appear as any other I2C bus to the system and makes it possible to connect 56 drivers for the I2C devices on the bus like 51 drivers for the I2C devices on the bus like any other I2C bus driver. 57 52 58 - spi_gpio: drivers/spi/spi-gpio.c is used to 53 - spi_gpio: drivers/spi/spi-gpio.c is used to drive an SPI bus (variable number 59 of wires, at least SCK and optionally MISO, 54 of wires, at least SCK and optionally MISO, MOSI and chip select lines) using 60 GPIO hammering (bitbang). It will appear as 55 GPIO hammering (bitbang). It will appear as any other SPI bus on the system 61 and makes it possible to connect drivers for 56 and makes it possible to connect drivers for SPI devices on the bus like 62 any other SPI bus driver. For example any MM 57 any other SPI bus driver. For example any MMC/SD card can then be connected 63 to this SPI by using the mmc_spi host from t 58 to this SPI by using the mmc_spi host from the MMC/SD card subsystem. 64 59 65 - w1-gpio: drivers/w1/masters/w1-gpio.c is use 60 - w1-gpio: drivers/w1/masters/w1-gpio.c is used to drive a one-wire bus using 66 a GPIO line, integrating with the W1 subsyst 61 a GPIO line, integrating with the W1 subsystem and handling devices on 67 the bus like any other W1 device. 62 the bus like any other W1 device. 68 63 69 - gpio-fan: drivers/hwmon/gpio-fan.c is used t 64 - gpio-fan: drivers/hwmon/gpio-fan.c is used to control a fan for cooling the 70 system, connected to a GPIO line (and option 65 system, connected to a GPIO line (and optionally a GPIO alarm line), 71 presenting all the right in-kernel and sysfs 66 presenting all the right in-kernel and sysfs interfaces to make your system 72 not overheat. 67 not overheat. 73 68 74 - gpio-regulator: drivers/regulator/gpio-regul 69 - gpio-regulator: drivers/regulator/gpio-regulator.c is used to control a 75 regulator providing a certain voltage by pul 70 regulator providing a certain voltage by pulling a GPIO line, integrating 76 with the regulator subsystem and giving you 71 with the regulator subsystem and giving you all the right interfaces. 77 72 78 - gpio-wdt: drivers/watchdog/gpio_wdt.c is use 73 - gpio-wdt: drivers/watchdog/gpio_wdt.c is used to provide a watchdog timer 79 that will periodically "ping" a hardware con 74 that will periodically "ping" a hardware connected to a GPIO line by toggling 80 it from 1-to-0-to-1. If that hardware does n 75 it from 1-to-0-to-1. If that hardware does not receive its "ping" 81 periodically, it will reset the system. 76 periodically, it will reset the system. 82 77 83 - gpio-nand: drivers/mtd/nand/raw/gpio.c is us 78 - gpio-nand: drivers/mtd/nand/raw/gpio.c is used to connect a NAND flash chip 84 to a set of simple GPIO lines: RDY, NCE, ALE 79 to a set of simple GPIO lines: RDY, NCE, ALE, CLE, NWP. It interacts with the 85 NAND flash MTD subsystem and provides chip a 80 NAND flash MTD subsystem and provides chip access and partition parsing like 86 any other NAND driving hardware. 81 any other NAND driving hardware. 87 82 88 - ps2-gpio: drivers/input/serio/ps2-gpio.c is 83 - ps2-gpio: drivers/input/serio/ps2-gpio.c is used to drive a PS/2 (IBM) serio 89 bus, data and clock line, by bit banging two 84 bus, data and clock line, by bit banging two GPIO lines. It will appear as 90 any other serio bus to the system and makes 85 any other serio bus to the system and makes it possible to connect drivers 91 for e.g. keyboards and other PS/2 protocol b 86 for e.g. keyboards and other PS/2 protocol based devices. 92 87 93 - cec-gpio: drivers/media/platform/cec-gpio/ i 88 - cec-gpio: drivers/media/platform/cec-gpio/ is used to interact with a CEC 94 Consumer Electronics Control bus using only 89 Consumer Electronics Control bus using only GPIO. It is used to communicate 95 with devices on the HDMI bus. 90 with devices on the HDMI bus. 96 91 97 - gpio-charger: drivers/power/supply/gpio-char << 98 battery charging and all you have to go by t << 99 AC charger or more complex tasks such as ind << 100 nothing but GPIO lines, this driver provides << 101 way to pass the charging parameters from har << 102 device tree. << 103 << 104 - gpio-mux: drivers/mux/gpio.c is used for con << 105 n GPIO lines such that you can mux in 2^n di << 106 different GPIO lines. Often the GPIOs are on << 107 some SoC-external entities, such as differen << 108 can be selectively enabled. << 109 << 110 Apart from this there are special GPIO drivers 92 Apart from this there are special GPIO drivers in subsystems like MMC/SD to 111 read card detect and write protect GPIO lines, 93 read card detect and write protect GPIO lines, and in the TTY serial subsystem 112 to emulate MCTRL (modem control) signals CTS/R 94 to emulate MCTRL (modem control) signals CTS/RTS by using two GPIO lines. The 113 MTD NOR flash has add-ons for extra GPIO lines 95 MTD NOR flash has add-ons for extra GPIO lines too, though the address bus is 114 usually connected directly to the flash. 96 usually connected directly to the flash. 115 97 116 Use those instead of talking directly to the G !! 98 Use those instead of talking directly to the GPIOs using sysfs; they integrate 117 integrate with kernel frameworks better than y !! 99 with kernel frameworks better than your userspace code could. Needless to say, 118 Needless to say, just using the appropriate ke !! 100 just using the appropriate kernel drivers will simplify and speed up your 119 speed up your embedded hacking in particular b !! 101 embedded hacking in particular by providing ready-made components.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.