forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/staging/iio/addac/adt7316-spi.c
....@@ -1,10 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * API bus driver for ADT7316/7/8 ADT7516/7/9 digital temperature
34 * sensor, ADC and DAC
45 *
56 * Copyright 2010 Analog Devices Inc.
6
- *
7
- * Licensed under the GPL-2 or later.
87 */
98
109 #include <linux/device.h>
....@@ -27,7 +26,7 @@
2726 {
2827 struct spi_device *spi_dev = client;
2928 u8 cmd[2];
30
- int ret = 0;
29
+ int ret;
3130
3231 if (count > ADT7316_REG_MAX_ADDR)
3332 count = ADT7316_REG_MAX_ADDR;
....@@ -56,7 +55,7 @@
5655 {
5756 struct spi_device *spi_dev = client;
5857 u8 buf[ADT7316_REG_MAX_ADDR + 2];
59
- int i, ret = 0;
58
+ int i, ret;
6059
6160 if (count > ADT7316_REG_MAX_ADDR)
6261 count = ADT7316_REG_MAX_ADDR;
....@@ -94,7 +93,6 @@
9493 struct adt7316_bus bus = {
9594 .client = spi_dev,
9695 .irq = spi_dev->irq,
97
- .irq_flags = IRQF_TRIGGER_LOW,
9896 .read = adt7316_spi_read,
9997 .write = adt7316_spi_write,
10098 .multi_read = adt7316_spi_multi_read,
....@@ -128,9 +126,22 @@
128126
129127 MODULE_DEVICE_TABLE(spi, adt7316_spi_id);
130128
129
+static const struct of_device_id adt7316_of_spi_match[] = {
130
+ { .compatible = "adi,adt7316" },
131
+ { .compatible = "adi,adt7317" },
132
+ { .compatible = "adi,adt7318" },
133
+ { .compatible = "adi,adt7516" },
134
+ { .compatible = "adi,adt7517" },
135
+ { .compatible = "adi,adt7519" },
136
+ { }
137
+};
138
+
139
+MODULE_DEVICE_TABLE(of, adt7316_of_spi_match);
140
+
131141 static struct spi_driver adt7316_driver = {
132142 .driver = {
133143 .name = "adt7316",
144
+ .of_match_table = adt7316_of_spi_match,
134145 .pm = ADT7316_PM_OPS,
135146 },
136147 .probe = adt7316_spi_probe,