tps65023-regulator.c 15 KB

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