Thomas Gleixner | a10e763 | 2019-05-31 01:09:32 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 2 | /* |
| 3 | * An hwmon driver for the Analog Devices AD7416/17/18 |
| 4 | * Copyright (C) 2006-07 Tower Technologies |
| 5 | * |
| 6 | * Author: Alessandro Zummo <a.zummo@towertech.it> |
| 7 | * |
| 8 | * Based on lm75.c |
| 9 | * Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl> |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <linux/module.h> |
| 13 | #include <linux/jiffies.h> |
| 14 | #include <linux/i2c.h> |
| 15 | #include <linux/hwmon.h> |
| 16 | #include <linux/hwmon-sysfs.h> |
| 17 | #include <linux/err.h> |
| 18 | #include <linux/mutex.h> |
Linus Walleij | f4c2965 | 2019-01-28 22:06:37 +0100 | [diff] [blame] | 19 | #include <linux/of_device.h> |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 20 | #include <linux/delay.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 21 | #include <linux/slab.h> |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 22 | |
| 23 | #include "lm75.h" |
| 24 | |
Jean Delvare | 369932f | 2008-07-16 19:30:08 +0200 | [diff] [blame] | 25 | #define DRV_VERSION "0.4" |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 26 | |
Jean Delvare | 369932f | 2008-07-16 19:30:08 +0200 | [diff] [blame] | 27 | enum chips { ad7416, ad7417, ad7418 }; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 28 | |
| 29 | /* AD7418 registers */ |
| 30 | #define AD7418_REG_TEMP_IN 0x00 |
| 31 | #define AD7418_REG_CONF 0x01 |
| 32 | #define AD7418_REG_TEMP_HYST 0x02 |
| 33 | #define AD7418_REG_TEMP_OS 0x03 |
| 34 | #define AD7418_REG_ADC 0x04 |
| 35 | #define AD7418_REG_CONF2 0x05 |
| 36 | |
| 37 | #define AD7418_REG_ADC_CH(x) ((x) << 5) |
| 38 | #define AD7418_CH_TEMP AD7418_REG_ADC_CH(0) |
| 39 | |
| 40 | static const u8 AD7418_REG_TEMP[] = { AD7418_REG_TEMP_IN, |
| 41 | AD7418_REG_TEMP_HYST, |
| 42 | AD7418_REG_TEMP_OS }; |
| 43 | |
| 44 | struct ad7418_data { |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 45 | struct i2c_client *client; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 46 | enum chips type; |
| 47 | struct mutex lock; |
| 48 | int adc_max; /* number of ADC channels */ |
| 49 | char valid; |
| 50 | unsigned long last_updated; /* In jiffies */ |
| 51 | s16 temp[3]; /* Register values */ |
| 52 | u16 in[4]; |
| 53 | }; |
| 54 | |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 55 | static int ad7418_update_device(struct device *dev) |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 56 | { |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 57 | struct ad7418_data *data = dev_get_drvdata(dev); |
| 58 | struct i2c_client *client = data->client; |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 59 | s32 val; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 60 | |
| 61 | mutex_lock(&data->lock); |
| 62 | |
| 63 | if (time_after(jiffies, data->last_updated + HZ + HZ / 2) |
| 64 | || !data->valid) { |
| 65 | u8 cfg; |
| 66 | int i, ch; |
| 67 | |
| 68 | /* read config register and clear channel bits */ |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 69 | val = i2c_smbus_read_byte_data(client, AD7418_REG_CONF); |
| 70 | if (val < 0) |
| 71 | goto abort; |
| 72 | |
| 73 | cfg = val; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 74 | cfg &= 0x1F; |
| 75 | |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 76 | val = i2c_smbus_write_byte_data(client, AD7418_REG_CONF, |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 77 | cfg | AD7418_CH_TEMP); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 78 | if (val < 0) |
| 79 | goto abort; |
| 80 | |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 81 | udelay(30); |
| 82 | |
| 83 | for (i = 0; i < 3; i++) { |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 84 | val = i2c_smbus_read_word_swapped(client, |
| 85 | AD7418_REG_TEMP[i]); |
| 86 | if (val < 0) |
| 87 | goto abort; |
| 88 | |
| 89 | data->temp[i] = val; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | for (i = 0, ch = 4; i < data->adc_max; i++, ch--) { |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 93 | val = i2c_smbus_write_byte_data(client, AD7418_REG_CONF, |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 94 | cfg | AD7418_REG_ADC_CH(ch)); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 95 | if (val < 0) |
| 96 | goto abort; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 97 | |
| 98 | udelay(15); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 99 | val = i2c_smbus_read_word_swapped(client, |
| 100 | AD7418_REG_ADC); |
| 101 | if (val < 0) |
| 102 | goto abort; |
| 103 | |
| 104 | data->in[data->adc_max - 1 - i] = val; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | /* restore old configuration value */ |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 108 | val = i2c_smbus_write_word_swapped(client, AD7418_REG_CONF, |
| 109 | cfg); |
| 110 | if (val < 0) |
| 111 | goto abort; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 112 | |
| 113 | data->last_updated = jiffies; |
| 114 | data->valid = 1; |
| 115 | } |
| 116 | |
| 117 | mutex_unlock(&data->lock); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 118 | return 0; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 119 | |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 120 | abort: |
| 121 | data->valid = 0; |
| 122 | mutex_unlock(&data->lock); |
| 123 | return val; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 124 | } |
| 125 | |
Guenter Roeck | 6fdc5d7 | 2018-12-10 14:01:59 -0800 | [diff] [blame] | 126 | static ssize_t temp_show(struct device *dev, struct device_attribute *devattr, |
| 127 | char *buf) |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 128 | { |
| 129 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 130 | struct ad7418_data *data = dev_get_drvdata(dev); |
| 131 | int ret; |
| 132 | |
| 133 | ret = ad7418_update_device(dev); |
| 134 | if (ret < 0) |
| 135 | return ret; |
| 136 | |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 137 | return sprintf(buf, "%d\n", |
| 138 | LM75_TEMP_FROM_REG(data->temp[attr->index])); |
| 139 | } |
| 140 | |
Guenter Roeck | 6fdc5d7 | 2018-12-10 14:01:59 -0800 | [diff] [blame] | 141 | static ssize_t adc_show(struct device *dev, struct device_attribute *devattr, |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 142 | char *buf) |
| 143 | { |
| 144 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
Brandon Maier | 45034e4 | 2019-02-07 15:50:36 -0600 | [diff] [blame] | 145 | struct ad7418_data *data = dev_get_drvdata(dev); |
| 146 | int ret; |
| 147 | |
| 148 | ret = ad7418_update_device(dev); |
| 149 | if (ret < 0) |
| 150 | return ret; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 151 | |
| 152 | return sprintf(buf, "%d\n", |
| 153 | ((data->in[attr->index] >> 6) * 2500 + 512) / 1024); |
| 154 | } |
| 155 | |
Guenter Roeck | 6fdc5d7 | 2018-12-10 14:01:59 -0800 | [diff] [blame] | 156 | static ssize_t temp_store(struct device *dev, |
| 157 | struct device_attribute *devattr, const char *buf, |
| 158 | size_t count) |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 159 | { |
| 160 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 161 | struct ad7418_data *data = dev_get_drvdata(dev); |
| 162 | struct i2c_client *client = data->client; |
Frans Meulenbroeks | e91aef22 | 2012-01-08 19:34:17 +0100 | [diff] [blame] | 163 | long temp; |
| 164 | int ret = kstrtol(buf, 10, &temp); |
| 165 | |
| 166 | if (ret < 0) |
| 167 | return ret; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 168 | |
| 169 | mutex_lock(&data->lock); |
| 170 | data->temp[attr->index] = LM75_TEMP_TO_REG(temp); |
Jean Delvare | 90f4102 | 2011-11-04 12:00:47 +0100 | [diff] [blame] | 171 | i2c_smbus_write_word_swapped(client, |
| 172 | AD7418_REG_TEMP[attr->index], |
| 173 | data->temp[attr->index]); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 174 | mutex_unlock(&data->lock); |
| 175 | return count; |
| 176 | } |
| 177 | |
Guenter Roeck | 6fdc5d7 | 2018-12-10 14:01:59 -0800 | [diff] [blame] | 178 | static SENSOR_DEVICE_ATTR_RO(temp1_input, temp, 0); |
| 179 | static SENSOR_DEVICE_ATTR_RW(temp1_max_hyst, temp, 1); |
| 180 | static SENSOR_DEVICE_ATTR_RW(temp1_max, temp, 2); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 181 | |
Guenter Roeck | 6fdc5d7 | 2018-12-10 14:01:59 -0800 | [diff] [blame] | 182 | static SENSOR_DEVICE_ATTR_RO(in1_input, adc, 0); |
| 183 | static SENSOR_DEVICE_ATTR_RO(in2_input, adc, 1); |
| 184 | static SENSOR_DEVICE_ATTR_RO(in3_input, adc, 2); |
| 185 | static SENSOR_DEVICE_ATTR_RO(in4_input, adc, 3); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 186 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 187 | static struct attribute *ad7416_attrs[] = { |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 188 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
| 189 | &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, |
| 190 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
| 191 | NULL |
| 192 | }; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 193 | ATTRIBUTE_GROUPS(ad7416); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 194 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 195 | static struct attribute *ad7417_attrs[] = { |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 196 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
| 197 | &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, |
| 198 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
| 199 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| 200 | &sensor_dev_attr_in2_input.dev_attr.attr, |
| 201 | &sensor_dev_attr_in3_input.dev_attr.attr, |
| 202 | &sensor_dev_attr_in4_input.dev_attr.attr, |
| 203 | NULL |
| 204 | }; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 205 | ATTRIBUTE_GROUPS(ad7417); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 206 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 207 | static struct attribute *ad7418_attrs[] = { |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 208 | &sensor_dev_attr_temp1_max.dev_attr.attr, |
| 209 | &sensor_dev_attr_temp1_max_hyst.dev_attr.attr, |
| 210 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
| 211 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| 212 | NULL |
| 213 | }; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 214 | ATTRIBUTE_GROUPS(ad7418); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 215 | |
Axel Lin | 991763a | 2014-07-01 22:39:08 +0800 | [diff] [blame] | 216 | static void ad7418_init_client(struct i2c_client *client) |
| 217 | { |
| 218 | struct ad7418_data *data = i2c_get_clientdata(client); |
| 219 | |
| 220 | int reg = i2c_smbus_read_byte_data(client, AD7418_REG_CONF); |
| 221 | if (reg < 0) { |
| 222 | dev_err(&client->dev, "cannot read configuration register\n"); |
| 223 | } else { |
| 224 | dev_info(&client->dev, "configuring for mode 1\n"); |
| 225 | i2c_smbus_write_byte_data(client, AD7418_REG_CONF, reg & 0xfe); |
| 226 | |
| 227 | if (data->type == ad7417 || data->type == ad7418) |
| 228 | i2c_smbus_write_byte_data(client, |
| 229 | AD7418_REG_CONF2, 0x00); |
| 230 | } |
| 231 | } |
| 232 | |
Jean Delvare | 369932f | 2008-07-16 19:30:08 +0200 | [diff] [blame] | 233 | static int ad7418_probe(struct i2c_client *client, |
| 234 | const struct i2c_device_id *id) |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 235 | { |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 236 | struct device *dev = &client->dev; |
Jean Delvare | 369932f | 2008-07-16 19:30:08 +0200 | [diff] [blame] | 237 | struct i2c_adapter *adapter = client->adapter; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 238 | struct ad7418_data *data; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 239 | struct device *hwmon_dev; |
| 240 | const struct attribute_group **attr_groups = NULL; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 241 | |
| 242 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | |
Guenter Roeck | d528292 | 2012-06-02 09:57:58 -0700 | [diff] [blame] | 243 | I2C_FUNC_SMBUS_WORD_DATA)) |
| 244 | return -EOPNOTSUPP; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 245 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 246 | data = devm_kzalloc(dev, sizeof(struct ad7418_data), GFP_KERNEL); |
Guenter Roeck | d528292 | 2012-06-02 09:57:58 -0700 | [diff] [blame] | 247 | if (!data) |
| 248 | return -ENOMEM; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 249 | |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 250 | i2c_set_clientdata(client, data); |
| 251 | |
| 252 | mutex_init(&data->lock); |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 253 | data->client = client; |
Linus Walleij | f4c2965 | 2019-01-28 22:06:37 +0100 | [diff] [blame] | 254 | if (dev->of_node) |
| 255 | data->type = (enum chips)of_device_get_match_data(dev); |
| 256 | else |
| 257 | data->type = id->driver_data; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 258 | |
| 259 | switch (data->type) { |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 260 | case ad7416: |
| 261 | data->adc_max = 0; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 262 | attr_groups = ad7416_groups; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 263 | break; |
| 264 | |
| 265 | case ad7417: |
| 266 | data->adc_max = 4; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 267 | attr_groups = ad7417_groups; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 268 | break; |
| 269 | |
| 270 | case ad7418: |
| 271 | data->adc_max = 1; |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 272 | attr_groups = ad7418_groups; |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 273 | break; |
| 274 | } |
| 275 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 276 | dev_info(dev, "%s chip found\n", client->name); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 277 | |
| 278 | /* Initialize the AD7418 chip */ |
| 279 | ad7418_init_client(client); |
| 280 | |
Axel Lin | 337076f | 2014-07-01 22:40:29 +0800 | [diff] [blame] | 281 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, |
| 282 | client->name, |
| 283 | data, attr_groups); |
| 284 | return PTR_ERR_OR_ZERO(hwmon_dev); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 285 | } |
| 286 | |
Axel Lin | 991763a | 2014-07-01 22:39:08 +0800 | [diff] [blame] | 287 | static const struct i2c_device_id ad7418_id[] = { |
| 288 | { "ad7416", ad7416 }, |
| 289 | { "ad7417", ad7417 }, |
| 290 | { "ad7418", ad7418 }, |
| 291 | { } |
| 292 | }; |
| 293 | MODULE_DEVICE_TABLE(i2c, ad7418_id); |
| 294 | |
Linus Walleij | f4c2965 | 2019-01-28 22:06:37 +0100 | [diff] [blame] | 295 | static const struct of_device_id ad7418_dt_ids[] = { |
| 296 | { .compatible = "adi,ad7416", .data = (void *)ad7416, }, |
| 297 | { .compatible = "adi,ad7417", .data = (void *)ad7417, }, |
| 298 | { .compatible = "adi,ad7418", .data = (void *)ad7418, }, |
| 299 | { } |
| 300 | }; |
| 301 | MODULE_DEVICE_TABLE(of, ad7418_dt_ids); |
| 302 | |
Axel Lin | 991763a | 2014-07-01 22:39:08 +0800 | [diff] [blame] | 303 | static struct i2c_driver ad7418_driver = { |
| 304 | .driver = { |
| 305 | .name = "ad7418", |
Linus Walleij | f4c2965 | 2019-01-28 22:06:37 +0100 | [diff] [blame] | 306 | .of_match_table = ad7418_dt_ids, |
Axel Lin | 991763a | 2014-07-01 22:39:08 +0800 | [diff] [blame] | 307 | }, |
| 308 | .probe = ad7418_probe, |
Axel Lin | 991763a | 2014-07-01 22:39:08 +0800 | [diff] [blame] | 309 | .id_table = ad7418_id, |
| 310 | }; |
| 311 | |
Axel Lin | f0967ee | 2012-01-20 15:38:18 +0800 | [diff] [blame] | 312 | module_i2c_driver(ad7418_driver); |
Alessandro Zummo | 2d8dd65 | 2007-05-08 17:22:02 +0200 | [diff] [blame] | 313 | |
| 314 | MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); |
| 315 | MODULE_DESCRIPTION("AD7416/17/18 driver"); |
| 316 | MODULE_LICENSE("GPL"); |
| 317 | MODULE_VERSION(DRV_VERSION); |