ad5272.c (14e77332e74603efab8347c89d3cda447c3b97c9) ad5272.c (b11df8374c0d0581474e0b8f74a7ba8f4a10be7d)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Analog Devices AD5272 digital potentiometer driver
4 * Copyright (C) 2018 Phil Reid <preid@electromag.com.au>
5 *
6 * Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5272_5274.pdf
7 *
8 * DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address

--- 144 unchanged lines hidden (view full) ---

153 } else {
154 ad5272_write(data, AD5272_RESET, 0);
155 }
156 usleep_range(1000, 2000);
157
158 return 0;
159}
160
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Analog Devices AD5272 digital potentiometer driver
4 * Copyright (C) 2018 Phil Reid <preid@electromag.com.au>
5 *
6 * Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5272_5274.pdf
7 *
8 * DEVID #Wipers #Positions Resistor Opts (kOhm) i2c address

--- 144 unchanged lines hidden (view full) ---

153 } else {
154 ad5272_write(data, AD5272_RESET, 0);
155 }
156 usleep_range(1000, 2000);
157
158 return 0;
159}
160
161static int ad5272_probe(struct i2c_client *client,
162 const struct i2c_device_id *id)
161static int ad5272_probe(struct i2c_client *client)
163{
162{
163 const struct i2c_device_id *id = i2c_client_get_device_id(client);
164 struct device *dev = &client->dev;
165 struct iio_dev *indio_dev;
166 struct ad5272_data *data;
167 int ret;
168
169 indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
170 if (!indio_dev)
171 return -ENOMEM;

--- 41 unchanged lines hidden (view full) ---

213};
214MODULE_DEVICE_TABLE(i2c, ad5272_id);
215
216static struct i2c_driver ad5272_driver = {
217 .driver = {
218 .name = "ad5272",
219 .of_match_table = ad5272_dt_ids,
220 },
164 struct device *dev = &client->dev;
165 struct iio_dev *indio_dev;
166 struct ad5272_data *data;
167 int ret;
168
169 indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
170 if (!indio_dev)
171 return -ENOMEM;

--- 41 unchanged lines hidden (view full) ---

213};
214MODULE_DEVICE_TABLE(i2c, ad5272_id);
215
216static struct i2c_driver ad5272_driver = {
217 .driver = {
218 .name = "ad5272",
219 .of_match_table = ad5272_dt_ids,
220 },
221 .probe = ad5272_probe,
221 .probe_new = ad5272_probe,
222 .id_table = ad5272_id,
223};
224
225module_i2c_driver(ad5272_driver);
226
227MODULE_AUTHOR("Phil Reid <preid@eletromag.com.au>");
228MODULE_DESCRIPTION("AD5272 digital potentiometer");
229MODULE_LICENSE("GPL v2");
222 .id_table = ad5272_id,
223};
224
225module_i2c_driver(ad5272_driver);
226
227MODULE_AUTHOR("Phil Reid <preid@eletromag.com.au>");
228MODULE_DESCRIPTION("AD5272 digital potentiometer");
229MODULE_LICENSE("GPL v2");