1fe95046eSLinus WalleijWhat: /sys/class/gpio/ 2fe95046eSLinus WalleijDate: July 2008 3fe95046eSLinus WalleijKernelVersion: 2.6.27 4fe95046eSLinus WalleijContact: Linus Walleij <linusw@kernel.org> 5fe95046eSLinus WalleijDescription: 6fe95046eSLinus Walleij 7fe95046eSLinus Walleij As a Kconfig option, individual GPIO signals may be accessed from 8fe95046eSLinus Walleij userspace. GPIOs are only made available to userspace by an explicit 9fe95046eSLinus Walleij "export" operation. If a given GPIO is not claimed for use by 10fe95046eSLinus Walleij kernel code, it may be exported by userspace (and unexported later). 11fe95046eSLinus Walleij Kernel code may export it for complete or partial access. 12fe95046eSLinus Walleij 13fe95046eSLinus Walleij GPIOs are identified as they are inside the kernel, using integers in 14c2746a1eSMauro Carvalho Chehab the range 0..INT_MAX. See Documentation/admin-guide/gpio for more information. 15fe95046eSLinus Walleij 167832dea7SMauro Carvalho Chehab :: 177832dea7SMauro Carvalho Chehab 18fe95046eSLinus Walleij /sys/class/gpio 19fe95046eSLinus Walleij /export ... asks the kernel to export a GPIO to userspace 20fe95046eSLinus Walleij /unexport ... to return a GPIO to the kernel 21fe95046eSLinus Walleij /gpioN ... for each exported GPIO #N OR 22fe95046eSLinus Walleij /value ... always readable, writes fail for input GPIOs 23fe95046eSLinus Walleij /direction ... r/w as: in, out (default low); write: high, low 24fe95046eSLinus Walleij /edge ... r/w as: none, falling, rising, both 251ae86030SBartosz Golaszewski /active_low ... r/w as: 0, 1 26fe95046eSLinus Walleij /gpiochipN ... for each gpiochip; #N is its first GPIO 27fe95046eSLinus Walleij /base ... (r/o) same as N 282028f854SBartosz Golaszewski /label ... (r/o) descriptive chip name 29fe95046eSLinus Walleij /ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1) 30*4fa93223SBartosz Golaszewski /gpio<OFFSET> 31*4fa93223SBartosz Golaszewski /value ... always readable, writes fail for input GPIOs 32*4fa93223SBartosz Golaszewski /direction ... r/w as: in, out (default low); write: high, low 332028f854SBartosz Golaszewski /chipX ... for each gpiochip; #X is the gpio device ID 342028f854SBartosz Golaszewski /export ... asks the kernel to export a GPIO at HW offset X to userspace 352028f854SBartosz Golaszewski /unexport ... to return a GPIO at HW offset X to the kernel 362028f854SBartosz Golaszewski /label ... (r/o) descriptive chip name 372028f854SBartosz Golaszewski /ngpio ... (r/o) number of GPIOs exposed by the chip 38fe95046eSLinus Walleij 39f1fc93d9SKent Gibson This ABI is obsoleted by Documentation/ABI/testing/gpio-cdev and will be 40f1fc93d9SKent Gibson removed after 2020. 41