[PATCH] media: ipu-bridge: Add Himax HM1092 IR sensor

Jake S <[email protected]>
Newsgroups org.kernel.vger.linux-media
Message-ID <[email protected]>
From: Jake Steinman <[email protected]>

The HM1092 is a 648x368 mono IR sensor used for face unlock on recent
Intel IPU6/IPU7 laptops, sitting behind a Synaptics or Intel vision
bridge. Without an entry here ipu-bridge builds the sensor endpoint with
no link-frequencies property, the driver's frequency validation rejects
every mode, and the sensor never binds.

Two frequencies are listed because the sensor is driven from different
external clocks depending on the platform, and the PLL registers are
programmed to match:

  0x030d (pre-divider), 0x030f (multiplier), link_freq = EXTCLK * m / p

  Dell, IPU7      EXTCLK 19.2 MHz, p=10, m=94  ->  180,480,000 Hz
  ASUS, Qualcomm  EXTCLK 24.0 MHz, p=12, m=90  ->  180,000,000 Hz

Both are the CSI-2 DDR clock, so the per-lane bit rate is twice the
value, 360.96 and 360 Mbit/s respectively, over one data lane.

Worth stating explicitly because published figures for this part have
been wrong: V4L2_CID_LINK_FREQ is the DDR clock, while the vendor mode
descriptors publish the per-lane BIT rate. Taking the descriptor value
verbatim gives 360,960,000, isys then configures the D-PHY for 721 Mbit/s
against a sensor transmitting 361, the clock lane toggles, and no frame
is ever framed. Halving it to the DDR clock is what produced the first
captured frames from this sensor on Linux.

The two platform values differ by 0.27%, which is within what the
sensor's PLL tolerates, but they are listed separately rather than
merged so each platform matches exactly what its firmware programs.

Depends on the HM1092 sensor driver, currently in review.

Signed-off-by: Jake Steinman <[email protected]>
---
 drivers/media/pci/intel/ipu-bridge.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -50,6 +50,8 @@
  * Please keep the list sorted by ACPI HID.
  */
 static const struct ipu_sensor_config ipu_supported_sensors[] = {
+	/* Himax HM1092 */
+	IPU_SENSOR_CONFIG("HIMX1092", 2, 180000000, 180480000),
 	/* Himax HM11B1 */
 	IPU_SENSOR_CONFIG("HIMX11B1", 1, 384000000),
 	/* Himax HM2170 */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.