Skip to content

fix(linux-mt6858): give the STK3A5X its own illuminance scale (r25) - #105

Open
patrickjquinn wants to merge 1 commit into
mainfrom
fix/jolla-als
Open

patrickjquinn wants to merge 1 commit into
mainfrom
fix/jolla-als

Conversation

@patrickjquinn

Copy link
Copy Markdown
Owner

Jolla e2e 2026-11-28, P2 "ALS": in_illuminance_raw read 65535 on every sample, so auto-brightness acted on a saturated input.

Root cause. The STK3A5X counts in 11.84 ms frames and averages longer integrations (measured at 1x gain: counts double per step up to 11.84 ms, then stay at ~3250 from 11.84 ms to 757 ms). The driver programmed 64x gain and 94.72 ms for the STK3310's scale table, so room light saturated, and that table's 0.1 lux/count does not describe this part.

Fix. Kernel patch 0291 (jp2601/devfix-r25): a STK3A5X scale table (0.1375 lux/count at 1x and >=11.84 ms, from Sensortek's own stk3a5x driver: 1.1 lux/count at 4x and 370 us), 1x gain and 94.72 ms at probe, and ALS integration times under 11.84 ms refused. linux-mt6858 r25.

On the phone (module built from this source swapped in on r24): 2605 counts = 358 lux in daylight; 41657 at 16x for the same light (also 358 lux); 130 counts = 18 lux after dusk; never 65535. Proximity unchanged. checkpatch clean apart from the series' missing Signed-off-by; W=1 build clean.

The full r25 package build could not finish on this host (disk full); the patch applies in the package series (the build got past prepare and compiled for 20 min).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BrjN1gf1Fu2w5MqXBmEowh

The Jolla's ambient light sensor read 65535 on every sample, so
auto-brightness acted on a saturated input. The STK3A5X counts in
11.84 ms frames and averages longer integrations, so the 64x gain and
94.72 ms programmed for the STK3310's scale table saturated in room
light, and the table's 0.1 lux a count was wrong for this part.

r25 adds 0291 (jp2601/devfix-r25): 1x gain, 94.72 ms, 0.1375 lux a
count from Sensortek's stk3a5x conversion, and no ALS integration time
under 11.84 ms. Checked on the Jolla with the module built from this
source swapped in: 2605 counts (358 lux) in daylight, 41657 at 16x for
the same light, 130 counts (18 lux) after dusk, never 65535.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant