About new gpio API in linux/gpio.h adopted by kernel 4.8

Wang, Kuiying kuiying.wang at intel.com
Thu Sep 6 17:29:55 AEST 2018


Hi Brad/Andrew,
I found the new gpio API adopted by kernel 4.8, is not fully ready, all the lines are "unnamed".
If that we cannot switch to it now. 
Or there is special kernel based configuration I have to do?

root at wolfpass:/tmp# ./gpiodetect
gpiochip0 [SGPIOA] (8 lines)
gpiochip1 [SGPIOB] (8 lines)
gpiochip10 [1e780000.gpio] (232 lines)
gpiochip2 [SGPIOC] (8 lines)
gpiochip3 [SGPIOD] (8 lines)
gpiochip4 [SGPIOE] (8 lines)
gpiochip5 [SGPIOF] (8 lines)
gpiochip6 [SGPIOG] (8 lines)
gpiochip7 [SGPIOH] (8 lines)
gpiochip8 [SGPIOI] (8 lines)
gpiochip9 [SGPIOJ] (8 lines)
root at wolfpass:/tmp# ./gpioinfo /dev/gpiochip1
gpiochip1 - 8 lines:
        line   0:      unnamed       unused  output  active-high
        line   1:      unnamed       unused  output  active-high
        line   2:      unnamed       unused  output  active-high
        line   3:      unnamed       unused  output  active-high
        line   4:      unnamed       unused  output  active-high
        line   5:      unnamed       unused  output  active-high
        line   6:      unnamed       unused  output  active-high
        line   7:      unnamed       unused  output  active-high
root at wolfpass:/tmp# ./gpioinfo /dev/gpiochip10
gpiochip10 - 232 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
root at wolfpass:/tmp# ./gpioget /dev/gpiochip10 219
./gpioget: error reading GPIO values: Device or resource busy

Thanks,
Kuiying.


More information about the openbmc mailing list