18c2ecf20Sopenharmony_ciWhat: /sys/class/gpio/ 28c2ecf20Sopenharmony_ciDate: July 2008 38c2ecf20Sopenharmony_ciKernelVersion: 2.6.27 48c2ecf20Sopenharmony_ciContact: Linus Walleij <linusw@kernel.org> 58c2ecf20Sopenharmony_ciDescription: 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci As a Kconfig option, individual GPIO signals may be accessed from 88c2ecf20Sopenharmony_ci userspace. GPIOs are only made available to userspace by an explicit 98c2ecf20Sopenharmony_ci "export" operation. If a given GPIO is not claimed for use by 108c2ecf20Sopenharmony_ci kernel code, it may be exported by userspace (and unexported later). 118c2ecf20Sopenharmony_ci Kernel code may export it for complete or partial access. 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci GPIOs are identified as they are inside the kernel, using integers in 148c2ecf20Sopenharmony_ci the range 0..INT_MAX. See Documentation/admin-guide/gpio for more information. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci :: 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci /sys/class/gpio 198c2ecf20Sopenharmony_ci /export ... asks the kernel to export a GPIO to userspace 208c2ecf20Sopenharmony_ci /unexport ... to return a GPIO to the kernel 218c2ecf20Sopenharmony_ci /gpioN ... for each exported GPIO #N OR 228c2ecf20Sopenharmony_ci /<LINE-NAME> ... for a properly named GPIO line 238c2ecf20Sopenharmony_ci /value ... always readable, writes fail for input GPIOs 248c2ecf20Sopenharmony_ci /direction ... r/w as: in, out (default low); write: high, low 258c2ecf20Sopenharmony_ci /edge ... r/w as: none, falling, rising, both 268c2ecf20Sopenharmony_ci /gpiochipN ... for each gpiochip; #N is its first GPIO 278c2ecf20Sopenharmony_ci /base ... (r/o) same as N 288c2ecf20Sopenharmony_ci /label ... (r/o) descriptive, not necessarily unique 298c2ecf20Sopenharmony_ci /ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1) 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci This ABI is deprecated and will be removed after 2020. It is 328c2ecf20Sopenharmony_ci replaced with the GPIO character device. 33