tps65023-regulator.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. /*
  2. * tps65023-regulator.c
  3. *
  4. * Supports TPS65023 Regulator
  5. *
  6. * Copyright (C) 2009 Texas Instrument Incorporated - http://www.ti.com/
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation version 2.
  11. *
  12. * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
  13. * whether express or implied; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/module.h>
  19. #include <linux/init.h>
  20. #include <linux/err.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/regulator/driver.h>
  23. #include <linux/regulator/machine.h>
  24. #include <linux/i2c.h>
  25. #include <linux/delay.h>
  26. #include <linux/slab.h>
  27. /* Register definitions */
  28. #define TPS65023_REG_VERSION 0
  29. #define TPS65023_REG_PGOODZ 1
  30. #define TPS65023_REG_MASK 2
  31. #define TPS65023_REG_REG_CTRL 3
  32. #define TPS65023_REG_CON_CTRL 4
  33. #define TPS65023_REG_CON_CTRL2 5
  34. #define TPS65023_REG_DEF_CORE 6
  35. #define TPS65023_REG_DEFSLEW 7
  36. #define TPS65023_REG_LDO_CTRL 8
  37. /* PGOODZ bitfields */
  38. #define TPS65023_PGOODZ_PWRFAILZ BIT(7)
  39. #define TPS65023_PGOODZ_LOWBATTZ BIT(6)
  40. #define TPS65023_PGOODZ_VDCDC1 BIT(5)
  41. #define TPS65023_PGOODZ_VDCDC2 BIT(4)
  42. #define TPS65023_PGOODZ_VDCDC3 BIT(3)
  43. #define TPS65023_PGOODZ_LDO2 BIT(2)
  44. #define TPS65023_PGOODZ_LDO1 BIT(1)
  45. /* MASK bitfields */
  46. #define TPS65023_MASK_PWRFAILZ BIT(7)
  47. #define TPS65023_MASK_LOWBATTZ BIT(6)
  48. #define TPS65023_MASK_VDCDC1 BIT(5)
  49. #define TPS65023_MASK_VDCDC2 BIT(4)
  50. #define TPS65023_MASK_VDCDC3 BIT(3)
  51. #define TPS65023_MASK_LDO2 BIT(2)
  52. #define TPS65023_MASK_LDO1 BIT(1)
  53. /* REG_CTRL bitfields */
  54. #define TPS65023_REG_CTRL_VDCDC1_EN BIT(5)
  55. #define TPS65023_REG_CTRL_VDCDC2_EN BIT(4)
  56. #define TPS65023_REG_CTRL_VDCDC3_EN BIT(3)
  57. #define TPS65023_REG_CTRL_LDO2_EN BIT(2)
  58. #define TPS65023_REG_CTRL_LDO1_EN BIT(1)
  59. /* LDO_CTRL bitfields */
  60. #define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4)
  61. #define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0xF0 >> ((ldo_id)*4))
  62. /* Number of step-down converters available */
  63. #define TPS65023_NUM_DCDC 3
  64. /* Number of LDO voltage regulators available */
  65. #define TPS65023_NUM_LDO 2
  66. /* Number of total regulators available */
  67. #define TPS65023_NUM_REGULATOR (TPS65023_NUM_DCDC + TPS65023_NUM_LDO)
  68. /* DCDCs */
  69. #define TPS65023_DCDC_1 0
  70. #define TPS65023_DCDC_2 1
  71. #define TPS65023_DCDC_3 2
  72. /* LDOs */
  73. #define TPS65023_LDO_1 3
  74. #define TPS65023_LDO_2 4
  75. #define TPS65023_MAX_REG_ID TPS65023_LDO_2
  76. /* Supported voltage values for regulators */
  77. static const u16 VDCDC1_VSEL_table[] = {
  78. 800, 825, 850, 875,
  79. 900, 925, 950, 975,
  80. 1000, 1025, 1050, 1075,
  81. 1100, 1125, 1150, 1175,
  82. 1200, 1225, 1250, 1275,
  83. 1300, 1325, 1350, 1375,
  84. 1400, 1425, 1450, 1475,
  85. 1500, 1525, 1550, 1600,
  86. };
  87. static const u16 LDO1_VSEL_table[] = {
  88. 1000, 1100, 1300, 1800,
  89. 2200, 2600, 2800, 3150,
  90. };
  91. static const u16 LDO2_VSEL_table[] = {
  92. 1050, 1200, 1300, 1800,
  93. 2500, 2800, 3000, 3300,
  94. };
  95. static unsigned int num_voltages[] = {ARRAY_SIZE(VDCDC1_VSEL_table),
  96. 0, 0, ARRAY_SIZE(LDO1_VSEL_table),
  97. ARRAY_SIZE(LDO2_VSEL_table)};
  98. /* Regulator specific details */
  99. struct tps_info {
  100. const char *name;
  101. unsigned min_uV;
  102. unsigned max_uV;
  103. bool fixed;
  104. u8 table_len;
  105. const u16 *table;
  106. };
  107. /* PMIC details */
  108. struct tps_pmic {
  109. struct regulator_desc desc[TPS65023_NUM_REGULATOR];
  110. struct i2c_client *client;
  111. struct regulator_dev *rdev[TPS65023_NUM_REGULATOR];
  112. const struct tps_info *info[TPS65023_NUM_REGULATOR];
  113. struct mutex io_lock;
  114. };
  115. static inline int tps_65023_read(struct tps_pmic *tps, u8 reg)
  116. {
  117. return i2c_smbus_read_byte_data(tps->client, reg);
  118. }
  119. static inline int tps_65023_write(struct tps_pmic *tps, u8 reg, u8 val)
  120. {
  121. return i2c_smbus_write_byte_data(tps->client, reg, val);
  122. }
  123. static int tps_65023_set_bits(struct tps_pmic *tps, u8 reg, u8 mask)
  124. {
  125. int err, data;
  126. mutex_lock(&tps->io_lock);
  127. data = tps_65023_read(tps, reg);
  128. if (data < 0) {
  129. dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
  130. err = data;
  131. goto out;
  132. }
  133. data |= mask;
  134. err = tps_65023_write(tps, reg, data);
  135. if (err)
  136. dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
  137. out:
  138. mutex_unlock(&tps->io_lock);
  139. return err;
  140. }
  141. static int tps_65023_clear_bits(struct tps_pmic *tps, u8 reg, u8 mask)
  142. {
  143. int err, data;
  144. mutex_lock(&tps->io_lock);
  145. data = tps_65023_read(tps, reg);
  146. if (data < 0) {
  147. dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
  148. err = data;
  149. goto out;
  150. }
  151. data &= ~mask;
  152. err = tps_65023_write(tps, reg, data);
  153. if (err)
  154. dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
  155. out:
  156. mutex_unlock(&tps->io_lock);
  157. return err;
  158. }
  159. static int tps_65023_reg_read(struct tps_pmic *tps, u8 reg)
  160. {
  161. int data;
  162. mutex_lock(&tps->io_lock);
  163. data = tps_65023_read(tps, reg);
  164. if (data < 0)
  165. dev_err(&tps->client->dev, "Read from reg 0x%x failed\n", reg);
  166. mutex_unlock(&tps->io_lock);
  167. return data;
  168. }
  169. static int tps_65023_reg_write(struct tps_pmic *tps, u8 reg, u8 val)
  170. {
  171. int err;
  172. mutex_lock(&tps->io_lock);
  173. err = tps_65023_write(tps, reg, val);
  174. if (err < 0)
  175. dev_err(&tps->client->dev, "Write for reg 0x%x failed\n", reg);
  176. mutex_unlock(&tps->io_lock);
  177. return err;
  178. }
  179. static int tps65023_dcdc_is_enabled(struct regulator_dev *dev)
  180. {
  181. struct tps_pmic *tps = rdev_get_drvdata(dev);
  182. int data, dcdc = rdev_get_id(dev);
  183. u8 shift;
  184. if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
  185. return -EINVAL;
  186. shift = TPS65023_NUM_REGULATOR - dcdc;
  187. data = tps_65023_reg_read(tps, TPS65023_REG_REG_CTRL);
  188. if (data < 0)
  189. return data;
  190. else
  191. return (data & 1<<shift) ? 1 : 0;
  192. }
  193. static int tps65023_ldo_is_enabled(struct regulator_dev *dev)
  194. {
  195. struct tps_pmic *tps = rdev_get_drvdata(dev);
  196. int data, ldo = rdev_get_id(dev);
  197. u8 shift;
  198. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  199. return -EINVAL;
  200. shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
  201. data = tps_65023_reg_read(tps, TPS65023_REG_REG_CTRL);
  202. if (data < 0)
  203. return data;
  204. else
  205. return (data & 1<<shift) ? 1 : 0;
  206. }
  207. static int tps65023_dcdc_enable(struct regulator_dev *dev)
  208. {
  209. struct tps_pmic *tps = rdev_get_drvdata(dev);
  210. int dcdc = rdev_get_id(dev);
  211. u8 shift;
  212. if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
  213. return -EINVAL;
  214. shift = TPS65023_NUM_REGULATOR - dcdc;
  215. return tps_65023_set_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
  216. }
  217. static int tps65023_dcdc_disable(struct regulator_dev *dev)
  218. {
  219. struct tps_pmic *tps = rdev_get_drvdata(dev);
  220. int dcdc = rdev_get_id(dev);
  221. u8 shift;
  222. if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
  223. return -EINVAL;
  224. shift = TPS65023_NUM_REGULATOR - dcdc;
  225. return tps_65023_clear_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
  226. }
  227. static int tps65023_ldo_enable(struct regulator_dev *dev)
  228. {
  229. struct tps_pmic *tps = rdev_get_drvdata(dev);
  230. int ldo = rdev_get_id(dev);
  231. u8 shift;
  232. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  233. return -EINVAL;
  234. shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
  235. return tps_65023_set_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
  236. }
  237. static int tps65023_ldo_disable(struct regulator_dev *dev)
  238. {
  239. struct tps_pmic *tps = rdev_get_drvdata(dev);
  240. int ldo = rdev_get_id(dev);
  241. u8 shift;
  242. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  243. return -EINVAL;
  244. shift = (ldo == TPS65023_LDO_1 ? 1 : 2);
  245. return tps_65023_clear_bits(tps, TPS65023_REG_REG_CTRL, 1 << shift);
  246. }
  247. static int tps65023_dcdc_get_voltage(struct regulator_dev *dev)
  248. {
  249. struct tps_pmic *tps = rdev_get_drvdata(dev);
  250. int data, dcdc = rdev_get_id(dev);
  251. if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
  252. return -EINVAL;
  253. if (dcdc == TPS65023_DCDC_1) {
  254. data = tps_65023_reg_read(tps, TPS65023_REG_DEF_CORE);
  255. if (data < 0)
  256. return data;
  257. data &= (tps->info[dcdc]->table_len - 1);
  258. return tps->info[dcdc]->table[data] * 1000;
  259. } else
  260. return tps->info[dcdc]->min_uV;
  261. }
  262. static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
  263. int min_uV, int max_uV)
  264. {
  265. struct tps_pmic *tps = rdev_get_drvdata(dev);
  266. int dcdc = rdev_get_id(dev);
  267. int vsel;
  268. if (dcdc != TPS65023_DCDC_1)
  269. return -EINVAL;
  270. if (min_uV < tps->info[dcdc]->min_uV
  271. || min_uV > tps->info[dcdc]->max_uV)
  272. return -EINVAL;
  273. if (max_uV < tps->info[dcdc]->min_uV
  274. || max_uV > tps->info[dcdc]->max_uV)
  275. return -EINVAL;
  276. for (vsel = 0; vsel < tps->info[dcdc]->table_len; vsel++) {
  277. int mV = tps->info[dcdc]->table[vsel];
  278. int uV = mV * 1000;
  279. /* Break at the first in-range value */
  280. if (min_uV <= uV && uV <= max_uV)
  281. break;
  282. }
  283. /* write to the register in case we found a match */
  284. if (vsel == tps->info[dcdc]->table_len)
  285. return -EINVAL;
  286. else
  287. return tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
  288. }
  289. static int tps65023_ldo_get_voltage(struct regulator_dev *dev)
  290. {
  291. struct tps_pmic *tps = rdev_get_drvdata(dev);
  292. int data, ldo = rdev_get_id(dev);
  293. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  294. return -EINVAL;
  295. data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL);
  296. if (data < 0)
  297. return data;
  298. data >>= (TPS65023_LDO_CTRL_LDOx_SHIFT(ldo - TPS65023_LDO_1));
  299. data &= (tps->info[ldo]->table_len - 1);
  300. return tps->info[ldo]->table[data] * 1000;
  301. }
  302. static int tps65023_ldo_set_voltage(struct regulator_dev *dev,
  303. int min_uV, int max_uV)
  304. {
  305. struct tps_pmic *tps = rdev_get_drvdata(dev);
  306. int data, vsel, ldo = rdev_get_id(dev);
  307. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  308. return -EINVAL;
  309. if (min_uV < tps->info[ldo]->min_uV || min_uV > tps->info[ldo]->max_uV)
  310. return -EINVAL;
  311. if (max_uV < tps->info[ldo]->min_uV || max_uV > tps->info[ldo]->max_uV)
  312. return -EINVAL;
  313. for (vsel = 0; vsel < tps->info[ldo]->table_len; vsel++) {
  314. int mV = tps->info[ldo]->table[vsel];
  315. int uV = mV * 1000;
  316. /* Break at the first in-range value */
  317. if (min_uV <= uV && uV <= max_uV)
  318. break;
  319. }
  320. if (vsel == tps->info[ldo]->table_len)
  321. return -EINVAL;
  322. data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL);
  323. if (data < 0)
  324. return data;
  325. data &= TPS65023_LDO_CTRL_LDOx_MASK(ldo - TPS65023_LDO_1);
  326. data |= (vsel << (TPS65023_LDO_CTRL_LDOx_SHIFT(ldo - TPS65023_LDO_1)));
  327. return tps_65023_reg_write(tps, TPS65023_REG_LDO_CTRL, data);
  328. }
  329. static int tps65023_dcdc_list_voltage(struct regulator_dev *dev,
  330. unsigned selector)
  331. {
  332. struct tps_pmic *tps = rdev_get_drvdata(dev);
  333. int dcdc = rdev_get_id(dev);
  334. if (dcdc < TPS65023_DCDC_1 || dcdc > TPS65023_DCDC_3)
  335. return -EINVAL;
  336. if (dcdc == TPS65023_DCDC_1) {
  337. if (selector >= tps->info[dcdc]->table_len)
  338. return -EINVAL;
  339. else
  340. return tps->info[dcdc]->table[selector] * 1000;
  341. } else
  342. return tps->info[dcdc]->min_uV;
  343. }
  344. static int tps65023_ldo_list_voltage(struct regulator_dev *dev,
  345. unsigned selector)
  346. {
  347. struct tps_pmic *tps = rdev_get_drvdata(dev);
  348. int ldo = rdev_get_id(dev);
  349. if (ldo < TPS65023_LDO_1 || ldo > TPS65023_LDO_2)
  350. return -EINVAL;
  351. if (selector >= tps->info[ldo]->table_len)
  352. return -EINVAL;
  353. else
  354. return tps->info[ldo]->table[selector] * 1000;
  355. }
  356. /* Operations permitted on VDCDCx */
  357. static struct regulator_ops tps65023_dcdc_ops = {
  358. .is_enabled = tps65023_dcdc_is_enabled,
  359. .enable = tps65023_dcdc_enable,
  360. .disable = tps65023_dcdc_disable,
  361. .get_voltage = tps65023_dcdc_get_voltage,
  362. .set_voltage = tps65023_dcdc_set_voltage,
  363. .list_voltage = tps65023_dcdc_list_voltage,
  364. };
  365. /* Operations permitted on LDOx */
  366. static struct regulator_ops tps65023_ldo_ops = {
  367. .is_enabled = tps65023_ldo_is_enabled,
  368. .enable = tps65023_ldo_enable,
  369. .disable = tps65023_ldo_disable,
  370. .get_voltage = tps65023_ldo_get_voltage,
  371. .set_voltage = tps65023_ldo_set_voltage,
  372. .list_voltage = tps65023_ldo_list_voltage,
  373. };
  374. static int __devinit tps_65023_probe(struct i2c_client *client,
  375. const struct i2c_device_id *id)
  376. {
  377. static int desc_id;
  378. const struct tps_info *info = (void *)id->driver_data;
  379. struct regulator_init_data *init_data;
  380. struct regulator_dev *rdev;
  381. struct tps_pmic *tps;
  382. int i;
  383. int error;
  384. if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
  385. return -EIO;
  386. /**
  387. * init_data points to array of regulator_init structures
  388. * coming from the board-evm file.
  389. */
  390. init_data = client->dev.platform_data;
  391. if (!init_data)
  392. return -EIO;
  393. tps = kzalloc(sizeof(*tps), GFP_KERNEL);
  394. if (!tps)
  395. return -ENOMEM;
  396. mutex_init(&tps->io_lock);
  397. /* common for all regulators */
  398. tps->client = client;
  399. for (i = 0; i < TPS65023_NUM_REGULATOR; i++, info++, init_data++) {
  400. /* Store regulator specific information */
  401. tps->info[i] = info;
  402. tps->desc[i].name = info->name;
  403. tps->desc[i].id = desc_id++;
  404. tps->desc[i].n_voltages = num_voltages[i];
  405. tps->desc[i].ops = (i > TPS65023_DCDC_3 ?
  406. &tps65023_ldo_ops : &tps65023_dcdc_ops);
  407. tps->desc[i].type = REGULATOR_VOLTAGE;
  408. tps->desc[i].owner = THIS_MODULE;
  409. /* Register the regulators */
  410. rdev = regulator_register(&tps->desc[i], &client->dev,
  411. init_data, tps);
  412. if (IS_ERR(rdev)) {
  413. dev_err(&client->dev, "failed to register %s\n",
  414. id->name);
  415. error = PTR_ERR(rdev);
  416. goto fail;
  417. }
  418. /* Save regulator for cleanup */
  419. tps->rdev[i] = rdev;
  420. }
  421. i2c_set_clientdata(client, tps);
  422. return 0;
  423. fail:
  424. while (--i >= 0)
  425. regulator_unregister(tps->rdev[i]);
  426. kfree(tps);
  427. return error;
  428. }
  429. /**
  430. * tps_65023_remove - TPS65023 driver i2c remove handler
  431. * @client: i2c driver client device structure
  432. *
  433. * Unregister TPS driver as an i2c client device driver
  434. */
  435. static int __devexit tps_65023_remove(struct i2c_client *client)
  436. {
  437. struct tps_pmic *tps = i2c_get_clientdata(client);
  438. int i;
  439. for (i = 0; i < TPS65023_NUM_REGULATOR; i++)
  440. regulator_unregister(tps->rdev[i]);
  441. kfree(tps);
  442. return 0;
  443. }
  444. static const struct tps_info tps65023_regs[] = {
  445. {
  446. .name = "VDCDC1",
  447. .min_uV = 800000,
  448. .max_uV = 1600000,
  449. .table_len = ARRAY_SIZE(VDCDC1_VSEL_table),
  450. .table = VDCDC1_VSEL_table,
  451. },
  452. {
  453. .name = "VDCDC2",
  454. .min_uV = 3300000,
  455. .max_uV = 3300000,
  456. .fixed = 1,
  457. },
  458. {
  459. .name = "VDCDC3",
  460. .min_uV = 1800000,
  461. .max_uV = 1800000,
  462. .fixed = 1,
  463. },
  464. {
  465. .name = "LDO1",
  466. .min_uV = 1000000,
  467. .max_uV = 3150000,
  468. .table_len = ARRAY_SIZE(LDO1_VSEL_table),
  469. .table = LDO1_VSEL_table,
  470. },
  471. {
  472. .name = "LDO2",
  473. .min_uV = 1050000,
  474. .max_uV = 3300000,
  475. .table_len = ARRAY_SIZE(LDO2_VSEL_table),
  476. .table = LDO2_VSEL_table,
  477. },
  478. };
  479. static const struct i2c_device_id tps_65023_id[] = {
  480. {.name = "tps65023",
  481. .driver_data = (unsigned long) tps65023_regs,},
  482. {.name = "tps65021",
  483. .driver_data = (unsigned long) tps65023_regs,},
  484. { },
  485. };
  486. MODULE_DEVICE_TABLE(i2c, tps_65023_id);
  487. static struct i2c_driver tps_65023_i2c_driver = {
  488. .driver = {
  489. .name = "tps65023",
  490. .owner = THIS_MODULE,
  491. },
  492. .probe = tps_65023_probe,
  493. .remove = __devexit_p(tps_65023_remove),
  494. .id_table = tps_65023_id,
  495. };
  496. /**
  497. * tps_65023_init
  498. *
  499. * Module init function
  500. */
  501. static int __init tps_65023_init(void)
  502. {
  503. return i2c_add_driver(&tps_65023_i2c_driver);
  504. }
  505. subsys_initcall(tps_65023_init);
  506. /**
  507. * tps_65023_cleanup
  508. *
  509. * Module exit function
  510. */
  511. static void __exit tps_65023_cleanup(void)
  512. {
  513. i2c_del_driver(&tps_65023_i2c_driver);
  514. }
  515. module_exit(tps_65023_cleanup);
  516. MODULE_AUTHOR("Texas Instruments");
  517. MODULE_DESCRIPTION("TPS65023 voltage regulator driver");
  518. MODULE_LICENSE("GPL v2");