aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel/int3472/discrete.c
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2025-04-17 11:13:32 +0000
committerIlpo Järvinen <[email protected]>2025-04-24 13:05:34 +0000
commit38ff83a374cdaf146ee6f6d1007419f7fad70e8f (patch)
tree7325a237626d0173a0afd80d679543329dddce09 /drivers/platform/x86/intel/int3472/discrete.c
parentplatform/x86: int3472: Drop unused gpio field from struct int3472_gpio_regulator (diff)
downloadkernel-38ff83a374cdaf146ee6f6d1007419f7fad70e8f.tar.gz
kernel-38ff83a374cdaf146ee6f6d1007419f7fad70e8f.zip
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 <[email protected]> Signed-off-by: Hans de Goede <[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] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/int3472/discrete.c')
-rw-r--r--drivers/platform/x86/intel/int3472/discrete.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c
index 30ff8f3ea1f5..cbf39459bdf0 100644
--- a/drivers/platform/x86/intel/int3472/discrete.c
+++ b/drivers/platform/x86/intel/int3472/discrete.c
@@ -5,6 +5,7 @@
#include <linux/array_size.h>
#include <linux/bitfield.h>
#include <linux/device.h>
+#include <linux/dmi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
@@ -310,7 +311,8 @@ 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);
+ ret = skl_int3472_register_regulator(int3472, gpio,
+ int3472->quirks.avdd_second_sensor);
if (ret)
err_msg = "Failed to map regulator to sensor\n";
@@ -378,13 +380,19 @@ static void skl_int3472_discrete_remove(struct platform_device *pdev)
static int skl_int3472_discrete_probe(struct platform_device *pdev)
{
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
+ const struct int3472_discrete_quirks *quirks = NULL;
struct int3472_discrete_device *int3472;
+ const struct dmi_system_id *id;
struct int3472_cldb cldb;
int ret;
if (!adev)
return -ENODEV;
+ id = dmi_first_match(skl_int3472_discrete_quirks);
+ if (id)
+ quirks = id->driver_data;
+
ret = skl_int3472_fill_cldb(adev, &cldb);
if (ret) {
dev_err(&pdev->dev, "Couldn't fill CLDB structure\n");
@@ -408,6 +416,9 @@ static int skl_int3472_discrete_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, int3472);
int3472->clock.imgclk_index = cldb.clock_source;
+ if (quirks)
+ int3472->quirks = *quirks;
+
ret = skl_int3472_get_sensor_adev_and_name(&pdev->dev, &int3472->sensor,
&int3472->sensor_name);
if (ret)