• Janusz Krzysztofik's avatar
    gpiolib: Fix array members of same chip processed separately · c4c958aa
    Janusz Krzysztofik authored
    New code introduced by commit bf9346f5 ("gpiolib: Identify arrays
    matching GPIO hardware") forcibly tries to find an array member which
    has its array index number equal to its hardware pin number and set
    up an array info for possible fast bitmap processing of all arrray
    pins belonging to that chip which also satisfy that numbering rule.
    
    Depending on array content, it may happen that consecutive array
    members which belong to the same chip but don't have array indexes
    equal to their pin hardware numbers will be split into groups, some of
    them processed together via the fast bitmap path, and rest of them
    separetely.  However, applications may expect all those pins being
    processed together with a single call to .set_multiple() chip callback,
    like that was done before the change.
    
    Limit applicability of fast bitmap processing path to cases where all
    pins of consecutive array members starting from 0 which belong to the
    same chip have their hardware numbers equal to their corresponding
    array indexes.  That should still speed up processing of applications
    using whole GPIO banks as I/O ports, while not breaking simultaneous
    manipulation of consecutive pins of the same chip which don't follow
    the equal numbering rule.
    
    Cc: Jonathan Corbet <corbet@lwn.net>
    Signed-off-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
    Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    c4c958aa
board.rst 8.36 KB