mt6362-regulator.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2019 MediaTek Inc.
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/module.h>
  7. #include <linux/of_irq.h>
  8. #include <linux/regmap.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/regulator/driver.h>
  11. #include <linux/interrupt.h>
  12. #include <dt-bindings/mfd/mt6362.h>
  13. #define MT6362_REG_BUCK1_SEQOFFDLY (0x107)
  14. #define MT6362_POFF_SEQ_MAX 9
  15. /* Set sub-pmic buck1/2/3/4/5/6&ldo7/6/4 power off seuqence */
  16. static const u8 def_pwr_off_seq[MT6362_POFF_SEQ_MAX] = {
  17. 0x24, 0x24, 0x04, 0x22, 0x00, 0x00, 0x00, 0x02, 0x04,
  18. };
  19. enum {
  20. MT6362_IDX_BUCK1 = 0,
  21. MT6362_IDX_BUCK2,
  22. MT6362_IDX_BUCK3,
  23. MT6362_IDX_BUCK4,
  24. MT6362_IDX_BUCK5,
  25. MT6362_IDX_BUCK6,
  26. MT6362_IDX_LDO1,
  27. MT6362_IDX_LDO2,
  28. MT6362_IDX_LDO3,
  29. MT6362_IDX_LDO4,
  30. MT6362_IDX_LDO5,
  31. MT6362_IDX_LDO6,
  32. MT6362_IDX_LDO7,
  33. MT6362_IDX_MAX,
  34. };
  35. #define MT6362_VOL_REGMASK (0xff)
  36. #define MT6362_VOL_MAX (256)
  37. #define LDOVOL_OFFSET (0xA)
  38. #define LDOENA_OFFSET (0x6)
  39. #define LDOADE_OFFSET (0x9)
  40. #define LDOMOD_OFFSET (0x6)
  41. #define MT6362_LDOENA_REGMASK BIT(7)
  42. #define MT6362_LDOMOD_REGMASK BIT(6)
  43. #define MT6362_LDOADE_REGMASK BIT(2)
  44. #define MT6362_LDO1_BASE (0x310)
  45. #define MT6362_LDO2_BASE (0x320)
  46. #define MT6362_LDO3_BASE (0x330)
  47. #define MT6362_LDO4_BASE (0x140)
  48. #define MT6362_LDO5_BASE (0x350)
  49. #define MT6362_LDO6_BASE (0x130)
  50. #define MT6362_LDO7_BASE (0x120)
  51. #define MT6362_LDOVOL_REGADDR(_id) (MT6362_LDO##_id##_BASE + LDOVOL_OFFSET)
  52. #define MT6362_LDOENA_REGADDR(_id) (MT6362_LDO##_id##_BASE + LDOENA_OFFSET)
  53. #define MT6362_LDOADE_REGADDR(_id) (MT6362_LDO##_id##_BASE + LDOADE_OFFSET)
  54. #define MT6362_LDOMOD_REGADDR(_id) (MT6362_LDO##_id##_BASE + LDOMOD_OFFSET)
  55. #define MT6362_BUCKVOL_REGBASE (0x70C)
  56. #define MT6362_BUCKVOL_REGADDR(_id) (MT6362_BUCKVOL_REGBASE + _id - 1)
  57. #define MT6362_BUCKENA_REGADDR (0x700)
  58. #define MT6362_BUCKMOD_REGADDR (0x706)
  59. #define MT6362_VOLFBD2_MASK BIT(7)
  60. #define MT6362_DEFAULT_BUCKSTEP (6250)
  61. #define MT6362_VOLFBD2_BUCKSTEP (8333)
  62. struct mt6362_regulator_desc {
  63. struct regulator_desc desc;
  64. unsigned int mode_reg;
  65. unsigned int mode_mask;
  66. };
  67. struct mt6362_regulator_irqt {
  68. const char *name;
  69. irq_handler_t irqh;
  70. };
  71. struct mt6362_regulator_data {
  72. struct device *dev;
  73. struct regmap *regmap;
  74. u8 pwr_off_seq[MT6362_POFF_SEQ_MAX];
  75. };
  76. static int mt6362_enable_poweroff_sequence(struct mt6362_regulator_data *data)
  77. {
  78. int i, ret;
  79. dev_dbg(data->dev, "%s\n", __func__);
  80. for (i = 0; i < MT6362_POFF_SEQ_MAX; i++) {
  81. ret = regmap_write(data->regmap,
  82. MT6362_REG_BUCK1_SEQOFFDLY + i,
  83. data->pwr_off_seq[i]);
  84. if (ret < 0) {
  85. dev_notice(data->dev, "%s: set buck(%d) fail\n",
  86. __func__, i);
  87. return ret;
  88. }
  89. }
  90. return ret;
  91. }
  92. static int mt6362_general_set_active_discharge(struct regulator_dev *rdev,
  93. bool enable)
  94. {
  95. const struct regulator_desc *desc = rdev->desc;
  96. if (!desc->active_discharge_reg)
  97. return 0;
  98. return regulator_set_active_discharge_regmap(rdev, enable);
  99. }
  100. static int mt6362_general_set_mode(struct regulator_dev *rdev,
  101. unsigned int mode)
  102. {
  103. struct mt6362_regulator_desc *mdesc =
  104. (struct mt6362_regulator_desc *)rdev->desc;
  105. int ret;
  106. switch (mode) {
  107. case REGULATOR_MODE_NORMAL:
  108. ret = regmap_update_bits(rdev->regmap, mdesc->mode_reg,
  109. mdesc->mode_mask, 0);
  110. break;
  111. case REGULATOR_MODE_IDLE:
  112. ret = regmap_update_bits(rdev->regmap, mdesc->mode_reg,
  113. mdesc->mode_mask, mdesc->mode_mask);
  114. break;
  115. default:
  116. ret = -EINVAL;
  117. }
  118. return ret ? : 0;
  119. }
  120. static unsigned int mt6362_general_get_mode(struct regulator_dev *rdev)
  121. {
  122. struct mt6362_regulator_desc *mdesc =
  123. (struct mt6362_regulator_desc *)rdev->desc;
  124. unsigned int val = 0;
  125. int ret;
  126. ret = regmap_read(rdev->regmap, mdesc->mode_reg, &val);
  127. if (ret)
  128. return 0;
  129. if (val & mdesc->mode_mask)
  130. return REGULATOR_MODE_IDLE;
  131. return REGULATOR_MODE_NORMAL;
  132. }
  133. static unsigned int mt6362_general_of_map_mode(unsigned int mode)
  134. {
  135. switch (mode) {
  136. case MT6362_REGULATOR_MODE_LP:
  137. return REGULATOR_MODE_IDLE;
  138. case MT6362_REGULATOR_MODE_NORMAL:
  139. return REGULATOR_MODE_NORMAL;
  140. default:
  141. return REGULATOR_MODE_INVALID;
  142. }
  143. }
  144. static const struct regulator_ops mt6362_ldo_regulator_ops = {
  145. .list_voltage = regulator_list_voltage_linear_range,
  146. .set_voltage_sel = regulator_set_voltage_sel_regmap,
  147. .get_voltage_sel = regulator_get_voltage_sel_regmap,
  148. .enable = regulator_enable_regmap,
  149. .disable = regulator_disable_regmap,
  150. .is_enabled = regulator_is_enabled_regmap,
  151. .set_active_discharge = mt6362_general_set_active_discharge,
  152. .set_mode = mt6362_general_set_mode,
  153. .get_mode = mt6362_general_get_mode,
  154. };
  155. static const struct regulator_ops mt6362_buck_regulator_ops = {
  156. .list_voltage = regulator_list_voltage_linear,
  157. .set_voltage_sel = regulator_set_voltage_sel_regmap,
  158. .get_voltage_sel = regulator_get_voltage_sel_regmap,
  159. .enable = regulator_enable_regmap,
  160. .disable = regulator_disable_regmap,
  161. .is_enabled = regulator_is_enabled_regmap,
  162. .set_active_discharge = mt6362_general_set_active_discharge,
  163. .set_mode = mt6362_general_set_mode,
  164. .get_mode = mt6362_general_get_mode,
  165. };
  166. static const struct regulator_linear_range lvldo_ranges[] = {
  167. REGULATOR_LINEAR_RANGE(500000, 0x00, 0x0a, 10000),
  168. REGULATOR_LINEAR_RANGE(600000, 0x0b, 0x0f, 0),
  169. REGULATOR_LINEAR_RANGE(600000, 0x10, 0x1a, 10000),
  170. REGULATOR_LINEAR_RANGE(700000, 0x1b, 0x1f, 0),
  171. REGULATOR_LINEAR_RANGE(700000, 0x20, 0x2a, 10000),
  172. REGULATOR_LINEAR_RANGE(800000, 0x2b, 0x2f, 0),
  173. REGULATOR_LINEAR_RANGE(800000, 0x30, 0x3a, 10000),
  174. REGULATOR_LINEAR_RANGE(900000, 0x3b, 0x3f, 0),
  175. REGULATOR_LINEAR_RANGE(900000, 0x40, 0x4a, 10000),
  176. REGULATOR_LINEAR_RANGE(1000000, 0x4b, 0x4f, 0),
  177. REGULATOR_LINEAR_RANGE(1000000, 0x50, 0x5a, 10000),
  178. REGULATOR_LINEAR_RANGE(1100000, 0x5b, 0x5f, 0),
  179. REGULATOR_LINEAR_RANGE(1100000, 0x60, 0x6a, 10000),
  180. REGULATOR_LINEAR_RANGE(1200000, 0x6b, 0x6f, 0),
  181. REGULATOR_LINEAR_RANGE(1200000, 0x70, 0x7a, 10000),
  182. REGULATOR_LINEAR_RANGE(1300000, 0x7b, 0x7f, 0),
  183. REGULATOR_LINEAR_RANGE(1300000, 0x80, 0x8a, 10000),
  184. REGULATOR_LINEAR_RANGE(1400000, 0x8b, 0x8f, 0),
  185. REGULATOR_LINEAR_RANGE(1400000, 0x90, 0x9a, 10000),
  186. REGULATOR_LINEAR_RANGE(1500000, 0x9b, 0x9f, 0),
  187. REGULATOR_LINEAR_RANGE(1500000, 0xa0, 0xaa, 10000),
  188. REGULATOR_LINEAR_RANGE(1600000, 0xab, 0xaf, 0),
  189. REGULATOR_LINEAR_RANGE(1600000, 0xb0, 0xba, 10000),
  190. REGULATOR_LINEAR_RANGE(1700000, 0xbb, 0xbf, 0),
  191. REGULATOR_LINEAR_RANGE(1700000, 0xc0, 0xca, 10000),
  192. REGULATOR_LINEAR_RANGE(1800000, 0xcb, 0xcf, 0),
  193. REGULATOR_LINEAR_RANGE(1800000, 0xd0, 0xda, 10000),
  194. REGULATOR_LINEAR_RANGE(1900000, 0xdb, 0xdf, 0),
  195. REGULATOR_LINEAR_RANGE(1900000, 0xe0, 0xea, 10000),
  196. REGULATOR_LINEAR_RANGE(2000000, 0xeb, 0xef, 0),
  197. REGULATOR_LINEAR_RANGE(2000000, 0xf0, 0xfa, 10000),
  198. REGULATOR_LINEAR_RANGE(2100000, 0xfb, 0xff, 0),
  199. };
  200. static const struct regulator_linear_range hvldo_ranges[] = {
  201. REGULATOR_LINEAR_RANGE(1200000, 0x00, 0x0a, 10000),
  202. REGULATOR_LINEAR_RANGE(1300000, 0x0b, 0x0f, 0),
  203. REGULATOR_LINEAR_RANGE(1300000, 0x10, 0x1a, 10000),
  204. REGULATOR_LINEAR_RANGE(1400000, 0x1b, 0x1f, 0),
  205. REGULATOR_LINEAR_RANGE(1500000, 0x20, 0x2a, 10000),
  206. REGULATOR_LINEAR_RANGE(1600000, 0x2b, 0x2f, 0),
  207. REGULATOR_LINEAR_RANGE(1700000, 0x30, 0x3a, 10000),
  208. REGULATOR_LINEAR_RANGE(1800000, 0x3b, 0x3f, 0),
  209. REGULATOR_LINEAR_RANGE(1800000, 0x40, 0x4a, 10000),
  210. REGULATOR_LINEAR_RANGE(1900000, 0x4b, 0x4f, 0),
  211. REGULATOR_LINEAR_RANGE(2000000, 0x50, 0x5a, 10000),
  212. REGULATOR_LINEAR_RANGE(2100000, 0x5b, 0x5f, 0),
  213. REGULATOR_LINEAR_RANGE(2100000, 0x60, 0x6a, 10000),
  214. REGULATOR_LINEAR_RANGE(2200000, 0x6b, 0x6f, 0),
  215. REGULATOR_LINEAR_RANGE(2500000, 0x70, 0x7a, 10000),
  216. REGULATOR_LINEAR_RANGE(2600000, 0x7b, 0x7f, 0),
  217. REGULATOR_LINEAR_RANGE(2700000, 0x80, 0x8a, 10000),
  218. REGULATOR_LINEAR_RANGE(2800000, 0x8b, 0x8f, 0),
  219. REGULATOR_LINEAR_RANGE(2800000, 0x90, 0x9a, 10000),
  220. REGULATOR_LINEAR_RANGE(2900000, 0x9b, 0x9f, 0),
  221. REGULATOR_LINEAR_RANGE(2900000, 0xa0, 0xaa, 10000),
  222. REGULATOR_LINEAR_RANGE(3000000, 0xab, 0xaf, 0),
  223. REGULATOR_LINEAR_RANGE(3000000, 0xb0, 0xba, 10000),
  224. REGULATOR_LINEAR_RANGE(3100000, 0xbb, 0xbf, 0),
  225. REGULATOR_LINEAR_RANGE(3100000, 0xc0, 0xca, 10000),
  226. REGULATOR_LINEAR_RANGE(3200000, 0xcb, 0xcf, 0),
  227. REGULATOR_LINEAR_RANGE(3300000, 0xd0, 0xda, 10000),
  228. REGULATOR_LINEAR_RANGE(3400000, 0xdb, 0xdf, 0),
  229. REGULATOR_LINEAR_RANGE(3400000, 0xe0, 0xea, 10000),
  230. REGULATOR_LINEAR_RANGE(3500000, 0xeb, 0xef, 0),
  231. REGULATOR_LINEAR_RANGE(3500000, 0xf0, 0xfa, 10000),
  232. REGULATOR_LINEAR_RANGE(3600000, 0xfb, 0xff, 0),
  233. };
  234. #define MT6362_LDO_DESC(_id, _type, _supply_name) \
  235. {\
  236. .desc = {\
  237. .ops = &mt6362_ldo_regulator_ops,\
  238. .name = "mt6362-ldo" #_id,\
  239. .supply_name = _supply_name,\
  240. .of_match = "ldo" #_id,\
  241. .id = MT6362_IDX_LDO##_id,\
  242. .type = REGULATOR_VOLTAGE,\
  243. .owner = THIS_MODULE,\
  244. .n_voltages = MT6362_VOL_MAX,\
  245. .linear_ranges = _type##ldo_ranges,\
  246. .n_linear_ranges = ARRAY_SIZE(_type##ldo_ranges),\
  247. .vsel_reg = MT6362_LDOVOL_REGADDR(_id),\
  248. .vsel_mask = MT6362_VOL_REGMASK,\
  249. .enable_reg = MT6362_LDOENA_REGADDR(_id),\
  250. .enable_mask = MT6362_LDOENA_REGMASK,\
  251. .active_discharge_reg = MT6362_LDOADE_REGADDR(_id),\
  252. .active_discharge_mask = MT6362_LDOADE_REGMASK,\
  253. .active_discharge_on = MT6362_LDOADE_REGMASK,\
  254. .of_map_mode = mt6362_general_of_map_mode,\
  255. },\
  256. .mode_reg = MT6362_LDOMOD_REGADDR(_id),\
  257. .mode_mask = MT6362_LDOMOD_REGMASK,\
  258. }
  259. #define MT6362_BUCK_DESC(_id) \
  260. {\
  261. .desc = {\
  262. .ops = &mt6362_buck_regulator_ops,\
  263. .name = "mt6362-buck" #_id,\
  264. .of_match = "buck" #_id,\
  265. .id = MT6362_IDX_BUCK##_id,\
  266. .type = REGULATOR_VOLTAGE,\
  267. .owner = THIS_MODULE,\
  268. .uV_step = MT6362_DEFAULT_BUCKSTEP,\
  269. .n_voltages = MT6362_VOL_MAX,\
  270. .vsel_reg = MT6362_BUCKVOL_REGADDR(_id),\
  271. .vsel_mask = MT6362_VOL_REGMASK,\
  272. .enable_reg = MT6362_BUCKENA_REGADDR,\
  273. .enable_mask = BIT(_id),\
  274. .of_map_mode = mt6362_general_of_map_mode,\
  275. },\
  276. .mode_reg = MT6362_BUCKMOD_REGADDR,\
  277. .mode_mask = BIT(_id),\
  278. }
  279. static struct mt6362_regulator_desc mtreg_descs[MT6362_IDX_MAX] = {
  280. MT6362_BUCK_DESC(1),
  281. MT6362_BUCK_DESC(2),
  282. MT6362_BUCK_DESC(3),
  283. MT6362_BUCK_DESC(4),
  284. MT6362_BUCK_DESC(5),
  285. MT6362_BUCK_DESC(6),
  286. MT6362_LDO_DESC(1, hv, NULL),
  287. MT6362_LDO_DESC(2, hv, NULL),
  288. MT6362_LDO_DESC(3, hv, NULL),
  289. MT6362_LDO_DESC(4, hv, NULL),
  290. MT6362_LDO_DESC(5, hv, NULL),
  291. MT6362_LDO_DESC(6, lv, "mt6362-buck3"),
  292. MT6362_LDO_DESC(7, lv, "mt6362-buck3"),
  293. };
  294. #define MT6362_REGULATOR_IRQH(_name, _event) \
  295. static irqreturn_t mt6362_##_name##_irq_handler(int irq, void *data)\
  296. {\
  297. struct regulator_dev *rdev = data;\
  298. struct device *dev = rdev_get_dev(rdev);\
  299. dev_warn(dev, "%s: id = %d\n", __func__, rdev_get_id(rdev));\
  300. regulator_notifier_call_chain(rdev, _event, NULL);\
  301. return IRQ_HANDLED;\
  302. }
  303. MT6362_REGULATOR_IRQH(oc_evt, REGULATOR_EVENT_OVER_CURRENT)
  304. MT6362_REGULATOR_IRQH(pgb_evt, REGULATOR_EVENT_FAIL)
  305. #define MT6362_IRQ_DECLARE(_name) \
  306. {\
  307. .name = #_name,\
  308. .irqh = mt6362_##_name##_irq_handler,\
  309. }
  310. static const struct mt6362_regulator_irqt irqts[] = {
  311. MT6362_IRQ_DECLARE(oc_evt),
  312. MT6362_IRQ_DECLARE(pgb_evt),
  313. };
  314. static int mt6362_regulator_irq_register(struct regulator_dev *rdev)
  315. {
  316. struct device *dev = rdev_get_dev(rdev);
  317. struct device_node *np = dev->of_node;
  318. int i, irq, rv;
  319. for (i = 0; i < ARRAY_SIZE(irqts); i++) {
  320. irq = of_irq_get_byname(np, irqts[i].name);
  321. if (irq <= 0)
  322. continue;
  323. rv = devm_request_threaded_irq(dev->parent, irq, NULL,
  324. irqts[i].irqh, 0, NULL, rdev);
  325. if (rv)
  326. return rv;
  327. }
  328. return 0;
  329. }
  330. static int mt6362_reconfigure_voltage_step(struct mt6362_regulator_data *data,
  331. struct regulator_desc *desc)
  332. {
  333. const unsigned int buck_fbd2_regs[] = {
  334. 0x29b, 0x2a3, 0x2ab, 0x2b3, 0x2d1, 0x2d9
  335. };
  336. unsigned int val;
  337. int rv;
  338. if (desc->id >= MT6362_IDX_BUCK1 && desc->id <= MT6362_IDX_BUCK6) {
  339. rv = regmap_read(data->regmap, buck_fbd2_regs[desc->id], &val);
  340. if (rv)
  341. return rv;
  342. if (val & MT6362_VOLFBD2_MASK)
  343. desc->uV_step = MT6362_VOLFBD2_BUCKSTEP;
  344. }
  345. return 0;
  346. }
  347. static int mt6362_parse_dt_data(struct device *dev,
  348. struct mt6362_regulator_data *data)
  349. {
  350. struct device_node *np = dev->of_node;
  351. int ret;
  352. memcpy(data->pwr_off_seq, &def_pwr_off_seq, MT6362_POFF_SEQ_MAX);
  353. ret = of_property_read_u8_array(np, "pwr_off_seq", data->pwr_off_seq,
  354. MT6362_POFF_SEQ_MAX);
  355. if (ret)
  356. dev_notice(dev, "%s: undefine pwr_off_seq\n", __func__);
  357. return ret;
  358. }
  359. static int mt6362_regulator_probe(struct platform_device *pdev)
  360. {
  361. struct mt6362_regulator_data *data;
  362. struct regulator_config config = { };
  363. struct regulator_dev *rdev;
  364. int i, rv;
  365. data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
  366. if (!data)
  367. return -ENOMEM;
  368. rv = mt6362_parse_dt_data(&pdev->dev, data);
  369. if (rv < 0) {
  370. dev_err(&pdev->dev, "parse dt fail\n");
  371. return rv;
  372. }
  373. data->dev = &pdev->dev;
  374. data->regmap = dev_get_regmap(pdev->dev.parent, NULL);
  375. if (!data->regmap) {
  376. dev_err(&pdev->dev, "failed to allocate regmap\n");
  377. return -ENODEV;
  378. }
  379. config.dev = &pdev->dev;
  380. config.driver_data = data;
  381. config.regmap = data->regmap;
  382. for (i = 0; i < MT6362_IDX_MAX; i++) {
  383. struct mt6362_regulator_desc *mt_desc;
  384. mt_desc = mtreg_descs + i;
  385. rv = mt6362_reconfigure_voltage_step(data, &mt_desc->desc);
  386. if (rv)
  387. return rv;
  388. rdev = devm_regulator_register(&pdev->dev,
  389. &mt_desc->desc, &config);
  390. if (IS_ERR(rdev)) {
  391. dev_err(&pdev->dev,
  392. "failed to register [%d] regulator\n", i);
  393. return PTR_ERR(rdev);
  394. }
  395. rv = mt6362_regulator_irq_register(rdev);
  396. if (rv) {
  397. dev_err(&pdev->dev,
  398. "failed to register [%d] regulator irq\n", i);
  399. return rv;
  400. }
  401. }
  402. platform_set_drvdata(pdev, data);
  403. return 0;
  404. }
  405. static void mt6362_shutdown(struct platform_device *pdev)
  406. {
  407. struct mt6362_regulator_data *data = platform_get_drvdata(pdev);
  408. int ret;
  409. dev_dbg(data->dev, "%s\n", __func__);
  410. if (data == NULL)
  411. return;
  412. ret = mt6362_enable_poweroff_sequence(data);
  413. if (ret < 0)
  414. dev_notice(data->dev,
  415. "%s: enable power off sequence fail\n", __func__);
  416. }
  417. static const struct of_device_id __maybe_unused mt6362_regulator_ofid_tbls[] = {
  418. { .compatible = "mediatek,mt6362-regulator", },
  419. { },
  420. };
  421. MODULE_DEVICE_TABLE(of, mt6362_regulator_ofid_tbls);
  422. static struct platform_driver mt6362_regulator_driver = {
  423. .driver = {
  424. .name = "mt6362-regulator",
  425. .of_match_table = of_match_ptr(mt6362_regulator_ofid_tbls),
  426. },
  427. .probe = mt6362_regulator_probe,
  428. .shutdown = mt6362_shutdown,
  429. };
  430. module_platform_driver(mt6362_regulator_driver);
  431. MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>");
  432. MODULE_DESCRIPTION("MT6362 SPMI Regulator Driver");
  433. MODULE_LICENSE("GPL");
  434. MODULE_VERSION("1.0.0");