Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: int3472: Parameterize LED con_id in registration

Add a con_id parameter to skl_int3472_register_led() to allow callers
to specify both the LED name suffix and lookup con_id instead of
hardcoding "privacy". This prepares for registering additional LED
types with different names.

While at it, rename the privacy LED's GPIO con_id from "privacy-led"
to "privacy" in int3472_get_con_id_and_polarity() and pass it
directly to skl_int3472_register_led(), reducing churn when adding
new LED types.

No functional change.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Marco Nenciarini <mnencia@kcore.it>
Link: https://patch.msgid.link/20260401203638.1601661-4-mnencia@kcore.it
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Marco Nenciarini and committed by
Ilpo Järvinen
218d3c44 39237e32

+8 -6
+2 -2
drivers/platform/x86/intel/int3472/discrete.c
··· 212 212 *gpio_flags = GPIO_ACTIVE_HIGH; 213 213 break; 214 214 case INT3472_GPIO_TYPE_PRIVACY_LED: 215 - *con_id = "privacy-led"; 215 + *con_id = "privacy"; 216 216 *gpio_flags = GPIO_ACTIVE_HIGH; 217 217 break; 218 218 case INT3472_GPIO_TYPE_HOTPLUG_DETECT: ··· 354 354 355 355 break; 356 356 case INT3472_GPIO_TYPE_PRIVACY_LED: 357 - ret = skl_int3472_register_led(int3472, gpio); 357 + ret = skl_int3472_register_led(int3472, gpio, con_id); 358 358 if (ret) 359 359 err_msg = "Failed to register LED\n"; 360 360
+4 -3
drivers/platform/x86/intel/int3472/led.c
··· 14 14 return 0; 15 15 } 16 16 17 - int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio) 17 + int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio, 18 + const char *con_id) 18 19 { 19 20 struct int3472_led *led = &int3472->led; 20 21 char *p; ··· 28 27 29 28 /* Generate the name, replacing the ':' in the ACPI devname with '_' */ 30 29 snprintf(led->name, sizeof(led->name), 31 - "%s::privacy_led", acpi_dev_name(int3472->sensor)); 30 + "%s::%s_led", acpi_dev_name(int3472->sensor), con_id); 32 31 p = strchr(led->name, ':'); 33 32 if (p) 34 33 *p = '_'; ··· 43 42 44 43 led->lookup.provider = led->name; 45 44 led->lookup.dev_id = int3472->sensor_name; 46 - led->lookup.con_id = "privacy"; 45 + led->lookup.con_id = con_id; 47 46 led_add_lookup(&led->lookup); 48 47 49 48 return 0;
+2 -1
include/linux/platform_data/x86/int3472.h
··· 161 161 const char *second_sensor); 162 162 void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472); 163 163 164 - int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio); 164 + int skl_int3472_register_led(struct int3472_discrete_device *int3472, struct gpio_desc *gpio, 165 + const char *con_id); 165 166 void skl_int3472_unregister_led(struct int3472_discrete_device *int3472); 166 167 167 168 #endif