[PATCH] gpio: sifive: use the correct register to read output values
Linus Walleij
linus.walleij at linaro.org
Sat Feb 5 08:39:35 PST 2022
On Fri, Feb 4, 2022 at 2:02 PM Niklas Cassel <Niklas.Cassel at wdc.com> wrote:
> From: Niklas Cassel <niklas.cassel at wdc.com>
Hi Niklas, long time no C!
> Setting the output of a GPIO to 1 using gpiod_set_value(), followed by
> reading the same GPIO using gpiod_get_value(), will currently yield an
> incorrect result.
>
> This is because the SiFive GPIO device stores the output values in reg_set,
> not reg_dat.
>
> Supply the flag BGPIOF_READ_OUTPUT_REG_SET to bgpio_init() so that the
> generic driver reads the correct register.
>
> Signed-off-by: Niklas Cassel <niklas.cassel at wdc.com>
Looks like a straight-forward fix so:
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>
Yours,
Linus Walleij
More information about the linux-riscv
mailing list