From: Svyatoslav Ryhel clamor95@gmail.com
[ Upstream commit 07c7efda24453e05951fb2879f5452b720b91169 ]
According to LP8556 datasheet EPROM region starts at 0x98 so adjust value in the driver accordingly.
Signed-off-by: Svyatoslav Ryhel clamor95@gmail.com Reviewed-by: "Daniel Thompson (RISCstar)" danielt@kernel.org Link: https://lore.kernel.org/r/20250909074304.92135-2-clamor95@gmail.com Signed-off-by: Lee Jones lee@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
Explanation - What changed: The LP8556 EPROM start constant is corrected from 0xA0 to 0x98. See drivers/video/backlight/lp855x_bl.c:25 (old 0xA0; commit changes to 0x98). The end remains 0xAF (drivers/video/backlight/lp855x_bl.c:26). - How it’s used: The valid ROM window for a given chip is enforced by lp855x_is_valid_rom_area(), which selects the [start, end] range based on chip ID and filters all ROM writes against it: - Range selection for LP8556 uses these macros (drivers/video/backlight/lp855x_bl.c:114-116). - The write loop applies this filter when programming platform/DT- provided ROM entries (drivers/video/backlight/lp855x_bl.c:193-204), skipping any address outside the range. - DT parsing populates the ROM programming list (drivers/video/backlight/lp855x_bl.c:342-360), so the incorrect start value causes any LP8556 ROM entries in 0x98–0x9F to be silently ignored.
Why this matters - Functional bug for LP8556: According to the commit message (datasheet reference), the LP8556 ROM region begins at 0x98. With the current code, addresses 0x98–0x9F are wrongly rejected by lp855x_is_valid_rom_area(), so intended ROM configuration may not be applied to LP8556 devices. This can lead to misconfiguration of backlight behavior on boards that rely on these addresses. - The change is strictly a correction: It expands the accepted range for LP8556 to the true datasheet range [0x98..0xAF]. It does not alter behavior for other chips (LP8550/1/2/3 use LP855X_EEPROM_START/END at 0xA0–0xA7, and LP8555/7 use their own ranges; see drivers/video/backlight/lp855x_bl.c:23-24,35-38).
Risk and regression assessment - Small, contained fix: One-line macro change in a single driver file; no API/ABI or architectural changes. - Low regression risk: - Only affects LP8556 and only the ROM programming acceptance window. - In-tree DTs for LP8556 commonly use 0xA0+ (e.g., arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano- castor.dts:41), so existing configurations remain unaffected. - ACPI-enumerated LP8556 systems do not use ROM programming path (they read back registers), so they are unaffected by the range check. - Security impact: none; this is a correctness change to permitted I2C write addresses for the device’s configuration space.
Stable backport criteria - Fixes a real bug: Corrects the ROM region mapping for LP8556 so valid configuration writes are no longer dropped. - Minimal and clearly scoped: One constant change; code paths only in a leaf driver. - No feature addition or architectural refactor. - Touches a non-critical subsystem (backlight), and the behavior change is limited to enabling previously valid writes per datasheet. - Reviewed-by and signed-off chain present; commit rationale is clear and tied to the datasheet.
Conclusion - This is a safe, data-sheet-backed correctness fix that can affect actual device behavior for LP8556 users relying on 0x98–0x9F configuration. It is small, low risk, and appropriate for stable backporting.
drivers/video/backlight/lp855x_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 7075bfab59c4d..d191560ce285f 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c @@ -22,7 +22,7 @@ #define LP855X_DEVICE_CTRL 0x01 #define LP855X_EEPROM_START 0xA0 #define LP855X_EEPROM_END 0xA7 -#define LP8556_EPROM_START 0xA0 +#define LP8556_EPROM_START 0x98 #define LP8556_EPROM_END 0xAF
/* LP8555/7 Registers */