From: Sergey Lebedev <lsa.uz@pm.me>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Benjamin Mugnier <benjamin.mugnier@foss.st.com>,
Sylvain Petinot <sylvain.petinot@foss.st.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Dan Scally <dan.scally@ideasonboard.com>,
Hans de Goede <hansg@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Peter Marshall <pm@petermarshall.ca>,
George Neacsu <geocausa@gmail.com>, Hao Yao <hao.yao@intel.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] media: ipu-bridge: Add the Surface Pro 11 infrared illuminator
Date: Mon, 19 Oct 2026 16:28:11 +0000 [thread overview]
Message-ID: <20261019162722.25587-5-lsa.uz@pm.me> (raw)
In-Reply-To: <20261019162722.25587-1-lsa.uz@pm.me>
On the Surface Pro 11 with Intel the infrared illuminator is driven by the
VD55G0's GPIO 1, which strobes it during the exposure. The ACPI tables do
not describe it, so the sensor driver finds no st,leds and offers no
V4L2_CID_FLASH_LED_MODE.
Give the sensor's software node st,leds from a DMI match, as the
upside-down quirk gives a rotation. dev_properties gains an entry for it,
as a sensor can also have a lens-focus reference.
Assisted-by: Claude:claude-opus-5-5 sparse
Signed-off-by: Sergey Lebedev <lsa.uz@pm.me>
---
drivers/media/pci/intel/ipu-bridge.c | 60 +++++++++++++++++++++++++++-
include/media/ipu-bridge.h | 2 +-
2 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index cb1d1582fa1..05aa6d92bbf 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -283,6 +283,39 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
{} /* Terminating entry */
};
+/*
+ * Sensor GPIOs that drive an illuminator, for machines whose ACPI tables do
+ * not say which. They reach the sensor driver as its own leds property.
+ */
+struct ipu_sensor_leds {
+ const char *hid;
+ const char *property;
+ const u32 *gpios;
+ unsigned int nr_gpios;
+};
+
+/* The infrared illuminator, strobed by the VD55G0's GPIO 1 */
+static const u32 surface_pro_11_ir_gpios[] = { 1 };
+
+static const struct ipu_sensor_leds surface_pro_11_ir_leds = {
+ .hid = "SMO55F0",
+ .property = "st,leds",
+ .gpios = surface_pro_11_ir_gpios,
+ .nr_gpios = ARRAY_SIZE(surface_pro_11_ir_gpios),
+};
+
+static const struct dmi_system_id sensor_leds_dmi_ids[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME,
+ "Surface Pro for Business 11th Edition with Intel"),
+ },
+ .driver_data = (void *)&surface_pro_11_ir_leds,
+ },
+ {} /* Terminating entry */
+};
+
static const struct ipu_property_names prop_names = {
.clock_frequency = "clock-frequency",
.rotation = "rotation",
@@ -563,6 +596,22 @@ int ipu_bridge_parse_ssdb(struct acpi_device *adev, struct ipu_sensor *sensor)
}
EXPORT_SYMBOL_NS_GPL(ipu_bridge_parse_ssdb, "INTEL_IPU_BRIDGE");
+static const struct ipu_sensor_leds *
+ipu_bridge_get_leds(const struct ipu_sensor_config *cfg)
+{
+ const struct dmi_system_id *dmi_id;
+ const struct ipu_sensor_leds *leds;
+
+ for (dmi_id = dmi_first_match(sensor_leds_dmi_ids); dmi_id;
+ dmi_id = dmi_first_match(dmi_id + 1)) {
+ leds = dmi_id->driver_data;
+ if (!strcmp(cfg->hid, leds->hid))
+ return leds;
+ }
+
+ return NULL;
+}
+
static void ipu_bridge_create_fwnode_properties(
struct ipu_sensor *sensor,
struct ipu_bridge *bridge,
@@ -570,7 +619,8 @@ static void ipu_bridge_create_fwnode_properties(
{
struct ipu_property_names *names = &sensor->prop_names;
struct software_node *nodes = sensor->swnodes;
- unsigned int i = 0;
+ const struct ipu_sensor_leds *leds;
+ unsigned int i = 0, d = 3;
sensor->prop_names = prop_names;
@@ -624,10 +674,16 @@ static void ipu_bridge_create_fwnode_properties(
if (sensor->vcm_type) {
sensor->vcm_ref[0] =
SOFTWARE_NODE_REFERENCE(&sensor->swnodes[SWNODE_VCM]);
- sensor->dev_properties[3] =
+ sensor->dev_properties[d++] =
PROPERTY_ENTRY_REF_ARRAY("lens-focus", sensor->vcm_ref);
}
+ leds = ipu_bridge_get_leds(cfg);
+ if (leds)
+ sensor->dev_properties[d++] =
+ PROPERTY_ENTRY_U32_ARRAY_LEN(leds->property, leds->gpios,
+ leds->nr_gpios);
+
sensor->ep_properties[IPU_BRIDGE_NEXT_PROPERTY(i, EP_BUS_TYPE)] =
PROPERTY_ENTRY_U32(names->bus_type,
V4L2_FWNODE_BUS_TYPE_CSI2_DPHY);
diff --git a/include/media/ipu-bridge.h b/include/media/ipu-bridge.h
index 3ef94c2b767..f56ac1c4e96 100644
--- a/include/media/ipu-bridge.h
+++ b/include/media/ipu-bridge.h
@@ -179,7 +179,7 @@ struct ipu_sensor {
struct ipu_property_names prop_names;
struct property_entry ep_properties[IPU_BRIDGE_EP_NUM_ENTRIES];
- struct property_entry dev_properties[5];
+ struct property_entry dev_properties[6];
struct property_entry ipu_properties[3];
struct property_entry ivsc_properties[1];
struct property_entry ivsc_sensor_ep_properties[4];
--
2.54.0
prev parent reply other threads:[~2026-10-19 16:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 16:27 [PATCH 0/4] media: Add the ST VD55G0 global shutter sensor Sergey Lebedev
2026-10-19 16:27 ` [PATCH 1/4] dt-bindings: media: i2c: Add ST VD55G0 camera sensor Sergey Lebedev
2026-10-20 8:27 ` Krzysztof Kozlowski
2026-10-20 9:08 ` Sergey Lebedev
2026-10-19 16:27 ` [PATCH 2/4] media: i2c: Add ST VD55G0 global shutter sensor driver Sergey Lebedev
2026-10-19 18:24 ` George Neacsu
2026-10-19 19:34 ` Sergey Lebedev
2026-10-20 6:44 ` George Neacsu
2026-10-20 8:52 ` Sergey Lebedev
2026-10-19 16:28 ` [PATCH 3/4] media: ipu-bridge: Add ST VD55G0 Sergey Lebedev
2026-10-19 16:28 ` Sergey Lebedev [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261019162722.25587-5-lsa.uz@pm.me \
--to=lsa.uz@pm.me \
--cc=benjamin.mugnier@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=dan.scally@ideasonboard.com \
--cc=devicetree@vger.kernel.org \
--cc=geocausa@gmail.com \
--cc=hansg@kernel.org \
--cc=hao.yao@intel.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pm@petermarshall.ca \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®