forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/iio/potentiometer/ds1803.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Maxim Integrated DS1803 digital potentiometer driver
34 * Copyright (c) 2016 Slawomir Stepien
....@@ -6,10 +7,6 @@
67 *
78 * DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address
89 * ds1803 2 256 10, 50, 100 0101xxx
9
- *
10
- * This program is free software; you can redistribute it and/or modify it
11
- * under the terms of the GNU General Public License version 2 as published by
12
- * the Free Software Foundation.
1310 */
1411
1512 #include <linux/err.h>
....@@ -17,7 +14,7 @@
1714 #include <linux/i2c.h>
1815 #include <linux/iio/iio.h>
1916 #include <linux/module.h>
20
-#include <linux/of.h>
17
+#include <linux/mod_devicetable.h>
2118
2219 #define DS1803_MAX_POS 255
2320 #define DS1803_WRITE(chan) (0xa8 | ((chan) + 1))
....@@ -129,7 +126,6 @@
129126 data->client = client;
130127 data->cfg = &ds1803_cfg[id->driver_data];
131128
132
- indio_dev->dev.parent = dev;
133129 indio_dev->info = &ds1803_info;
134130 indio_dev->channels = ds1803_channels;
135131 indio_dev->num_channels = ARRAY_SIZE(ds1803_channels);
....@@ -138,7 +134,6 @@
138134 return devm_iio_device_register(dev, indio_dev);
139135 }
140136
141
-#if defined(CONFIG_OF)
142137 static const struct of_device_id ds1803_dt_ids[] = {
143138 { .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] },
144139 { .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] },
....@@ -146,7 +141,6 @@
146141 {}
147142 };
148143 MODULE_DEVICE_TABLE(of, ds1803_dt_ids);
149
-#endif /* CONFIG_OF */
150144
151145 static const struct i2c_device_id ds1803_id[] = {
152146 { "ds1803-010", DS1803_010 },
....@@ -159,7 +153,7 @@
159153 static struct i2c_driver ds1803_driver = {
160154 .driver = {
161155 .name = "ds1803",
162
- .of_match_table = of_match_ptr(ds1803_dt_ids),
156
+ .of_match_table = ds1803_dt_ids,
163157 },
164158 .probe = ds1803_probe,
165159 .id_table = ds1803_id,