diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-10-04 15:28:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-10-04 15:28:18 -0700 |
commit | b66451723c45b791fd2824d1b8f62fe498989e23 (patch) | |
tree | f178b8b9a4d8b20786378c98854bf4a62a0ee380 /drivers/platform/x86/intel/int3472/discrete.c | |
parent | b4e5bb555594826bb98aaf8bcd9f957f0428cb07 (diff) | |
parent | b8754092dfed4fc2fcdb0de32a029ba8f9b464b6 (diff) |
Merge tag 'platform-drivers-x86-v6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Ilpo Järvinen:
- amd/pmf:
- Add support for adjusting PMF PPT and PPT APU thresholds
- Extend custom BIOS inputs for more policies
- Update ta_pmf_action structure to the latest PMF TA
- arm64:
- thinkpad-t14s-ec: Add EC driver for ThinkPad T14s Gen6 Snapdragon
- int3472:
- Increase handshake GPIO delay
- intel/pmc:
- SSRAM support for Lunar Lake and Panther Lake
- Support reading substate requirements data from S0ix blockers
(for platforms starting from Panther Lake)
- Wildcat Lake support
- intel-uncore-freq:
- Solve duplicate sysfs entry warnings
- Present unique domain ID per package
- portwell-ec:
- Support suspend/resume
- Add hwmon support for voltage and temperature
- redmi-wmi:
- Add WMI driver for Redmibook keyboard
- think-lmi:
- Certificate support for ThinkCenter
- x86-android-tables + others:
- Convert away from legacy GPIO APIs
- x86-android-tables:
- Add support for Acer A1-840 tablet
- Fix modules list for Lenovo devices
- Stop using EPROBE_DEFER
- Miscellaneous cleanups / refactoring / improvements
* tag 'platform-drivers-x86-v6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (63 commits)
platform/x86: pcengines-apuv2: Use static device properties
platform/x86: meraki-mx100: Use static device properties
platform/x86: barco-p50-gpio: use software nodes for gpio-leds/keys
platform/x86: x86-android-tablets: Stop using EPROBE_DEFER
platform/x86: x86-android-tablets: Fix modules lists for Lenovo devices
platform/x86: x86-android-tablets: Simplify lenovo_yoga_tab2_830_1050_exit()
platform/x86: x86-android-tablets: Add support for Acer A1-840 tablet
platform/x86: x86-android-tablets: Move Acer info to its own file
platform/x86: x86-android-tablets: Update my email address
platform/x86: x86-android-tablets: Simplify node-group [un]registration
platform/x86: x86-android-tablets: use swnode_group instead of manual registering
platform/x86: x86-android-tablets: replace bat_swnode with swnode_group
platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references
platform/x86: x86-android-tablets: remove support for GPIO lookup tables
platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger to GPIO references
platform/x86: x86-android-tablets: convert HID-I2C devices to GPIO references
platform/x86: x86-android-tablets: convert wm1502 devices to GPIO references
platform/x86: x86-android-tablets: convert int3496 devices to GPIO references
platform/x86: x86-android-tablets: convert EDT devices to GPIO references
platform/x86: x86-android-tablets: convert Novatek devices to GPIO references
...
Diffstat (limited to 'drivers/platform/x86/intel/int3472/discrete.c')
-rw-r--r-- | drivers/platform/x86/intel/int3472/discrete.c | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index bdfb8a800c54..1505fc3ef7a8 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -129,6 +129,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, * @hid: The ACPI HID of the device without the instance number e.g. INT347E * @type_from: The GPIO type from ACPI ?SDT * @type_to: The assigned GPIO type, typically same as @type_from + * @enable_time_us: Enable time in usec for GPIOs mapped to regulators * @con_id: The name of the GPIO for the device * @polarity_low: GPIO_ACTIVE_LOW true if the @polarity_low is true, * GPIO_ACTIVE_HIGH otherwise @@ -138,18 +139,36 @@ struct int3472_gpio_map { u8 type_from; u8 type_to; bool polarity_low; + unsigned int enable_time_us; const char *con_id; }; static const struct int3472_gpio_map int3472_gpio_map[] = { - /* mt9m114 designs declare a powerdown pin which controls the regulators */ - { "INT33F0", INT3472_GPIO_TYPE_POWERDOWN, INT3472_GPIO_TYPE_POWER_ENABLE, false, "vdd" }, - /* ov7251 driver / DT-bindings expect "enable" as con_id for reset */ - { "INT347E", INT3472_GPIO_TYPE_RESET, INT3472_GPIO_TYPE_RESET, false, "enable" }, + { /* mt9m114 designs declare a powerdown pin which controls the regulators */ + .hid = "INT33F0", + .type_from = INT3472_GPIO_TYPE_POWERDOWN, + .type_to = INT3472_GPIO_TYPE_POWER_ENABLE, + .con_id = "vdd", + .enable_time_us = GPIO_REGULATOR_ENABLE_TIME, + }, + { /* ov7251 driver / DT-bindings expect "enable" as con_id for reset */ + .hid = "INT347E", + .type_from = INT3472_GPIO_TYPE_RESET, + .type_to = INT3472_GPIO_TYPE_RESET, + .con_id = "enable", + }, + { /* ov08x40's handshake pin needs a 45 ms delay on some HP laptops */ + .hid = "OVTI08F4", + .type_from = INT3472_GPIO_TYPE_HANDSHAKE, + .type_to = INT3472_GPIO_TYPE_HANDSHAKE, + .con_id = "dvdd", + .enable_time_us = 45 * USEC_PER_MSEC, + }, }; static void int3472_get_con_id_and_polarity(struct int3472_discrete_device *int3472, u8 *type, - const char **con_id, unsigned long *gpio_flags) + const char **con_id, unsigned long *gpio_flags, + unsigned int *enable_time_us) { struct acpi_device *adev = int3472->sensor; unsigned int i; @@ -173,9 +192,12 @@ static void int3472_get_con_id_and_polarity(struct int3472_discrete_device *int3 *gpio_flags = int3472_gpio_map[i].polarity_low ? GPIO_ACTIVE_LOW : GPIO_ACTIVE_HIGH; *con_id = int3472_gpio_map[i].con_id; + *enable_time_us = int3472_gpio_map[i].enable_time_us; return; } + *enable_time_us = GPIO_REGULATOR_ENABLE_TIME; + switch (*type) { case INT3472_GPIO_TYPE_RESET: *con_id = "reset"; @@ -204,6 +226,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; break; default: *con_id = "unknown"; @@ -249,13 +273,15 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, void *data) { struct int3472_discrete_device *int3472 = data; + const char *second_sensor = NULL; struct acpi_resource_gpio *agpio; + unsigned int enable_time_us; u8 active_value, pin, type; + unsigned long gpio_flags; union acpi_object *obj; struct gpio_desc *gpio; const char *err_msg; const char *con_id; - unsigned long gpio_flags; int ret; if (!acpi_gpio_get_io_resource(ares, &agpio)) @@ -278,7 +304,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, type = FIELD_GET(INT3472_GPIO_DSM_TYPE, obj->integer.value); - int3472_get_con_id_and_polarity(int3472, &type, &con_id, &gpio_flags); + int3472_get_con_id_and_polarity(int3472, &type, &con_id, &gpio_flags, &enable_time_us); pin = FIELD_GET(INT3472_GPIO_DSM_PIN, obj->integer.value); /* Pin field is not really used under Windows and wraps around at 8 bits */ @@ -328,21 +354,13 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, break; case INT3472_GPIO_TYPE_POWER_ENABLE: - ret = skl_int3472_register_regulator(int3472, gpio, - GPIO_REGULATOR_ENABLE_TIME, - con_id, - int3472->quirks.avdd_second_sensor); - if (ret) - err_msg = "Failed to map power-enable to sensor\n"; - - break; + second_sensor = int3472->quirks.avdd_second_sensor; + fallthrough; case INT3472_GPIO_TYPE_HANDSHAKE: - /* Setups using a handshake pin need 25 ms enable delay */ - ret = skl_int3472_register_regulator(int3472, gpio, - 25 * USEC_PER_MSEC, - con_id, NULL); + ret = skl_int3472_register_regulator(int3472, gpio, enable_time_us, + con_id, second_sensor); if (ret) - err_msg = "Failed to map handshake to sensor\n"; + err_msg = "Failed to register regulator\n"; break; default: /* Never reached */ |