From nobody Thu Apr 2 17:10:50 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 8422B3D9DA0; Fri, 27 Mar 2026 09:08:06 +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=1774602488; cv=none; b=a8DDP77k8ODKhZRdahhT6UhHuwKLNgySR8IbrGUg9q5iG+5hcLMlo6IsG2dCTl6rOUPHsiocOxPrN/6busm2hEY4XnaPStWNQ3T2L3IcgtNJQj0U0eRdNTNEDobZSzrDmjM1XdPp+OSnUVZ8Z7yZTJ6tj4TJ+dzsPquhKSHpqvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774602488; c=relaxed/simple; bh=Geu8VQ8aXNK+oC8wANTBHshaKugF0Gk3vrny495NR/s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rn1nMZpgEZlAovDEYHSy8EPf4t3L31FO79Fck6FvStKy9hKSfkrS9tW8fcikCV7W965UmfWBwCmcngE1RpgbbuvYq8k/x+YCk2UMYUuuz6Ccz97WR4V6PZUrzPeM/LkfbYYJTY0qz+ObB/etUUjISbmBeVnJR0q/UUbU1u4kbHI= 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=Gf2+x3iw; 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="Gf2+x3iw" 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=QxEV4MGnbEuDmUfyMGlSWYDO/NL/pfs3zls+yTLZ7N0=; b=Gf2+x3iwo2p4LnQOEHWyEws6j9 mdK2ZZsgGz5wNEVFqmC7DygoRMeUG3ixmSA59hGDpF5J2z4T4A1vWypLTbG/3ZJJ5BFfdOrEDO9RB YebF39u9afF5671sNSmOXvHq+AXcIbHoDUOuGMUMbz7IeNh3JelN+WxY5WnSTQ8P1EA8=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w63AX-006DOY-2l; Fri, 27 Mar 2026 10:07:53 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , Hans de Goede , =?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 v4 1/4] platform/x86: int3472: Rename pled to led in LED registration code Date: Fri, 27 Mar 2026 10:07:50 +0100 Message-Id: <20260327090753.1481453-2-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327090753.1481453-1-mnencia@kcore.it> References: <20260327090753.1481453-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 Reviewed-by: Andy Shevchenko --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 4 +- drivers/platform/x86/intel/int3472/led.c | 42 +++++++++---------- include/linux/platform_data/x86/int3472.h | 8 ++-- 3 files changed, 27 insertions(+), 27 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 b1d84b9..ccd51f2 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -6,55 +6,55 @@ #include #include =20 -static int int3472_pled_set(struct led_classdev *led_cdev, +static int int3472_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) { struct int3472_discrete_device *int3472 =3D - container_of(led_cdev, struct int3472_discrete_device, pled.classdev); + container_of(led_cdev, struct int3472_discrete_device, led.classdev); =20 - gpiod_set_value_cansleep(int3472->pled.gpio, brightness); + gpiod_set_value_cansleep(int3472->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) { char *p; int ret; =20 - if (int3472->pled.classdev.dev) + if (int3472->led.classdev.dev) return -EBUSY; =20 - int3472->pled.gpio =3D gpio; + int3472->led.gpio =3D gpio; =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ - snprintf(int3472->pled.name, sizeof(int3472->pled.name), + snprintf(int3472->led.name, sizeof(int3472->led.name), "%s::privacy_led", acpi_dev_name(int3472->sensor)); - p =3D strchr(int3472->pled.name, ':'); + p =3D strchr(int3472->led.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; + int3472->led.classdev.name =3D int3472->led.name; + int3472->led.classdev.max_brightness =3D 1; + int3472->led.classdev.brightness_set_blocking =3D int3472_led_set; =20 - ret =3D led_classdev_register(int3472->dev, &int3472->pled.classdev); + ret =3D led_classdev_register(int3472->dev, &int3472->led.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); + int3472->led.lookup.provider =3D int3472->led.name; + int3472->led.lookup.dev_id =3D int3472->sensor_name; + int3472->led.lookup.con_id =3D "privacy"; + led_add_lookup(&int3472->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) { - if (IS_ERR_OR_NULL(int3472->pled.classdev.dev)) + if (IS_ERR_OR_NULL(int3472->led.classdev.dev)) return; =20 - led_remove_lookup(&int3472->pled.lookup); - led_classdev_unregister(&int3472->pled.classdev); - gpiod_put(int3472->pled.gpio); + led_remove_lookup(&int3472->led.lookup); + led_classdev_unregister(&int3472->led.classdev); + gpiod_put(int3472->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 17:10:50 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 38BFA3C9EF0; Fri, 27 Mar 2026 09:08:05 +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=1774602486; cv=none; b=YJqDHDNbNnChHKlJaKENDSiD8fFiGC1vI6yxLGZbGS8BmhQyy45B7dNGjOfxt7rDdanSlg0fzQBUiOmo1JXzQ8gLuFPq3IS/xl0QWV/WAVImsRnvwAlo+R6M7k/U98pEoKcUK/DjRDdjWxvThZFVvKtz+POZPrjSn6UsQWApdjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774602486; c=relaxed/simple; bh=CvC61XeMVwlPFf3renEnnynRkbtgGOutbfE6em4sng0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jQFE6tyMNn5WNMhC9evZsZfMnEWeSv14ehmNZDZDjQ9HuuwUyQzNvDzAeFjAzETdWeTPCpFwc7DX9Wa1q511iqytcDdOLFY0f8k9eu6zm/cEpwbbBO4GH2UhaZmR+V7GHu2265sWn/dBkzt4ZAokluhd0owB5mUFAaBPjyjAKk8= 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=zBocX4kN; 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="zBocX4kN" 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=gdL6TF00khNTCDWH0opWEdKAuryG3EP0C3qV+jSMD8Q=; b=zBocX4kNgp0Gv+ASIQ7OTCWunI zs2ESzTkFi59YiH5M+b+3/Ao9p9CwxiZXdETycUNoYC5N5M6vAbZ10w368g20sCrL8QAZpZ80j9UK LLjCIISHJ/UGbtgT3Zw8v4gtd+Wt4JKWS99z7D3dq+avDUtorJ2LHrWDqEeBye493aHY=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w63AX-006DOb-2q; Fri, 27 Mar 2026 10:07:53 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , Hans de Goede , =?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 v4 2/4] platform/x86: int3472: Use local variable for LED struct access Date: Fri, 27 Mar 2026 10:07:51 +0100 Message-Id: <20260327090753.1481453-3-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327090753.1481453-1-mnencia@kcore.it> References: <20260327090753.1481453-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_led pointer in the LED registration and unregistration functions to avoid repeatedly dereferencing int3472->led. In the brightness callback, use container_of to get the int3472_led 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 | 43 +++++++++++++----------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index ccd51f2..efbb02c 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -7,54 +7,57 @@ #include =20 static int int3472_led_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, led.classdev); + struct int3472_led *led =3D + container_of(led_cdev, struct int3472_led, classdev); =20 - gpiod_set_value_cansleep(int3472->led.gpio, brightness); + gpiod_set_value_cansleep(led->gpio, brightness); return 0; } =20 int skl_int3472_register_led(struct int3472_discrete_device *int3472, stru= ct gpio_desc *gpio) { + struct int3472_led *led =3D &int3472->led; char *p; int ret; =20 - if (int3472->led.classdev.dev) + if (led->classdev.dev) return -EBUSY; =20 - int3472->led.gpio =3D gpio; + led->gpio =3D gpio; =20 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ - snprintf(int3472->led.name, sizeof(int3472->led.name), + snprintf(led->name, sizeof(led->name), "%s::privacy_led", acpi_dev_name(int3472->sensor)); - p =3D strchr(int3472->led.name, ':'); + p =3D strchr(led->name, ':'); if (p) *p =3D '_'; =20 - int3472->led.classdev.name =3D int3472->led.name; - int3472->led.classdev.max_brightness =3D 1; - int3472->led.classdev.brightness_set_blocking =3D int3472_led_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, &int3472->led.classdev); + ret =3D led_classdev_register(int3472->dev, &led->classdev); if (ret) return ret; =20 - int3472->led.lookup.provider =3D int3472->led.name; - int3472->led.lookup.dev_id =3D int3472->sensor_name; - int3472->led.lookup.con_id =3D "privacy"; - led_add_lookup(&int3472->led.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_led(struct int3472_discrete_device *int3472) { - if (IS_ERR_OR_NULL(int3472->led.classdev.dev)) + struct int3472_led *led =3D &int3472->led; + + if (IS_ERR_OR_NULL(led->classdev.dev)) return; =20 - led_remove_lookup(&int3472->led.lookup); - led_classdev_unregister(&int3472->led.classdev); - gpiod_put(int3472->led.gpio); + led_remove_lookup(&led->lookup); + led_classdev_unregister(&led->classdev); + gpiod_put(led->gpio); } --=20 2.47.3 From nobody Thu Apr 2 17:10:50 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 38C8B3CBE7B; Fri, 27 Mar 2026 09:08:05 +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=1774602486; cv=none; b=OQ3/3z7nOdVVRTkZozfUWiURV0Wxd8Ol08amBuUXkDBTzqkO8V/n2CEmo7cXRQasdiFxz+SMFKpOr42hQhk3DqUvNqdFyGGmUscRMf5cBX7mzzC+x6oGZSDJUhZAxXVeXDkoG3HsCUwuVSukpe8mf+IOGkg1uEnMAoIUhB4h8Qc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774602486; c=relaxed/simple; bh=Ek3RQBJS4GldWcR+pLKBbICkdXVZvaSCJB2fF+gq6xk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ny87GGRkaeyqmlRzjxanyx2dSyefwdvnB5MMNSHRpRupDYb9GXkflv0kAXRqsGvpuVUn4IO7ig2dnTCWJMPqEVTVytd8HaaOKiwVyF43+RuxUR83L+HLrUZAEnm+uYr1E569Z3xfCxik0ECcUEV4dfWkhCrnWvMWGBO2h2xf71A= 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=cg0npDY6; 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="cg0npDY6" 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=2CKVQnngKqFun6UF1jGBD+/ololOhltgTZvoG15RPpI=; b=cg0npDY6yynhM8rTCFJyb3yOWi QxvoUBCtjLKqWB2Zryn843BcTytCtku34zdpOt3ZpDqGmVVoRHffRj+IRtqgfYCV2upXILcBDUawm R3mHy8BlyBiCeSGYoTuZK20oBNJKP5hyI8kNYNq8dkfmiZ/MV+yF3kRwVixvKr27mVXo=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w63AX-006DOe-2v; Fri, 27 Mar 2026 10:07:53 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , Hans de Goede , =?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 v4 3/4] platform/x86: int3472: Introduce LED type enum and multi-LED support Date: Fri, 27 Mar 2026 10:07:52 +0100 Message-Id: <20260327090753.1481453-4-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327090753.1481453-1-mnencia@kcore.it> References: <20260327090753.1481453-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 an enum int3472_led_type to parameterize LED registration, and lookup tables to derive the LED name suffix and con_id from the type. This replaces the hardcoded "privacy" name and prepares for additional LED types. Convert the single struct int3472_led member to an array with a counter to support devices with multiple LEDs. The LED lookup is now conditionally registered based on the con_id lookup table entry, and a has_lookup flag tracks whether to remove it during cleanup. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 7 +-- drivers/platform/x86/intel/int3472/led.c | 51 +++++++++++++------ include/linux/platform_data/x86/int3472.h | 15 ++++-- 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platfo= rm/x86/intel/int3472/discrete.c index cb24763..2c554a0 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -348,9 +348,10 @@ 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); + ret =3D skl_int3472_register_led(int3472, gpio, + INT3472_LED_TYPE_PRIVACY); if (ret) - err_msg =3D "Failed to register LED\n"; + err_msg =3D "Failed to register privacy LED\n"; =20 break; case INT3472_GPIO_TYPE_POWER_ENABLE: @@ -422,7 +423,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 efbb02c..33b30f3 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -6,6 +6,14 @@ #include #include =20 +static const char * const int3472_led_names[] =3D { + [INT3472_LED_TYPE_PRIVACY] =3D "privacy", +}; + +static const char * const int3472_led_con_ids[] =3D { + [INT3472_LED_TYPE_PRIVACY] =3D "privacy", +}; + static int int3472_led_set(struct led_classdev *led_cdev, enum led_brightness brightness) { @@ -16,20 +24,25 @@ static int int3472_led_set(struct led_classdev *led_cde= v, 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, + enum int3472_led_type type) { - struct int3472_led *led =3D &int3472->led; + const char *name_suffix =3D int3472_led_names[type]; + const char *con_id =3D int3472_led_con_ids[type]; + 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 '_' */ snprintf(led->name, sizeof(led->name), - "%s::privacy_led", acpi_dev_name(int3472->sensor)); + "%s::%s_led", acpi_dev_name(int3472->sensor), name_suffix); p =3D strchr(led->name, ':'); if (p) *p =3D '_'; @@ -42,22 +55,28 @@ int skl_int3472_register_led(struct int3472_discrete_de= vice *int3472, struct gpi 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 (con_id) { + led->lookup.provider =3D led->name; + led->lookup.dev_id =3D int3472->sensor_name; + led->lookup.con_id =3D con_id; + 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; + unsigned int i; =20 - if (IS_ERR_OR_NULL(led->classdev.dev)) - return; + for (i =3D 0; i < int3472->n_leds; i++) { + struct int3472_led *led =3D &int3472->leds[i]; =20 - 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 7af6731..b6b5b36 100644 --- a/include/linux/platform_data/x86/int3472.h +++ b/include/linux/platform_data/x86/int3472.h @@ -49,6 +49,7 @@ #define GPIO_REGULATOR_OFF_ON_DELAY (2 * USEC_PER_MSEC) =20 #define INT3472_LED_MAX_NAME_LEN 32 +#define INT3472_MAX_LEDS 2 =20 #define CIO2_SENSOR_SSDB_MCLKSPEED_OFFSET 86 =20 @@ -68,6 +69,10 @@ #define to_int3472_device(clk) \ container_of(clk, struct int3472_discrete_device, clock) =20 +enum int3472_led_type { + INT3472_LED_TYPE_PRIVACY, +}; + struct acpi_device; struct dmi_system_id; struct i2c_client; @@ -126,7 +131,9 @@ 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]; + unsigned int n_leds; =20 struct int3472_discrete_quirks quirks; =20 @@ -160,7 +167,9 @@ 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); -void skl_int3472_unregister_led(struct int3472_discrete_device *int3472); +int skl_int3472_register_led(struct int3472_discrete_device *int3472, + struct gpio_desc *gpio, + enum int3472_led_type type); +void skl_int3472_unregister_leds(struct int3472_discrete_device *int3472); =20 #endif --=20 2.47.3 From nobody Thu Apr 2 17:10:50 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 636D73D9044; Fri, 27 Mar 2026 09:08:06 +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=1774602487; cv=none; b=YI3s+fBw7BQc2PluPWA8Hjhmwz7AB5JMd4+qaJiBGOfNEnJZcYTqzui1Ux0GEXX7I++/SbUArVst62rxFI4WwjkzsAsJsxu4p1nknl4Yni0Q2vTsEEKFZpqJ1Lb+k4O21fUwMvQlVUx1l6hqI5Alxr9x3JYG8DI0TBRRDn6ws5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774602487; c=relaxed/simple; bh=IW8wT+nYV2b3gblOL+QMjAa4/8maVyR/QCWIP2hCZS4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MkjBnt4g66daA2R5wvzKEGa3xcPBz3BCI/43xkVE6Jz1Fzqps6JCF5RtLNJ3EnOB+gXeZ4mQNJraMYSXdrbxItpEiRjeHIjCZonu3f+Pn9K8Sx6HY2mjtLLDgUJT8Av4YMkKS2Ns9rUvolw9RrIBnp8PuWIQShb14SnEfYN6Kig= 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=FS76bz0i; 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="FS76bz0i" 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=SrNwU+vCM7AcLOv3Lgv7rg4YZN7d0YGaFgHQS2YG+cM=; b=FS76bz0i2FHmjP+4C5riFTJdHy ehYSjh0NTStdL/bH8BO+hHJwZBE1CtMcIuvO88n23B3SfwSE32TJuCfE4lIS2bTAwFAzVjdg30JiJ WOQ1gTdz/RCiqjXf4fNPU74O8S3F5aVvZ2e/WUMVGwsiX3SNtb2iNuQ+ESAvLodBevjE=; Received: from mnencia by spark.kcore.it with local (Exim 4.96) (envelope-from ) id 1w63AX-006DOh-30; Fri, 27 Mar 2026 10:07:53 +0100 From: Marco Nenciarini To: Daniel Scally , Sakari Ailus , Hans de Goede , =?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 v4 4/4] platform/x86: int3472: Add support for GPIO type 0x02 (strobe LED) Date: Fri, 27 Mar 2026 10:07:53 +0100 Message-Id: <20260327090753.1481453-5-mnencia@kcore.it> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260327090753.1481453-1-mnencia@kcore.it> References: <20260327090753.1481453-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" Some ACPI INT3472 devices include a GPIO with DSM type 0x02, used for IR flood (strobe) illumination. This GPIO type was previously unhandled, resulting in the following warning during probe: int3472-discrete INT3472:00: GPIO type 0x02 unknown; the sensor may not work Add INT3472_GPIO_TYPE_STROBE (0x02) handling that registers the GPIO as an LED class device via skl_int3472_register_led(). Unlike the privacy LED, the strobe LED is not consumed by the sensor driver, so no LED lookup is registered. Signed-off-by: Marco Nenciarini --- Cc: Andy Shevchenko drivers/platform/x86/intel/int3472/discrete.c | 13 +++++++++++++ drivers/platform/x86/intel/int3472/led.c | 2 ++ include/linux/platform_data/x86/int3472.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platfo= rm/x86/intel/int3472/discrete.c index 2c554a0..03f0b49 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -207,6 +207,10 @@ static void int3472_get_con_id_and_polarity(struct int= 3472_discrete_device *int3 *con_id =3D "powerdown"; *gpio_flags =3D GPIO_ACTIVE_LOW; break; + case INT3472_GPIO_TYPE_STROBE: + *con_id =3D "strobe"; + *gpio_flags =3D GPIO_ACTIVE_HIGH; + break; case INT3472_GPIO_TYPE_CLK_ENABLE: *con_id =3D "clk-enable"; *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 (IR flood LED) * 0x0b Power enable * 0x0c Clock enable * 0x0d Privacy LED @@ -329,6 +334,7 @@ static int skl_int3472_handle_gpio_resources(struct acp= i_resource *ares, err_msg =3D "Failed to map GPIO pin to sensor\n"; =20 break; + case INT3472_GPIO_TYPE_STROBE: case INT3472_GPIO_TYPE_CLK_ENABLE: case INT3472_GPIO_TYPE_PRIVACY_LED: case INT3472_GPIO_TYPE_POWER_ENABLE: @@ -353,6 +359,13 @@ static int skl_int3472_handle_gpio_resources(struct ac= pi_resource *ares, if (ret) err_msg =3D "Failed to register privacy LED\n"; =20 + break; + case INT3472_GPIO_TYPE_STROBE: + ret =3D skl_int3472_register_led(int3472, gpio, + INT3472_LED_TYPE_STROBE); + if (ret) + err_msg =3D "Failed to register strobe LED\n"; + break; case INT3472_GPIO_TYPE_POWER_ENABLE: second_sensor =3D int3472->quirks.avdd_second_sensor; diff --git a/drivers/platform/x86/intel/int3472/led.c b/drivers/platform/x8= 6/intel/int3472/led.c index 33b30f3..e6faba4 100644 --- a/drivers/platform/x86/intel/int3472/led.c +++ b/drivers/platform/x86/intel/int3472/led.c @@ -8,10 +8,12 @@ =20 static const char * const int3472_led_names[] =3D { [INT3472_LED_TYPE_PRIVACY] =3D "privacy", + [INT3472_LED_TYPE_STROBE] =3D "strobe", }; =20 static const char * const int3472_led_con_ids[] =3D { [INT3472_LED_TYPE_PRIVACY] =3D "privacy", + [INT3472_LED_TYPE_STROBE] =3D NULL, }; =20 static int int3472_led_set(struct led_classdev *led_cdev, diff --git a/include/linux/platform_data/x86/int3472.h b/include/linux/plat= form_data/x86/int3472.h index b6b5b36..9893711 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 @@ -71,6 +72,7 @@ =20 enum int3472_led_type { INT3472_LED_TYPE_PRIVACY, + INT3472_LED_TYPE_STROBE, }; =20 struct acpi_device; --=20 2.47.3