From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A7D53B0AD0 for ; Wed, 29 Jul 2026 05:31:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785303082; cv=none; b=FgERTHVoLkbWCeeQimmdyUctAwUgVRPqWAjY2GHflP59dEk86w/keRNIunwhSXc1BiBIFuDYVv8Fa33rYTXooCZGAvD9J2P1n1Q1txBlT2B0z/ApWS5upg1gg9F+X2R3fhPFJXtP2Y4ZKOD9mlRt8D9cXipYuqwBbdjpc7RNVLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785303082; c=relaxed/simple; bh=LLNe/QabHLmXoyu280V5S17s3AYMWuJtJKY13AQeKnI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ra9fkgwpCXIrRTiN10a8H/Us8fkEU3UxropQZNHqSO4kxD+YLgyBd2rcXs1rI+o93MHPM1PwctL2VBqJkLVwi8iAZLf2kSvIQHtL5xS7Chb9YL9yUXvvzZYDs6bn1LzI0Jbrt7hhBawItD5fvbBbB+ZE6yfRwM7az/9qavIhwtg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SAqyl26j; arc=none smtp.client-ip=209.85.160.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SAqyl26j" Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-517dc520840so4201941cf.3 for ; Tue, 28 Jul 2026 22:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785303076; x=1785907876; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ajJ4gb5K+FqgyR1CXk8w+2a0cfOTWEXUH5BdVR+3LEY=; b=SAqyl26jaTu/5D48mOtXkSGOcrHzAMVLcz+77DEjQR7PYrGh8vZkudGsjzg3UVoNUU I2gxncJAXcRLi0vI/dHsQ842WxzjnmxITdKvFC4gEfqUaZTRHaLFoqKNvNxS1Aqzp4ry aZMfj18pTsBSy/LyCRPknK4xTLPtgPU9+tuCLzurnTXJffNd2KCxLlfwjb9bu3bMuMMX 7wLGwdKRf/I7wmx7J4Agtmwd8GoDDJFzjbRAYLBaEBakSPS+oHrrr0i9WIhSsMwCaIzs oHHJRmSPx6a2pygVUMTOM2pzJJQBhke0Ipo3xz1aZlULtkiPxr+1bJLaZK/6Z+EniPkE t0Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785303076; x=1785907876; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ajJ4gb5K+FqgyR1CXk8w+2a0cfOTWEXUH5BdVR+3LEY=; b=cnZjuY1aj/mSUjnio+E5G9OJZ9FGfTfv4nsnDfpctNPVXxLp3ncTnWs/erloLzcmnt EvV/J2lQAwLOkyn9ddnSpg+m0njjY20+QlO6g5CHsCpIn3KJ5hu6fHUUpufMO1ZSToMn Esf1TStfUpzBVnkYHnC5Qm/+uiUPV6mQds1YIx2w8mHbFiFubDP4hnIHRlhDD+oCozYL lfezSQ+6AkhcwWtsJ883HPJWQlaBLssGmYATZegXkBnM8P+N6yVlyVrljwEMtLhh3QCh JdrrScZzPilrvng1jk5Lw2CKRhmHivWyh0s2Bjchx7vd7jpvF2GI1YJ9VC0g8kvHtM5i sFIA== X-Forwarded-Encrypted: i=1; AHgh+RokuuMNk2kkM2SYeD9nut9TKkEQPJInG/ZsAC96Z3AIeCUvkB3Q8RCsVqoOMZwwKg3JrqubufuiIQW0+dw=@vger.kernel.org X-Gm-Message-State: AOJu0YyLVIklYaD/DwwozrgyCIFMfL+B1YPu/TJ+O9hpXVke2qNA6JoB sY1z6+uHlWGzfb+Bn1wVqjqjzE1r/BHYCfCcnODjFFapwpe7rYBMaoXb X-Gm-Gg: AR+sD10lXzLXWciEXMIqxN5hdNM+b8EP/DwWb07N9QeWidaZjbYBkW8DDqNdusuePgu ynanptBWglJewHUcIyjnjca/tSxBSxr6bfkNpnAsYMBKPrgHfhICOhQYe6F/DuiZTzz8gjINvPa F3hb0VUYP/k1dRlaBMgmxg+LoAt/rCM1jpiUC8h3trNQPNhI6XPPpgHcVZxoqiQPfoqav94x06h J1gOivZRW/9OSFT0RwirLdKUFDPGrKYEud13NwsTLLrK90HwDwU6conIcyrcoZP1O3Uop1qKCjq VWm+uW/ji9XM18tSGJiby088KHsIDDo1n2bFx3yKn+PRyfKcLyi8jVSsgtMBQ9TSjlNV71qA8wo 51dF5BCZDgMS/r/QVOc5SVdUllvXVW/DeC7up73EB0/B1kJNOwVfZGQxVr24drW8bDbgTzxHycq wZ/SHTpfNev7MA/QleY1fBs5hmseBMmikWTUzIbnEm8/20bS+dwgmzU6HbMSw= X-Received: by 2002:a05:622a:130f:b0:51c:f04:4aa9 with SMTP id d75a77b69052e-529d7106b58mr51995491cf.32.1785303076548; Tue, 28 Jul 2026 22:31:16 -0700 (PDT) Received: from thinker ([65.195.2.74]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-529e2b1a1ddsm12592861cf.5.2026.07.28.22.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 22:31:16 -0700 (PDT) From: Amit Barzilai To: Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Amit Barzilai Subject: [PATCH 0/2] drm/ssd130x: Wire up ssd133x backlight/dimming Date: Wed, 29 Jul 2026 08:30:52 +0300 Message-ID: <20260729053054.29374-1-amit.barzilai22@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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