media: Add Himax HM1092 mono NIR sensor driver
Subsystems (2)
v4 cover media: Add Himax HM1092 mono NIR sensor driver
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 native mode, a test pattern control and the standard fwnode properties (orientation, rotation). It has been tested on real hardware (an ASUS Zenbook A14): the sensor probes, streams, and the on-chip test patterns come through the full CSI-2 pipeline.
The available HM1092 documentation does not describe the test pattern modes. Their menu names are based on output observed during hardware testing; the register programming was recovered from the Windows driver.
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.
---
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]
To: Ramshouriesh R <[email protected]>
To: Mauro Carvalho Chehab <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [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 | 109 +++ MAINTAINERS | 7 + drivers/media/i2c/Kconfig | 11 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/hm1092.c | 728 +++++++++++++++++++++ 5 files changed, 856 insertions(+)
---
base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6
change-id: 20260618-hm1092-driver-a6f2aaddf201
Best regards,
Signature · 1 line
Ramshouriesh R <[email protected]>
PATCH v4 1/2 media: dt-bindings: Add Himax HM1092 NIR sensor
Add a dt-binding schema for the Himax HM1092, a 1 megapixel monochrome near-infrared CMOS image sensor used as the face-authentication IR camera on laptops. The sensor streams 10-bit RAW over a single MIPI CSI-2 data lane.
--- .../bindings/media/i2c/himax,hm1092.yaml | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+)
Documentation/devicetree/bindings/media/i2c/himax,hm1092.yaml new file +109 -0
@@ -0,0 +1,109 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/himax,hm1092.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Himax HM1092 Monochrome NIR Sensor + +maintainers: + - Ramshouriesh R <[email protected]> + +description: + The Himax HM1092 is a 1 megapixel monochrome near-infrared CMOS image + sensor with a MIPI CSI-2 interface, commonly used as the IR camera for + face authentication on laptops. It outputs 10-bit RAW over a single + MIPI CSI-2 data lane. + +allOf: + - $ref: /schemas/media/video-interface-devices.yaml# + +properties: + compatible: + const: himax,hm1092 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + avdd-supply: + description: Analogue circuit voltage supply. + + dovdd-supply: + description: I/O circuit voltage supply. + + dvdd-supply: + description: Digital circuit voltage supply. + + reset-gpios: + maxItems: 1 + description: Active low GPIO connected to the XSHUTDOWN pad. + + port: + $ref: /schemas/graph.yaml#/$defs/port-base + additionalProperties: false + + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + items: + - const: 1 + description: + The sensor uses a single MIPI CSI-2 data lane; this defaults + to 1 if omitted. + + required: + - link-frequencies + +required: + - compatible + - reg + - clocks + - avdd-supply + - dovdd-supply + - dvdd-supply + - port + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + camera@24 { + compatible = "himax,hm1092"; + reg = <0x24>; + + reset-gpios = <&tlmm 109 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&cam_ir_default>; + + clocks = <&camcc 1>; + assigned-clocks = <&camcc 1>; + assigned-clock-rates = <24000000>; + + orientation = <0>; + + avdd-supply = <&vreg_l7m_2p9>; + dvdd-supply = <&vreg_l7m_2p9>; + dovdd-supply = <&vreg_l4m_1p8>; + + port { + hm1092_ep: endpoint { + link-frequencies = /bits/ 64 <400000000>; + remote-endpoint = <&camss_csiphy0_inep>; + }; + }; + }; + }; +...
Signature · 1 line
2.53.0
PATCH v4 2/2 media: i2c: hm1092: add Himax HM1092 mono NIR sensor driver
In reply to Ramshouriesh RAdd a V4L2 subdev driver for the Himax HM1092, a 1 megapixel monochrome near-infrared image sensor with a single-lane MIPI CSI-2 interface, typically used as the face-authentication IR camera on laptops.
The driver supports the sensor's native 560x360 10-bit mono mode, a test pattern control and the standard fwnode properties (orientation, rotation).
--- MAINTAINERS | 7 + drivers/media/i2c/Kconfig | 11 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/hm1092.c | 728 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 747 insertions(+)
MAINTAINERS +7 -0
@@ -11652,6 +11652,13 @@ L: [email protected] S: Maintained F: drivers/misc/hisi_hikey_usb.c +HIMAX HM1092 SENSOR DRIVER +M: Ramshouriesh R <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/media/i2c/himax,hm1092.yaml +F: drivers/media/i2c/hm1092.c + HIMAX HX83112B TOUCHSCREEN SUPPORT M: Job Noorman <[email protected]> L: [email protected]
drivers/media/i2c/Kconfig +11 -0
@@ -137,6 +137,17 @@ config VIDEO_HI847 To compile this driver as a module, choose M here: the module will be called hi847. +config VIDEO_HM1092 + tristate "Himax HM1092 sensor support" + select V4L2_CCI_I2C + help + This is a Video4Linux2 sensor driver for the Himax HM1092 + monochrome near-infrared CMOS image sensor, used as the + face-authentication IR camera on laptops. + + To compile this driver as a module, choose M here: the + module will be called hm1092. + config VIDEO_IMX111 tristate "Sony IMX111 sensor support" select V4L2_CCI_I2C
drivers/media/i2c/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_VIDEO_GC2145) += gc2145.o obj-$(CONFIG_VIDEO_HI556) += hi556.o obj-$(CONFIG_VIDEO_HI846) += hi846.o obj-$(CONFIG_VIDEO_HI847) += hi847.o +obj-$(CONFIG_VIDEO_HM1092) += hm1092.o obj-$(CONFIG_VIDEO_I2C) += video-i2c.o obj-$(CONFIG_VIDEO_IMX111) += imx111.o obj-$(CONFIG_VIDEO_IMX208) += imx208.o
drivers/media/i2c/hm1092.c new file +728 -0
728 lines not on this page · raw message
Signature · 1 line
2.53.0