blob: 28921b62e64203427a79272798ac9cea4f3c93ce [file] [log] [blame]
Thomas Gleixnerfda8d262019-05-28 09:57:06 -07001// SPDX-License-Identifier: GPL-2.0-only
Michael Hennerich59c23ea2011-04-04 15:39:15 +02002/*
3 * AD5504, AD5501 High Voltage Digital to Analog Converter
4 *
5 * Copyright 2011 Analog Devices Inc.
Michael Hennerich59c23ea2011-04-04 15:39:15 +02006 */
7
8#include <linux/interrupt.h>
Michael Hennerich59c23ea2011-04-04 15:39:15 +02009#include <linux/fs.h>
10#include <linux/device.h>
11#include <linux/kernel.h>
12#include <linux/spi/spi.h>
13#include <linux/slab.h>
14#include <linux/sysfs.h>
15#include <linux/regulator/consumer.h>
Paul Gortmaker99c97852011-07-03 15:49:50 -040016#include <linux/module.h>
Peter Meerwalda476bc02014-12-06 06:00:00 +000017#include <linux/bitops.h>
Michael Hennerich59c23ea2011-04-04 15:39:15 +020018
Jonathan Cameron06458e22012-04-25 15:54:58 +010019#include <linux/iio/iio.h>
20#include <linux/iio/sysfs.h>
21#include <linux/iio/events.h>
Lars-Peter Clausendbdc0252012-06-04 11:36:28 +020022#include <linux/iio/dac/ad5504.h>
Michael Hennerich59c23ea2011-04-04 15:39:15 +020023
Peter Meerwalda476bc02014-12-06 06:00:00 +000024#define AD5504_RES_MASK GENMASK(11, 0)
25#define AD5504_CMD_READ BIT(15)
26#define AD5504_CMD_WRITE 0
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020027#define AD5504_ADDR(addr) ((addr) << 12)
28
29/* Registers */
30#define AD5504_ADDR_NOOP 0
31#define AD5504_ADDR_DAC(x) ((x) + 1)
32#define AD5504_ADDR_ALL_DAC 5
33#define AD5504_ADDR_CTRL 7
34
35/* Control Register */
36#define AD5504_DAC_PWR(ch) ((ch) << 2)
37#define AD5504_DAC_PWRDWN_MODE(mode) ((mode) << 6)
38#define AD5504_DAC_PWRDN_20K 0
39#define AD5504_DAC_PWRDN_3STATE 1
40
41/**
42 * struct ad5446_state - driver instance specific data
Peter Meerwalda476bc02014-12-06 06:00:00 +000043 * @spi: spi_device
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020044 * @reg: supply regulator
45 * @vref_mv: actual reference voltage used
Lee Jones57f335c2020-07-17 17:55:20 +010046 * @pwr_down_mask: power down mask
47 * @pwr_down_mode: current power down mode
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000048 * @data: transfer buffer
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020049 */
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020050struct ad5504_state {
51 struct spi_device *spi;
52 struct regulator *reg;
53 unsigned short vref_mv;
54 unsigned pwr_down_mask;
55 unsigned pwr_down_mode;
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000056
57 __be16 data[2] ____cacheline_aligned;
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020058};
59
Lee Jones57f335c2020-07-17 17:55:20 +010060/*
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020061 * ad5504_supported_device_ids:
62 */
Lars-Peter Clausena98348b2012-06-04 11:36:26 +020063enum ad5504_supported_device_ids {
64 ID_AD5504,
65 ID_AD5501,
66};
67
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000068static int ad5504_spi_write(struct ad5504_state *st, u8 addr, u16 val)
Michael Hennerich59c23ea2011-04-04 15:39:15 +020069{
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000070 st->data[0] = cpu_to_be16(AD5504_CMD_WRITE | AD5504_ADDR(addr) |
Michael Hennerich59c23ea2011-04-04 15:39:15 +020071 (val & AD5504_RES_MASK));
72
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000073 return spi_write(st->spi, &st->data[0], 2);
Michael Hennerich59c23ea2011-04-04 15:39:15 +020074}
75
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000076static int ad5504_spi_read(struct ad5504_state *st, u8 addr)
Michael Hennerich59c23ea2011-04-04 15:39:15 +020077{
Michael Hennerich59c23ea2011-04-04 15:39:15 +020078 int ret;
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000079 struct spi_transfer t = {
80 .tx_buf = &st->data[0],
81 .rx_buf = &st->data[1],
82 .len = 2,
83 };
Michael Hennerich59c23ea2011-04-04 15:39:15 +020084
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000085 st->data[0] = cpu_to_be16(AD5504_CMD_READ | AD5504_ADDR(addr));
86 ret = spi_sync_transfer(st->spi, &t, 1);
Lars-Peter Clausena7b15282011-11-15 16:31:23 +010087 if (ret < 0)
Michael Hennerich59c23ea2011-04-04 15:39:15 +020088 return ret;
89
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +000090 return be16_to_cpu(st->data[1]) & AD5504_RES_MASK;
Michael Hennerich59c23ea2011-04-04 15:39:15 +020091}
92
Lars-Peter Clausena7b15282011-11-15 16:31:23 +010093static int ad5504_read_raw(struct iio_dev *indio_dev,
94 struct iio_chan_spec const *chan,
95 int *val,
96 int *val2,
97 long m)
Michael Hennerich59c23ea2011-04-04 15:39:15 +020098{
Jonathan Camerona3684de2011-06-27 13:07:32 +010099 struct ad5504_state *st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200100 int ret;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200101
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100102 switch (m) {
Jonathan Cameron09f4eb42012-04-15 17:41:19 +0100103 case IIO_CHAN_INFO_RAW:
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +0000104 ret = ad5504_spi_read(st, chan->address);
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100105 if (ret < 0)
106 return ret;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200107
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100108 *val = ret;
109
110 return IIO_VAL_INT;
111 case IIO_CHAN_INFO_SCALE:
Lars-Peter Clausen54ea1432013-09-28 10:31:00 +0100112 *val = st->vref_mv;
113 *val2 = chan->scan_type.realbits;
114 return IIO_VAL_FRACTIONAL_LOG2;
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100115 }
116 return -EINVAL;
117}
118
119static int ad5504_write_raw(struct iio_dev *indio_dev,
120 struct iio_chan_spec const *chan,
121 int val,
122 int val2,
123 long mask)
124{
125 struct ad5504_state *st = iio_priv(indio_dev);
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100126
127 switch (mask) {
Jonathan Cameron09f4eb42012-04-15 17:41:19 +0100128 case IIO_CHAN_INFO_RAW:
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100129 if (val >= (1 << chan->scan_type.realbits) || val < 0)
130 return -EINVAL;
131
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +0000132 return ad5504_spi_write(st, chan->address, val);
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100133 default:
Sachin Kamat0d3a9b22014-03-07 07:38:00 +0000134 return -EINVAL;
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100135 }
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200136}
137
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200138static const char * const ad5504_powerdown_modes[] = {
139 "20kohm_to_gnd",
140 "three_state",
141};
142
143static int ad5504_get_powerdown_mode(struct iio_dev *indio_dev,
144 const struct iio_chan_spec *chan)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200145{
Jonathan Camerona3684de2011-06-27 13:07:32 +0100146 struct ad5504_state *st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200147
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200148 return st->pwr_down_mode;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200149}
150
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200151static int ad5504_set_powerdown_mode(struct iio_dev *indio_dev,
152 const struct iio_chan_spec *chan, unsigned int mode)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200153{
Jonathan Camerona3684de2011-06-27 13:07:32 +0100154 struct ad5504_state *st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200155
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200156 st->pwr_down_mode = mode;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200157
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200158 return 0;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200159}
160
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200161static const struct iio_enum ad5504_powerdown_mode_enum = {
162 .items = ad5504_powerdown_modes,
163 .num_items = ARRAY_SIZE(ad5504_powerdown_modes),
164 .get = ad5504_get_powerdown_mode,
165 .set = ad5504_set_powerdown_mode,
166};
167
168static ssize_t ad5504_read_dac_powerdown(struct iio_dev *indio_dev,
169 uintptr_t private, const struct iio_chan_spec *chan, char *buf)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200170{
Jonathan Camerona3684de2011-06-27 13:07:32 +0100171 struct ad5504_state *st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200172
173 return sprintf(buf, "%d\n",
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200174 !(st->pwr_down_mask & (1 << chan->channel)));
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200175}
176
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200177static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev,
178 uintptr_t private, const struct iio_chan_spec *chan, const char *buf,
179 size_t len)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200180{
Lars-Peter Clausen3bbbf152012-06-04 11:36:22 +0200181 bool pwr_down;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200182 int ret;
Jonathan Camerona3684de2011-06-27 13:07:32 +0100183 struct ad5504_state *st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200184
Lars-Peter Clausen3bbbf152012-06-04 11:36:22 +0200185 ret = strtobool(buf, &pwr_down);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200186 if (ret)
187 return ret;
188
Lars-Peter Clausen3bbbf152012-06-04 11:36:22 +0200189 if (pwr_down)
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200190 st->pwr_down_mask |= (1 << chan->channel);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200191 else
Lars-Peter Clausen3bbbf152012-06-04 11:36:22 +0200192 st->pwr_down_mask &= ~(1 << chan->channel);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200193
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +0000194 ret = ad5504_spi_write(st, AD5504_ADDR_CTRL,
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200195 AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) |
196 AD5504_DAC_PWR(st->pwr_down_mask));
197
198 /* writes to the CTRL register must be followed by a NOOP */
Lars-Peter Clausen0dbe59c2013-11-25 12:41:00 +0000199 ad5504_spi_write(st, AD5504_ADDR_NOOP, 0);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200200
201 return ret ? ret : len;
202}
203
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200204static IIO_CONST_ATTR(temp0_thresh_rising_value, "110000");
205static IIO_CONST_ATTR(temp0_thresh_rising_en, "1");
206
207static struct attribute *ad5504_ev_attributes[] = {
208 &iio_const_attr_temp0_thresh_rising_value.dev_attr.attr,
209 &iio_const_attr_temp0_thresh_rising_en.dev_attr.attr,
210 NULL,
211};
212
simran singhale36020f2017-03-29 01:51:48 +0530213static const struct attribute_group ad5504_ev_attribute_group = {
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200214 .attrs = ad5504_ev_attributes,
215};
216
Jonathan Cameronce298d42011-05-18 14:41:04 +0100217static irqreturn_t ad5504_event_handler(int irq, void *private)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200218{
Jonathan Cameron5aa96182011-08-30 12:41:06 +0100219 iio_push_event(private,
Jonathan Cameronc4b14d92011-08-12 17:56:04 +0100220 IIO_UNMOD_EVENT_CODE(IIO_TEMP,
Jonathan Cameronce298d42011-05-18 14:41:04 +0100221 0,
222 IIO_EV_TYPE_THRESH,
223 IIO_EV_DIR_RISING),
simran singhal4d925082017-04-01 19:41:53 +0530224 iio_get_time_ns(private));
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200225
Jonathan Cameronce298d42011-05-18 14:41:04 +0100226 return IRQ_HANDLED;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200227}
228
Jonathan Cameron6fe81352011-05-18 14:42:37 +0100229static const struct iio_info ad5504_info = {
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100230 .write_raw = ad5504_write_raw,
231 .read_raw = ad5504_read_raw,
Jonathan Cameron6fe81352011-05-18 14:42:37 +0100232 .event_attrs = &ad5504_ev_attribute_group,
Jonathan Cameron6fe81352011-05-18 14:42:37 +0100233};
234
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200235static const struct iio_chan_spec_ext_info ad5504_ext_info[] = {
236 {
237 .name = "powerdown",
238 .read = ad5504_read_dac_powerdown,
239 .write = ad5504_write_dac_powerdown,
Jonathan Cameron37044322013-09-08 14:57:00 +0100240 .shared = IIO_SEPARATE,
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200241 },
Jonathan Cameron37044322013-09-08 14:57:00 +0100242 IIO_ENUM("powerdown_mode", IIO_SHARED_BY_TYPE,
243 &ad5504_powerdown_mode_enum),
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200244 IIO_ENUM_AVAILABLE("powerdown_mode", &ad5504_powerdown_mode_enum),
245 { },
246};
247
248#define AD5504_CHANNEL(_chan) { \
249 .type = IIO_VOLTAGE, \
250 .indexed = 1, \
251 .output = 1, \
252 .channel = (_chan), \
Jonathan Cameronf3ec5a22013-02-27 19:11:04 +0000253 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
254 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200255 .address = AD5504_ADDR_DAC(_chan), \
Jonathan Cameron73d3a772013-12-11 18:45:00 +0000256 .scan_type = { \
257 .sign = 'u', \
258 .realbits = 12, \
259 .storagebits = 16, \
260 }, \
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200261 .ext_info = ad5504_ext_info, \
262}
263
264static const struct iio_chan_spec ad5504_channels[] = {
265 AD5504_CHANNEL(0),
266 AD5504_CHANNEL(1),
267 AD5504_CHANNEL(2),
268 AD5504_CHANNEL(3),
Jonathan Cameron6fe81352011-05-18 14:42:37 +0100269};
270
Greg Kroah-Hartmanfc526922012-12-21 13:21:43 -0800271static int ad5504_probe(struct spi_device *spi)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200272{
273 struct ad5504_platform_data *pdata = spi->dev.platform_data;
Jonathan Camerona3684de2011-06-27 13:07:32 +0100274 struct iio_dev *indio_dev;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200275 struct ad5504_state *st;
Jonathan Camerona3684de2011-06-27 13:07:32 +0100276 struct regulator *reg;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200277 int ret, voltage_uv = 0;
278
Sachin Kamat8571ebf2013-08-19 12:38:00 +0100279 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
280 if (!indio_dev)
281 return -ENOMEM;
282 reg = devm_regulator_get(&spi->dev, "vcc");
Jonathan Camerona3684de2011-06-27 13:07:32 +0100283 if (!IS_ERR(reg)) {
284 ret = regulator_enable(reg);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200285 if (ret)
Sachin Kamat8571ebf2013-08-19 12:38:00 +0100286 return ret;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200287
Axel Lin0ce2fda2012-12-14 12:06:00 +0000288 ret = regulator_get_voltage(reg);
289 if (ret < 0)
290 goto error_disable_reg;
291
292 voltage_uv = ret;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200293 }
294
Jonathan Camerona3684de2011-06-27 13:07:32 +0100295 spi_set_drvdata(spi, indio_dev);
296 st = iio_priv(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200297 if (voltage_uv)
298 st->vref_mv = voltage_uv / 1000;
299 else if (pdata)
300 st->vref_mv = pdata->vref_mv;
301 else
302 dev_warn(&spi->dev, "reference voltage unspecified\n");
303
Jonathan Camerona3684de2011-06-27 13:07:32 +0100304 st->reg = reg;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200305 st->spi = spi;
Jonathan Camerona3684de2011-06-27 13:07:32 +0100306 indio_dev->name = spi_get_device_id(st->spi)->name;
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200307 indio_dev->info = &ad5504_info;
308 if (spi_get_device_id(st->spi)->driver_data == ID_AD5501)
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100309 indio_dev->num_channels = 1;
Lars-Peter Clausen8d05d772012-06-04 11:36:15 +0200310 else
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100311 indio_dev->num_channels = 4;
Lars-Peter Clausena7b15282011-11-15 16:31:23 +0100312 indio_dev->channels = ad5504_channels;
Jonathan Camerona3684de2011-06-27 13:07:32 +0100313 indio_dev->modes = INDIO_DIRECT_MODE;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200314
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200315 if (spi->irq) {
Sachin Kamat8571ebf2013-08-19 12:38:00 +0100316 ret = devm_request_threaded_irq(&spi->dev, spi->irq,
Jonathan Cameronce298d42011-05-18 14:41:04 +0100317 NULL,
318 &ad5504_event_handler,
319 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
320 spi_get_device_id(st->spi)->name,
Jonathan Camerona3684de2011-06-27 13:07:32 +0100321 indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200322 if (ret)
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100323 goto error_disable_reg;
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200324 }
325
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100326 ret = iio_device_register(indio_dev);
327 if (ret)
Sachin Kamat8571ebf2013-08-19 12:38:00 +0100328 goto error_disable_reg;
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100329
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200330 return 0;
331
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200332error_disable_reg:
Jonathan Camerona3684de2011-06-27 13:07:32 +0100333 if (!IS_ERR(reg))
Jonathan Cameron0cbb2b52011-08-12 16:55:33 +0100334 regulator_disable(reg);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200335
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200336 return ret;
337}
338
Greg Kroah-Hartmanfc526922012-12-21 13:21:43 -0800339static int ad5504_remove(struct spi_device *spi)
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200340{
Jonathan Camerona3684de2011-06-27 13:07:32 +0100341 struct iio_dev *indio_dev = spi_get_drvdata(spi);
342 struct ad5504_state *st = iio_priv(indio_dev);
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100343
Jonathan Camerond2fffd62011-10-14 14:46:58 +0100344 iio_device_unregister(indio_dev);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200345
Sachin Kamat8571ebf2013-08-19 12:38:00 +0100346 if (!IS_ERR(st->reg))
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100347 regulator_disable(st->reg);
Jonathan Cameron26d25ae2011-09-02 17:14:40 +0100348
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200349 return 0;
350}
351
352static const struct spi_device_id ad5504_id[] = {
353 {"ad5504", ID_AD5504},
354 {"ad5501", ID_AD5501},
355 {}
356};
Lars-Peter Clausen55e43902011-11-16 08:53:31 +0100357MODULE_DEVICE_TABLE(spi, ad5504_id);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200358
359static struct spi_driver ad5504_driver = {
360 .driver = {
361 .name = "ad5504",
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200362 },
363 .probe = ad5504_probe,
Greg Kroah-Hartmanfc526922012-12-21 13:21:43 -0800364 .remove = ad5504_remove,
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200365 .id_table = ad5504_id,
366};
Lars-Peter Clausenae6ae6f2011-11-16 10:13:39 +0100367module_spi_driver(ad5504_driver);
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200368
Michael Hennerich9920ed22018-08-14 13:23:17 +0200369MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
Michael Hennerich59c23ea2011-04-04 15:39:15 +0200370MODULE_DESCRIPTION("Analog Devices AD5501/AD5501 DAC");
371MODULE_LICENSE("GPL v2");