fan53555.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /*
  2. * FAN53555 Fairchild Digitally Programmable TinyBuck Regulator Driver.
  3. *
  4. * Supported Part Numbers:
  5. * FAN53555UC00X/01X/03X/04X/05X
  6. *
  7. * Copyright (c) 2012 Marvell Technology Ltd.
  8. * Yunfan Zhang <yfzhang@marvell.com>
  9. *
  10. * This package is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. */
  15. #include <linux/module.h>
  16. #include <linux/param.h>
  17. #include <linux/err.h>
  18. #include <linux/delay.h>
  19. #include <linux/gpio.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/regulator/driver.h>
  22. #include <linux/regulator/machine.h>
  23. #include <linux/regulator/of_regulator.h>
  24. #include <linux/of.h>
  25. #include <linux/of_gpio.h>
  26. #include <linux/i2c.h>
  27. #include <linux/slab.h>
  28. #include <linux/regmap.h>
  29. #include <linux/regulator/fan53555.h>
  30. /* Voltage setting */
  31. #define FAN53555_VSEL0 0x00
  32. #define FAN53555_VSEL1 0x01
  33. /* Control register */
  34. #define FAN53555_CONTROL 0x02
  35. /* IC Type */
  36. #define FAN53555_ID1 0x03
  37. /* IC mask version */
  38. #define FAN53555_ID2 0x04
  39. /* Monitor register */
  40. #define FAN53555_MONITOR 0x05
  41. /* VSEL bit definitions */
  42. #define VSEL_BUCK_EN (1 << 7)
  43. #define VSEL_MODE (1 << 6)
  44. #define VSEL_NSEL_MASK 0x3F
  45. #define VSEL_FULL_MASK 0xFF
  46. /* Chip ID and Verison */
  47. #define DIE_ID 0x0F /* ID1 */
  48. #define DIE_REV 0x0F /* ID2 */
  49. #define DIE_13_REV 0x0F /* DIE Revsion ID of 13 option */
  50. /* Control bit definitions */
  51. #define CTL_OUTPUT_DISCHG (1 << 7)
  52. #define CTL_SLEW_MASK (0x7 << 4)
  53. #define CTL_SLEW_SHIFT 4
  54. #define CTL_RESET (1 << 2)
  55. #define FAN53555_NVOLTAGES 64 /* Numbers of voltages */
  56. /* IC Type */
  57. enum {
  58. FAN53555_CHIP_ID_00 = 0,
  59. FAN53555_CHIP_ID_01,
  60. FAN53555_CHIP_ID_02,
  61. FAN53555_CHIP_ID_03,
  62. FAN53555_CHIP_ID_04,
  63. FAN53555_CHIP_ID_05,
  64. };
  65. static const int slew_rate_plan[] = {
  66. 64000,
  67. 32000,
  68. 16000,
  69. 8000,
  70. 4000,
  71. 2000,
  72. 1000,
  73. 500
  74. };
  75. struct fan53555_device_info {
  76. struct regmap *regmap;
  77. struct device *dev;
  78. struct regulator_desc desc;
  79. struct regulator_dev *rdev;
  80. struct regulator_init_data *regulator;
  81. /* IC Type and Rev */
  82. int chip_id;
  83. int chip_rev;
  84. /* Voltage setting register */
  85. unsigned int vol_reg;
  86. unsigned int sleep_reg;
  87. /* Voltage range and step(linear) */
  88. unsigned int vsel_min;
  89. unsigned int vsel_step;
  90. /* Voltage slew rate limiting */
  91. unsigned int slew_rate;
  92. /* Sleep voltage cache */
  93. unsigned int sleep_vol_cache;
  94. bool disable_suspend;
  95. };
  96. static int fan53555_get_voltage(struct regulator_dev *rdev)
  97. {
  98. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  99. unsigned int val;
  100. int rc;
  101. rc = regmap_read(di->regmap, di->vol_reg, &val);
  102. if (rc) {
  103. dev_err(di->dev, "Unable to get voltage rc(%d)", rc);
  104. return rc;
  105. }
  106. return ((val & VSEL_NSEL_MASK) * di->vsel_step) +
  107. di->vsel_min;
  108. }
  109. static int fan53555_set_voltage(struct regulator_dev *rdev,
  110. int min_uv, int max_uv, unsigned *selector)
  111. {
  112. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  113. int rc, set_val, cur_uv, new_uv;
  114. set_val = DIV_ROUND_UP(min_uv - di->vsel_min, di->vsel_step);
  115. new_uv = (set_val * di->vsel_step) + di->vsel_min;
  116. if (new_uv > max_uv || max_uv < di->vsel_min) {
  117. dev_err(di->dev, "Unable to set voltage (%d %d)\n",
  118. min_uv, max_uv);
  119. }
  120. cur_uv = fan53555_get_voltage(rdev);
  121. if (cur_uv < 0)
  122. return cur_uv;
  123. rc = regmap_update_bits(di->regmap, di->vol_reg, VSEL_NSEL_MASK,
  124. set_val);
  125. if (rc) {
  126. dev_err(di->dev, "Unable to set voltage (%d %d)\n",
  127. min_uv, max_uv);
  128. } else {
  129. udelay(DIV_ROUND_UP(abs(new_uv - cur_uv),
  130. slew_rate_plan[di->slew_rate]));
  131. *selector = set_val;
  132. }
  133. return rc;
  134. }
  135. static int fan53555_list_voltage(struct regulator_dev *rdev,
  136. unsigned selector)
  137. {
  138. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  139. if (selector >= di->desc.n_voltages)
  140. return 0;
  141. return selector * di->vsel_step + di->vsel_min;
  142. }
  143. static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
  144. {
  145. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  146. int ret, val;
  147. if (di->sleep_vol_cache == uV)
  148. return 0;
  149. ret = fan53555_set_voltage(rdev, uV, uV, &val);
  150. if (ret < 0)
  151. return -EINVAL;
  152. ret = regmap_update_bits(di->regmap, di->sleep_reg,
  153. VSEL_NSEL_MASK, val);
  154. if (ret < 0)
  155. return -EINVAL;
  156. /* Cache the sleep voltage setting.
  157. * Might not be the real voltage which is rounded */
  158. di->sleep_vol_cache = uV;
  159. return 0;
  160. }
  161. static int fan53555_enable(struct regulator_dev *rdev)
  162. {
  163. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  164. int ret;
  165. ret = regmap_update_bits(di->regmap, di->vol_reg,
  166. VSEL_BUCK_EN, VSEL_BUCK_EN);
  167. if (ret)
  168. dev_err(di->dev, "Unable to enable regulator, ret = %d\n",
  169. ret);
  170. return ret;
  171. }
  172. static int fan53555_disable(struct regulator_dev *rdev)
  173. {
  174. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  175. int ret;
  176. ret = regmap_update_bits(di->regmap, di->vol_reg,
  177. VSEL_BUCK_EN, 0);
  178. if (ret)
  179. dev_err(di->dev, "Unable to set disable regulator, ret = %d\n",
  180. ret);
  181. return ret;
  182. }
  183. static int fan53555_is_enabled(struct regulator_dev *rdev)
  184. {
  185. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  186. int ret;
  187. u32 val;
  188. ret = regmap_read(di->regmap, di->vol_reg, &val);
  189. if (ret) {
  190. dev_err(di->dev, "Unable to get regulator status, ret = %d\n",
  191. ret);
  192. return ret;
  193. } else {
  194. return val & VSEL_BUCK_EN;
  195. }
  196. }
  197. static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode)
  198. {
  199. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  200. switch (mode) {
  201. case REGULATOR_MODE_FAST:
  202. regmap_update_bits(di->regmap, di->vol_reg,
  203. VSEL_MODE, VSEL_MODE);
  204. break;
  205. case REGULATOR_MODE_NORMAL:
  206. regmap_update_bits(di->regmap, di->vol_reg, VSEL_MODE, 0);
  207. break;
  208. default:
  209. return -EINVAL;
  210. }
  211. return 0;
  212. }
  213. static unsigned int fan53555_get_mode(struct regulator_dev *rdev)
  214. {
  215. struct fan53555_device_info *di = rdev_get_drvdata(rdev);
  216. unsigned int val;
  217. int ret = 0;
  218. ret = regmap_read(di->regmap, di->vol_reg, &val);
  219. if (ret < 0)
  220. return ret;
  221. if (val & VSEL_MODE)
  222. return REGULATOR_MODE_FAST;
  223. else
  224. return REGULATOR_MODE_NORMAL;
  225. }
  226. static struct regulator_ops fan53555_regulator_ops = {
  227. .set_voltage = fan53555_set_voltage,
  228. .get_voltage = fan53555_get_voltage,
  229. .list_voltage = fan53555_list_voltage,
  230. .set_suspend_voltage = fan53555_set_suspend_voltage,
  231. .enable = fan53555_enable,
  232. .disable = fan53555_disable,
  233. .is_enabled = fan53555_is_enabled,
  234. .set_mode = fan53555_set_mode,
  235. .get_mode = fan53555_get_mode,
  236. };
  237. static struct regulator_ops fan53555_regulator_disable_suspend_ops = {
  238. .set_voltage = fan53555_set_voltage,
  239. .get_voltage = fan53555_get_voltage,
  240. .list_voltage = fan53555_list_voltage,
  241. .enable = fan53555_enable,
  242. .disable = fan53555_disable,
  243. .is_enabled = fan53555_is_enabled,
  244. .set_mode = fan53555_set_mode,
  245. .get_mode = fan53555_get_mode,
  246. };
  247. /* For 00,01,03,05 options:
  248. * VOUT = 0.60V + NSELx * 10mV, from 0.60 to 1.23V.
  249. * For 04 option:
  250. * VOUT = 0.603V + NSELx * 12.826mV, from 0.603 to 1.411V.
  251. * For 13 option:
  252. * 13 option, its DIE ID is 0x00 and DIE_REV is 0x0F.
  253. * VOUT = 0.80V + NSELx * 10mV, from 0.80 to 1.43V.
  254. * */
  255. static int fan53555_device_setup(struct fan53555_device_info *di,
  256. struct fan53555_platform_data *pdata)
  257. {
  258. unsigned int reg, data, mask;
  259. /* Setup voltage control register */
  260. switch (pdata->sleep_vsel_id) {
  261. case FAN53555_VSEL_ID_0:
  262. di->sleep_reg = FAN53555_VSEL0;
  263. di->vol_reg = FAN53555_VSEL1;
  264. break;
  265. case FAN53555_VSEL_ID_1:
  266. di->sleep_reg = FAN53555_VSEL1;
  267. di->vol_reg = FAN53555_VSEL0;
  268. break;
  269. default:
  270. dev_err(di->dev, "Invalid VSEL ID!\n");
  271. return -EINVAL;
  272. }
  273. /* Init voltage range and step */
  274. switch (di->chip_id) {
  275. case FAN53555_CHIP_ID_00:
  276. if (di->chip_rev == DIE_13_REV) {
  277. di->vsel_min = 800000;
  278. di->vsel_step = 10000;
  279. break;
  280. }
  281. case FAN53555_CHIP_ID_01:
  282. case FAN53555_CHIP_ID_03:
  283. case FAN53555_CHIP_ID_05:
  284. di->vsel_min = 600000;
  285. di->vsel_step = 10000;
  286. break;
  287. case FAN53555_CHIP_ID_04:
  288. di->vsel_min = 603000;
  289. di->vsel_step = 12826;
  290. break;
  291. default:
  292. dev_err(di->dev,
  293. "Chip ID[%d]\n not supported!\n", di->chip_id);
  294. return -EINVAL;
  295. }
  296. /* Init slew rate */
  297. if (pdata->slew_rate & 0x7)
  298. di->slew_rate = pdata->slew_rate;
  299. else
  300. di->slew_rate = FAN53555_SLEW_RATE_64MV;
  301. reg = FAN53555_CONTROL;
  302. data = di->slew_rate << CTL_SLEW_SHIFT;
  303. mask = CTL_SLEW_MASK;
  304. return regmap_update_bits(di->regmap, reg, mask, data);
  305. }
  306. static int fan53555_regulator_register(struct fan53555_device_info *di,
  307. struct i2c_client *client)
  308. {
  309. struct regulator_desc *rdesc = &di->desc;
  310. rdesc->name = "fan53555-reg";
  311. if (di->disable_suspend)
  312. rdesc->ops = &fan53555_regulator_disable_suspend_ops;
  313. else
  314. rdesc->ops = &fan53555_regulator_ops;
  315. rdesc->type = REGULATOR_VOLTAGE;
  316. rdesc->n_voltages = FAN53555_NVOLTAGES;
  317. rdesc->owner = THIS_MODULE;
  318. di->rdev = regulator_register(&di->desc, di->dev,
  319. di->regulator, di, client->dev.of_node);
  320. return PTR_RET(di->rdev);
  321. }
  322. static struct regmap_config fan53555_regmap_config = {
  323. .reg_bits = 8,
  324. .val_bits = 8,
  325. };
  326. static int fan53555_parse_backup_reg(struct i2c_client *client, u32 *sleep_sel)
  327. {
  328. int rc = -EINVAL;
  329. rc = of_property_read_u32(client->dev.of_node, "fairchild,backup-vsel",
  330. sleep_sel);
  331. if (rc) {
  332. dev_err(&client->dev, "fairchild,backup-vsel property missing\n");
  333. } else {
  334. switch (*sleep_sel) {
  335. case FAN53555_VSEL_ID_0:
  336. case FAN53555_VSEL_ID_1:
  337. break;
  338. default:
  339. dev_err(&client->dev, "Invalid VSEL ID!\n");
  340. rc = -EINVAL;
  341. }
  342. }
  343. return rc;
  344. }
  345. static u32 fan53555_get_slew_rate_reg_value(struct i2c_client *client,
  346. u32 slew_rate)
  347. {
  348. u32 index;
  349. for (index = 0; index < ARRAY_SIZE(slew_rate_plan); index++)
  350. if (slew_rate == slew_rate_plan[index])
  351. break;
  352. if (index == ARRAY_SIZE(slew_rate_plan)) {
  353. dev_err(&client->dev, "invalid slew rate.\n");
  354. index = FAN53555_SLEW_RATE_8MV;
  355. }
  356. return index;
  357. }
  358. static struct fan53555_platform_data *
  359. fan53555_get_of_platform_data(struct i2c_client *client)
  360. {
  361. struct fan53555_platform_data *pdata = NULL;
  362. struct regulator_init_data *init_data;
  363. u32 sleep_sel, slew_rate;
  364. int rc;
  365. init_data = of_get_regulator_init_data(&client->dev,
  366. client->dev.of_node);
  367. if (!init_data) {
  368. dev_err(&client->dev, "regulator init data is missing\n");
  369. return pdata;
  370. }
  371. rc = of_property_read_u32(client->dev.of_node, "regulator-ramp-delay",
  372. &slew_rate);
  373. if (rc)
  374. slew_rate = slew_rate_plan[FAN53555_SLEW_RATE_8MV];
  375. if (fan53555_parse_backup_reg(client, &sleep_sel))
  376. return pdata;
  377. pdata = devm_kzalloc(&client->dev,
  378. sizeof(struct fan53555_platform_data), GFP_KERNEL);
  379. if (!pdata) {
  380. dev_err(&client->dev,
  381. "fan53555_platform_data allocation failed.\n");
  382. return pdata;
  383. }
  384. init_data->constraints.input_uV = init_data->constraints.max_uV;
  385. init_data->constraints.valid_ops_mask |=
  386. REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE |
  387. REGULATOR_CHANGE_MODE;
  388. init_data->constraints.valid_modes_mask =
  389. REGULATOR_MODE_NORMAL |
  390. REGULATOR_MODE_FAST;
  391. init_data->constraints.initial_mode = REGULATOR_MODE_NORMAL;
  392. pdata->regulator = init_data;
  393. pdata->slew_rate = fan53555_get_slew_rate_reg_value(client,
  394. slew_rate);
  395. pdata->sleep_vsel_id = sleep_sel;
  396. return pdata;
  397. }
  398. static int fan53555_restore_working_reg(struct device_node *node,
  399. struct fan53555_device_info *di)
  400. {
  401. int ret;
  402. u32 val;
  403. /* Restore register from back up register */
  404. ret = regmap_read(di->regmap, di->sleep_reg, &val);
  405. if (ret < 0) {
  406. dev_err(di->dev,
  407. "Failed to get backup data from reg %d, ret = %d\n",
  408. di->sleep_reg, ret);
  409. return ret;
  410. }
  411. ret = regmap_update_bits(di->regmap,
  412. di->vol_reg, VSEL_FULL_MASK, val);
  413. if (ret < 0) {
  414. dev_err(di->dev,
  415. "Failed to update working reg %d, ret = %d\n",
  416. di->vol_reg, ret);
  417. return ret;
  418. }
  419. return ret;
  420. }
  421. static int fan53555_of_init(struct device_node *node,
  422. struct fan53555_device_info *di)
  423. {
  424. int ret, gpio;
  425. enum of_gpio_flags flags;
  426. if (of_property_read_bool(node, "fairchild,restore-reg")) {
  427. ret = fan53555_restore_working_reg(node, di);
  428. if (ret)
  429. return ret;
  430. }
  431. if (of_find_property(node, "fairchild,vsel-gpio", NULL)) {
  432. gpio = of_get_named_gpio_flags(node, "fairchild,vsel-gpio", 0,
  433. &flags);
  434. if (!gpio_is_valid(gpio)) {
  435. if (gpio != -EPROBE_DEFER)
  436. dev_err(di->dev, "Could not get vsel, ret = %d\n",
  437. gpio);
  438. return gpio;
  439. }
  440. ret = devm_gpio_request(di->dev, gpio, "fan53555_vsel");
  441. if (ret) {
  442. dev_err(di->dev, "Failed to obtain gpio %d ret = %d\n",
  443. gpio, ret);
  444. return ret;
  445. }
  446. ret = gpio_direction_output(gpio, flags & OF_GPIO_ACTIVE_LOW ?
  447. 0 : 1);
  448. if (ret) {
  449. dev_err(di->dev,
  450. "Failed to set GPIO %d to: %s, ret = %d",
  451. gpio, flags & OF_GPIO_ACTIVE_LOW ?
  452. "GPIO_LOW" : "GPIO_HIGH", ret);
  453. return ret;
  454. }
  455. }
  456. di->disable_suspend = of_property_read_bool(node,
  457. "fairchild,disable-suspend");
  458. return 0;
  459. }
  460. static int __devinit fan53555_regulator_probe(struct i2c_client *client,
  461. const struct i2c_device_id *id)
  462. {
  463. struct fan53555_device_info *di;
  464. struct fan53555_platform_data *pdata;
  465. unsigned int val;
  466. int ret;
  467. if (client->dev.of_node)
  468. pdata = fan53555_get_of_platform_data(client);
  469. else
  470. pdata = client->dev.platform_data;
  471. if (!pdata || !pdata->regulator) {
  472. dev_err(&client->dev, "Platform data not found!\n");
  473. return -ENODEV;
  474. }
  475. di = devm_kzalloc(&client->dev, sizeof(struct fan53555_device_info),
  476. GFP_KERNEL);
  477. if (!di) {
  478. dev_err(&client->dev, "Failed to allocate device info data!\n");
  479. return -ENOMEM;
  480. }
  481. di->regmap = devm_regmap_init_i2c(client, &fan53555_regmap_config);
  482. if (IS_ERR(di->regmap)) {
  483. dev_err(&client->dev, "Failed to allocate regmap!\n");
  484. return PTR_ERR(di->regmap);
  485. }
  486. di->dev = &client->dev;
  487. di->regulator = pdata->regulator;
  488. i2c_set_clientdata(client, di);
  489. /* Get chip ID */
  490. ret = regmap_read(di->regmap, FAN53555_ID1, &val);
  491. if (ret < 0) {
  492. dev_err(&client->dev, "Failed to get chip ID!\n");
  493. return -ENODEV;
  494. }
  495. di->chip_id = val & DIE_ID;
  496. /* Get chip revision */
  497. ret = regmap_read(di->regmap, FAN53555_ID2, &val);
  498. if (ret < 0) {
  499. dev_err(&client->dev, "Failed to get chip Rev!\n");
  500. return -ENODEV;
  501. }
  502. di->chip_rev = val & DIE_REV;
  503. dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n",
  504. di->chip_id, di->chip_rev);
  505. /* Device init */
  506. ret = fan53555_device_setup(di, pdata);
  507. if (ret < 0) {
  508. dev_err(&client->dev, "Failed to setup device!\n");
  509. return ret;
  510. }
  511. /* Set up from device tree */
  512. if (client->dev.of_node) {
  513. ret = fan53555_of_init(client->dev.of_node, di);
  514. if (ret)
  515. return ret;
  516. }
  517. ret = fan53555_regulator_register(di, client);
  518. if (ret < 0)
  519. dev_err(&client->dev, "Failed to register regulator!\n");
  520. return ret;
  521. }
  522. static int __devexit fan53555_regulator_remove(struct i2c_client *client)
  523. {
  524. struct fan53555_device_info *di = i2c_get_clientdata(client);
  525. regulator_unregister(di->rdev);
  526. return 0;
  527. }
  528. static struct of_device_id fan53555_match_table[] = {
  529. { .compatible = "fairchild,fan53555-regulator",},
  530. {},
  531. };
  532. MODULE_DEVICE_TABLE(of, fan53555_match_table);
  533. static const struct i2c_device_id fan53555_id[] = {
  534. {"fan53555", -1},
  535. { },
  536. };
  537. static struct i2c_driver fan53555_regulator_driver = {
  538. .driver = {
  539. .name = "fan53555-regulator",
  540. .owner = THIS_MODULE,
  541. .of_match_table = fan53555_match_table,
  542. },
  543. .probe = fan53555_regulator_probe,
  544. .remove = __devexit_p(fan53555_regulator_remove),
  545. .id_table = fan53555_id,
  546. };
  547. /**
  548. * fan53555_regulator_init() - initialized fan53555 regulator driver
  549. * This function registers the fan53555 regulator platform driver.
  550. *
  551. * Returns 0 on success or errno on failure.
  552. */
  553. int __init fan53555_regulator_init(void)
  554. {
  555. static bool initialized;
  556. if (initialized)
  557. return 0;
  558. else
  559. initialized = true;
  560. return i2c_add_driver(&fan53555_regulator_driver);
  561. }
  562. EXPORT_SYMBOL(fan53555_regulator_init);
  563. module_init(fan53555_regulator_init);
  564. static void __exit fan53555_regulator_exit(void)
  565. {
  566. i2c_del_driver(&fan53555_regulator_driver);
  567. }
  568. module_exit(fan53555_regulator_exit);
  569. MODULE_AUTHOR("Yunfan Zhang <yfzhang@marvell.com>");
  570. MODULE_DESCRIPTION("FAN53555 regulator driver");
  571. MODULE_LICENSE("GPL v2");