All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/ssd130x: Wire up ssd133x backlight/dimming
@ 2026-07-29  5:30 Amit Barzilai
  2026-07-29  5:30 ` [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init Amit Barzilai
  2026-07-29  5:30 ` [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic Amit Barzilai
  0 siblings, 2 replies; 5+ messages in thread
From: Amit Barzilai @ 2026-07-29  5:30 UTC (permalink / raw)
  To: Javier Martinez Canillas, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Amit Barzilai

The ssd130x backlight controller adjusts brightness by writing the panel's
contrast, but ssd130x_update_bl() writes the single global SSD13XX_CONTRAST
(0x81) command that only the SSD130x and SSD132x families expose.  SSD133x
has no such command: brightness is controlled through three per-channel
contrast registers (CONTRAST_A/B/C) that form a white-balance calibration
and must be scaled together.  As a result the backlight device registered
for an ssd133x panel had no effect.

This series adds ssd133x dimming:

  - Patch 1 extracts the ssd133x_init() contrast magic values into
    ssd133x_set_contrast(), which scales the per-channel calibration by a
    requested brightness so the white point is preserved while dimming.

  - Patch 2 makes backlight_ops.update_status a per-family choice, so
    ssd133x uses a handler that drives the three channels while SSD130x and
    SSD132x keep the existing single-register path.

Note patch 1 changes the ssd133x power-on brightness: it previously booted
at the unscaled (full) calibration and ignored the contrast field, and now
honours the shared default contrast of 127, i.e. half of MAX_CONTRAST.
This is intentional and matches ssd130x, whose contrast register also
defaults to mid-scale, so all families now power on at ~50%.

WARNING - NOT TESTED ON HARDWARE: this series is compile-tested only.  I do
not have an ssd133x panel, so the runtime behaviour -- in particular the
ssd133x contrast scaling and the new per-family backlight update -- is
unverified.  It is posted now so that dependent work (ssd1351 support) can
be based on it.  Review and testing by anyone with the hardware is welcome.

Amit Barzilai (2):
  drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init
  drm/ssd130x: Add per-family update backlight logic

 drivers/gpu/drm/solomon/ssd130x.c | 67 +++++++++++++++++++++++++++----
 1 file changed, 60 insertions(+), 7 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-29  5:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29  5:30 [PATCH 0/2] drm/ssd130x: Wire up ssd133x backlight/dimming Amit Barzilai
2026-07-29  5:30 ` [PATCH 1/2] drm/ssd130x: Scale ssd133x per-channel contrast by brightness on init Amit Barzilai
2026-07-29  5:41   ` sashiko-bot
2026-07-29  5:30 ` [PATCH 2/2] drm/ssd130x: Add per-family update backlight logic Amit Barzilai
2026-07-29  5:40   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.