From b487f30cadc2771754aac535b45f1a980e09f410 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 20 Aug 2026 23:19:01 +0300 Subject: [PATCH 1/4] platform/x86: int3472: Fix uninitialised variable warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a compiler warning about an uninitialised err_msg variable by printing the error where it is handled: drivers/platform/x86/intel/int3472/discrete.c:440:24: warning: ‘err_msg’ may be used uninitialized [-Wmaybe-uninitialized] 440 | return dev_err_probe(int3472->dev, ret, err_msg); Fixes: 5de691bffe57 ("platform/x86: Add intel_skl_int3472 driver") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus Reviewed-by: Ricardo Ribalda Acked-by: Rafael J. Wysocki (Intel) Reviewed-by: Daniel Scally (cherry picked from commit 70e6384fe0f4cf9768944f81924f6c1478b0ce43) Signed-off-by: Firas Sharary --- drivers/platform/x86/intel/int3472/discrete.c | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 8f17a262b30de..ed1b47ace411d 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -333,7 +333,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, unsigned long gpio_flags; union acpi_object *obj; struct gpio_desc *gpio; - const char *err_msg; const char *con_id; int ret; @@ -379,7 +378,8 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, case INT3472_GPIO_TYPE_HOTPLUG_DETECT: ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, con_id, gpio_flags); if (ret) - err_msg = "Failed to map GPIO pin to sensor\n"; + dev_err_probe(int3472->dev, ret, + "Failed to map GPIO pin to sensor\n"); break; case INT3472_GPIO_TYPE_CLK_ENABLE: @@ -392,7 +392,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, con_id, gpio_flags); if (IS_ERR(gpio)) { ret = PTR_ERR(gpio); - err_msg = "Failed to get GPIO\n"; + dev_err_probe(int3472->dev, ret, "Failed to get GPIO\n"); break; } @@ -400,14 +400,16 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, case INT3472_GPIO_TYPE_CLK_ENABLE: ret = skl_int3472_register_gpio_clock(int3472, gpio); if (ret) - err_msg = "Failed to register clock\n"; + dev_err_probe(int3472->dev, ret, + "Failed to register clock\n"); break; case INT3472_GPIO_TYPE_PRIVACY_LED: case INT3472_GPIO_TYPE_STROBE: ret = skl_int3472_register_led(int3472, gpio, con_id); if (ret) - err_msg = "Failed to register LED\n"; + dev_err_probe(int3472->dev, ret, + "Failed to register LED\n"); break; case INT3472_GPIO_TYPE_POWER_ENABLE: @@ -418,7 +420,8 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, ret = skl_int3472_register_regulator(int3472, gpio, enable_time_us, con_id, second_sensor); if (ret) - err_msg = "Failed to register regulator\n"; + dev_err_probe(int3472->dev, ret, + "Failed to register regulator\n"); break; case 0x08: /* Surface Pro 9 - treat as power*/ @@ -452,11 +455,11 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, int3472->ngpios++; ACPI_FREE(obj); - if (ret < 0) - return dev_err_probe(int3472->dev, ret, err_msg); - - /* Tell acpi_dev_get_resources() to not make a copy of the resource */ - return 1; + /* + * Either return an error or tell acpi_dev_get_resources() to not make a + * copy of the resource. + */ + return ret < 0 ? ret : 1; } int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472) From da69b1375042e93adad661a3d086a905e54d3ec1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 18 Aug 2026 14:28:21 +0200 Subject: [PATCH 2/4] platform/x86: int3472: Increase handshake GPIO delay to 200 ms There have been several reports of the sensor not properly powering on, on laptops where an INT3472 handshake GPIO is used. Both with ov08x40 and hi556 sensors. Testing has shown that a delay of 200 ms is necessary in some cases. The handshake GPIO is typically used to signal an extra bridge or other IC with that IC running the full sensor power sequence based on the handshake signal and also possible controlling I2C pass-through. It seems that in some cases that extra IC takes up to 200 ms to before the sensor is fully powered up and ready for I2C communication. With the default handshake signal delay increased to 200 ms the quirk to increase it to 45 ms for the ov08x40 is no longer necessary and is actually undesirable since some ov08x40 setups also need the longer delay, drop it. Fixes: 30359c239ba8 ("platform/x86: int3472: Increase ov08x40 handshake GPIO delay to 45 ms") Closes: https://lore.kernel.org/platform-driver-x86/20260816204247.2844986-1-opensource@inspiredexperts.com/ Reported-by: James Alexander Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2333331 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2333647 Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus (cherry picked from commit 844982d3b99340c21dd2125f44e1ad04ace6a38e) Signed-off-by: Firas Sharary --- drivers/platform/x86/intel/int3472/discrete.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index ed1b47ace411d..59892bc08f26e 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -15,6 +15,7 @@ #include #include #include +#include #include /* @@ -178,13 +179,6 @@ static const struct int3472_gpio_map int3472_gpio_map[] = { .type_to = INT3472_GPIO_TYPE_RESET, .con_id = "enable", }, - { /* ov08x40's handshake pin needs a 45 ms delay on some HP laptops */ - .hids = (const char * const[]) { "OVTI08F4", NULL }, - .type_from = INT3472_GPIO_TYPE_HANDSHAKE, - .type_to = INT3472_GPIO_TYPE_HANDSHAKE, - .con_id = "dvdd", - .enable_time_us = 45 * USEC_PER_MSEC, - }, { /* Sensors which expect "vana" as con_id for power enable */ .hids = power_enable_hids_vana, .type_from = INT3472_GPIO_TYPE_POWER_ENABLE, @@ -273,8 +267,8 @@ static void int3472_get_con_id_and_polarity(struct int3472_discrete_device *int3 case INT3472_GPIO_TYPE_HANDSHAKE: *con_id = "dvdd"; *gpio_flags = GPIO_ACTIVE_HIGH; - /* Setups using a handshake pin need 25 ms enable delay */ - *enable_time_us = 25 * USEC_PER_MSEC; + /* Powering up the sensor through the handshake pin takes up to 200 ms */ + *enable_time_us = 200 * USEC_PER_MSEC; break; case 0x08: /* Surface Pro 9 - additional power rail */ *con_id = "pwr1"; From 137387314515f1e526da8a0864bfc7b4688eb548 Mon Sep 17 00:00:00 2001 From: "D. Manresa" Date: Mon, 31 Aug 2026 12:23:06 +0200 Subject: [PATCH 3/4] platform/x86: int3472: map the ov7251 power enable GPIO to "vdda" On IPU6 designs carrying an OV7251 IR sensor (ACPI HID INT347E) the INT3472 describes the sensor's single gated rail as a power-enable GPIO, which the driver registers as a regulator with con_id "avdd". The ov7251 driver and its DT bindings name the sensor supplies vdda, vddd and vdddo, so the lookup finds nothing, the rail is never enabled, and probe fails on the first I2C access: int3472-discrete INT3472:02: avdd \_SB.GPI0 pin 131 active-high ov7251 i2c-INT347E:00: supply vdda not found, using dummy regulator ov7251 i2c-INT347E:00: probe with driver ov7251 failed with error -121 Map the power-enable GPIO to con_id "vdda" for INT347E, the same way the existing entries map it to "vdd" for the mt9m114 and to "vana" for the imx471. The sensor's other two supplies keep falling back to the dummy regulator, which is correct here: the firmware gates a single rail. The table already has an INT347E entry mapping the reset GPIO to "enable", added when the ov7251 was brought up on these machines; this is the same class of firmware-vs-binding name mismatch for the remaining pin. Tested on a Microsoft Surface Pro 7+ (Tiger Lake, IPU6): with this change the IR sensor probes, the illuminator strobes, and the camera streams 640x480 at 30 fps through libcamera. The same failure was reproduced independently on a second Pro 7+ running stock firmware and a distro kernel, with no out-of-tree code, in [1]. Developed with the assistance of an AI tool (Claude) and verified on hardware. Link: https://github.com/linux-surface/linux-surface/issues/1702 [1] Reviewed-by: Hans de Goede Signed-off-by: D. Manresa Tested-by: Jakob Berg Jespersen # Surface Pro 7+, probe/power-on Signed-off-by: Sakari Ailus (cherry picked from commit 59cab094b8b50d7d4483bb04143294e1fb66aacc) Signed-off-by: Firas Sharary --- drivers/platform/x86/intel/int3472/discrete.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 59892bc08f26e..8be18ef262ec4 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -144,6 +144,11 @@ static const char * const power_enable_hids_enable[] = { NULL }; +static const char * const power_enable_hids_vdda[] = { + "INT347E", /* ov7251 */ + NULL +}; + /** * struct int3472_gpio_map - Map GPIOs to whatever is expected by the * sensor driver (as in DT bindings) @@ -179,6 +184,13 @@ static const struct int3472_gpio_map int3472_gpio_map[] = { .type_to = INT3472_GPIO_TYPE_RESET, .con_id = "enable", }, + { /* Sensors which expect "vdda" as con_id for power enable */ + .hids = power_enable_hids_vdda, + .type_from = INT3472_GPIO_TYPE_POWER_ENABLE, + .type_to = INT3472_GPIO_TYPE_POWER_ENABLE, + .con_id = "vdda", + .enable_time_us = GPIO_REGULATOR_ENABLE_TIME, + }, { /* Sensors which expect "vana" as con_id for power enable */ .hids = power_enable_hids_vana, .type_from = INT3472_GPIO_TYPE_POWER_ENABLE, From b78beef7bccaab5c7248a87e7d2b252ad6088d76 Mon Sep 17 00:00:00 2001 From: Firas Sharary Date: Sun, 15 Nov 2026 18:47:19 +0200 Subject: [PATCH 4/4] platform/x86: int3472: map the Surface Pro 7+ ov8865 POWER1 rail to "dvdd" On the Surface Pro 7+ the INT3472 for the rear camera (INT347A, ov8865) describes a second power rail as GPIO type 0x08 (POWER1). The 0x08 handling added for the Surface Pro 9 registers that rail as "pwr1", the name its ov13858 asks for, but ov8865 requests "dvdd". It gets a dummy regulator instead and the sensor is never fully powered. Add a GPIO map entry that names the 0x08 rail "dvdd" for INT347A only. The Surface Pro 9 keeps its "pwr1" rail unchanged. Upstream solves this generically with commit 34e31390a3b9 ("platform/x86: int3472: support the POWER1 GPIO type"), which maps 0x08 to "dvdd" for all devices; this entry can be dropped together with the Pro 9 0x08 handling once that commit is picked up. Assisted-by: LLM Signed-off-by: Firas Sharary --- drivers/platform/x86/intel/int3472/discrete.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index 8be18ef262ec4..15f757f9ffd16 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -149,6 +149,11 @@ static const char * const power_enable_hids_vdda[] = { NULL }; +static const char * const power1_hids_dvdd[] = { + "INT347A", /* ov8865 on Surface Pro 7+ */ + NULL +}; + /** * struct int3472_gpio_map - Map GPIOs to whatever is expected by the * sensor driver (as in DT bindings) @@ -198,6 +203,13 @@ static const struct int3472_gpio_map int3472_gpio_map[] = { .con_id = "vana", .enable_time_us = GPIO_REGULATOR_ENABLE_TIME, }, + { /* Sensors which expect "dvdd" for the 0x08 (POWER1) rail */ + .hids = power1_hids_dvdd, + .type_from = 0x08, + .type_to = 0x08, + .con_id = "dvdd", + .enable_time_us = GPIO_REGULATOR_ENABLE_TIME, + }, }; static bool int3472_gpio_map_hids_match(struct acpi_device *adev,