Re: [PATCH] Input: gpio_decoder - fix bit order reversal introduced by bitmap conversion

From: Andy Shevchenko

Date: Mon Aug 17 2026 - 09:37:39 EST


On Mon, Aug 17, 2026 at 01:50:27PM +0200, Esben Haabendal wrote:
> The switch from a manual loop to gpiod_get_array_value_cansleep() +
> bitmap_read() inadvertently reversed the bit order of the decoded value.
> The original loop treated GPIO[0] as MSB by shifting left on each
> iteration, but bitmap_read() returns GPIO[0] at bit 0 (LSB).
>
> The previous bit order was correct according to device-tree bindings, and
> the change broke existing users.

Oops, thanks for catching this!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko