Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Driver for Texas Instruments INA219, INA226 power monitor chips |
| 3 | * |
| 4 | * INA219: |
| 5 | * Zero Drift Bi-Directional Current/Power Monitor with I2C Interface |
| 6 | * Datasheet: http://www.ti.com/product/ina219 |
| 7 | * |
Guenter Roeck | dc92cd0 | 2012-05-12 11:33:11 -0700 | [diff] [blame] | 8 | * INA220: |
| 9 | * Bi-Directional Current/Power Monitor with I2C Interface |
| 10 | * Datasheet: http://www.ti.com/product/ina220 |
| 11 | * |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 12 | * INA226: |
| 13 | * Bi-Directional Current/Power Monitor with I2C Interface |
| 14 | * Datasheet: http://www.ti.com/product/ina226 |
| 15 | * |
Guenter Roeck | dc92cd0 | 2012-05-12 11:33:11 -0700 | [diff] [blame] | 16 | * INA230: |
| 17 | * Bi-directional Current/Power Monitor with I2C Interface |
| 18 | * Datasheet: http://www.ti.com/product/ina230 |
| 19 | * |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 20 | * Copyright (C) 2012 Lothar Felten <l-felten@ti.com> |
| 21 | * Thanks to Jan Volkering |
| 22 | * |
| 23 | * This program is free software; you can redistribute it and/or modify |
| 24 | * it under the terms of the GNU General Public License as published by |
| 25 | * the Free Software Foundation; version 2 of the License. |
| 26 | */ |
| 27 | |
| 28 | #include <linux/kernel.h> |
| 29 | #include <linux/module.h> |
| 30 | #include <linux/init.h> |
| 31 | #include <linux/err.h> |
| 32 | #include <linux/slab.h> |
| 33 | #include <linux/i2c.h> |
| 34 | #include <linux/hwmon.h> |
| 35 | #include <linux/hwmon-sysfs.h> |
Jean Delvare | dcd8f39 | 2012-10-10 15:25:56 +0200 | [diff] [blame] | 36 | #include <linux/jiffies.h> |
Tang Yuantian | 31e7ad7 | 2013-06-19 14:50:20 +0800 | [diff] [blame] | 37 | #include <linux/of.h> |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 38 | #include <linux/delay.h> |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 39 | |
| 40 | #include <linux/platform_data/ina2xx.h> |
| 41 | |
| 42 | /* common register definitions */ |
| 43 | #define INA2XX_CONFIG 0x00 |
| 44 | #define INA2XX_SHUNT_VOLTAGE 0x01 /* readonly */ |
| 45 | #define INA2XX_BUS_VOLTAGE 0x02 /* readonly */ |
| 46 | #define INA2XX_POWER 0x03 /* readonly */ |
| 47 | #define INA2XX_CURRENT 0x04 /* readonly */ |
| 48 | #define INA2XX_CALIBRATION 0x05 |
| 49 | |
| 50 | /* INA226 register definitions */ |
| 51 | #define INA226_MASK_ENABLE 0x06 |
| 52 | #define INA226_ALERT_LIMIT 0x07 |
| 53 | #define INA226_DIE_ID 0xFF |
| 54 | |
| 55 | |
| 56 | /* register count */ |
| 57 | #define INA219_REGISTERS 6 |
| 58 | #define INA226_REGISTERS 8 |
| 59 | |
| 60 | #define INA2XX_MAX_REGISTERS 8 |
| 61 | |
| 62 | /* settings - depend on use case */ |
| 63 | #define INA219_CONFIG_DEFAULT 0x399F /* PGA=8 */ |
| 64 | #define INA226_CONFIG_DEFAULT 0x4527 /* averages=16 */ |
| 65 | |
| 66 | /* worst case is 68.10 ms (~14.6Hz, ina219) */ |
| 67 | #define INA2XX_CONVERSION_RATE 15 |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 68 | #define INA2XX_MAX_DELAY 69 /* worst case delay in ms */ |
| 69 | |
| 70 | #define INA2XX_RSHUNT_DEFAULT 10000 |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 71 | |
| 72 | enum ina2xx_ids { ina219, ina226 }; |
| 73 | |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 74 | struct ina2xx_config { |
| 75 | u16 config_default; |
| 76 | int calibration_factor; |
| 77 | int registers; |
| 78 | int shunt_div; |
| 79 | int bus_voltage_shift; |
| 80 | int bus_voltage_lsb; /* uV */ |
| 81 | int power_lsb; /* uW */ |
| 82 | }; |
| 83 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 84 | struct ina2xx_data { |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 85 | struct i2c_client *client; |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 86 | const struct ina2xx_config *config; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 87 | |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 88 | long rshunt; |
| 89 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 90 | struct mutex update_lock; |
| 91 | bool valid; |
| 92 | unsigned long last_updated; |
| 93 | |
| 94 | int kind; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 95 | u16 regs[INA2XX_MAX_REGISTERS]; |
| 96 | }; |
| 97 | |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 98 | static const struct ina2xx_config ina2xx_config[] = { |
| 99 | [ina219] = { |
| 100 | .config_default = INA219_CONFIG_DEFAULT, |
| 101 | .calibration_factor = 40960000, |
| 102 | .registers = INA219_REGISTERS, |
| 103 | .shunt_div = 100, |
| 104 | .bus_voltage_shift = 3, |
| 105 | .bus_voltage_lsb = 4000, |
| 106 | .power_lsb = 20000, |
| 107 | }, |
| 108 | [ina226] = { |
| 109 | .config_default = INA226_CONFIG_DEFAULT, |
| 110 | .calibration_factor = 5120000, |
| 111 | .registers = INA226_REGISTERS, |
| 112 | .shunt_div = 400, |
| 113 | .bus_voltage_shift = 0, |
| 114 | .bus_voltage_lsb = 1250, |
| 115 | .power_lsb = 25000, |
| 116 | }, |
| 117 | }; |
| 118 | |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 119 | /* |
| 120 | * Initialize the configuration and calibration registers. |
| 121 | */ |
| 122 | static int ina2xx_init(struct ina2xx_data *data) |
| 123 | { |
| 124 | struct i2c_client *client = data->client; |
| 125 | int ret; |
| 126 | |
| 127 | /* device configuration */ |
| 128 | ret = i2c_smbus_write_word_swapped(client, INA2XX_CONFIG, |
| 129 | data->config->config_default); |
| 130 | if (ret < 0) |
| 131 | return ret; |
| 132 | |
| 133 | /* |
| 134 | * Set current LSB to 1mA, shunt is in uOhms |
| 135 | * (equation 13 in datasheet). |
| 136 | */ |
| 137 | return i2c_smbus_write_word_swapped(client, INA2XX_CALIBRATION, |
| 138 | data->config->calibration_factor / data->rshunt); |
| 139 | } |
| 140 | |
| 141 | static int ina2xx_do_update(struct device *dev) |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 142 | { |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 143 | struct ina2xx_data *data = dev_get_drvdata(dev); |
| 144 | struct i2c_client *client = data->client; |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 145 | int i, rv, retry; |
| 146 | |
| 147 | dev_dbg(&client->dev, "Starting ina2xx update\n"); |
| 148 | |
| 149 | for (retry = 5; retry; retry--) { |
| 150 | /* Read all registers */ |
| 151 | for (i = 0; i < data->config->registers; i++) { |
| 152 | rv = i2c_smbus_read_word_swapped(client, i); |
| 153 | if (rv < 0) |
| 154 | return rv; |
| 155 | data->regs[i] = rv; |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | * If the current value in the calibration register is 0, the |
| 160 | * power and current registers will also remain at 0. In case |
| 161 | * the chip has been reset let's check the calibration |
| 162 | * register and reinitialize if needed. |
| 163 | */ |
| 164 | if (data->regs[INA2XX_CALIBRATION] == 0) { |
| 165 | dev_warn(dev, "chip not calibrated, reinitializing\n"); |
| 166 | |
| 167 | rv = ina2xx_init(data); |
| 168 | if (rv < 0) |
| 169 | return rv; |
| 170 | |
| 171 | /* |
| 172 | * Let's make sure the power and current registers |
| 173 | * have been updated before trying again. |
| 174 | */ |
| 175 | msleep(INA2XX_MAX_DELAY); |
| 176 | continue; |
| 177 | } |
| 178 | |
| 179 | data->last_updated = jiffies; |
| 180 | data->valid = 1; |
| 181 | |
| 182 | return 0; |
| 183 | } |
| 184 | |
| 185 | /* |
| 186 | * If we're here then although all write operations succeeded, the |
| 187 | * chip still returns 0 in the calibration register. Nothing more we |
| 188 | * can do here. |
| 189 | */ |
| 190 | dev_err(dev, "unable to reinitialize the chip\n"); |
| 191 | return -ENODEV; |
| 192 | } |
| 193 | |
| 194 | static struct ina2xx_data *ina2xx_update_device(struct device *dev) |
| 195 | { |
| 196 | struct ina2xx_data *data = dev_get_drvdata(dev); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 197 | struct ina2xx_data *ret = data; |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 198 | int rv; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 199 | |
| 200 | mutex_lock(&data->update_lock); |
| 201 | |
| 202 | if (time_after(jiffies, data->last_updated + |
| 203 | HZ / INA2XX_CONVERSION_RATE) || !data->valid) { |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 204 | rv = ina2xx_do_update(dev); |
| 205 | if (rv < 0) |
| 206 | ret = ERR_PTR(rv); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 207 | } |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 208 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 209 | mutex_unlock(&data->update_lock); |
| 210 | return ret; |
| 211 | } |
| 212 | |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 213 | static int ina2xx_get_value(struct ina2xx_data *data, u8 reg) |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 214 | { |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 215 | int val; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 216 | |
| 217 | switch (reg) { |
| 218 | case INA2XX_SHUNT_VOLTAGE: |
Fabio Baltieri | c0214f9 | 2014-06-08 22:06:24 +0100 | [diff] [blame] | 219 | /* signed register */ |
| 220 | val = DIV_ROUND_CLOSEST((s16)data->regs[reg], |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 221 | data->config->shunt_div); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 222 | break; |
| 223 | case INA2XX_BUS_VOLTAGE: |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 224 | val = (data->regs[reg] >> data->config->bus_voltage_shift) |
| 225 | * data->config->bus_voltage_lsb; |
| 226 | val = DIV_ROUND_CLOSEST(val, 1000); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 227 | break; |
| 228 | case INA2XX_POWER: |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 229 | val = data->regs[reg] * data->config->power_lsb; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 230 | break; |
| 231 | case INA2XX_CURRENT: |
Fabio Baltieri | c0214f9 | 2014-06-08 22:06:24 +0100 | [diff] [blame] | 232 | /* signed register, LSB=1mA (selected), in mA */ |
| 233 | val = (s16)data->regs[reg]; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 234 | break; |
| 235 | default: |
| 236 | /* programmer goofed */ |
| 237 | WARN_ON_ONCE(1); |
| 238 | val = 0; |
| 239 | break; |
| 240 | } |
| 241 | |
| 242 | return val; |
| 243 | } |
| 244 | |
| 245 | static ssize_t ina2xx_show_value(struct device *dev, |
| 246 | struct device_attribute *da, char *buf) |
| 247 | { |
| 248 | struct sensor_device_attribute *attr = to_sensor_dev_attr(da); |
| 249 | struct ina2xx_data *data = ina2xx_update_device(dev); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 250 | |
| 251 | if (IS_ERR(data)) |
| 252 | return PTR_ERR(data); |
| 253 | |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 254 | return snprintf(buf, PAGE_SIZE, "%d\n", |
| 255 | ina2xx_get_value(data, attr->index)); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | /* shunt voltage */ |
Guenter Roeck | f0df0fd | 2013-01-10 10:04:06 -0800 | [diff] [blame] | 259 | static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, ina2xx_show_value, NULL, |
| 260 | INA2XX_SHUNT_VOLTAGE); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 261 | |
| 262 | /* bus voltage */ |
Guenter Roeck | f0df0fd | 2013-01-10 10:04:06 -0800 | [diff] [blame] | 263 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, ina2xx_show_value, NULL, |
| 264 | INA2XX_BUS_VOLTAGE); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 265 | |
| 266 | /* calculated current */ |
Guenter Roeck | f0df0fd | 2013-01-10 10:04:06 -0800 | [diff] [blame] | 267 | static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, ina2xx_show_value, NULL, |
| 268 | INA2XX_CURRENT); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 269 | |
| 270 | /* calculated power */ |
Guenter Roeck | f0df0fd | 2013-01-10 10:04:06 -0800 | [diff] [blame] | 271 | static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, ina2xx_show_value, NULL, |
| 272 | INA2XX_POWER); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 273 | |
| 274 | /* pointers to created device attributes */ |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 275 | static struct attribute *ina2xx_attrs[] = { |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 276 | &sensor_dev_attr_in0_input.dev_attr.attr, |
| 277 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| 278 | &sensor_dev_attr_curr1_input.dev_attr.attr, |
| 279 | &sensor_dev_attr_power1_input.dev_attr.attr, |
| 280 | NULL, |
| 281 | }; |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 282 | ATTRIBUTE_GROUPS(ina2xx); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 283 | |
| 284 | static int ina2xx_probe(struct i2c_client *client, |
| 285 | const struct i2c_device_id *id) |
| 286 | { |
| 287 | struct i2c_adapter *adapter = client->adapter; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 288 | struct ina2xx_platform_data *pdata; |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 289 | struct device *dev = &client->dev; |
| 290 | struct ina2xx_data *data; |
| 291 | struct device *hwmon_dev; |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 292 | u32 val; |
Bartosz Golaszewski | f975b33 | 2014-11-27 10:59:06 +0100 | [diff] [blame] | 293 | int ret; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 294 | |
| 295 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) |
| 296 | return -ENODEV; |
| 297 | |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 298 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 299 | if (!data) |
| 300 | return -ENOMEM; |
| 301 | |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 302 | if (dev_get_platdata(dev)) { |
| 303 | pdata = dev_get_platdata(dev); |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 304 | data->rshunt = pdata->shunt_uohms; |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 305 | } else if (!of_property_read_u32(dev->of_node, |
| 306 | "shunt-resistor", &val)) { |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 307 | data->rshunt = val; |
| 308 | } else { |
| 309 | data->rshunt = INA2XX_RSHUNT_DEFAULT; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 310 | } |
| 311 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 312 | /* set the device type */ |
| 313 | data->kind = id->driver_data; |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 314 | data->config = &ina2xx_config[data->kind]; |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 315 | data->client = client; |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 316 | |
| 317 | if (data->rshunt <= 0) |
| 318 | return -ENODEV; |
| 319 | |
| 320 | ret = ina2xx_init(data); |
| 321 | if (ret < 0) { |
| 322 | dev_err(dev, "error configuring the device: %d\n", ret); |
| 323 | return -ENODEV; |
| 324 | } |
| 325 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 326 | mutex_init(&data->update_lock); |
| 327 | |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 328 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, |
| 329 | data, ina2xx_groups); |
| 330 | if (IS_ERR(hwmon_dev)) |
| 331 | return PTR_ERR(hwmon_dev); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 332 | |
Guenter Roeck | 468bf0e | 2013-09-02 13:16:19 -0700 | [diff] [blame] | 333 | dev_info(dev, "power monitor %s (Rshunt = %li uOhm)\n", |
Bartosz Golaszewski | 509416a | 2015-01-05 15:20:52 +0100 | [diff] [blame^] | 334 | id->name, data->rshunt); |
Guenter Roeck | 6106db2 | 2012-05-12 11:21:01 -0700 | [diff] [blame] | 335 | |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 336 | return 0; |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | static const struct i2c_device_id ina2xx_id[] = { |
| 340 | { "ina219", ina219 }, |
Guenter Roeck | dc92cd0 | 2012-05-12 11:33:11 -0700 | [diff] [blame] | 341 | { "ina220", ina219 }, |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 342 | { "ina226", ina226 }, |
Guenter Roeck | dc92cd0 | 2012-05-12 11:33:11 -0700 | [diff] [blame] | 343 | { "ina230", ina226 }, |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 344 | { } |
| 345 | }; |
| 346 | MODULE_DEVICE_TABLE(i2c, ina2xx_id); |
| 347 | |
| 348 | static struct i2c_driver ina2xx_driver = { |
| 349 | .driver = { |
| 350 | .name = "ina2xx", |
| 351 | }, |
| 352 | .probe = ina2xx_probe, |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 353 | .id_table = ina2xx_id, |
| 354 | }; |
| 355 | |
Wei Yongjun | d835ca0 | 2012-10-08 20:40:35 +0800 | [diff] [blame] | 356 | module_i2c_driver(ina2xx_driver); |
Felten, Lothar | f7c2fe3 | 2012-05-12 04:36:38 -0400 | [diff] [blame] | 357 | |
| 358 | MODULE_AUTHOR("Lothar Felten <l-felten@ti.com>"); |
| 359 | MODULE_DESCRIPTION("ina2xx driver"); |
| 360 | MODULE_LICENSE("GPL"); |