[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSSPKObizmpKiSpR@smile.fi.intel.com>
Date: Mon, 24 Nov 2025 19:00:24 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Jean-François Lessard <jefflessard3@...il.com>
Cc: Andy Shevchenko <andy@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v6 7/7] auxdisplay: TM16xx: Add support for SPI-based
controllers
On Fri, Nov 21, 2025 at 09:59:07AM -0500, Jean-François Lessard wrote:
> Add support for TM16xx-compatible auxiliary display controllers connected
> via the SPI bus.
>
> The implementation includes:
> - SPI driver registration and initialization
> - Probe/remove logic for SPI devices
> - Controller-specific handling and communication sequences
> - Integration with the TM16xx core driver for common functionality
>
> This allows platforms using TM16xx or compatible controllers over SPI to be
> managed by the TM16xx driver infrastructure.
...
Seems like same/similar comments as per I2C glue driver are applicable here.
Please, address accordingly.
Additional comments below.
...
> + tm16xx_for_each_key(display, row, col) {
> + byte = col >> 1;
> + bit = (2 - row) + ((col & 1) << 2);
If you do something like
byte = col / 2;
... = col % 2;
it may be optimised to a single assembly instruction on some architectures
by a compiler (and yes, I saw it in real life that `idiv` on x86 has been
chosen over other approaches by GCC).
> + value = !!(codes[byte] & BIT(bit));
Seems unneeded
> + tm16xx_set_key(display, row, col, value);
tm16xx_set_key(display, row, col, codes[byte] & BIT(bit));
> + }
> +
> + return 0;
> +}
...
> + tm16xx_set_key(display, 0, 0, !!(codes[0] & BIT(1)));
> + tm16xx_set_key(display, 0, 1, !!(codes[0] & BIT(4)));
> + tm16xx_set_key(display, 0, 2, !!(codes[1] & BIT(1)));
> + tm16xx_set_key(display, 0, 3, !!(codes[1] & BIT(4)));
> + tm16xx_set_key(display, 0, 4, !!(codes[2] & BIT(1)));
Do we really need !!() ?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists