• Lukas Wunner's avatar
    gpio: Introduce ->get_multiple callback · eec1d566
    Lukas Wunner authored
    SPI-attached GPIO controllers typically read out all inputs in one go.
    If callers desire the values of multipe inputs, ideally a single readout
    should take place to return the desired values.  However the current
    driver API only offers a ->get callback but no ->get_multiple (unlike
    ->set_multiple, which is present).  Thus, to read multiple inputs, a
    full readout needs to be performed for every single value (barring
    driver-internal caching), which is inefficient.
    
    In fact, the lack of a ->get_multiple callback has been bemoaned
    repeatedly by the gpio subsystem maintainer:
    http://www.spinics.net/lists/linux-gpio/msg10571.html
    http://www.spinics.net/lists/devicetree/msg121734.html
    
    Introduce the missing callback.  Add corresponding consumer functions
    such as gpiod_get_array_value().  Amend linehandle_ioctl() to take
    advantage of the newly added infrastructure.  Update the documentation.
    
    Cc: Rojhalat Ibrahim <imr@rtschenk.de>
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    eec1d566
consumer.txt 17.2 KB