diff options
| author | Hans de Goede <[email protected]> | 2025-04-17 11:13:33 +0000 |
|---|---|---|
| committer | Ilpo Järvinen <[email protected]> | 2025-04-24 13:05:36 +0000 |
| commit | 033234bdc6cfb88a797a16aa3a9df815bbe01a28 (patch) | |
| tree | d66ccd53fabbafdab748342cab71d6f8f01b77ab /drivers/platform/x86/intel/int3472/common.h | |
| parent | platform/x86: int3472: Rework AVDD second sensor quirk handling (diff) | |
| download | kernel-033234bdc6cfb88a797a16aa3a9df815bbe01a28.tar.gz kernel-033234bdc6cfb88a797a16aa3a9df815bbe01a28.zip | |
platform/x86: int3472: Make regulator supply name configurable
This is a preparation patch for registering multiple regulators, which
requires a different supply-name for each regulator. Make supply-name
a parameter to skl_int3472_register_regulator() and use con-id to set it
so that the existing int3472_gpio_map remapping can be used with it.
Since supply-name is a parameter now, drop the fixed
skl_int3472_regulator_map_supplies[] array and instead add lower- and
upper-case mappings of the passed-in supply-name to the regulator.
Signed-off-by: Hans de Goede <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Tested-by: David Heidelberg <[email protected]> # Dell Latitude 9440
Reviewed-by: Sakari Ailus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ij: GPIO_SUPPPLY_NAME_LENGTH -> GPIO_SUPPLY_NAME_LENGTH]
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/int3472/common.h')
| -rw-r--r-- | drivers/platform/x86/intel/int3472/common.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/int3472/common.h b/drivers/platform/x86/intel/int3472/common.h index 3728f3864a84..4bfd60df06de 100644 --- a/drivers/platform/x86/intel/int3472/common.h +++ b/drivers/platform/x86/intel/int3472/common.h @@ -26,7 +26,11 @@ #define INT3472_PDEV_MAX_NAME_LEN 23 #define INT3472_MAX_SENSOR_GPIOS 3 -#define GPIO_REGULATOR_NAME_LENGTH 21 +/* E.g. "avdd\0" */ +#define GPIO_SUPPLY_NAME_LENGTH 5 +/* 12 chars for acpi_dev_name() + "-", e.g. "ABCD1234:00-" */ +#define GPIO_REGULATOR_NAME_LENGTH (12 + GPIO_SUPPLY_NAME_LENGTH) +/* lower- and upper-case mapping */ #define GPIO_REGULATOR_SUPPLY_MAP_COUNT 2 #define INT3472_LED_MAX_NAME_LEN 32 @@ -85,6 +89,7 @@ struct int3472_discrete_device { struct int3472_gpio_regulator { /* SUPPLY_MAP_COUNT * 2 to make room for second sensor mappings */ struct regulator_consumer_supply supply_map[GPIO_REGULATOR_SUPPLY_MAP_COUNT * 2]; + char supply_name_upper[GPIO_SUPPLY_NAME_LENGTH]; char regulator_name[GPIO_REGULATOR_NAME_LENGTH]; struct regulator_dev *rdev; struct regulator_desc rdesc; @@ -129,6 +134,7 @@ void skl_int3472_unregister_clock(struct int3472_discrete_device *int3472); int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, struct gpio_desc *gpio, + const char *supply_name, const char *second_sensor); void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472); |
