[PATCH v6 0/2] media: Add Himax HM1092 mono NIR sensor driver
Ramshouriesh R <[email protected]> Sat, 01 Aug 2026 18:24:41 +0530
| Newsgroups | org.kernel.vger.linux-media,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
This adds a V4L2 subdev driver and DT binding for the Himax HM1092, a 1 megapixel monochrome near-infrared image sensor. On laptops it sits behind the IR camera used for face unlock. It speaks a single MIPI CSI-2 data lane and outputs 10-bit RAW at 560x360. The driver exposes that one fixed mode, test patterns, exposure, analogue gain and digital gain controls, pixel-array selection targets and the standard fwnode properties. It has been tested on an ASUS Zenbook A14: the sensor probes, streams, changes brightness across the full exposure and analogue gain ranges, accepts digital gain endpoint updates while streaming, and returns to runtime suspend after capture. The exposure default is 500 lines, selected from unstretched illuminated captures on the ASUS system. The init sequence programs the same value so the sensor state and V4L2 control default remain consistent. The register programming was extracted from com.qti.sensormodule.hm1092.bin in the Qualcomm camera stack shipped for the ASUS system. Jake Steinman independently identified the exposure, analogue gain, digital gain and group-hold registers from Dell's hm1092.sys. The available documentation does not identify the test-pattern modes, so their menu names are based on output observed during hardware testing. The ASUS Windows configuration supplies a 24 MHz external clock. The programmed PLL divide-by-12 pre-divider and multiply-by-90 multiplier give a 180 MHz CSI-2 DDR link frequency, a 360 Mbit/s lane rate and a 36 MHz pixel rate. With HTS 1616 and VTS 750, the resulting frame rate is approximately 29.7 frames per second. The driver reports the 1296x736 native pixel array, the 1280x720 active array and the mode's 1150x718 crop. The sensor driver and its binding are SoC-neutral, so they are sent on their own through the media tree. The board-level device tree and PHY work that wires this camera up on the ASUS Zenbook A14 will be sent as its own series. Signed-off-by: Ramshouriesh R <[email protected]> --- Changes in v6: - dt-bindings: update the example to the PLL-derived 180 MHz link frequency. - hm1092: replace the inconsistent 400 MHz link frequency and derived 80 MHz pixel rate with 180 MHz and 36 MHz. The new values are derived from the ASUS Windows configuration's 24 MHz external clock and the sensor PLL dividers. - hm1092: report the 1296x736 native array, 1280x720 active array and 1150x718 mode crop as distinct selection targets. - hm1092: add exposure, analogue gain and digital gain controls using the register map supplied by Jake Steinman. Keep multi-byte controls as separate writes, use group hold, derive the exposure maximum from VTS, and program the hardware-tested 500-line exposure default in both the init table and control. Hardware-test the controls on the 560x360 mode. - hm1092: do not power the sensor on in probe(). There is no I2C access during probe, so leave it suspended and let runtime PM power it for streaming. - Link to v5: https://patch.msgid.link/[email protected] Changes in v5: - dt-bindings: drop the data-lanes property entirely; the fixed single-lane wiring is not configurable, so it does not belong in DT. - hm1092: implement the get_selection pad op (CROP, CROP_DEFAULT, CROP_BOUNDS and NATIVE_SIZE) reporting the sensor's pixel-array geometry, as required by libcamera. - Link to v4: https://patch.msgid.link/[email protected] Changes in v4: - dt-bindings: make data-lanes optional for the fixed single-lane sensor, constrain explicit values to <1>, and omit it from the example. - hm1092: add the copyright notice. - hm1092: replace the private register representation and write helper with CCI register sequences and direct CCI writes. - hm1092: use descriptive test-pattern names based on hardware captures; the available documentation does not identify these modes. - hm1092: parse fwnode properties before creating controls and set read-only flags after validating control creation. - hm1092: use the generic get_fmt callback for the fixed sensor mode. - hm1092: initialize endpoint parsing with the fixed one-lane default, reject other lane configurations, and remove the redundant endpoint presence check. - hm1092: use fsleep() and null-safe GPIO calls, and apply the requested declaration, brace, return-value and error-path formatting cleanups. - Link to v3: https://patch.msgid.link/[email protected] Changes in v3: - dt-bindings: add the Reviewed-by tag from Conor Dooley. - hm1092: initialize RAW colorimetry fields in the pad format helper so userspace values cannot leak into subdevice state. - hm1092: return -ENXIO when the required firmware graph endpoint is absent instead of deferring probe indefinitely. - Link to v2: https://patch.msgid.link/[email protected] Changes in v2: - hm1092: use pm_ptr() instead of pm_sleep_ptr() for the dev_pm_ops pointer. The ops come from DEFINE_RUNTIME_DEV_PM_OPS(), so gating them on CONFIG_PM_SLEEP dropped runtime PM on a CONFIG_PM=y, PM_SLEEP=n build. - hm1092: free the control handler on the error paths in hm1092_init_controls(); the fwnode-parse and ctrl_hdlr->error returns leaked the handler. - Link to v1: https://patch.msgid.link/[email protected] --- Ramshouriesh R (2): media: dt-bindings: Add Himax HM1092 NIR sensor media: i2c: hm1092: add Himax HM1092 mono NIR sensor driver .../bindings/media/i2c/himax,hm1092.yaml | 101 +++ MAINTAINERS | 7 + drivers/media/i2c/Kconfig | 11 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/hm1092.c | 863 +++++++++++++++++++++ 5 files changed, 983 insertions(+) --- base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6 change-id: 20260618-hm1092-driver-a6f2aaddf201 Best regards, -- Ramshouriesh R <[email protected]>