• Daniel Kurtz's avatar
    pinctrl/amd: add get_direction handler · 12b10f47
    Daniel Kurtz authored
    On boot, gpiochip_add_data() initializes the FLAG_IS_OUT bit in
    desc->flags iff its gpio_chip does not have ->direction_input() handler,
    else it is initialized to 0, which implies the GPIO is an "input".
    
    Later, the sysfs "direction" handler will use gpiod_get_direction() to
    get the current direction, but if no ->get_direction() handler is
    installed, the result will just be the current (initial) value of flags,
    which will always be OUT irregardless of the initial register value.
    
    Add a get_direction() handler to pinctrl-amd to fix this and always
    provide the correct value for direction.
    Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    12b10f47
pinctrl-amd.c 24.8 KB