[PATCH 0/2] iio: light: Add Capella CM3217 ambient light sensor
From: Patrick Fischer via B4 Relay
Date: Sun Nov 01 2026 - 09:46:46 EST
The Capella CM3217 is a small ambient light sensor without registers.
NVIDIA used it in the Tegra Note 7 and the Shield Tablet. Mainline has
no driver for it: cm32181 and cm3232 expect registers and an ID, the
CM3217 has neither.
Patch 1 adds the binding, patch 2 the driver with raw value, scale and
integration time. The datasheet is not public, so the bit fields come
from NVIDIA's downstream drivers and the scale from Capella's published
detection range. Patch 2 explains both.
Tested on a Tegra Note 7 (P1640) with v7.3 and the driver built as a
module, the device created through new_device. In room light all 32
combinations of integration time and scale gave the same illuminance
within the count resolution (6.0 to 7.3 lux), and the first read after
each change matched the second one. The raw counts scale linearly with
both fields. Svyatoslav Ryhel also tried it on the P1988 variant of the
Tegra Note 7.
Probing through the device tree works with the real supply (vdd_dev,
Palmas LDO6), and unloading and reloading the module twice brought the
device back each time. Next to a phone light sensor the readings were
about 7 to 20 times lower. NVIDIA's Android HAL for this tablet
multiplies the count by 2.1505 at the same 2 T/100 ms setting, which is
7.2 times the scale here, so most of that is the dark cover window. With
that factor the tablet was within 15 % of the phone in bright light but
a factor of three lower in dim room light; I could not tell whether that
was my setup.
The device tree node for the Tegra Note 7 will follow with Svyatoslav's
tegratab series.
Tool use (see Documentation/process/generated-content.rst): this series
was prepared with an LLM coding assistant (Claude Code). It read the
NVIDIA downstream drivers and Capella's product data, wrote the driver,
the binding and the texts from my instructions, and ran the build and
binding checks. I reviewed the code and ran the tests on the device.
---
Patrick Fischer (2):
dt-bindings: iio: light: Add Capella CM3217
iio: light: Add Capella CM3217 ambient light sensor driver
.../bindings/iio/light/capella,cm3217.yaml | 45 +++
drivers/iio/light/Kconfig | 10 +
drivers/iio/light/Makefile | 1 +
drivers/iio/light/cm3217.c | 383 +++++++++++++++++++++
4 files changed, 439 insertions(+)
---
base-commit: 137ca6e5de3bd4e1056877d0b82214e82143efa7
change-id: 20261101-upstream-iio-cm3217-e3f14c4760e5
Best regards,
--
Patrick Fischer <admin@xxxxxxxxxxxxxxxxxx>