From nobody Thu Apr 2 15:39:00 2026 Received: from spark.kcore.it (spark.kcore.it [49.13.27.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61A2D331A57; Fri, 27 Mar 2026 18:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.13.27.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; cv=none; b=dZpGqF+0s+r1bSpqoIzoVhXdXAp0kXfBLQZHYXCHhmtv2jdpa57wQ5TZX7/Efgq6cqQCLTYMcnQ7UWYT/if4CX0JSqO9IdzSW+x76voFRQtjKSgM0fsUewfDOTj2Aaz3uqe3MqoUzkWhpZnlb+oSb90vuyAl8Umo8MFd2NKQTxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; c=relaxed/simple; bh=5anKZ713DKRvTehtWC+cBIeqxu/F84Rb60CaeZSmfbU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F4IVKRlaEw5HGb6Dc6pqQSQ3eUkO/dAu+LaIjQXSVbbwGvf6auruwxJ6Uo62zWh/mhR8JpY6m9xylHCtPeoWXyydVtYwnx0rEaYF6ZcwDmIv8HpqfMD23MHVB8mmot9HGEgE8rY1tlDWm9GE4Lp98peoa5N2vYv2hNWKseH4jcY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it; spf=pass smtp.mailfrom=kcore.it; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b=Icip6EW/; arc=none smtp.client-ip=49.13.27.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kcore.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b="Icip6EW/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kcore.it; s=spark; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Qj3pMrPTJH8iNxFc7o1eObD1qZkpRNcjx2PEJh5+0qc=; b=Icip6EW/7Q1N/JORBasqN/+/n2 59iGPfQMwvbZSwnTjx4pVALpvplEf/pIIA7wrldYGch8COlZByG8Y3t5sjR8Mf24ZDU1c2LlHhvNK AyTuXwC/zSP8AfLzh70CUJt7Ri3sQkZJDY+o/86roPXgawlTLC24LCHlvzoM1oTO76eo=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w6Bdf-006FSA-2U; Fri, 27 Mar 2026 19:10:31 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Marco Nenciarini Subject: [PATCH v5 1/4] platform/x86: int3472: Use local variable for LED struct access Date: Fri, 27 Mar 2026 19:10:28 +0100 Message-Id: <20260327181031.1489365-2-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327181031.1489365-1-mnencia@kcore.it> References: <20260327181031.1489365-1-mnencia@kcore.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce a local struct int3472_pled pointer in the LED registration and unregistration functions to avoid repeatedly dereferencing int3472->pled. In the brightness callback, use container_of() to get the int3472_pled struct directly instead of going through int3472_discrete_device. No functional change. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/led.c | 42 +++++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index b1d84b9..4c52f99 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -7,54 +7,56 @@ #include =20 static int int3472_pled_set(struct led_classdev *led_cdev, - enum led_brightness brightness) + enum led_brightness brightness) { - struct int3472_discrete_device *int3472 =3D - container_of(led_cdev, struct int3472_discrete_device, pled.classdev); + struct int3472_pled *pled =3D container_of(led_cdev, struct int3472_pled,= classdev); =20 - gpiod_set_value_cansleep(int3472->pled.gpio, brightness); + gpiod_set_value_cansleep(pled->gpio, brightness); return 0; } =20 int skl_int3472_register_pled(struct int3472_discrete_device *int3472, str= uct gpio_desc *gpio) { + struct int3472_pled *pled =3D &int3472->pled; char *p; int ret; =20 - if (int3472->pled.classdev.dev) + if (pled->classdev.dev) return -EBUSY; =20 - int3472->pled.gpio =3D gpio; + pled->gpio =3D gpio; =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ - snprintf(int3472->pled.name, sizeof(int3472->pled.name), + snprintf(pled->name, sizeof(pled->name), "%s::privacy_led", acpi_dev_name(int3472->sensor)); - p =3D strchr(int3472->pled.name, ':'); + p =3D strchr(pled->name, ':'); if (p) *p =3D '_'; =20 - int3472->pled.classdev.name =3D int3472->pled.name; - int3472->pled.classdev.max_brightness =3D 1; - int3472->pled.classdev.brightness_set_blocking =3D int3472_pled_set; + pled->classdev.name =3D pled->name; + pled->classdev.max_brightness =3D 1; + pled->classdev.brightness_set_blocking =3D int3472_pled_set; =20 - ret =3D led_classdev_register(int3472->dev, &int3472->pled.classdev); + ret =3D led_classdev_register(int3472->dev, &pled->classdev); if (ret) return ret; =20 - int3472->pled.lookup.provider =3D int3472->pled.name; - int3472->pled.lookup.dev_id =3D int3472->sensor_name; - int3472->pled.lookup.con_id =3D "privacy"; - led_add_lookup(&int3472->pled.lookup); + pled->lookup.provider =3D pled->name; + pled->lookup.dev_id =3D int3472->sensor_name; + pled->lookup.con_id =3D "privacy"; + led_add_lookup(&pled->lookup); =20 return 0; } =20 void skl_int3472_unregister_pled(struct int3472_discrete_device *int3472) { - if (IS_ERR_OR_NULL(int3472->pled.classdev.dev)) + struct int3472_pled *pled =3D &int3472->pled; + + if (IS_ERR_OR_NULL(pled->classdev.dev)) return; =20 - led_remove_lookup(&int3472->pled.lookup); - led_classdev_unregister(&int3472->pled.classdev); - gpiod_put(int3472->pled.gpio); + led_remove_lookup(&pled->lookup); + led_classdev_unregister(&pled->classdev); + gpiod_put(pled->gpio); } --=20 2.47.3 From nobody Thu Apr 2 15:39:00 2026 Received: from spark.kcore.it (spark.kcore.it [49.13.27.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62D0D3624C2; Fri, 27 Mar 2026 18:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.13.27.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; cv=none; b=YluyFLFXRWZXzlCYzsdjoVq4qDIG5OS3XBebPILuxndxogy2jvaw8mm9vP+WNnQ+5V50Q2c8vGDzk/EoAPSpzSfIO7n04cpgf7GF1lKEAdLhbpMQLVmQbw4jex8JbVn7NGkkJ+bcZM/kDmj+sUaI2ftwEK09d2Y+D2+MUDnTGjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; c=relaxed/simple; bh=GPBmiZS7ve18pxlg6BxIAXv/Vv66+opA+KYdFpG0Hlc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NrPgVCcRO4/ubHxi/HIjikMnaa22vGQ1qV9c+QwXQcjjRVtiKxfhu3fvdJW23Xqn13OQJBW2OC8oSOPKx6CNbsSwRxWIMTL3ymqwrhShpSyrHVJuzqbQaIJiiwR3m0DyvXQ0XdzKQjvTVkGvG/nYMrB5NbdFdT6/wMAWGsM/PfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it; spf=pass smtp.mailfrom=kcore.it; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b=i2aDwtmd; arc=none smtp.client-ip=49.13.27.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kcore.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b="i2aDwtmd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kcore.it; s=spark; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QGC7ldH3ILLghnQtQzgtvz8BDZPw0m49fZl+qO4/4kM=; b=i2aDwtmd7m6eqTDez1hg90gh7w pxLWt61xIRBewPK4qHEeh3+MFKgSztJOKL2cQPw+FAnvGcoQHRihdWQbZfHz8/dzWbcsso2KQ/Bh1 cwDmlVESHlMKiJk0W5CBCOhHRhCPYGJyvL1nj6O4YQDauuZ8a3jCLUwUB8d/8V2DVQMw=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w6Bdf-006FSD-2Z; Fri, 27 Mar 2026 19:10:31 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Marco Nenciarini Subject: [PATCH v5 2/4] platform/x86: int3472: Rename pled to led in LED registration code Date: Fri, 27 Mar 2026 19:10:29 +0100 Message-Id: <20260327181031.1489365-3-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327181031.1489365-1-mnencia@kcore.it> References: <20260327181031.1489365-1-mnencia@kcore.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename the privacy LED functions, struct type and member from pled/int3472_pled/register_pled to led/int3472_led/register_led to prepare for supporting additional LED types (e.g. strobe/IR flood). No functional change. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 4 +- drivers/platform/x86/intel/int3472/led.c | 48 +++++++++---------- include/linux/platform_data/x86/int3472.h | 8 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platfo= rm/x86/intel/int3472/discrete.c index 1505fc3..cb24763 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -348,7 +348,7 @@ static int skl_int3472_handle_gpio_resources(struct acp= i_resource *ares, =20 break; case INT3472_GPIO_TYPE_PRIVACY_LED: - ret =3D skl_int3472_register_pled(int3472, gpio); + ret =3D skl_int3472_register_led(int3472, gpio); if (ret) err_msg =3D "Failed to register LED\n"; =20 @@ -422,7 +422,7 @@ void int3472_discrete_cleanup(struct int3472_discrete_d= evice *int3472) gpiod_remove_lookup_table(&int3472->gpios); =20 skl_int3472_unregister_clock(int3472); - skl_int3472_unregister_pled(int3472); + skl_int3472_unregister_led(int3472); skl_int3472_unregister_regulator(int3472); } EXPORT_SYMBOL_NS_GPL(int3472_discrete_cleanup, "INTEL_INT3472_DISCRETE"); diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index 4c52f99..8e92e8e 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -6,57 +6,57 @@ #include #include =20 -static int int3472_pled_set(struct led_classdev *led_cdev, - enum led_brightness brightness) +static int int3472_led_set(struct led_classdev *led_cdev, + enum led_brightness brightness) { - struct int3472_pled *pled =3D container_of(led_cdev, struct int3472_pled,= classdev); + struct int3472_led *led =3D container_of(led_cdev, struct int3472_led, cl= assdev); =20 - gpiod_set_value_cansleep(pled->gpio, brightness); + gpiod_set_value_cansleep(led->gpio, brightness); return 0; } =20 -int skl_int3472_register_pled(struct int3472_discrete_device *int3472, str= uct gpio_desc *gpio) +int skl_int3472_register_led(struct int3472_discrete_device *int3472, stru= ct gpio_desc *gpio) { - struct int3472_pled *pled =3D &int3472->pled; + struct int3472_led *led =3D &int3472->led; char *p; int ret; =20 - if (pled->classdev.dev) + if (led->classdev.dev) return -EBUSY; =20 - pled->gpio =3D gpio; + led->gpio =3D gpio; =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ - snprintf(pled->name, sizeof(pled->name), + snprintf(led->name, sizeof(led->name), "%s::privacy_led", acpi_dev_name(int3472->sensor)); - p =3D strchr(pled->name, ':'); + p =3D strchr(led->name, ':'); if (p) *p =3D '_'; =20 - pled->classdev.name =3D pled->name; - pled->classdev.max_brightness =3D 1; - pled->classdev.brightness_set_blocking =3D int3472_pled_set; + led->classdev.name =3D led->name; + led->classdev.max_brightness =3D 1; + led->classdev.brightness_set_blocking =3D int3472_led_set; =20 - ret =3D led_classdev_register(int3472->dev, &pled->classdev); + ret =3D led_classdev_register(int3472->dev, &led->classdev); if (ret) return ret; =20 - pled->lookup.provider =3D pled->name; - pled->lookup.dev_id =3D int3472->sensor_name; - pled->lookup.con_id =3D "privacy"; - led_add_lookup(&pled->lookup); + led->lookup.provider =3D led->name; + led->lookup.dev_id =3D int3472->sensor_name; + led->lookup.con_id =3D "privacy"; + led_add_lookup(&led->lookup); =20 return 0; } =20 -void skl_int3472_unregister_pled(struct int3472_discrete_device *int3472) +void skl_int3472_unregister_led(struct int3472_discrete_device *int3472) { - struct int3472_pled *pled =3D &int3472->pled; + struct int3472_led *led =3D &int3472->led; =20 - if (IS_ERR_OR_NULL(pled->classdev.dev)) + if (IS_ERR_OR_NULL(led->classdev.dev)) return; =20 - led_remove_lookup(&pled->lookup); - led_classdev_unregister(&pled->classdev); - gpiod_put(pled->gpio); + led_remove_lookup(&led->lookup); + led_classdev_unregister(&led->classdev); + gpiod_put(led->gpio); } diff --git a/include/linux/platform_data/x86/int3472.h b/include/linux/plat= form_data/x86/int3472.h index b1b8375..7af6731 100644 --- a/include/linux/platform_data/x86/int3472.h +++ b/include/linux/platform_data/x86/int3472.h @@ -121,12 +121,12 @@ struct int3472_discrete_device { u8 imgclk_index; } clock; =20 - struct int3472_pled { + struct int3472_led { struct led_classdev classdev; struct led_lookup_data lookup; char name[INT3472_LED_MAX_NAME_LEN]; struct gpio_desc *gpio; - } pled; + } led; =20 struct int3472_discrete_quirks quirks; =20 @@ -160,7 +160,7 @@ int skl_int3472_register_regulator(struct int3472_discr= ete_device *int3472, const char *second_sensor); void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3= 472); =20 -int skl_int3472_register_pled(struct int3472_discrete_device *int3472, str= uct gpio_desc *gpio); -void skl_int3472_unregister_pled(struct int3472_discrete_device *int3472); +int skl_int3472_register_led(struct int3472_discrete_device *int3472, stru= ct gpio_desc *gpio); +void skl_int3472_unregister_led(struct int3472_discrete_device *int3472); =20 #endif --=20 2.47.3 From nobody Thu Apr 2 15:39:00 2026 Received: from spark.kcore.it (spark.kcore.it [49.13.27.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62C80355F22; Fri, 27 Mar 2026 18:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.13.27.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; cv=none; b=TlztRCId/AMg0b0Yb+200bH4ILduZMAdnEj3B1DnAKSpaXYFTsMPqd33K1mlcmlMojfSLCkDiopz2dyCX6whFopapg4ZeHAlaem4dhme9LbK3a2YTGOfUtVjWaYFCEndbVOas3UXkYJmZSlc2aCOe807nlVeOSrC2H71mNgBVvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635038; c=relaxed/simple; bh=Me/dNDhjULUX4bfZoWy2VYCeCbFJlFbArFgcmmWcBxE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a/Lb/sR9x4XkRyIWdzgtZJ7GCsDamih4GBExL65cLQs71BdMTGEv2prtg45hMy5x8ZyouLLjim627tbW59tcIG2QqSwknzDo6dvR6O78JLCWEK5Em25HnVllkjmElzCR6+nQo24UMssH3+XMcbvV083gN5V+eUirNjFV8Is7XZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it; spf=pass smtp.mailfrom=kcore.it; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b=OmTyy/mC; arc=none smtp.client-ip=49.13.27.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kcore.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b="OmTyy/mC" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kcore.it; s=spark; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=57BwF54EmoRVxe2+xL7GGnB9Jgg4m5zqhYTpvW/p10I=; b=OmTyy/mCbkO7BguEtQaa2MOmBh l2bF5WQTzgX7TyqkZ5fPf5wqKixmlfjoAom9USh9WFERw+Ss4/jzWn5nT1lCL0YFADldBTXww7IVx A6PT2Nr1Nkb2TA60h5vB4Szm1yQP2kMoZCLVrZ0+ykqRm3tzRcGy1fIMa0PcJWFolfnI=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w6Bdf-006FSG-2e; Fri, 27 Mar 2026 19:10:31 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Marco Nenciarini Subject: [PATCH v5 3/4] platform/x86: int3472: Parameterize LED name in registration Date: Fri, 27 Mar 2026 19:10:30 +0100 Message-Id: <20260327181031.1489365-4-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327181031.1489365-1-mnencia@kcore.it> References: <20260327181031.1489365-1-mnencia@kcore.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a name parameter to skl_int3472_register_led() to allow callers to specify the LED name suffix instead of hardcoding "privacy". This prepares for registering additional LED types with different names. No functional change. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 2 +- drivers/platform/x86/intel/int3472/led.c | 5 +++-- include/linux/platform_data/x86/int3472.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platfo= rm/x86/intel/int3472/discrete.c index cb24763..57c3b2c 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -348,7 +348,7 @@ static int skl_int3472_handle_gpio_resources(struct acp= i_resource *ares, =20 break; case INT3472_GPIO_TYPE_PRIVACY_LED: - ret =3D skl_int3472_register_led(int3472, gpio); + ret =3D skl_int3472_register_led(int3472, gpio, "privacy"); if (ret) err_msg =3D "Failed to register LED\n"; =20 diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index 8e92e8e..8222550 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -15,7 +15,8 @@ static int int3472_led_set(struct led_classdev *led_cdev, return 0; } =20 -int skl_int3472_register_led(struct int3472_discrete_device *int3472, stru= ct gpio_desc *gpio) +int skl_int3472_register_led(struct int3472_discrete_device *int3472, + struct gpio_desc *gpio, const char *name) { struct int3472_led *led =3D &int3472->led; char *p; @@ -28,7 +29,7 @@ int skl_int3472_register_led(struct int3472_discrete_devi= ce *int3472, struct gpi =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ snprintf(led->name, sizeof(led->name), - "%s::privacy_led", acpi_dev_name(int3472->sensor)); + "%s::%s_led", acpi_dev_name(int3472->sensor), name); p =3D strchr(led->name, ':'); if (p) *p =3D '_'; diff --git a/include/linux/platform_data/x86/int3472.h b/include/linux/plat= form_data/x86/int3472.h index 7af6731..3a077f4 100644 --- a/include/linux/platform_data/x86/int3472.h +++ b/include/linux/platform_data/x86/int3472.h @@ -160,7 +160,8 @@ int skl_int3472_register_regulator(struct int3472_discr= ete_device *int3472, const char *second_sensor); void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3= 472); =20 -int skl_int3472_register_led(struct int3472_discrete_device *int3472, stru= ct gpio_desc *gpio); +int skl_int3472_register_led(struct int3472_discrete_device *int3472, + struct gpio_desc *gpio, const char *name); void skl_int3472_unregister_led(struct int3472_discrete_device *int3472); =20 #endif --=20 2.47.3 From nobody Thu Apr 2 15:39:00 2026 Received: from spark.kcore.it (spark.kcore.it [49.13.27.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61D82346FC6; Fri, 27 Mar 2026 18:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.13.27.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635039; cv=none; b=jPSIfevWUaGFgh8uTb699wWamLfU/46Qk31UgqE0eIXmyVlxv0MJDI+BHQ1JM3m6mv/IgRlLHGpqGCa5nVsVDm6t8N5j+8ShPwv87fCybwOtC+2r49X7WX1OCXh+swSUJFRRhX8dwacgBNVJKFrRV/gUOZoiVQ3wxboXLHzbZbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774635039; c=relaxed/simple; bh=T/dSfo/LMkLDt4W4JkHqJv+gQtkXzGBbDcaufjbQLkM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rohFSZTxm9VN8aO30/ao9XTYxzvBCtrdg7b7urP56FmuN5WOC6J1czDW+ysbMi/qJCBgvdT8mo4nB7d/3IJ+vjmtYXGE61W+gsKnc9tjRl0ZsVE/MjzIO2O7vMlk1UlD0ZC/JOMhjNZJJfAl+sp8EahzK+zsIwEnkD+9RHzHI2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it; spf=pass smtp.mailfrom=kcore.it; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b=qSpEe/gT; arc=none smtp.client-ip=49.13.27.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kcore.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kcore.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kcore.it header.i=@kcore.it header.b="qSpEe/gT" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kcore.it; s=spark; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Qt3XWHI5YmC5jcWIMY0NXX2T8UoU9QZRTYaKhKnU4YE=; b=qSpEe/gTleO6zuYrEJh7MP7DtG 9DDnjMkVAnfX5EgC7C14dJnazkr5v1QX4f+SX22K1BFSNynfqsnW7j3GyXwQfXNx5gZSTr7ca+1ls 1R+ZMb1TqUdNcCNfGgtB7wqEjH6qXhi9j43wOKOxOltTN4ZQbIf1sZCefh159k8AG/gY=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w6Bdf-006FSJ-2j; Fri, 27 Mar 2026 19:10:31 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Marco Nenciarini Subject: [PATCH v5 4/4] platform/x86: int3472: Add support for GPIO type 0x02 (strobe) Date: Fri, 27 Mar 2026 19:10:31 +0100 Message-Id: <20260327181031.1489365-5-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327181031.1489365-1-mnencia@kcore.it> References: <20260327181031.1489365-1-mnencia@kcore.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for GPIO type 0x02, which controls an IR strobe LED used for face authentication on some laptops (e.g. Dell Pro Max 16 Premium). Without this patch, the kernel logs "GPIO type 0x02 unknown; the sensor may not work" and IR sensors paired with a strobe LED cannot function. The strobe LED is registered through the LED subsystem like the existing privacy LED. Unlike the privacy LED, it does not have a lookup entry since there is no consumer driver expecting it via led_get(). To support multiple LEDs per INT3472 device, convert the single led struct member to an array with a counter. This GPIO type was previously referred to as "ir_flood" in early versions of this patch series. It has been renamed to "strobe" to match the GPIO type name used in ACPI _DSM tables and align with common camera terminology for IR illuminators. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 16 +++++++- drivers/platform/x86/intel/int3472/led.c | 38 +++++++++++-------- include/linux/platform_data/x86/int3472.h | 11 ++++-- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platfo= rm/x86/intel/int3472/discrete.c index 57c3b2c..4c03845 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -215,6 +215,10 @@ static void int3472_get_con_id_and_polarity(struct int= 3472_discrete_device *int3 *con_id =3D "privacy-led"; *gpio_flags =3D GPIO_ACTIVE_HIGH; break; + case INT3472_GPIO_TYPE_STROBE: + *con_id =3D "strobe"; + *gpio_flags =3D GPIO_ACTIVE_HIGH; + break; case INT3472_GPIO_TYPE_HOTPLUG_DETECT: *con_id =3D "hpd"; *gpio_flags =3D GPIO_ACTIVE_HIGH; @@ -248,6 +252,7 @@ static void int3472_get_con_id_and_polarity(struct int3= 472_discrete_device *int3 * * 0x00 Reset * 0x01 Power down + * 0x02 Strobe * 0x0b Power enable * 0x0c Clock enable * 0x0d Privacy LED @@ -331,6 +336,7 @@ static int skl_int3472_handle_gpio_resources(struct acp= i_resource *ares, break; case INT3472_GPIO_TYPE_CLK_ENABLE: case INT3472_GPIO_TYPE_PRIVACY_LED: + case INT3472_GPIO_TYPE_STROBE: case INT3472_GPIO_TYPE_POWER_ENABLE: case INT3472_GPIO_TYPE_HANDSHAKE: gpio =3D skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, con_id, = gpio_flags); @@ -348,7 +354,13 @@ static int skl_int3472_handle_gpio_resources(struct ac= pi_resource *ares, =20 break; case INT3472_GPIO_TYPE_PRIVACY_LED: - ret =3D skl_int3472_register_led(int3472, gpio, "privacy"); + ret =3D skl_int3472_register_led(int3472, gpio, "privacy", true); + if (ret) + err_msg =3D "Failed to register LED\n"; + + break; + case INT3472_GPIO_TYPE_STROBE: + ret =3D skl_int3472_register_led(int3472, gpio, "strobe", false); if (ret) err_msg =3D "Failed to register LED\n"; =20 @@ -422,7 +434,7 @@ void int3472_discrete_cleanup(struct int3472_discrete_d= evice *int3472) gpiod_remove_lookup_table(&int3472->gpios); =20 skl_int3472_unregister_clock(int3472); - skl_int3472_unregister_led(int3472); + skl_int3472_unregister_leds(int3472); skl_int3472_unregister_regulator(int3472); } EXPORT_SYMBOL_NS_GPL(int3472_discrete_cleanup, "INTEL_INT3472_DISCRETE"); diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index 8222550..77f61a4 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -16,15 +16,17 @@ static int int3472_led_set(struct led_classdev *led_cde= v, } =20 int skl_int3472_register_led(struct int3472_discrete_device *int3472, - struct gpio_desc *gpio, const char *name) + struct gpio_desc *gpio, const char *name, + bool has_lookup) { - struct int3472_led *led =3D &int3472->led; + struct int3472_led *led; char *p; int ret; =20 - if (led->classdev.dev) - return -EBUSY; + if (int3472->n_leds >=3D INT3472_MAX_LEDS) + return -ENOSPC; =20 + led =3D &int3472->leds[int3472->n_leds]; led->gpio =3D gpio; =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ @@ -42,22 +44,26 @@ int skl_int3472_register_led(struct int3472_discrete_de= vice *int3472, if (ret) return ret; =20 - led->lookup.provider =3D led->name; - led->lookup.dev_id =3D int3472->sensor_name; - led->lookup.con_id =3D "privacy"; - led_add_lookup(&led->lookup); + if (has_lookup) { + led->lookup.provider =3D led->name; + led->lookup.dev_id =3D int3472->sensor_name; + led->lookup.con_id =3D name; + led_add_lookup(&led->lookup); + led->has_lookup =3D true; + } =20 + int3472->n_leds++; return 0; } =20 -void skl_int3472_unregister_led(struct int3472_discrete_device *int3472) +void skl_int3472_unregister_leds(struct int3472_discrete_device *int3472) { - struct int3472_led *led =3D &int3472->led; + for (unsigned int i =3D 0; i < int3472->n_leds; i++) { + struct int3472_led *led =3D &int3472->leds[i]; =20 - if (IS_ERR_OR_NULL(led->classdev.dev)) - return; - - led_remove_lookup(&led->lookup); - led_classdev_unregister(&led->classdev); - gpiod_put(led->gpio); + if (led->has_lookup) + led_remove_lookup(&led->lookup); + led_classdev_unregister(&led->classdev); + gpiod_put(led->gpio); + } } diff --git a/include/linux/platform_data/x86/int3472.h b/include/linux/plat= form_data/x86/int3472.h index 3a077f4..540e3f2 100644 --- a/include/linux/platform_data/x86/int3472.h +++ b/include/linux/platform_data/x86/int3472.h @@ -23,6 +23,7 @@ /* PMIC GPIO Types */ #define INT3472_GPIO_TYPE_RESET 0x00 #define INT3472_GPIO_TYPE_POWERDOWN 0x01 +#define INT3472_GPIO_TYPE_STROBE 0x02 #define INT3472_GPIO_TYPE_POWER_ENABLE 0x0b #define INT3472_GPIO_TYPE_CLK_ENABLE 0x0c #define INT3472_GPIO_TYPE_PRIVACY_LED 0x0d @@ -31,6 +32,7 @@ =20 #define INT3472_PDEV_MAX_NAME_LEN 23 #define INT3472_MAX_SENSOR_GPIOS 3 +#define INT3472_MAX_LEDS 2 #define INT3472_MAX_REGULATORS 3 =20 /* E.g. "avdd\0" */ @@ -126,12 +128,14 @@ struct int3472_discrete_device { struct led_lookup_data lookup; char name[INT3472_LED_MAX_NAME_LEN]; struct gpio_desc *gpio; - } led; + bool has_lookup; + } leds[INT3472_MAX_LEDS]; =20 struct int3472_discrete_quirks quirks; =20 unsigned int ngpios; /* how many GPIOs have we seen */ unsigned int n_sensor_gpios; /* how many have we mapped to sensor */ + unsigned int n_leds; /* how many LEDs have we registered */ unsigned int n_regulator_gpios; /* how many have we mapped to a regulator= */ struct gpiod_lookup_table gpios; }; @@ -161,7 +165,8 @@ int skl_int3472_register_regulator(struct int3472_discr= ete_device *int3472, void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3= 472); =20 int skl_int3472_register_led(struct int3472_discrete_device *int3472, - struct gpio_desc *gpio, const char *name); -void skl_int3472_unregister_led(struct int3472_discrete_device *int3472); + struct gpio_desc *gpio, const char *name, + bool has_lookup); +void skl_int3472_unregister_leds(struct int3472_discrete_device *int3472); =20 #endif --=20 2.47.3