act8865-regulator.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. /*
  2. * act8865-regulator.c - Voltage regulation for active-semi ACT88xx PMUs
  3. *
  4. * http://www.active-semi.com/products/power-management-units/act88xx/
  5. *
  6. * Copyright (C) 2013 Atmel Corporation
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. */
  18. #include <linux/module.h>
  19. #include <linux/init.h>
  20. #include <linux/i2c.h>
  21. #include <linux/err.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/regulator/driver.h>
  24. #include <linux/regulator/act8865.h>
  25. #include <linux/of.h>
  26. #include <linux/of_device.h>
  27. #include <linux/regulator/of_regulator.h>
  28. #include <linux/regmap.h>
  29. /*
  30. * ACT8600 Global Register Map.
  31. */
  32. #define ACT8600_SYS_MODE 0x00
  33. #define ACT8600_SYS_CTRL 0x01
  34. #define ACT8600_DCDC1_VSET 0x10
  35. #define ACT8600_DCDC1_CTRL 0x12
  36. #define ACT8600_DCDC2_VSET 0x20
  37. #define ACT8600_DCDC2_CTRL 0x22
  38. #define ACT8600_DCDC3_VSET 0x30
  39. #define ACT8600_DCDC3_CTRL 0x32
  40. #define ACT8600_SUDCDC4_VSET 0x40
  41. #define ACT8600_SUDCDC4_CTRL 0x41
  42. #define ACT8600_LDO5_VSET 0x50
  43. #define ACT8600_LDO5_CTRL 0x51
  44. #define ACT8600_LDO6_VSET 0x60
  45. #define ACT8600_LDO6_CTRL 0x61
  46. #define ACT8600_LDO7_VSET 0x70
  47. #define ACT8600_LDO7_CTRL 0x71
  48. #define ACT8600_LDO8_VSET 0x80
  49. #define ACT8600_LDO8_CTRL 0x81
  50. #define ACT8600_LDO910_CTRL 0x91
  51. #define ACT8600_APCH0 0xA1
  52. #define ACT8600_APCH1 0xA8
  53. #define ACT8600_APCH2 0xA9
  54. #define ACT8600_APCH_STAT 0xAA
  55. #define ACT8600_OTG0 0xB0
  56. #define ACT8600_OTG1 0xB2
  57. /*
  58. * ACT8846 Global Register Map.
  59. */
  60. #define ACT8846_SYS0 0x00
  61. #define ACT8846_SYS1 0x01
  62. #define ACT8846_REG1_VSET 0x10
  63. #define ACT8846_REG1_CTRL 0x12
  64. #define ACT8846_REG2_VSET0 0x20
  65. #define ACT8846_REG2_VSET1 0x21
  66. #define ACT8846_REG2_CTRL 0x22
  67. #define ACT8846_REG3_VSET0 0x30
  68. #define ACT8846_REG3_VSET1 0x31
  69. #define ACT8846_REG3_CTRL 0x32
  70. #define ACT8846_REG4_VSET0 0x40
  71. #define ACT8846_REG4_VSET1 0x41
  72. #define ACT8846_REG4_CTRL 0x42
  73. #define ACT8846_REG5_VSET 0x50
  74. #define ACT8846_REG5_CTRL 0x51
  75. #define ACT8846_REG6_VSET 0x58
  76. #define ACT8846_REG6_CTRL 0x59
  77. #define ACT8846_REG7_VSET 0x60
  78. #define ACT8846_REG7_CTRL 0x61
  79. #define ACT8846_REG8_VSET 0x68
  80. #define ACT8846_REG8_CTRL 0x69
  81. #define ACT8846_REG9_VSET 0x70
  82. #define ACT8846_REG9_CTRL 0x71
  83. #define ACT8846_REG10_VSET 0x80
  84. #define ACT8846_REG10_CTRL 0x81
  85. #define ACT8846_REG11_VSET 0x90
  86. #define ACT8846_REG11_CTRL 0x91
  87. #define ACT8846_REG12_VSET 0xa0
  88. #define ACT8846_REG12_CTRL 0xa1
  89. #define ACT8846_REG13_CTRL 0xb1
  90. #define ACT8846_GLB_OFF_CTRL 0xc3
  91. #define ACT8846_OFF_SYSMASK 0x18
  92. /*
  93. * ACT8865 Global Register Map.
  94. */
  95. #define ACT8865_SYS_MODE 0x00
  96. #define ACT8865_SYS_CTRL 0x01
  97. #define ACT8865_DCDC1_VSET1 0x20
  98. #define ACT8865_DCDC1_VSET2 0x21
  99. #define ACT8865_DCDC1_CTRL 0x22
  100. #define ACT8865_DCDC2_VSET1 0x30
  101. #define ACT8865_DCDC2_VSET2 0x31
  102. #define ACT8865_DCDC2_CTRL 0x32
  103. #define ACT8865_DCDC3_VSET1 0x40
  104. #define ACT8865_DCDC3_VSET2 0x41
  105. #define ACT8865_DCDC3_CTRL 0x42
  106. #define ACT8865_LDO1_VSET 0x50
  107. #define ACT8865_LDO1_CTRL 0x51
  108. #define ACT8865_LDO2_VSET 0x54
  109. #define ACT8865_LDO2_CTRL 0x55
  110. #define ACT8865_LDO3_VSET 0x60
  111. #define ACT8865_LDO3_CTRL 0x61
  112. #define ACT8865_LDO4_VSET 0x64
  113. #define ACT8865_LDO4_CTRL 0x65
  114. #define ACT8865_MSTROFF 0x20
  115. /*
  116. * Field Definitions.
  117. */
  118. #define ACT8865_ENA 0x80 /* ON - [7] */
  119. #define ACT8865_VSEL_MASK 0x3F /* VSET - [5:0] */
  120. #define ACT8600_LDO10_ENA 0x40 /* ON - [6] */
  121. #define ACT8600_SUDCDC_VSEL_MASK 0xFF /* SUDCDC VSET - [7:0] */
  122. /*
  123. * ACT8865 voltage number
  124. */
  125. #define ACT8865_VOLTAGE_NUM 64
  126. #define ACT8600_SUDCDC_VOLTAGE_NUM 255
  127. struct act8865 {
  128. struct regmap *regmap;
  129. int off_reg;
  130. int off_mask;
  131. };
  132. static const struct regmap_config act8865_regmap_config = {
  133. .reg_bits = 8,
  134. .val_bits = 8,
  135. };
  136. static const struct regulator_linear_range act8865_voltage_ranges[] = {
  137. REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000),
  138. REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000),
  139. REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),
  140. };
  141. static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = {
  142. REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0),
  143. REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000),
  144. REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000),
  145. REGULATOR_LINEAR_RANGE(19000000, 191, 255, 400000),
  146. };
  147. static struct regulator_ops act8865_ops = {
  148. .list_voltage = regulator_list_voltage_linear_range,
  149. .map_voltage = regulator_map_voltage_linear_range,
  150. .get_voltage_sel = regulator_get_voltage_sel_regmap,
  151. .set_voltage_sel = regulator_set_voltage_sel_regmap,
  152. .enable = regulator_enable_regmap,
  153. .disable = regulator_disable_regmap,
  154. .is_enabled = regulator_is_enabled_regmap,
  155. };
  156. static struct regulator_ops act8865_ldo_ops = {
  157. .enable = regulator_enable_regmap,
  158. .disable = regulator_disable_regmap,
  159. .is_enabled = regulator_is_enabled_regmap,
  160. };
  161. #define ACT88xx_REG(_name, _family, _id, _vsel_reg, _supply) \
  162. [_family##_ID_##_id] = { \
  163. .name = _name, \
  164. .supply_name = _supply, \
  165. .id = _family##_ID_##_id, \
  166. .type = REGULATOR_VOLTAGE, \
  167. .ops = &act8865_ops, \
  168. .n_voltages = ACT8865_VOLTAGE_NUM, \
  169. .linear_ranges = act8865_voltage_ranges, \
  170. .n_linear_ranges = ARRAY_SIZE(act8865_voltage_ranges), \
  171. .vsel_reg = _family##_##_id##_##_vsel_reg, \
  172. .vsel_mask = ACT8865_VSEL_MASK, \
  173. .enable_reg = _family##_##_id##_CTRL, \
  174. .enable_mask = ACT8865_ENA, \
  175. .owner = THIS_MODULE, \
  176. }
  177. static const struct regulator_desc act8600_regulators[] = {
  178. ACT88xx_REG("DCDC1", ACT8600, DCDC1, VSET, "vp1"),
  179. ACT88xx_REG("DCDC2", ACT8600, DCDC2, VSET, "vp2"),
  180. ACT88xx_REG("DCDC3", ACT8600, DCDC3, VSET, "vp3"),
  181. {
  182. .name = "SUDCDC_REG4",
  183. .id = ACT8600_ID_SUDCDC4,
  184. .ops = &act8865_ops,
  185. .type = REGULATOR_VOLTAGE,
  186. .n_voltages = ACT8600_SUDCDC_VOLTAGE_NUM,
  187. .linear_ranges = act8600_sudcdc_voltage_ranges,
  188. .n_linear_ranges = ARRAY_SIZE(act8600_sudcdc_voltage_ranges),
  189. .vsel_reg = ACT8600_SUDCDC4_VSET,
  190. .vsel_mask = ACT8600_SUDCDC_VSEL_MASK,
  191. .enable_reg = ACT8600_SUDCDC4_CTRL,
  192. .enable_mask = ACT8865_ENA,
  193. .owner = THIS_MODULE,
  194. },
  195. ACT88xx_REG("LDO5", ACT8600, LDO5, VSET, "inl"),
  196. ACT88xx_REG("LDO6", ACT8600, LDO6, VSET, "inl"),
  197. ACT88xx_REG("LDO7", ACT8600, LDO7, VSET, "inl"),
  198. ACT88xx_REG("LDO8", ACT8600, LDO8, VSET, "inl"),
  199. {
  200. .name = "LDO_REG9",
  201. .id = ACT8600_ID_LDO9,
  202. .ops = &act8865_ldo_ops,
  203. .type = REGULATOR_VOLTAGE,
  204. .n_voltages = 1,
  205. .fixed_uV = 1800000,
  206. .enable_reg = ACT8600_LDO910_CTRL,
  207. .enable_mask = ACT8865_ENA,
  208. .owner = THIS_MODULE,
  209. },
  210. {
  211. .name = "LDO_REG10",
  212. .id = ACT8600_ID_LDO10,
  213. .ops = &act8865_ldo_ops,
  214. .type = REGULATOR_VOLTAGE,
  215. .n_voltages = 1,
  216. .fixed_uV = 1200000,
  217. .enable_reg = ACT8600_LDO910_CTRL,
  218. .enable_mask = ACT8600_LDO10_ENA,
  219. .owner = THIS_MODULE,
  220. },
  221. };
  222. static const struct regulator_desc act8846_regulators[] = {
  223. ACT88xx_REG("REG1", ACT8846, REG1, VSET, "vp1"),
  224. ACT88xx_REG("REG2", ACT8846, REG2, VSET0, "vp2"),
  225. ACT88xx_REG("REG3", ACT8846, REG3, VSET0, "vp3"),
  226. ACT88xx_REG("REG4", ACT8846, REG4, VSET0, "vp4"),
  227. ACT88xx_REG("REG5", ACT8846, REG5, VSET, "inl1"),
  228. ACT88xx_REG("REG6", ACT8846, REG6, VSET, "inl1"),
  229. ACT88xx_REG("REG7", ACT8846, REG7, VSET, "inl1"),
  230. ACT88xx_REG("REG8", ACT8846, REG8, VSET, "inl2"),
  231. ACT88xx_REG("REG9", ACT8846, REG9, VSET, "inl2"),
  232. ACT88xx_REG("REG10", ACT8846, REG10, VSET, "inl3"),
  233. ACT88xx_REG("REG11", ACT8846, REG11, VSET, "inl3"),
  234. ACT88xx_REG("REG12", ACT8846, REG12, VSET, "inl3"),
  235. };
  236. static const struct regulator_desc act8865_regulators[] = {
  237. ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET1, "vp1"),
  238. ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET1, "vp2"),
  239. ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET1, "vp3"),
  240. ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"),
  241. ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"),
  242. ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"),
  243. ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"),
  244. };
  245. #ifdef CONFIG_OF
  246. static const struct of_device_id act8865_dt_ids[] = {
  247. { .compatible = "active-semi,act8600", .data = (void *)ACT8600 },
  248. { .compatible = "active-semi,act8846", .data = (void *)ACT8846 },
  249. { .compatible = "active-semi,act8865", .data = (void *)ACT8865 },
  250. { }
  251. };
  252. MODULE_DEVICE_TABLE(of, act8865_dt_ids);
  253. static struct of_regulator_match act8846_matches[] = {
  254. [ACT8846_ID_REG1] = { .name = "REG1" },
  255. [ACT8846_ID_REG2] = { .name = "REG2" },
  256. [ACT8846_ID_REG3] = { .name = "REG3" },
  257. [ACT8846_ID_REG4] = { .name = "REG4" },
  258. [ACT8846_ID_REG5] = { .name = "REG5" },
  259. [ACT8846_ID_REG6] = { .name = "REG6" },
  260. [ACT8846_ID_REG7] = { .name = "REG7" },
  261. [ACT8846_ID_REG8] = { .name = "REG8" },
  262. [ACT8846_ID_REG9] = { .name = "REG9" },
  263. [ACT8846_ID_REG10] = { .name = "REG10" },
  264. [ACT8846_ID_REG11] = { .name = "REG11" },
  265. [ACT8846_ID_REG12] = { .name = "REG12" },
  266. };
  267. static struct of_regulator_match act8865_matches[] = {
  268. [ACT8865_ID_DCDC1] = { .name = "DCDC_REG1"},
  269. [ACT8865_ID_DCDC2] = { .name = "DCDC_REG2"},
  270. [ACT8865_ID_DCDC3] = { .name = "DCDC_REG3"},
  271. [ACT8865_ID_LDO1] = { .name = "LDO_REG1"},
  272. [ACT8865_ID_LDO2] = { .name = "LDO_REG2"},
  273. [ACT8865_ID_LDO3] = { .name = "LDO_REG3"},
  274. [ACT8865_ID_LDO4] = { .name = "LDO_REG4"},
  275. };
  276. static struct of_regulator_match act8600_matches[] = {
  277. [ACT8600_ID_DCDC1] = { .name = "DCDC_REG1"},
  278. [ACT8600_ID_DCDC2] = { .name = "DCDC_REG2"},
  279. [ACT8600_ID_DCDC3] = { .name = "DCDC_REG3"},
  280. [ACT8600_ID_SUDCDC4] = { .name = "SUDCDC_REG4"},
  281. [ACT8600_ID_LDO5] = { .name = "LDO_REG5"},
  282. [ACT8600_ID_LDO6] = { .name = "LDO_REG6"},
  283. [ACT8600_ID_LDO7] = { .name = "LDO_REG7"},
  284. [ACT8600_ID_LDO8] = { .name = "LDO_REG8"},
  285. [ACT8600_ID_LDO9] = { .name = "LDO_REG9"},
  286. [ACT8600_ID_LDO10] = { .name = "LDO_REG10"},
  287. };
  288. static int act8865_pdata_from_dt(struct device *dev,
  289. struct device_node **of_node,
  290. struct act8865_platform_data *pdata,
  291. unsigned long type)
  292. {
  293. int matched, i, num_matches;
  294. struct device_node *np;
  295. struct act8865_regulator_data *regulator;
  296. struct of_regulator_match *matches;
  297. np = of_get_child_by_name(dev->of_node, "regulators");
  298. if (!np) {
  299. dev_err(dev, "missing 'regulators' subnode in DT\n");
  300. return -EINVAL;
  301. }
  302. switch (type) {
  303. case ACT8600:
  304. matches = act8600_matches;
  305. num_matches = ARRAY_SIZE(act8600_matches);
  306. break;
  307. case ACT8846:
  308. matches = act8846_matches;
  309. num_matches = ARRAY_SIZE(act8846_matches);
  310. break;
  311. case ACT8865:
  312. matches = act8865_matches;
  313. num_matches = ARRAY_SIZE(act8865_matches);
  314. break;
  315. default:
  316. dev_err(dev, "invalid device id %lu\n", type);
  317. return -EINVAL;
  318. }
  319. matched = of_regulator_match(dev, np, matches, num_matches);
  320. of_node_put(np);
  321. if (matched <= 0)
  322. return matched;
  323. pdata->regulators = devm_kzalloc(dev,
  324. sizeof(struct act8865_regulator_data) *
  325. num_matches, GFP_KERNEL);
  326. if (!pdata->regulators)
  327. return -ENOMEM;
  328. pdata->num_regulators = num_matches;
  329. regulator = pdata->regulators;
  330. for (i = 0; i < num_matches; i++) {
  331. regulator->id = i;
  332. regulator->name = matches[i].name;
  333. regulator->platform_data = matches[i].init_data;
  334. of_node[i] = matches[i].of_node;
  335. regulator++;
  336. }
  337. return 0;
  338. }
  339. #else
  340. static inline int act8865_pdata_from_dt(struct device *dev,
  341. struct device_node **of_node,
  342. struct act8865_platform_data *pdata,
  343. unsigned long type)
  344. {
  345. return 0;
  346. }
  347. #endif
  348. static struct regulator_init_data
  349. *act8865_get_init_data(int id, struct act8865_platform_data *pdata)
  350. {
  351. int i;
  352. if (!pdata)
  353. return NULL;
  354. for (i = 0; i < pdata->num_regulators; i++) {
  355. if (pdata->regulators[i].id == id)
  356. return pdata->regulators[i].platform_data;
  357. }
  358. return NULL;
  359. }
  360. static struct i2c_client *act8865_i2c_client;
  361. static void act8865_power_off(void)
  362. {
  363. struct act8865 *act8865;
  364. act8865 = i2c_get_clientdata(act8865_i2c_client);
  365. regmap_write(act8865->regmap, act8865->off_reg, act8865->off_mask);
  366. while (1);
  367. }
  368. static int act8865_pmic_probe(struct i2c_client *client,
  369. const struct i2c_device_id *i2c_id)
  370. {
  371. static const struct regulator_desc *regulators;
  372. struct act8865_platform_data pdata_of, *pdata;
  373. struct device *dev = &client->dev;
  374. struct device_node **of_node;
  375. int i, ret, num_regulators;
  376. struct act8865 *act8865;
  377. unsigned long type;
  378. int off_reg, off_mask;
  379. pdata = dev_get_platdata(dev);
  380. if (dev->of_node && !pdata) {
  381. const struct of_device_id *id;
  382. id = of_match_device(of_match_ptr(act8865_dt_ids), dev);
  383. if (!id)
  384. return -ENODEV;
  385. type = (unsigned long) id->data;
  386. } else {
  387. type = i2c_id->driver_data;
  388. }
  389. switch (type) {
  390. case ACT8600:
  391. regulators = act8600_regulators;
  392. num_regulators = ARRAY_SIZE(act8600_regulators);
  393. off_reg = -1;
  394. off_mask = -1;
  395. break;
  396. case ACT8846:
  397. regulators = act8846_regulators;
  398. num_regulators = ARRAY_SIZE(act8846_regulators);
  399. off_reg = ACT8846_GLB_OFF_CTRL;
  400. off_mask = ACT8846_OFF_SYSMASK;
  401. break;
  402. case ACT8865:
  403. regulators = act8865_regulators;
  404. num_regulators = ARRAY_SIZE(act8865_regulators);
  405. off_reg = ACT8865_SYS_CTRL;
  406. off_mask = ACT8865_MSTROFF;
  407. break;
  408. default:
  409. dev_err(dev, "invalid device id %lu\n", type);
  410. return -EINVAL;
  411. }
  412. of_node = devm_kzalloc(dev, sizeof(struct device_node *) *
  413. num_regulators, GFP_KERNEL);
  414. if (!of_node)
  415. return -ENOMEM;
  416. if (dev->of_node && !pdata) {
  417. ret = act8865_pdata_from_dt(dev, of_node, &pdata_of, type);
  418. if (ret < 0)
  419. return ret;
  420. pdata = &pdata_of;
  421. }
  422. if (pdata->num_regulators > num_regulators) {
  423. dev_err(dev, "too many regulators: %d\n",
  424. pdata->num_regulators);
  425. return -EINVAL;
  426. }
  427. act8865 = devm_kzalloc(dev, sizeof(struct act8865), GFP_KERNEL);
  428. if (!act8865)
  429. return -ENOMEM;
  430. act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
  431. if (IS_ERR(act8865->regmap)) {
  432. ret = PTR_ERR(act8865->regmap);
  433. dev_err(&client->dev, "Failed to allocate register map: %d\n",
  434. ret);
  435. return ret;
  436. }
  437. if (of_device_is_system_power_controller(dev->of_node)) {
  438. if (!pm_power_off && (off_reg > 0)) {
  439. act8865_i2c_client = client;
  440. act8865->off_reg = off_reg;
  441. act8865->off_mask = off_mask;
  442. pm_power_off = act8865_power_off;
  443. } else {
  444. dev_err(dev, "Failed to set poweroff capability, already defined\n");
  445. }
  446. }
  447. /* Finally register devices */
  448. for (i = 0; i < num_regulators; i++) {
  449. const struct regulator_desc *desc = &regulators[i];
  450. struct regulator_config config = { };
  451. struct regulator_dev *rdev;
  452. config.dev = dev;
  453. config.init_data = act8865_get_init_data(desc->id, pdata);
  454. config.of_node = of_node[i];
  455. config.driver_data = act8865;
  456. config.regmap = act8865->regmap;
  457. rdev = devm_regulator_register(&client->dev, desc, &config);
  458. if (IS_ERR(rdev)) {
  459. dev_err(dev, "failed to register %s\n", desc->name);
  460. return PTR_ERR(rdev);
  461. }
  462. }
  463. i2c_set_clientdata(client, act8865);
  464. devm_kfree(dev, of_node);
  465. return 0;
  466. }
  467. static const struct i2c_device_id act8865_ids[] = {
  468. { .name = "act8600", .driver_data = ACT8600 },
  469. { .name = "act8846", .driver_data = ACT8846 },
  470. { .name = "act8865", .driver_data = ACT8865 },
  471. { },
  472. };
  473. MODULE_DEVICE_TABLE(i2c, act8865_ids);
  474. static struct i2c_driver act8865_pmic_driver = {
  475. .driver = {
  476. .name = "act8865",
  477. .owner = THIS_MODULE,
  478. },
  479. .probe = act8865_pmic_probe,
  480. .id_table = act8865_ids,
  481. };
  482. module_i2c_driver(act8865_pmic_driver);
  483. MODULE_DESCRIPTION("active-semi act88xx voltage regulator driver");
  484. MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>");
  485. MODULE_LICENSE("GPL v2");