Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25fc503e authored by Shrirang Bagul's avatar Shrirang Bagul Committed by Jonathan Cameron
Browse files

iio: humidity: Support acpi probe for hts211



Support driver probe by reading unique HID on systems based on ACPI instead
of DT compatible strings.

Signed-off-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 9d317724
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/acpi.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include "hts221.h"
@@ -83,6 +84,12 @@ static int hts221_i2c_probe(struct i2c_client *client,
	return hts221_probe(iio_dev);
}

static const struct acpi_device_id hts221_acpi_match[] = {
	{"SMO9100", 0},
	{ },
};
MODULE_DEVICE_TABLE(acpi, hts221_acpi_match);

static const struct of_device_id hts221_i2c_of_match[] = {
	{ .compatible = "st,hts221", },
	{},
@@ -99,6 +106,7 @@ static struct i2c_driver hts221_driver = {
	.driver = {
		.name = "hts221_i2c",
		.of_match_table = of_match_ptr(hts221_i2c_of_match),
		.acpi_match_table = ACPI_PTR(hts221_acpi_match),
	},
	.probe = hts221_i2c_probe,
	.id_table = hts221_i2c_id_table,