forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/iio/potentiometer/ad5272.c
....@@ -3,7 +3,7 @@
33 * Analog Devices AD5272 digital potentiometer driver
44 * Copyright (C) 2018 Phil Reid <preid@electromag.com.au>
55 *
6
- * Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5272_5274.pdf
6
+ * Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5272_5274.pdf
77 *
88 * DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address
99 * ad5272 1 1024 20, 50, 100 01011xx
....@@ -15,6 +15,7 @@
1515 #include <linux/i2c.h>
1616 #include <linux/iio/iio.h>
1717 #include <linux/module.h>
18
+#include <linux/mod_devicetable.h>
1819
1920 #define AD5272_RDAC_WR 1
2021 #define AD5272_RDAC_RD 2
....@@ -184,7 +185,6 @@
184185 if (ret < 0)
185186 return -ENODEV;
186187
187
- indio_dev->dev.parent = dev;
188188 indio_dev->info = &ad5272_info;
189189 indio_dev->channels = &ad5272_channel;
190190 indio_dev->num_channels = 1;
....@@ -193,7 +193,6 @@
193193 return devm_iio_device_register(dev, indio_dev);
194194 }
195195
196
-#if defined(CONFIG_OF)
197196 static const struct of_device_id ad5272_dt_ids[] = {
198197 { .compatible = "adi,ad5272-020", .data = (void *)AD5272_020 },
199198 { .compatible = "adi,ad5272-050", .data = (void *)AD5272_050 },
....@@ -203,7 +202,6 @@
203202 {}
204203 };
205204 MODULE_DEVICE_TABLE(of, ad5272_dt_ids);
206
-#endif /* CONFIG_OF */
207205
208206 static const struct i2c_device_id ad5272_id[] = {
209207 { "ad5272-020", AD5272_020 },
....@@ -218,7 +216,7 @@
218216 static struct i2c_driver ad5272_driver = {
219217 .driver = {
220218 .name = "ad5272",
221
- .of_match_table = of_match_ptr(ad5272_dt_ids),
219
+ .of_match_table = ad5272_dt_ids,
222220 },
223221 .probe = ad5272_probe,
224222 .id_table = ad5272_id,