Extend the hx9023s driver to support ACPI matching by adding TYHX9023
to the ACPI device ID table.
Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
---
drivers/iio/proximity/hx9023s.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c
index b680b89956bd..6bf5a02c3615 100644
--- a/drivers/iio/proximity/hx9023s.c
+++ b/drivers/iio/proximity/hx9023s.c
@@ -8,6 +8,7 @@
* http://www.tianyihexin.com/ueditor/php/upload/file/20240614/1718336303992081.pdf
*/
+#include <linux/acpi.h>
#include <linux/array_size.h>
#include <linux/bitfield.h>
#include <linux/bitops.h>
@@ -1106,7 +1107,7 @@ static int hx9023s_probe(struct i2c_client *client)
ret = hx9023s_property_get(data);
if (ret)
- return dev_err_probe(dev, ret, "dts phase failed\n");
+ return dev_err_probe(dev, ret, "failed to get device properties\n");
ret = devm_regulator_get_enable(dev, "vdd");
if (ret)
@@ -1195,6 +1196,12 @@ static int hx9023s_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(hx9023s_pm_ops, hx9023s_suspend,
hx9023s_resume);
+static const struct acpi_device_id hx9023s_acpi_match[] = {
+ { "TYHX9023", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, hx9023s_acpi_match);
+
static const struct of_device_id hx9023s_of_match[] = {
{ .compatible = "tyhx,hx9023s" },
{ }
@@ -1210,6 +1217,7 @@ MODULE_DEVICE_TABLE(i2c, hx9023s_id);
static struct i2c_driver hx9023s_driver = {
.driver = {
.name = "hx9023s",
+ .acpi_match_table = hx9023s_acpi_match,
.of_match_table = hx9023s_of_match,
.pm = &hx9023s_pm_ops,
--
2.43.0