Re: [PATCH v3 3/3] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support
From: Andy Shevchenko
Date: Thu Jul 16 2026 - 05:40:35 EST
On Sat, Jul 04, 2026 at 11:09:25AM +0300, Amit Barzilai wrote:
> The Solomon SSD1351 is a 128x128 RGB color OLED controller. It shares
> the SSD133X data path: a column/row addressing window followed by a bulk
> RGB565 pixel write. Add it as a new SSD135X_FAMILY rather than a separate
> driver, reusing the SSD133X plane, CRTC and blit/clear helpers.
>
> The only data-path difference is that the SSD1351 requires an explicit
> Write RAM command (0x5c) after the address window is programmed, before
> pixel data is accepted, whereas the SSD133X enters data mode implicitly.
> This is emitted from a shared ssd133x_write_pixels() helper so both the
> damage-update and clear-screen paths cover it.
>
> The SSD1351 also needs its own init sequence (ssd135x_init), dispatched
> via ssd135x_encoder_atomic_enable. The re-map byte is fixed at 0 degrees,
> 65k color, COM split, BGR sub-pixel order; rotation is not supported.
>
> The SSD1351 doesn't implement the SSD13XX_CONTRAST command (0x81) and
> expects different opcodes for contrast and brightness management. The
> current ssd130x_update_bl() function wouldn't work and the brightness
> byte would be executed as a command opcode if run on the SSD1351 panel.
> Until the backlight path is family-aware, skip backlight device
> registration for the SSD135X family.
>
> The SSD1351 is SPI-only, so only the SPI transport match tables gain an
> entry; no new config symbol is needed.
>
> While adding the SSD135X command path, ssd130x_write_cmds() forwards its
> 'const u8 *cmd' buffer to ssd130x_write_data(), which previously took a
> non-const 'u8 *'. Constify the ssd130x_write_data() 'values' parameter
> so the const-qualified buffer passes through without casting away const.
...
> { "ssd1327", SSD1327_ID },
> /* ssd133x family */
> { "ssd1331", SSD1331_ID },
> + /* ssd135x family */
> + { "ssd1351", SSD1351_ID },
> { /* sentinel */ }
To avoid conflicts it's better to convert this ID table to use C99 initialisers
(so Uwe will be happy).
--
With Best Regards,
Andy Shevchenko