ltc4245.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. /*
  2. * Driver for Linear Technology LTC4245 I2C Multiple Supply Hot Swap Controller
  3. *
  4. * Copyright (C) 2008 Ira W. Snyder <iws@ovro.caltech.edu>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This driver is based on the ds1621 and ina209 drivers.
  11. *
  12. * Datasheet:
  13. * http://www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1003,C1006,C1140,P19392,D13517
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/module.h>
  17. #include <linux/init.h>
  18. #include <linux/err.h>
  19. #include <linux/slab.h>
  20. #include <linux/i2c.h>
  21. #include <linux/hwmon.h>
  22. #include <linux/hwmon-sysfs.h>
  23. #include <linux/jiffies.h>
  24. #include <linux/i2c/ltc4245.h>
  25. /* Here are names of the chip's registers (a.k.a. commands) */
  26. enum ltc4245_cmd {
  27. LTC4245_STATUS = 0x00, /* readonly */
  28. LTC4245_ALERT = 0x01,
  29. LTC4245_CONTROL = 0x02,
  30. LTC4245_ON = 0x03,
  31. LTC4245_FAULT1 = 0x04,
  32. LTC4245_FAULT2 = 0x05,
  33. LTC4245_GPIO = 0x06,
  34. LTC4245_ADCADR = 0x07,
  35. LTC4245_12VIN = 0x10,
  36. LTC4245_12VSENSE = 0x11,
  37. LTC4245_12VOUT = 0x12,
  38. LTC4245_5VIN = 0x13,
  39. LTC4245_5VSENSE = 0x14,
  40. LTC4245_5VOUT = 0x15,
  41. LTC4245_3VIN = 0x16,
  42. LTC4245_3VSENSE = 0x17,
  43. LTC4245_3VOUT = 0x18,
  44. LTC4245_VEEIN = 0x19,
  45. LTC4245_VEESENSE = 0x1a,
  46. LTC4245_VEEOUT = 0x1b,
  47. LTC4245_GPIOADC = 0x1c,
  48. };
  49. struct ltc4245_data {
  50. struct i2c_client *client;
  51. const struct attribute_group *groups[3];
  52. struct mutex update_lock;
  53. bool valid;
  54. unsigned long last_updated; /* in jiffies */
  55. /* Control registers */
  56. u8 cregs[0x08];
  57. /* Voltage registers */
  58. u8 vregs[0x0d];
  59. /* GPIO ADC registers */
  60. bool use_extra_gpios;
  61. int gpios[3];
  62. };
  63. /*
  64. * Update the readings from the GPIO pins. If the driver has been configured to
  65. * sample all GPIO's as analog voltages, a round-robin sampling method is used.
  66. * Otherwise, only the configured GPIO pin is sampled.
  67. *
  68. * LOCKING: must hold data->update_lock
  69. */
  70. static void ltc4245_update_gpios(struct device *dev)
  71. {
  72. struct ltc4245_data *data = dev_get_drvdata(dev);
  73. struct i2c_client *client = data->client;
  74. u8 gpio_curr, gpio_next, gpio_reg;
  75. int i;
  76. /* no extra gpio support, we're basically done */
  77. if (!data->use_extra_gpios) {
  78. data->gpios[0] = data->vregs[LTC4245_GPIOADC - 0x10];
  79. return;
  80. }
  81. /*
  82. * If the last reading was too long ago, then we mark all old GPIO
  83. * readings as stale by setting them to -EAGAIN
  84. */
  85. if (time_after(jiffies, data->last_updated + 5 * HZ)) {
  86. dev_dbg(&client->dev, "Marking GPIOs invalid\n");
  87. for (i = 0; i < ARRAY_SIZE(data->gpios); i++)
  88. data->gpios[i] = -EAGAIN;
  89. }
  90. /*
  91. * Get the current GPIO pin
  92. *
  93. * The datasheet calls these GPIO[1-3], but we'll calculate the zero
  94. * based array index instead, and call them GPIO[0-2]. This is much
  95. * easier to think about.
  96. */
  97. gpio_curr = (data->cregs[LTC4245_GPIO] & 0xc0) >> 6;
  98. if (gpio_curr > 0)
  99. gpio_curr -= 1;
  100. /* Read the GPIO voltage from the GPIOADC register */
  101. data->gpios[gpio_curr] = data->vregs[LTC4245_GPIOADC - 0x10];
  102. /* Find the next GPIO pin to read */
  103. gpio_next = (gpio_curr + 1) % ARRAY_SIZE(data->gpios);
  104. /*
  105. * Calculate the correct setting for the GPIO register so it will
  106. * sample the next GPIO pin
  107. */
  108. gpio_reg = (data->cregs[LTC4245_GPIO] & 0x3f) | ((gpio_next + 1) << 6);
  109. /* Update the GPIO register */
  110. i2c_smbus_write_byte_data(client, LTC4245_GPIO, gpio_reg);
  111. /* Update saved data */
  112. data->cregs[LTC4245_GPIO] = gpio_reg;
  113. }
  114. static struct ltc4245_data *ltc4245_update_device(struct device *dev)
  115. {
  116. struct ltc4245_data *data = dev_get_drvdata(dev);
  117. struct i2c_client *client = data->client;
  118. s32 val;
  119. int i;
  120. mutex_lock(&data->update_lock);
  121. if (time_after(jiffies, data->last_updated + HZ) || !data->valid) {
  122. dev_dbg(&client->dev, "Starting ltc4245 update\n");
  123. /* Read control registers -- 0x00 to 0x07 */
  124. for (i = 0; i < ARRAY_SIZE(data->cregs); i++) {
  125. val = i2c_smbus_read_byte_data(client, i);
  126. if (unlikely(val < 0))
  127. data->cregs[i] = 0;
  128. else
  129. data->cregs[i] = val;
  130. }
  131. /* Read voltage registers -- 0x10 to 0x1c */
  132. for (i = 0; i < ARRAY_SIZE(data->vregs); i++) {
  133. val = i2c_smbus_read_byte_data(client, i+0x10);
  134. if (unlikely(val < 0))
  135. data->vregs[i] = 0;
  136. else
  137. data->vregs[i] = val;
  138. }
  139. /* Update GPIO readings */
  140. ltc4245_update_gpios(dev);
  141. data->last_updated = jiffies;
  142. data->valid = 1;
  143. }
  144. mutex_unlock(&data->update_lock);
  145. return data;
  146. }
  147. /* Return the voltage from the given register in millivolts */
  148. static int ltc4245_get_voltage(struct device *dev, u8 reg)
  149. {
  150. struct ltc4245_data *data = ltc4245_update_device(dev);
  151. const u8 regval = data->vregs[reg - 0x10];
  152. u32 voltage = 0;
  153. switch (reg) {
  154. case LTC4245_12VIN:
  155. case LTC4245_12VOUT:
  156. voltage = regval * 55;
  157. break;
  158. case LTC4245_5VIN:
  159. case LTC4245_5VOUT:
  160. voltage = regval * 22;
  161. break;
  162. case LTC4245_3VIN:
  163. case LTC4245_3VOUT:
  164. voltage = regval * 15;
  165. break;
  166. case LTC4245_VEEIN:
  167. case LTC4245_VEEOUT:
  168. voltage = regval * -55;
  169. break;
  170. case LTC4245_GPIOADC:
  171. voltage = regval * 10;
  172. break;
  173. default:
  174. /* If we get here, the developer messed up */
  175. WARN_ON_ONCE(1);
  176. break;
  177. }
  178. return voltage;
  179. }
  180. /* Return the current in the given sense register in milliAmperes */
  181. static unsigned int ltc4245_get_current(struct device *dev, u8 reg)
  182. {
  183. struct ltc4245_data *data = ltc4245_update_device(dev);
  184. const u8 regval = data->vregs[reg - 0x10];
  185. unsigned int voltage;
  186. unsigned int curr;
  187. /*
  188. * The strange looking conversions that follow are fixed-point
  189. * math, since we cannot do floating point in the kernel.
  190. *
  191. * Step 1: convert sense register to microVolts
  192. * Step 2: convert voltage to milliAmperes
  193. *
  194. * If you play around with the V=IR equation, you come up with
  195. * the following: X uV / Y mOhm == Z mA
  196. *
  197. * With the resistors that are fractions of a milliOhm, we multiply
  198. * the voltage and resistance by 10, to shift the decimal point.
  199. * Now we can use the normal division operator again.
  200. */
  201. switch (reg) {
  202. case LTC4245_12VSENSE:
  203. voltage = regval * 250; /* voltage in uV */
  204. curr = voltage / 50; /* sense resistor 50 mOhm */
  205. break;
  206. case LTC4245_5VSENSE:
  207. voltage = regval * 125; /* voltage in uV */
  208. curr = (voltage * 10) / 35; /* sense resistor 3.5 mOhm */
  209. break;
  210. case LTC4245_3VSENSE:
  211. voltage = regval * 125; /* voltage in uV */
  212. curr = (voltage * 10) / 25; /* sense resistor 2.5 mOhm */
  213. break;
  214. case LTC4245_VEESENSE:
  215. voltage = regval * 250; /* voltage in uV */
  216. curr = voltage / 100; /* sense resistor 100 mOhm */
  217. break;
  218. default:
  219. /* If we get here, the developer messed up */
  220. WARN_ON_ONCE(1);
  221. curr = 0;
  222. break;
  223. }
  224. return curr;
  225. }
  226. static ssize_t ltc4245_show_voltage(struct device *dev,
  227. struct device_attribute *da,
  228. char *buf)
  229. {
  230. struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
  231. const int voltage = ltc4245_get_voltage(dev, attr->index);
  232. return snprintf(buf, PAGE_SIZE, "%d\n", voltage);
  233. }
  234. static ssize_t ltc4245_show_current(struct device *dev,
  235. struct device_attribute *da,
  236. char *buf)
  237. {
  238. struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
  239. const unsigned int curr = ltc4245_get_current(dev, attr->index);
  240. return snprintf(buf, PAGE_SIZE, "%u\n", curr);
  241. }
  242. static ssize_t ltc4245_show_power(struct device *dev,
  243. struct device_attribute *da,
  244. char *buf)
  245. {
  246. struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
  247. const unsigned int curr = ltc4245_get_current(dev, attr->index);
  248. const int output_voltage = ltc4245_get_voltage(dev, attr->index+1);
  249. /* current in mA * voltage in mV == power in uW */
  250. const unsigned int power = abs(output_voltage * curr);
  251. return snprintf(buf, PAGE_SIZE, "%u\n", power);
  252. }
  253. static ssize_t ltc4245_show_alarm(struct device *dev,
  254. struct device_attribute *da,
  255. char *buf)
  256. {
  257. struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(da);
  258. struct ltc4245_data *data = ltc4245_update_device(dev);
  259. const u8 reg = data->cregs[attr->index];
  260. const u32 mask = attr->nr;
  261. return snprintf(buf, PAGE_SIZE, "%u\n", (reg & mask) ? 1 : 0);
  262. }
  263. static ssize_t ltc4245_show_gpio(struct device *dev,
  264. struct device_attribute *da,
  265. char *buf)
  266. {
  267. struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
  268. struct ltc4245_data *data = ltc4245_update_device(dev);
  269. int val = data->gpios[attr->index];
  270. /* handle stale GPIO's */
  271. if (val < 0)
  272. return val;
  273. /* Convert to millivolts and print */
  274. return snprintf(buf, PAGE_SIZE, "%u\n", val * 10);
  275. }
  276. /* Construct a sensor_device_attribute structure for each register */
  277. /* Input voltages */
  278. static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, ltc4245_show_voltage, NULL,
  279. LTC4245_12VIN);
  280. static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, ltc4245_show_voltage, NULL,
  281. LTC4245_5VIN);
  282. static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, ltc4245_show_voltage, NULL,
  283. LTC4245_3VIN);
  284. static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, ltc4245_show_voltage, NULL,
  285. LTC4245_VEEIN);
  286. /* Input undervoltage alarms */
  287. static SENSOR_DEVICE_ATTR_2(in1_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  288. 1 << 0, LTC4245_FAULT1);
  289. static SENSOR_DEVICE_ATTR_2(in2_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  290. 1 << 1, LTC4245_FAULT1);
  291. static SENSOR_DEVICE_ATTR_2(in3_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  292. 1 << 2, LTC4245_FAULT1);
  293. static SENSOR_DEVICE_ATTR_2(in4_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  294. 1 << 3, LTC4245_FAULT1);
  295. /* Currents (via sense resistor) */
  296. static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, ltc4245_show_current, NULL,
  297. LTC4245_12VSENSE);
  298. static SENSOR_DEVICE_ATTR(curr2_input, S_IRUGO, ltc4245_show_current, NULL,
  299. LTC4245_5VSENSE);
  300. static SENSOR_DEVICE_ATTR(curr3_input, S_IRUGO, ltc4245_show_current, NULL,
  301. LTC4245_3VSENSE);
  302. static SENSOR_DEVICE_ATTR(curr4_input, S_IRUGO, ltc4245_show_current, NULL,
  303. LTC4245_VEESENSE);
  304. /* Overcurrent alarms */
  305. static SENSOR_DEVICE_ATTR_2(curr1_max_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  306. 1 << 4, LTC4245_FAULT1);
  307. static SENSOR_DEVICE_ATTR_2(curr2_max_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  308. 1 << 5, LTC4245_FAULT1);
  309. static SENSOR_DEVICE_ATTR_2(curr3_max_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  310. 1 << 6, LTC4245_FAULT1);
  311. static SENSOR_DEVICE_ATTR_2(curr4_max_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  312. 1 << 7, LTC4245_FAULT1);
  313. /* Output voltages */
  314. static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, ltc4245_show_voltage, NULL,
  315. LTC4245_12VOUT);
  316. static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, ltc4245_show_voltage, NULL,
  317. LTC4245_5VOUT);
  318. static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, ltc4245_show_voltage, NULL,
  319. LTC4245_3VOUT);
  320. static SENSOR_DEVICE_ATTR(in8_input, S_IRUGO, ltc4245_show_voltage, NULL,
  321. LTC4245_VEEOUT);
  322. /* Power Bad alarms */
  323. static SENSOR_DEVICE_ATTR_2(in5_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  324. 1 << 0, LTC4245_FAULT2);
  325. static SENSOR_DEVICE_ATTR_2(in6_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  326. 1 << 1, LTC4245_FAULT2);
  327. static SENSOR_DEVICE_ATTR_2(in7_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  328. 1 << 2, LTC4245_FAULT2);
  329. static SENSOR_DEVICE_ATTR_2(in8_min_alarm, S_IRUGO, ltc4245_show_alarm, NULL,
  330. 1 << 3, LTC4245_FAULT2);
  331. /* GPIO voltages */
  332. static SENSOR_DEVICE_ATTR(in9_input, S_IRUGO, ltc4245_show_gpio, NULL, 0);
  333. static SENSOR_DEVICE_ATTR(in10_input, S_IRUGO, ltc4245_show_gpio, NULL, 1);
  334. static SENSOR_DEVICE_ATTR(in11_input, S_IRUGO, ltc4245_show_gpio, NULL, 2);
  335. /* Power Consumption (virtual) */
  336. static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, ltc4245_show_power, NULL,
  337. LTC4245_12VSENSE);
  338. static SENSOR_DEVICE_ATTR(power2_input, S_IRUGO, ltc4245_show_power, NULL,
  339. LTC4245_5VSENSE);
  340. static SENSOR_DEVICE_ATTR(power3_input, S_IRUGO, ltc4245_show_power, NULL,
  341. LTC4245_3VSENSE);
  342. static SENSOR_DEVICE_ATTR(power4_input, S_IRUGO, ltc4245_show_power, NULL,
  343. LTC4245_VEESENSE);
  344. /*
  345. * Finally, construct an array of pointers to members of the above objects,
  346. * as required for sysfs_create_group()
  347. */
  348. static struct attribute *ltc4245_std_attributes[] = {
  349. &sensor_dev_attr_in1_input.dev_attr.attr,
  350. &sensor_dev_attr_in2_input.dev_attr.attr,
  351. &sensor_dev_attr_in3_input.dev_attr.attr,
  352. &sensor_dev_attr_in4_input.dev_attr.attr,
  353. &sensor_dev_attr_in1_min_alarm.dev_attr.attr,
  354. &sensor_dev_attr_in2_min_alarm.dev_attr.attr,
  355. &sensor_dev_attr_in3_min_alarm.dev_attr.attr,
  356. &sensor_dev_attr_in4_min_alarm.dev_attr.attr,
  357. &sensor_dev_attr_curr1_input.dev_attr.attr,
  358. &sensor_dev_attr_curr2_input.dev_attr.attr,
  359. &sensor_dev_attr_curr3_input.dev_attr.attr,
  360. &sensor_dev_attr_curr4_input.dev_attr.attr,
  361. &sensor_dev_attr_curr1_max_alarm.dev_attr.attr,
  362. &sensor_dev_attr_curr2_max_alarm.dev_attr.attr,
  363. &sensor_dev_attr_curr3_max_alarm.dev_attr.attr,
  364. &sensor_dev_attr_curr4_max_alarm.dev_attr.attr,
  365. &sensor_dev_attr_in5_input.dev_attr.attr,
  366. &sensor_dev_attr_in6_input.dev_attr.attr,
  367. &sensor_dev_attr_in7_input.dev_attr.attr,
  368. &sensor_dev_attr_in8_input.dev_attr.attr,
  369. &sensor_dev_attr_in5_min_alarm.dev_attr.attr,
  370. &sensor_dev_attr_in6_min_alarm.dev_attr.attr,
  371. &sensor_dev_attr_in7_min_alarm.dev_attr.attr,
  372. &sensor_dev_attr_in8_min_alarm.dev_attr.attr,
  373. &sensor_dev_attr_in9_input.dev_attr.attr,
  374. &sensor_dev_attr_power1_input.dev_attr.attr,
  375. &sensor_dev_attr_power2_input.dev_attr.attr,
  376. &sensor_dev_attr_power3_input.dev_attr.attr,
  377. &sensor_dev_attr_power4_input.dev_attr.attr,
  378. NULL,
  379. };
  380. static struct attribute *ltc4245_gpio_attributes[] = {
  381. &sensor_dev_attr_in10_input.dev_attr.attr,
  382. &sensor_dev_attr_in11_input.dev_attr.attr,
  383. NULL,
  384. };
  385. static const struct attribute_group ltc4245_std_group = {
  386. .attrs = ltc4245_std_attributes,
  387. };
  388. static const struct attribute_group ltc4245_gpio_group = {
  389. .attrs = ltc4245_gpio_attributes,
  390. };
  391. static void ltc4245_sysfs_add_groups(struct ltc4245_data *data)
  392. {
  393. /* standard sysfs attributes */
  394. data->groups[0] = &ltc4245_std_group;
  395. /* if we're using the extra gpio support, register it's attributes */
  396. if (data->use_extra_gpios)
  397. data->groups[1] = &ltc4245_gpio_group;
  398. }
  399. static bool ltc4245_use_extra_gpios(struct i2c_client *client)
  400. {
  401. struct ltc4245_platform_data *pdata = dev_get_platdata(&client->dev);
  402. #ifdef CONFIG_OF
  403. struct device_node *np = client->dev.of_node;
  404. #endif
  405. /* prefer platform data */
  406. if (pdata)
  407. return pdata->use_extra_gpios;
  408. #ifdef CONFIG_OF
  409. /* fallback on OF */
  410. if (of_find_property(np, "ltc4245,use-extra-gpios", NULL))
  411. return true;
  412. #endif
  413. return false;
  414. }
  415. static int ltc4245_probe(struct i2c_client *client,
  416. const struct i2c_device_id *id)
  417. {
  418. struct i2c_adapter *adapter = client->adapter;
  419. struct ltc4245_data *data;
  420. struct device *hwmon_dev;
  421. if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
  422. return -ENODEV;
  423. data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
  424. if (!data)
  425. return -ENOMEM;
  426. data->client = client;
  427. mutex_init(&data->update_lock);
  428. data->use_extra_gpios = ltc4245_use_extra_gpios(client);
  429. /* Initialize the LTC4245 chip */
  430. i2c_smbus_write_byte_data(client, LTC4245_FAULT1, 0x00);
  431. i2c_smbus_write_byte_data(client, LTC4245_FAULT2, 0x00);
  432. /* Add sysfs hooks */
  433. ltc4245_sysfs_add_groups(data);
  434. hwmon_dev = hwmon_device_register_with_groups(&client->dev,
  435. client->name, data,
  436. data->groups);
  437. if (IS_ERR(hwmon_dev))
  438. return PTR_ERR(hwmon_dev);
  439. i2c_set_clientdata(client, hwmon_dev);
  440. return 0;
  441. }
  442. static int ltc4245_remove(struct i2c_client *client)
  443. {
  444. struct device *hwmon_dev = i2c_get_clientdata(client);
  445. hwmon_device_unregister(hwmon_dev);
  446. return 0;
  447. }
  448. static const struct i2c_device_id ltc4245_id[] = {
  449. { "ltc4245", 0 },
  450. { }
  451. };
  452. MODULE_DEVICE_TABLE(i2c, ltc4245_id);
  453. /* This is the driver that will be inserted */
  454. static struct i2c_driver ltc4245_driver = {
  455. .driver = {
  456. .name = "ltc4245",
  457. },
  458. .probe = ltc4245_probe,
  459. .remove = ltc4245_remove,
  460. .id_table = ltc4245_id,
  461. };
  462. module_i2c_driver(ltc4245_driver);
  463. MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
  464. MODULE_DESCRIPTION("LTC4245 driver");
  465. MODULE_LICENSE("GPL");