mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7
@ 2026-09-29  9:26 Ruslan Koreev
  2026-09-29  9:26 ` [PATCH v2 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana" Ruslan Koreev
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ruslan Koreev @ 2026-09-29  9:26 UTC (permalink / raw)
  To: sakari.ailus, benjamin.mugnier, sylvain.petinot, dan.scally
  Cc: mchehab, hansg, ilpo.jarvinen, linux-media, platform-driver-x86,
	linux-kernel, Peter Marshall, Ruslan Koreev

The ThinkPad X1 Carbon Gen 14 (Panther Lake, Intel IPU7) has a second
MIPI camera for Windows Hello: an ST VD55G1 monochrome global-shutter
sensor, enumerated by ACPI as TBE20A1, with one CSI-2 lane. It is
powered through an INT3472 discrete device that provides a power enable
GPIO, a reset GPIO, a privacy LED and a 19.2 MHz clock. Only the analog
supply has a GPIO; vcore and vddio fall back to dummy regulators. The
RGB camera of the same laptop (Sony IMX471, TBE20A0) is already
supported.

Patch 1 maps the INT3472 power enable GPIO to the supply name the
vd55g1 driver expects, patch 2 adds the ipu-bridge entry, patch 3 lets
the vd55g1 driver defer its probe while the bridge has not attached the
CSI-2 endpoint yet, and patch 4 adds the ACPI match.

Tested on next-20260924 with the ipu6 driver handling the IPU7: the
sensor probes, ipu-bridge connects both cameras, libcamera streams Y8
804x704 at 58 fps, Y10 and Y10P stream with plain V4L2, and with the IR
illuminator on the frames are good enough for face authentication with
howdy.

About the privacy LED Benjamin mentioned on v1: the V4L2 core switches
it when streaming starts and stops, not when the sensor is powered, so
powering up at probe does not light it. vd55g1 does not hand the LED to
the core yet, as it registers with v4l2_async_register_subdev() rather
than v4l2_async_register_subdev_sensor(), so for now the LED also stays
off while streaming. I can send that change as a separate patch.

Peter Marshall's VD55G0 series (linux-media, September 2026) adds the
SMO55F0 HID to the same ipu-bridge and INT3472 tables, so whichever
series lands second needs a trivial rebase.

Changes in v2:
- Dropped the staging ipu7 patch: the ipu6 driver, which takes over
  IPU7, already has the monochrome formats (Sakari).
- Split the vd55g1 change in two and let vd55g1_check_csi_conf()
  return the endpoint parser's error code instead of checking the
  endpoint beforehand (Sakari).
- Trimmed the commit messages, moved the hardware description here and
  dropped the comment above the ACPI table (Sakari).
- Added Benjamin's Acked-by to patches 1 and 2.
- Rebased on media-committers next.

v1: https://lore.kernel.org/linux-media/20260924171820.1179823-1-koreev.r@gmail.com/

Ruslan Koreev (4):
  platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana"
  media: ipu-bridge: Add the ST VD55G1 (TBE20A1)
  media: i2c: vd55g1: Return the endpoint parser's error code
  media: i2c: vd55g1: Add ACPI support

 drivers/media/i2c/vd55g1.c                    | 14 ++++++++------
 drivers/media/pci/intel/ipu-bridge.c          |  2 ++
 drivers/platform/x86/intel/int3472/discrete.c |  1 +
 3 files changed, 11 insertions(+), 6 deletions(-)


base-commit: 58348f64125e9a3e44d3abb275ca7f4e6c9641e5
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana"
  2026-09-29  9:26 [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
@ 2026-09-29  9:26 ` Ruslan Koreev
  2026-09-29  9:26 ` [PATCH v2 2/4] media: ipu-bridge: Add the ST VD55G1 (TBE20A1) Ruslan Koreev
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ruslan Koreev @ 2026-09-29  9:26 UTC (permalink / raw)
  To: sakari.ailus, benjamin.mugnier, sylvain.petinot, dan.scally
  Cc: mchehab, hansg, ilpo.jarvinen, linux-media, platform-driver-x86,
	linux-kernel, Peter Marshall, Ruslan Koreev

The ST VD55G1 IR camera of the Lenovo ThinkPad X1 Carbon Gen 14 (ACPI
HID TBE20A1) gets its analog supply from the power enable GPIO of an
INT3472 discrete device. Map that GPIO to "vana", the supply name the
vd55g1 driver uses, as is already done for the imx471 on the same
laptop.

Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
---
 drivers/platform/x86/intel/int3472/discrete.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index b48cf1b7f..b19ea6ee3 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -131,6 +131,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
 static const char * const power_enable_hids_vana[] = {
 	"SONY471A", /* imx471 on Lenovo X9-14 and X9-15 */
 	"TBE20A0", /* imx471 on Lenovo X1 Carbon G14 */
+	"TBE20A1", /* vd55g1 on Lenovo X1 Carbon G14 */
 	NULL
 };
 
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 2/4] media: ipu-bridge: Add the ST VD55G1 (TBE20A1)
  2026-09-29  9:26 [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
  2026-09-29  9:26 ` [PATCH v2 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana" Ruslan Koreev
@ 2026-09-29  9:26 ` Ruslan Koreev
  2026-09-29  9:27 ` [PATCH v2 3/4] media: i2c: vd55g1: Return the endpoint parser's error code Ruslan Koreev
  2026-09-29  9:27 ` [PATCH v2 4/4] media: i2c: vd55g1: Add ACPI support Ruslan Koreev
  3 siblings, 0 replies; 5+ messages in thread
From: Ruslan Koreev @ 2026-09-29  9:26 UTC (permalink / raw)
  To: sakari.ailus, benjamin.mugnier, sylvain.petinot, dan.scally
  Cc: mchehab, hansg, ilpo.jarvinen, linux-media, platform-driver-x86,
	linux-kernel, Peter Marshall, Ruslan Koreev

Add the ACPI HID Lenovo uses for the ST VD55G1 IR camera of the ThinkPad
X1 Carbon Gen 14. The firmware describes one CSI-2 data lane and, as
usual, no link frequency, so the value has to come from this table; the
vd55g1 driver requires exactly one.

Use 402 MHz (804 Mbps). The sensor derives its MIPI rate and clock tree
from this value and the IPU7 CSI-2 receiver reads the same value back
through V4L2_CID_LINK_FREQ, so both ends agree by construction. At
804 Mbps a full-width 10-bit line takes about 11 us on the link, which
allows well over 100 fps at full resolution; lower rates lengthen every
line proportionally. The rate is in the lower half of the 250 to
1200 Mbps range the sensor supports and is the one validated on the
hardware, where 804x704 streams at 58 fps.

Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
---
 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
index e476e269a..8bd200896 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -122,6 +122,8 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
 	IPU_SENSOR_CONFIG("SONY471A", 1, 200000000),
 	/* Sony IMX471 (found on Lenovo X1 Carbon G14) */
 	IPU_SENSOR_CONFIG("TBE20A0", 1, 200000000),
+	/* STMicroelectronics VD55G1 (found on Lenovo X1 Carbon G14) */
+	IPU_SENSOR_CONFIG("TBE20A1", 1, 402000000),
 	/* Toshiba T4KA3 */
 	IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
 };
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 3/4] media: i2c: vd55g1: Return the endpoint parser's error code
  2026-09-29  9:26 [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
  2026-09-29  9:26 ` [PATCH v2 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana" Ruslan Koreev
  2026-09-29  9:26 ` [PATCH v2 2/4] media: ipu-bridge: Add the ST VD55G1 (TBE20A1) Ruslan Koreev
@ 2026-09-29  9:27 ` Ruslan Koreev
  2026-09-29  9:27 ` [PATCH v2 4/4] media: i2c: vd55g1: Add ACPI support Ruslan Koreev
  3 siblings, 0 replies; 5+ messages in thread
From: Ruslan Koreev @ 2026-09-29  9:27 UTC (permalink / raw)
  To: sakari.ailus, benjamin.mugnier, sylvain.petinot, dan.scally
  Cc: mchehab, hansg, ilpo.jarvinen, linux-media, platform-driver-x86,
	linux-kernel, Peter Marshall, Ruslan Koreev

Pass the endpoint to v4l2_fwnode_endpoint_alloc_parse() without checking
it first and return the parser's error code instead of -EINVAL. The
parser returns -EPROBE_DEFER for a missing endpoint, which is what a
sensor on an ACPI system needs: there the endpoint is a software node
that the IPU bridge attaches when the IPU driver probes, possibly after
this driver. On OF systems a missing endpoint now defers the probe as
well instead of failing it, as in other sensor drivers that leave this
check to the parser.

Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
---
 drivers/media/i2c/vd55g1.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 22b1497e8..8043eaa50 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1801,7 +1801,7 @@ static int vd55g1_check_csi_conf(struct vd55g1 *sensor,
 
 	ret = v4l2_fwnode_endpoint_alloc_parse(endpoint, &ep);
 	if (ret)
-		return -EINVAL;
+		return ret;
 
 	/* Check lanes number */
 	n_lanes = ep.bus.mipi_csi2.num_data_lanes;
@@ -1905,11 +1905,6 @@ static int vd55g1_parse_dt(struct vd55g1 *sensor)
 
 	endpoint = fwnode_graph_get_endpoint_by_id(dev_fwnode(sensor->dev),
 						   0, 0, 0);
-	if (!endpoint) {
-		dev_err(sensor->dev, "Endpoint node not found\n");
-		return -EINVAL;
-	}
-
 	ret = vd55g1_check_csi_conf(sensor, endpoint);
 	fwnode_handle_put(endpoint);
 	if (ret)
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 4/4] media: i2c: vd55g1: Add ACPI support
  2026-09-29  9:26 [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
                   ` (2 preceding siblings ...)
  2026-09-29  9:27 ` [PATCH v2 3/4] media: i2c: vd55g1: Return the endpoint parser's error code Ruslan Koreev
@ 2026-09-29  9:27 ` Ruslan Koreev
  3 siblings, 0 replies; 5+ messages in thread
From: Ruslan Koreev @ 2026-09-29  9:27 UTC (permalink / raw)
  To: sakari.ailus, benjamin.mugnier, sylvain.petinot, dan.scally
  Cc: mchehab, hansg, ilpo.jarvinen, linux-media, platform-driver-x86,
	linux-kernel, Peter Marshall, Ruslan Koreev

Add an ACPI match table with the TBE20A1 HID that Lenovo uses for the
VD55G1, with the same match data as the st,vd55g1 compatible.

Signed-off-by: Ruslan Koreev <koreev.r@gmail.com>
---
 drivers/media/i2c/vd55g1.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 8043eaa50..e3939bb9b 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -2081,6 +2081,12 @@ static const struct of_device_id vd55g1_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, vd55g1_dt_ids);
 
+static const struct acpi_device_id vd55g1_acpi_ids[] = {
+	{ .id = "TBE20A1", .driver_data = (kernel_ulong_t)&vd55g1_versions[0] },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(acpi, vd55g1_acpi_ids);
+
 static const struct dev_pm_ops vd55g1_pm_ops = {
 	SET_RUNTIME_PM_OPS(vd55g1_power_off, vd55g1_power_on, NULL)
 };
@@ -2089,6 +2095,7 @@ static struct i2c_driver vd55g1_i2c_driver = {
 	.driver = {
 		.name  = "vd55g1",
 		.of_match_table = vd55g1_dt_ids,
+		.acpi_match_table = vd55g1_acpi_ids,
 		.pm = &vd55g1_pm_ops,
 	},
 	.probe = vd55g1_probe,
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-29  9:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29  9:26 [PATCH v2 0/4] Lenovo ThinkPad X1 Carbon Gen 14 IR camera: ST VD55G1 on Intel IPU7 Ruslan Koreev
2026-09-29  9:26 ` [PATCH v2 1/4] platform/x86: int3472: Map the VD55G1 power enable GPIO to "vana" Ruslan Koreev
2026-09-29  9:26 ` [PATCH v2 2/4] media: ipu-bridge: Add the ST VD55G1 (TBE20A1) Ruslan Koreev
2026-09-29  9:27 ` [PATCH v2 3/4] media: i2c: vd55g1: Return the endpoint parser's error code Ruslan Koreev
2026-09-29  9:27 ` [PATCH v2 4/4] media: i2c: vd55g1: Add ACPI support Ruslan Koreev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®