summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel/int3472/common.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2025-04-17 13:13:32 +0200
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-04-24 16:05:34 +0300
commit38ff83a374cdaf146ee6f6d1007419f7fad70e8f (patch)
tree7325a237626d0173a0afd80d679543329dddce09 /drivers/platform/x86/intel/int3472/common.h
parentb6d3d739b72ae1913d18d62126aee6039e2a42b1 (diff)
platform/x86: int3472: Rework AVDD second sensor quirk handling
Rework the discrete quirk handling to use a quirks struct which is pointed to by a dmi_system_id table, rather then having a dmi_system_id table per type of quirk. This is a preparation patch for adding support for multiple regulators, where not all regulators might be shared between sensors. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: David Heidelberg <david@ixit.cz> # Dell Latitude 9440 Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20250417111337.38142-5-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel/int3472/common.h')
-rw-r--r--drivers/platform/x86/intel/int3472/common.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/int3472/common.h b/drivers/platform/x86/intel/int3472/common.h
index e0fa34be8a07..3728f3864a84 100644
--- a/drivers/platform/x86/intel/int3472/common.h
+++ b/drivers/platform/x86/intel/int3472/common.h
@@ -48,6 +48,7 @@
container_of(clk, struct int3472_discrete_device, clock)
struct acpi_device;
+struct dmi_system_id;
struct i2c_client;
struct platform_device;
@@ -68,6 +69,11 @@ struct int3472_cldb {
u8 reserved2[17];
};
+struct int3472_discrete_quirks {
+ /* For models where AVDD GPIO is shared between sensors */
+ const char *avdd_second_sensor;
+};
+
struct int3472_discrete_device {
struct acpi_device *adev;
struct device *dev;
@@ -100,11 +106,15 @@ struct int3472_discrete_device {
struct gpio_desc *gpio;
} pled;
+ struct int3472_discrete_quirks quirks;
+
unsigned int ngpios; /* how many GPIOs have we seen */
unsigned int n_sensor_gpios; /* how many have we mapped to sensor */
struct gpiod_lookup_table gpios;
};
+extern const struct dmi_system_id skl_int3472_discrete_quirks[];
+
union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev,
char *id);
int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb);
@@ -118,7 +128,8 @@ int skl_int3472_register_dsm_clock(struct int3472_discrete_device *int3472);
void skl_int3472_unregister_clock(struct int3472_discrete_device *int3472);
int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
- struct gpio_desc *gpio);
+ struct gpio_desc *gpio,
+ const char *second_sensor);
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472);
int skl_int3472_register_pled(struct int3472_discrete_device *int3472, struct gpio_desc *gpio);