0072-mfd.patch 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591
  1. From 1a4dcc30578512d687528adcf963203faee50d83 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Fri, 3 Jul 2015 05:45:17 +0200
  4. Subject: [PATCH 72/76] mfd
  5. ---
  6. drivers/mfd/mt6323-core.c | 168 +++----
  7. drivers/regulator/mt6323-regulator.c | 218 ++++----
  8. include/linux/mfd/mt6323/core.h | 76 +--
  9. include/linux/mfd/mt6323/registers.h | 745 +++++++++++++++-------------
  10. include/linux/regulator/mt6323-regulator.h | 37 ++
  11. 5 files changed, 636 insertions(+), 608 deletions(-)
  12. create mode 100644 include/linux/regulator/mt6323-regulator.h
  13. diff --git a/drivers/mfd/mt6323-core.c b/drivers/mfd/mt6323-core.c
  14. index 012c620..9b7f5b9 100644
  15. --- a/drivers/mfd/mt6323-core.c
  16. +++ b/drivers/mfd/mt6323-core.c
  17. @@ -18,111 +18,99 @@
  18. #include <linux/of_irq.h>
  19. #include <linux/regmap.h>
  20. #include <linux/mfd/core.h>
  21. -#include <linux/mfd/mt6397/core.h>
  22. -#include <linux/mfd/mt6397/registers.h>
  23. +#include <linux/mfd/mt6323/core.h>
  24. +#include <linux/mfd/mt6323/registers.h>
  25. -static const struct mfd_cell mt6397_devs[] = {
  26. +static const struct mfd_cell mt6323_devs[] = {
  27. {
  28. - .name = "mt6397-rtc",
  29. - .of_compatible = "mediatek,mt6397-rtc",
  30. - }, {
  31. - .name = "mt6397-regulator",
  32. - .of_compatible = "mediatek,mt6397-regulator",
  33. - }, {
  34. - .name = "mt6397-codec",
  35. - .of_compatible = "mediatek,mt6397-codec",
  36. - }, {
  37. - .name = "mt6397-clk",
  38. - .of_compatible = "mediatek,mt6397-clk",
  39. - }, {
  40. - .name = "mediatek-mt6397-pinctrl",
  41. - .of_compatible = "mediatek,mt6397-pinctrl",
  42. + .name = "mt6323-regulator",
  43. + .of_compatible = "mediatek,mt6323-regulator",
  44. },
  45. };
  46. -static void mt6397_irq_lock(struct irq_data *data)
  47. +static void mt6323_irq_lock(struct irq_data *data)
  48. {
  49. - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq);
  50. + struct mt6323_chip *mt6323 = irq_get_chip_data(data->irq);
  51. - mutex_lock(&mt6397->irqlock);
  52. + mutex_lock(&mt6323->irqlock);
  53. }
  54. -static void mt6397_irq_sync_unlock(struct irq_data *data)
  55. +static void mt6323_irq_sync_unlock(struct irq_data *data)
  56. {
  57. - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq);
  58. + struct mt6323_chip *mt6323 = irq_get_chip_data(data->irq);
  59. - regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]);
  60. - regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]);
  61. + regmap_write(mt6323->regmap, MT6323_INT_CON0, mt6323->irq_masks_cur[0]);
  62. + regmap_write(mt6323->regmap, MT6323_INT_CON1, mt6323->irq_masks_cur[1]);
  63. - mutex_unlock(&mt6397->irqlock);
  64. + mutex_unlock(&mt6323->irqlock);
  65. }
  66. -static void mt6397_irq_disable(struct irq_data *data)
  67. +static void mt6323_irq_disable(struct irq_data *data)
  68. {
  69. - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq);
  70. + struct mt6323_chip *mt6323 = irq_get_chip_data(data->irq);
  71. int shift = data->hwirq & 0xf;
  72. int reg = data->hwirq >> 4;
  73. - mt6397->irq_masks_cur[reg] &= ~BIT(shift);
  74. + mt6323->irq_masks_cur[reg] &= ~BIT(shift);
  75. }
  76. -static void mt6397_irq_enable(struct irq_data *data)
  77. +static void mt6323_irq_enable(struct irq_data *data)
  78. {
  79. - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq);
  80. + struct mt6323_chip *mt6323 = irq_get_chip_data(data->irq);
  81. int shift = data->hwirq & 0xf;
  82. int reg = data->hwirq >> 4;
  83. - mt6397->irq_masks_cur[reg] |= BIT(shift);
  84. + mt6323->irq_masks_cur[reg] |= BIT(shift);
  85. }
  86. -static struct irq_chip mt6397_irq_chip = {
  87. - .name = "mt6397-irq",
  88. - .irq_bus_lock = mt6397_irq_lock,
  89. - .irq_bus_sync_unlock = mt6397_irq_sync_unlock,
  90. - .irq_enable = mt6397_irq_enable,
  91. - .irq_disable = mt6397_irq_disable,
  92. +static struct irq_chip mt6323_irq_chip = {
  93. + .name = "mt6323-irq",
  94. + .irq_bus_lock = mt6323_irq_lock,
  95. + .irq_bus_sync_unlock = mt6323_irq_sync_unlock,
  96. + .irq_enable = mt6323_irq_enable,
  97. + .irq_disable = mt6323_irq_disable,
  98. };
  99. -static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,
  100. +static void mt6323_irq_handle_reg(struct mt6323_chip *mt6323, int reg,
  101. int irqbase)
  102. {
  103. unsigned int status;
  104. int i, irq, ret;
  105. - ret = regmap_read(mt6397->regmap, reg, &status);
  106. + ret = regmap_read(mt6323->regmap, reg, &status);
  107. if (ret) {
  108. - dev_err(mt6397->dev, "Failed to read irq status: %d\n", ret);
  109. + dev_err(mt6323->dev, "Failed to read irq status: %d\n", ret);
  110. return;
  111. }
  112. for (i = 0; i < 16; i++) {
  113. if (status & BIT(i)) {
  114. - irq = irq_find_mapping(mt6397->irq_domain, irqbase + i);
  115. + irq = irq_find_mapping(mt6323->irq_domain, irqbase + i);
  116. if (irq)
  117. handle_nested_irq(irq);
  118. }
  119. }
  120. - regmap_write(mt6397->regmap, reg, status);
  121. + regmap_write(mt6323->regmap, reg, status);
  122. }
  123. -static irqreturn_t mt6397_irq_thread(int irq, void *data)
  124. +static irqreturn_t mt6323_irq_thread(int irq, void *data)
  125. {
  126. - struct mt6397_chip *mt6397 = data;
  127. + struct mt6323_chip *mt6323 = data;
  128. - mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS0, 0);
  129. - mt6397_irq_handle_reg(mt6397, MT6397_INT_STATUS1, 16);
  130. + mt6323_irq_handle_reg(mt6323, MT6323_INT_STATUS0, 0);
  131. + mt6323_irq_handle_reg(mt6323, MT6323_INT_STATUS1, 16);
  132. return IRQ_HANDLED;
  133. }
  134. -static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq,
  135. +static int mt6323_irq_domain_map(struct irq_domain *d, unsigned int irq,
  136. irq_hw_number_t hw)
  137. {
  138. - struct mt6397_chip *mt6397 = d->host_data;
  139. + struct mt6323_chip *mt6323 = d->host_data;
  140. - irq_set_chip_data(irq, mt6397);
  141. - irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq);
  142. + irq_set_chip_data(irq, mt6323);
  143. + irq_set_chip_and_handler(irq, &mt6323_irq_chip, handle_level_irq);
  144. irq_set_nested_thread(irq, 1);
  145. #ifdef CONFIG_ARM
  146. set_irq_flags(irq, IRQF_VALID);
  147. @@ -133,98 +121,98 @@ static int mt6397_irq_domain_map(struct irq_domain *d, unsigned int irq,
  148. return 0;
  149. }
  150. -static struct irq_domain_ops mt6397_irq_domain_ops = {
  151. - .map = mt6397_irq_domain_map,
  152. +static struct irq_domain_ops mt6323_irq_domain_ops = {
  153. + .map = mt6323_irq_domain_map,
  154. };
  155. -static int mt6397_irq_init(struct mt6397_chip *mt6397)
  156. +static int mt6323_irq_init(struct mt6323_chip *mt6323)
  157. {
  158. int ret;
  159. - mutex_init(&mt6397->irqlock);
  160. + mutex_init(&mt6323->irqlock);
  161. /* Mask all interrupt sources */
  162. - regmap_write(mt6397->regmap, MT6397_INT_CON0, 0x0);
  163. - regmap_write(mt6397->regmap, MT6397_INT_CON1, 0x0);
  164. + regmap_write(mt6323->regmap, MT6323_INT_CON0, 0x0);
  165. + regmap_write(mt6323->regmap, MT6323_INT_CON1, 0x0);
  166. - mt6397->irq_domain = irq_domain_add_linear(mt6397->dev->of_node,
  167. - MT6397_IRQ_NR, &mt6397_irq_domain_ops, mt6397);
  168. - if (!mt6397->irq_domain) {
  169. - dev_err(mt6397->dev, "could not create irq domain\n");
  170. + mt6323->irq_domain = irq_domain_add_linear(mt6323->dev->of_node,
  171. + MT6323_IRQ_NR, &mt6323_irq_domain_ops, mt6323);
  172. + if (!mt6323->irq_domain) {
  173. + dev_err(mt6323->dev, "could not create irq domain\n");
  174. return -ENOMEM;
  175. }
  176. - ret = devm_request_threaded_irq(mt6397->dev, mt6397->irq, NULL,
  177. - mt6397_irq_thread, IRQF_ONESHOT, "mt6397-pmic", mt6397);
  178. + ret = devm_request_threaded_irq(mt6323->dev, mt6323->irq, NULL,
  179. + mt6323_irq_thread, IRQF_ONESHOT, "mt6323-pmic", mt6323);
  180. if (ret) {
  181. - dev_err(mt6397->dev, "failed to register irq=%d; err: %d\n",
  182. - mt6397->irq, ret);
  183. + dev_err(mt6323->dev, "failed to register irq=%d; err: %d\n",
  184. + mt6323->irq, ret);
  185. return ret;
  186. }
  187. return 0;
  188. }
  189. -static int mt6397_probe(struct platform_device *pdev)
  190. +static int mt6323_probe(struct platform_device *pdev)
  191. {
  192. int ret;
  193. - struct mt6397_chip *mt6397;
  194. + struct mt6323_chip *mt6323;
  195. - mt6397 = devm_kzalloc(&pdev->dev, sizeof(*mt6397), GFP_KERNEL);
  196. - if (!mt6397)
  197. + mt6323 = devm_kzalloc(&pdev->dev, sizeof(*mt6323), GFP_KERNEL);
  198. + if (!mt6323)
  199. return -ENOMEM;
  200. - mt6397->dev = &pdev->dev;
  201. + mt6323->dev = &pdev->dev;
  202. /*
  203. - * mt6397 MFD is child device of soc pmic wrapper.
  204. + * mt6323 MFD is child device of soc pmic wrapper.
  205. * Regmap is set from its parent.
  206. */
  207. - mt6397->regmap = dev_get_regmap(pdev->dev.parent, NULL);
  208. - if (!mt6397->regmap)
  209. + mt6323->regmap = dev_get_regmap(pdev->dev.parent, NULL);
  210. + if (!mt6323->regmap)
  211. return -ENODEV;
  212. - platform_set_drvdata(pdev, mt6397);
  213. + platform_set_drvdata(pdev, mt6323);
  214. - mt6397->irq = platform_get_irq(pdev, 0);
  215. - if (mt6397->irq > 0) {
  216. - ret = mt6397_irq_init(mt6397);
  217. + mt6323->irq = platform_get_irq(pdev, 0);
  218. + if (mt6323->irq > 0) {
  219. + ret = mt6323_irq_init(mt6323);
  220. if (ret)
  221. return ret;
  222. }
  223. - ret = mfd_add_devices(&pdev->dev, -1, mt6397_devs,
  224. - ARRAY_SIZE(mt6397_devs), NULL, 0, NULL);
  225. + ret = mfd_add_devices(&pdev->dev, -1, mt6323_devs,
  226. + ARRAY_SIZE(mt6323_devs), NULL, 0, NULL);
  227. if (ret)
  228. dev_err(&pdev->dev, "failed to add child devices: %d\n", ret);
  229. return ret;
  230. }
  231. -static int mt6397_remove(struct platform_device *pdev)
  232. +static int mt6323_remove(struct platform_device *pdev)
  233. {
  234. mfd_remove_devices(&pdev->dev);
  235. return 0;
  236. }
  237. -static const struct of_device_id mt6397_of_match[] = {
  238. - { .compatible = "mediatek,mt6397" },
  239. +static const struct of_device_id mt6323_of_match[] = {
  240. + { .compatible = "mediatek,mt6323" },
  241. { }
  242. };
  243. -MODULE_DEVICE_TABLE(of, mt6397_of_match);
  244. +MODULE_DEVICE_TABLE(of, mt6323_of_match);
  245. -static struct platform_driver mt6397_driver = {
  246. - .probe = mt6397_probe,
  247. - .remove = mt6397_remove,
  248. +static struct platform_driver mt6323_driver = {
  249. + .probe = mt6323_probe,
  250. + .remove = mt6323_remove,
  251. .driver = {
  252. - .name = "mt6397",
  253. - .of_match_table = of_match_ptr(mt6397_of_match),
  254. + .name = "mt6323",
  255. + .of_match_table = of_match_ptr(mt6323_of_match),
  256. },
  257. };
  258. -module_platform_driver(mt6397_driver);
  259. +module_platform_driver(mt6323_driver);
  260. MODULE_AUTHOR("Flora Fu, MediaTek");
  261. -MODULE_DESCRIPTION("Driver for MediaTek MT6397 PMIC");
  262. +MODULE_DESCRIPTION("Driver for MediaTek MT6323 PMIC");
  263. MODULE_LICENSE("GPL");
  264. -MODULE_ALIAS("platform:mt6397");
  265. +MODULE_ALIAS("platform:mt6323");
  266. diff --git a/drivers/regulator/mt6323-regulator.c b/drivers/regulator/mt6323-regulator.c
  267. index a5b2f47..f5e3f67 100644
  268. --- a/drivers/regulator/mt6323-regulator.c
  269. +++ b/drivers/regulator/mt6323-regulator.c
  270. @@ -16,15 +16,15 @@
  271. #include <linux/of.h>
  272. #include <linux/platform_device.h>
  273. #include <linux/regmap.h>
  274. -#include <linux/mfd/mt6397/core.h>
  275. -#include <linux/mfd/mt6397/registers.h>
  276. +#include <linux/mfd/mt6323/core.h>
  277. +#include <linux/mfd/mt6323/registers.h>
  278. #include <linux/regulator/driver.h>
  279. #include <linux/regulator/machine.h>
  280. -#include <linux/regulator/mt6397-regulator.h>
  281. +#include <linux/regulator/mt6323-regulator.h>
  282. #include <linux/regulator/of_regulator.h>
  283. /*
  284. - * MT6397 regulators' information
  285. + * MT6323 regulators' information
  286. *
  287. * @desc: standard fields of regulator description.
  288. * @qi: Mask for query enable signal status of regulators
  289. @@ -32,7 +32,7 @@
  290. * @vselctrl_reg: Register for controlling the buck control mode.
  291. * @vselctrl_mask: Mask for query buck's voltage control mode.
  292. */
  293. -struct mt6397_regulator_info {
  294. +struct mt6323_regulator_info {
  295. struct regulator_desc desc;
  296. u32 qi;
  297. u32 vselon_reg;
  298. @@ -40,15 +40,15 @@ struct mt6397_regulator_info {
  299. u32 vselctrl_mask;
  300. };
  301. -#define MT6397_BUCK(match, vreg, min, max, step, volt_ranges, enreg, \
  302. +#define MT6323_BUCK(match, vreg, min, max, step, volt_ranges, enreg, \
  303. vosel, vosel_mask, voselon, vosel_ctrl) \
  304. -[MT6397_ID_##vreg] = { \
  305. +[MT6323_ID_##vreg] = { \
  306. .desc = { \
  307. .name = #vreg, \
  308. .of_match = of_match_ptr(match), \
  309. - .ops = &mt6397_volt_range_ops, \
  310. + .ops = &mt6323_volt_range_ops, \
  311. .type = REGULATOR_VOLTAGE, \
  312. - .id = MT6397_ID_##vreg, \
  313. + .id = MT6323_ID_##vreg, \
  314. .owner = THIS_MODULE, \
  315. .n_voltages = (max - min)/step + 1, \
  316. .linear_ranges = volt_ranges, \
  317. @@ -64,15 +64,15 @@ struct mt6397_regulator_info {
  318. .vselctrl_mask = BIT(1), \
  319. }
  320. -#define MT6397_LDO(match, vreg, ldo_volt_table, enreg, enbit, vosel, \
  321. +#define MT6323_LDO(match, vreg, ldo_volt_table, enreg, enbit, vosel, \
  322. vosel_mask) \
  323. -[MT6397_ID_##vreg] = { \
  324. +[MT6323_ID_##vreg] = { \
  325. .desc = { \
  326. .name = #vreg, \
  327. .of_match = of_match_ptr(match), \
  328. - .ops = &mt6397_volt_table_ops, \
  329. + .ops = &mt6323_volt_table_ops, \
  330. .type = REGULATOR_VOLTAGE, \
  331. - .id = MT6397_ID_##vreg, \
  332. + .id = MT6323_ID_##vreg, \
  333. .owner = THIS_MODULE, \
  334. .n_voltages = ARRAY_SIZE(ldo_volt_table), \
  335. .volt_table = ldo_volt_table, \
  336. @@ -84,14 +84,14 @@ struct mt6397_regulator_info {
  337. .qi = BIT(15), \
  338. }
  339. -#define MT6397_REG_FIXED(match, vreg, enreg, enbit, volt) \
  340. -[MT6397_ID_##vreg] = { \
  341. +#define MT6323_REG_FIXED(match, vreg, enreg, enbit, volt) \
  342. +[MT6323_ID_##vreg] = { \
  343. .desc = { \
  344. .name = #vreg, \
  345. .of_match = of_match_ptr(match), \
  346. - .ops = &mt6397_volt_fixed_ops, \
  347. + .ops = &mt6323_volt_fixed_ops, \
  348. .type = REGULATOR_VOLTAGE, \
  349. - .id = MT6397_ID_##vreg, \
  350. + .id = MT6323_ID_##vreg, \
  351. .owner = THIS_MODULE, \
  352. .n_voltages = 1, \
  353. .enable_reg = enreg, \
  354. @@ -106,50 +106,34 @@ static const struct regulator_linear_range buck_volt_range1[] = {
  355. };
  356. static const struct regulator_linear_range buck_volt_range2[] = {
  357. - REGULATOR_LINEAR_RANGE(800000, 0, 0x7f, 6250),
  358. + REGULATOR_LINEAR_RANGE(1400000, 0, 0x7f, 12500),
  359. };
  360. static const struct regulator_linear_range buck_volt_range3[] = {
  361. - REGULATOR_LINEAR_RANGE(1500000, 0, 0x1f, 20000),
  362. + REGULATOR_LINEAR_RANGE(500000, 0, 0x3f, 50000),
  363. };
  364. static const u32 ldo_volt_table1[] = {
  365. - 1500000, 1800000, 2500000, 2800000,
  366. + 1800000, 3300000,
  367. };
  368. static const u32 ldo_volt_table2[] = {
  369. - 1800000, 3300000,
  370. + 3000000, 3300000,
  371. };
  372. static const u32 ldo_volt_table3[] = {
  373. - 3000000, 3300000,
  374. + 1200000, 1300000, 1500000, 1800000, 2000000, 2800000, 3000000,
  375. };
  376. static const u32 ldo_volt_table4[] = {
  377. - 1220000, 1300000, 1500000, 1800000, 2500000, 2800000, 3000000, 3300000,
  378. -};
  379. -
  380. -static const u32 ldo_volt_table5[] = {
  381. 1200000, 1300000, 1500000, 1800000, 2500000, 2800000, 3000000, 3300000,
  382. };
  383. -static const u32 ldo_volt_table5_v2[] = {
  384. - 1200000, 1000000, 1500000, 1800000, 2500000, 2800000, 3000000, 3300000,
  385. -};
  386. -
  387. -static const u32 ldo_volt_table6[] = {
  388. - 1200000, 1300000, 1500000, 1800000, 2500000, 2800000, 3000000, 2000000,
  389. -};
  390. -
  391. -static const u32 ldo_volt_table7[] = {
  392. - 1300000, 1500000, 1800000, 2000000, 2500000, 2800000, 3000000, 3300000,
  393. -};
  394. -
  395. -static int mt6397_get_status(struct regulator_dev *rdev)
  396. +static int mt6323_get_status(struct regulator_dev *rdev)
  397. {
  398. int ret;
  399. u32 regval;
  400. - struct mt6397_regulator_info *info = rdev_get_drvdata(rdev);
  401. + struct mt6323_regulator_info *info = rdev_get_drvdata(rdev);
  402. ret = regmap_read(rdev->regmap, info->desc.enable_reg, &regval);
  403. if (ret != 0) {
  404. @@ -160,7 +144,7 @@ static int mt6397_get_status(struct regulator_dev *rdev)
  405. return (regval & info->qi) ? REGULATOR_STATUS_ON : REGULATOR_STATUS_OFF;
  406. }
  407. -static struct regulator_ops mt6397_volt_range_ops = {
  408. +static struct regulator_ops mt6323_volt_range_ops = {
  409. .list_voltage = regulator_list_voltage_linear_range,
  410. .map_voltage = regulator_map_voltage_linear_range,
  411. .set_voltage_sel = regulator_set_voltage_sel_regmap,
  412. @@ -169,10 +153,10 @@ static struct regulator_ops mt6397_volt_range_ops = {
  413. .enable = regulator_enable_regmap,
  414. .disable = regulator_disable_regmap,
  415. .is_enabled = regulator_is_enabled_regmap,
  416. - .get_status = mt6397_get_status,
  417. + .get_status = mt6323_get_status,
  418. };
  419. -static struct regulator_ops mt6397_volt_table_ops = {
  420. +static struct regulator_ops mt6323_volt_table_ops = {
  421. .list_voltage = regulator_list_voltage_table,
  422. .map_voltage = regulator_map_voltage_iterate,
  423. .set_voltage_sel = regulator_set_voltage_sel_regmap,
  424. @@ -181,90 +165,68 @@ static struct regulator_ops mt6397_volt_table_ops = {
  425. .enable = regulator_enable_regmap,
  426. .disable = regulator_disable_regmap,
  427. .is_enabled = regulator_is_enabled_regmap,
  428. - .get_status = mt6397_get_status,
  429. + .get_status = mt6323_get_status,
  430. };
  431. -static struct regulator_ops mt6397_volt_fixed_ops = {
  432. +static struct regulator_ops mt6323_volt_fixed_ops = {
  433. .list_voltage = regulator_list_voltage_linear,
  434. .enable = regulator_enable_regmap,
  435. .disable = regulator_disable_regmap,
  436. .is_enabled = regulator_is_enabled_regmap,
  437. - .get_status = mt6397_get_status,
  438. + .get_status = mt6323_get_status,
  439. };
  440. -/* The array is indexed by id(MT6397_ID_XXX) */
  441. -static struct mt6397_regulator_info mt6397_regulators[] = {
  442. - MT6397_BUCK("buck_vpca15", VPCA15, 700000, 1493750, 6250,
  443. - buck_volt_range1, MT6397_VCA15_CON7, MT6397_VCA15_CON9, 0x7f,
  444. - MT6397_VCA15_CON10, MT6397_VCA15_CON5),
  445. - MT6397_BUCK("buck_vpca7", VPCA7, 700000, 1493750, 6250,
  446. - buck_volt_range1, MT6397_VPCA7_CON7, MT6397_VPCA7_CON9, 0x7f,
  447. - MT6397_VPCA7_CON10, MT6397_VPCA7_CON5),
  448. - MT6397_BUCK("buck_vsramca15", VSRAMCA15, 700000, 1493750, 6250,
  449. - buck_volt_range1, MT6397_VSRMCA15_CON7, MT6397_VSRMCA15_CON9,
  450. - 0x7f, MT6397_VSRMCA15_CON10, MT6397_VSRMCA15_CON5),
  451. - MT6397_BUCK("buck_vsramca7", VSRAMCA7, 700000, 1493750, 6250,
  452. - buck_volt_range1, MT6397_VSRMCA7_CON7, MT6397_VSRMCA7_CON9,
  453. - 0x7f, MT6397_VSRMCA7_CON10, MT6397_VSRMCA7_CON5),
  454. - MT6397_BUCK("buck_vcore", VCORE, 700000, 1493750, 6250,
  455. - buck_volt_range1, MT6397_VCORE_CON7, MT6397_VCORE_CON9, 0x7f,
  456. - MT6397_VCORE_CON10, MT6397_VCORE_CON5),
  457. - MT6397_BUCK("buck_vgpu", VGPU, 700000, 1493750, 6250, buck_volt_range1,
  458. - MT6397_VGPU_CON7, MT6397_VGPU_CON9, 0x7f,
  459. - MT6397_VGPU_CON10, MT6397_VGPU_CON5),
  460. - MT6397_BUCK("buck_vdrm", VDRM, 800000, 1593750, 6250, buck_volt_range2,
  461. - MT6397_VDRM_CON7, MT6397_VDRM_CON9, 0x7f,
  462. - MT6397_VDRM_CON10, MT6397_VDRM_CON5),
  463. - MT6397_BUCK("buck_vio18", VIO18, 1500000, 2120000, 20000,
  464. - buck_volt_range3, MT6397_VIO18_CON7, MT6397_VIO18_CON9, 0x1f,
  465. - MT6397_VIO18_CON10, MT6397_VIO18_CON5),
  466. - MT6397_REG_FIXED("ldo_vtcxo", VTCXO, MT6397_ANALDO_CON0, 10, 2800000),
  467. - MT6397_REG_FIXED("ldo_va28", VA28, MT6397_ANALDO_CON1, 14, 2800000),
  468. - MT6397_LDO("ldo_vcama", VCAMA, ldo_volt_table1,
  469. - MT6397_ANALDO_CON2, 15, MT6397_ANALDO_CON6, 0xC0),
  470. - MT6397_REG_FIXED("ldo_vio28", VIO28, MT6397_DIGLDO_CON0, 14, 2800000),
  471. - MT6397_REG_FIXED("ldo_vusb", VUSB, MT6397_DIGLDO_CON1, 14, 3300000),
  472. - MT6397_LDO("ldo_vmc", VMC, ldo_volt_table2,
  473. - MT6397_DIGLDO_CON2, 12, MT6397_DIGLDO_CON29, 0x10),
  474. - MT6397_LDO("ldo_vmch", VMCH, ldo_volt_table3,
  475. - MT6397_DIGLDO_CON3, 14, MT6397_DIGLDO_CON17, 0x80),
  476. - MT6397_LDO("ldo_vemc3v3", VEMC3V3, ldo_volt_table3,
  477. - MT6397_DIGLDO_CON4, 14, MT6397_DIGLDO_CON18, 0x10),
  478. - MT6397_LDO("ldo_vgp1", VGP1, ldo_volt_table4,
  479. - MT6397_DIGLDO_CON5, 15, MT6397_DIGLDO_CON19, 0xE0),
  480. - MT6397_LDO("ldo_vgp2", VGP2, ldo_volt_table5,
  481. - MT6397_DIGLDO_CON6, 15, MT6397_DIGLDO_CON20, 0xE0),
  482. - MT6397_LDO("ldo_vgp3", VGP3, ldo_volt_table5,
  483. - MT6397_DIGLDO_CON7, 15, MT6397_DIGLDO_CON21, 0xE0),
  484. - MT6397_LDO("ldo_vgp4", VGP4, ldo_volt_table5,
  485. - MT6397_DIGLDO_CON8, 15, MT6397_DIGLDO_CON22, 0xE0),
  486. - MT6397_LDO("ldo_vgp5", VGP5, ldo_volt_table6,
  487. - MT6397_DIGLDO_CON9, 15, MT6397_DIGLDO_CON23, 0xE0),
  488. - MT6397_LDO("ldo_vgp6", VGP6, ldo_volt_table5,
  489. - MT6397_DIGLDO_CON10, 15, MT6397_DIGLDO_CON33, 0xE0),
  490. - MT6397_LDO("ldo_vibr", VIBR, ldo_volt_table7,
  491. - MT6397_DIGLDO_CON24, 15, MT6397_DIGLDO_CON25, 0xE00),
  492. +/* The array is indexed by id(MT6323_ID_XXX) */
  493. +static struct mt6323_regulator_info mt6323_regulators[] = {
  494. + /* buck */
  495. + MT6323_BUCK("buck_vproc", VPROC, 700000, 1493750, 6250,
  496. + buck_volt_range1, MT6323_VPROC_CON7, MT6323_VPROC_CON9, 0x7f,
  497. + MT6323_VPROC_CON10, MT6323_VPROC_CON5),
  498. + MT6323_BUCK("buck_vsys", VSYS, 1400000, 3000000, 12500,
  499. + buck_volt_range2, MT6323_VSYS_CON7, MT6323_VSYS_CON9,
  500. + 0x7f, MT6323_VSYS_CON10, MT6323_VSYS_CON5),
  501. + MT6323_BUCK("buck_vpa", VPA, 500000, 3650000, 50000,
  502. + buck_volt_range3, MT6323_VPA_CON7, MT6323_VPA_CON9, 0x7f,
  503. + MT6323_VPA_CON10, MT6323_VPA_CON5),
  504. +
  505. + /* analog */
  506. + MT6323_REG_FIXED("ldo_vtcxo", VTCXO, MT6323_ANALDO_CON1, 10, 2800000),
  507. + MT6323_REG_FIXED("ldo_va", VA, MT6323_ANALDO_CON2, 14, 2800000),
  508. + MT6323_REG_FIXED("ldo_vcn28", VCN28, MT6323_ANALDO_CON19, 12, 2800000),
  509. + MT6323_REG_FIXED("ldo_vcn33", VCN33, MT6323_ANALDO_CON21, 12, 3300000),
  510. +
  511. + /* digital */
  512. + MT6323_REG_FIXED("ldo_vio28", VIO28, MT6323_DIGLDO_CON0, 15, 2800000),
  513. + MT6323_REG_FIXED("ldo_vusb", VUSB, MT6323_DIGLDO_CON2, 15, 3300000),
  514. + MT6323_LDO("ldo_vmc", VMC, ldo_volt_table1,
  515. + MT6323_DIGLDO_CON3, 12, MT6323_DIGLDO_CON24, 0x10),
  516. + MT6323_LDO("ldo_vmch", VMCH, ldo_volt_table2,
  517. + MT6323_DIGLDO_CON5, 14, MT6323_DIGLDO_CON26, 0x80),
  518. + MT6323_LDO("ldo_vgp1", VGP1, ldo_volt_table3,
  519. + MT6323_DIGLDO_CON7, 15, MT6323_DIGLDO_CON28, 0xE0),
  520. + MT6323_LDO("ldo_vgp2", VGP2, ldo_volt_table4,
  521. + MT6323_DIGLDO_CON8, 15, MT6323_DIGLDO_CON29, 0xE0),
  522. };
  523. -static int mt6397_set_buck_vosel_reg(struct platform_device *pdev)
  524. +static int mt6323_set_buck_vosel_reg(struct platform_device *pdev)
  525. {
  526. - struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent);
  527. + struct mt6323_chip *mt6323 = dev_get_drvdata(pdev->dev.parent);
  528. int i;
  529. u32 regval;
  530. - for (i = 0; i < MT6397_MAX_REGULATOR; i++) {
  531. - if (mt6397_regulators[i].vselctrl_reg) {
  532. - if (regmap_read(mt6397->regmap,
  533. - mt6397_regulators[i].vselctrl_reg,
  534. + for (i = 0; i < MT6323_MAX_REGULATOR; i++) {
  535. + if (mt6323_regulators[i].vselctrl_reg) {
  536. + if (regmap_read(mt6323->regmap,
  537. + mt6323_regulators[i].vselctrl_reg,
  538. &regval) < 0) {
  539. dev_err(&pdev->dev,
  540. "Failed to read buck ctrl\n");
  541. return -EIO;
  542. }
  543. - if (regval & mt6397_regulators[i].vselctrl_mask) {
  544. - mt6397_regulators[i].desc.vsel_reg =
  545. - mt6397_regulators[i].vselon_reg;
  546. + if (regval & mt6323_regulators[i].vselctrl_mask) {
  547. + mt6323_regulators[i].desc.vsel_reg =
  548. + mt6323_regulators[i].vselon_reg;
  549. }
  550. }
  551. }
  552. @@ -272,44 +234,34 @@ static int mt6397_set_buck_vosel_reg(struct platform_device *pdev)
  553. return 0;
  554. }
  555. -static int mt6397_regulator_probe(struct platform_device *pdev)
  556. +static int mt6323_regulator_probe(struct platform_device *pdev)
  557. {
  558. - struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent);
  559. + struct mt6323_chip *mt6323 = dev_get_drvdata(pdev->dev.parent);
  560. struct regulator_config config = {};
  561. struct regulator_dev *rdev;
  562. int i;
  563. - u32 reg_value, version;
  564. + u32 reg_value;
  565. /* Query buck controller to select activated voltage register part */
  566. - if (mt6397_set_buck_vosel_reg(pdev))
  567. + if (mt6323_set_buck_vosel_reg(pdev))
  568. return -EIO;
  569. /* Read PMIC chip revision to update constraints and voltage table */
  570. - if (regmap_read(mt6397->regmap, MT6397_CID, &reg_value) < 0) {
  571. + if (regmap_read(mt6323->regmap, MT6323_CID, &reg_value) < 0) {
  572. dev_err(&pdev->dev, "Failed to read Chip ID\n");
  573. return -EIO;
  574. }
  575. dev_info(&pdev->dev, "Chip ID = 0x%x\n", reg_value);
  576. - version = (reg_value & 0xFF);
  577. - switch (version) {
  578. - case MT6397_REGULATOR_ID91:
  579. - mt6397_regulators[MT6397_ID_VGP2].desc.volt_table =
  580. - ldo_volt_table5_v2;
  581. - break;
  582. - default:
  583. - break;
  584. - }
  585. -
  586. - for (i = 0; i < MT6397_MAX_REGULATOR; i++) {
  587. + for (i = 0; i < MT6323_MAX_REGULATOR; i++) {
  588. config.dev = &pdev->dev;
  589. - config.driver_data = &mt6397_regulators[i];
  590. - config.regmap = mt6397->regmap;
  591. + config.driver_data = &mt6323_regulators[i];
  592. + config.regmap = mt6323->regmap;
  593. rdev = devm_regulator_register(&pdev->dev,
  594. - &mt6397_regulators[i].desc, &config);
  595. + &mt6323_regulators[i].desc, &config);
  596. if (IS_ERR(rdev)) {
  597. dev_err(&pdev->dev, "failed to register %s\n",
  598. - mt6397_regulators[i].desc.name);
  599. + mt6323_regulators[i].desc.name);
  600. return PTR_ERR(rdev);
  601. }
  602. }
  603. @@ -317,16 +269,16 @@ static int mt6397_regulator_probe(struct platform_device *pdev)
  604. return 0;
  605. }
  606. -static struct platform_driver mt6397_regulator_driver = {
  607. +static struct platform_driver mt6323_regulator_driver = {
  608. .driver = {
  609. - .name = "mt6397-regulator",
  610. + .name = "mt6323-regulator",
  611. },
  612. - .probe = mt6397_regulator_probe,
  613. + .probe = mt6323_regulator_probe,
  614. };
  615. -module_platform_driver(mt6397_regulator_driver);
  616. +module_platform_driver(mt6323_regulator_driver);
  617. MODULE_AUTHOR("Flora Fu <[email protected]>");
  618. -MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6397 PMIC");
  619. +MODULE_DESCRIPTION("Regulator Driver for MediaTek MT6323 PMIC");
  620. MODULE_LICENSE("GPL");
  621. -MODULE_ALIAS("platform:mt6397-regulator");
  622. +MODULE_ALIAS("platform:mt6323-regulator");
  623. diff --git a/include/linux/mfd/mt6323/core.h b/include/linux/mfd/mt6323/core.h
  624. index cf5265b..5bb2d32 100644
  625. --- a/include/linux/mfd/mt6323/core.h
  626. +++ b/include/linux/mfd/mt6323/core.h
  627. @@ -12,46 +12,46 @@
  628. * GNU General Public License for more details.
  629. */
  630. -#ifndef __MFD_MT6397_CORE_H__
  631. -#define __MFD_MT6397_CORE_H__
  632. +#ifndef __MFD_MT6323_CORE_H__
  633. +#define __MFD_MT6323_CORE_H__
  634. -enum mt6397_irq_numbers {
  635. - MT6397_IRQ_SPKL_AB = 0,
  636. - MT6397_IRQ_SPKR_AB,
  637. - MT6397_IRQ_SPKL,
  638. - MT6397_IRQ_SPKR,
  639. - MT6397_IRQ_BAT_L,
  640. - MT6397_IRQ_BAT_H,
  641. - MT6397_IRQ_FG_BAT_L,
  642. - MT6397_IRQ_FG_BAT_H,
  643. - MT6397_IRQ_WATCHDOG,
  644. - MT6397_IRQ_PWRKEY,
  645. - MT6397_IRQ_THR_L,
  646. - MT6397_IRQ_THR_H,
  647. - MT6397_IRQ_VBATON_UNDET,
  648. - MT6397_IRQ_BVALID_DET,
  649. - MT6397_IRQ_CHRDET,
  650. - MT6397_IRQ_OV,
  651. - MT6397_IRQ_LDO,
  652. - MT6397_IRQ_HOMEKEY,
  653. - MT6397_IRQ_ACCDET,
  654. - MT6397_IRQ_AUDIO,
  655. - MT6397_IRQ_RTC,
  656. - MT6397_IRQ_PWRKEY_RSTB,
  657. - MT6397_IRQ_HDMI_SIFM,
  658. - MT6397_IRQ_HDMI_CEC,
  659. - MT6397_IRQ_VCA15,
  660. - MT6397_IRQ_VSRMCA15,
  661. - MT6397_IRQ_VCORE,
  662. - MT6397_IRQ_VGPU,
  663. - MT6397_IRQ_VIO18,
  664. - MT6397_IRQ_VPCA7,
  665. - MT6397_IRQ_VSRMCA7,
  666. - MT6397_IRQ_VDRM,
  667. - MT6397_IRQ_NR,
  668. +enum mt6323_irq_numbers {
  669. + MT6323_IRQ_SPKL_AB = 0,
  670. + MT6323_IRQ_SPKR_AB,
  671. + MT6323_IRQ_SPKL,
  672. + MT6323_IRQ_SPKR,
  673. + MT6323_IRQ_BAT_L,
  674. + MT6323_IRQ_BAT_H,
  675. + MT6323_IRQ_FG_BAT_L,
  676. + MT6323_IRQ_FG_BAT_H,
  677. + MT6323_IRQ_WATCHDOG,
  678. + MT6323_IRQ_PWRKEY,
  679. + MT6323_IRQ_THR_L,
  680. + MT6323_IRQ_THR_H,
  681. + MT6323_IRQ_VBATON_UNDET,
  682. + MT6323_IRQ_BVALID_DET,
  683. + MT6323_IRQ_CHRDET,
  684. + MT6323_IRQ_OV,
  685. + MT6323_IRQ_LDO,
  686. + MT6323_IRQ_HOMEKEY,
  687. + MT6323_IRQ_ACCDET,
  688. + MT6323_IRQ_AUDIO,
  689. + MT6323_IRQ_RTC,
  690. + MT6323_IRQ_PWRKEY_RSTB,
  691. + MT6323_IRQ_HDMI_SIFM,
  692. + MT6323_IRQ_HDMI_CEC,
  693. + MT6323_IRQ_VCA15,
  694. + MT6323_IRQ_VSRMCA15,
  695. + MT6323_IRQ_VCORE,
  696. + MT6323_IRQ_VGPU,
  697. + MT6323_IRQ_VIO18,
  698. + MT6323_IRQ_VPCA7,
  699. + MT6323_IRQ_VSRMCA7,
  700. + MT6323_IRQ_VDRM,
  701. + MT6323_IRQ_NR,
  702. };
  703. -struct mt6397_chip {
  704. +struct mt6323_chip {
  705. struct device *dev;
  706. struct regmap *regmap;
  707. int irq;
  708. @@ -61,4 +61,4 @@ struct mt6397_chip {
  709. u16 irq_masks_cache[2];
  710. };
  711. -#endif /* __MFD_MT6397_CORE_H__ */
  712. +#endif /* __MFD_MT6323_CORE_H__ */
  713. diff --git a/include/linux/mfd/mt6323/registers.h b/include/linux/mfd/mt6323/registers.h
  714. index f23a0a6..4ee5e1f0 100644
  715. --- a/include/linux/mfd/mt6323/registers.h
  716. +++ b/include/linux/mfd/mt6323/registers.h
  717. @@ -1,6 +1,5 @@
  718. /*
  719. - * Copyright (c) 2014 MediaTek Inc.
  720. - * Author: Flora Fu, MediaTek
  721. + * Copyright (c) 2015 - John Crispin <[email protected]>
  722. *
  723. * This program is free software; you can redistribute it and/or modify
  724. * it under the terms of the GNU General Public License version 2 as
  725. @@ -12,351 +11,403 @@
  726. * GNU General Public License for more details.
  727. */
  728. -#ifndef __MFD_MT6397_REGISTERS_H__
  729. -#define __MFD_MT6397_REGISTERS_H__
  730. +#ifndef __MFD_MT6323_REGISTERS_H__
  731. +#define __MFD_MT6323_REGISTERS_H__
  732. /* PMIC Registers */
  733. -#define MT6397_CID 0x0100
  734. -#define MT6397_TOP_CKPDN 0x0102
  735. -#define MT6397_TOP_CKPDN_SET 0x0104
  736. -#define MT6397_TOP_CKPDN_CLR 0x0106
  737. -#define MT6397_TOP_CKPDN2 0x0108
  738. -#define MT6397_TOP_CKPDN2_SET 0x010A
  739. -#define MT6397_TOP_CKPDN2_CLR 0x010C
  740. -#define MT6397_TOP_GPIO_CKPDN 0x010E
  741. -#define MT6397_TOP_RST_CON 0x0114
  742. -#define MT6397_WRP_CKPDN 0x011A
  743. -#define MT6397_WRP_RST_CON 0x0120
  744. -#define MT6397_TOP_RST_MISC 0x0126
  745. -#define MT6397_TOP_CKCON1 0x0128
  746. -#define MT6397_TOP_CKCON2 0x012A
  747. -#define MT6397_TOP_CKTST1 0x012C
  748. -#define MT6397_TOP_CKTST2 0x012E
  749. -#define MT6397_OC_DEG_EN 0x0130
  750. -#define MT6397_OC_CTL0 0x0132
  751. -#define MT6397_OC_CTL1 0x0134
  752. -#define MT6397_OC_CTL2 0x0136
  753. -#define MT6397_INT_RSV 0x0138
  754. -#define MT6397_TEST_CON0 0x013A
  755. -#define MT6397_TEST_CON1 0x013C
  756. -#define MT6397_STATUS0 0x013E
  757. -#define MT6397_STATUS1 0x0140
  758. -#define MT6397_PGSTATUS 0x0142
  759. -#define MT6397_CHRSTATUS 0x0144
  760. -#define MT6397_OCSTATUS0 0x0146
  761. -#define MT6397_OCSTATUS1 0x0148
  762. -#define MT6397_OCSTATUS2 0x014A
  763. -#define MT6397_HDMI_PAD_IE 0x014C
  764. -#define MT6397_TEST_OUT_L 0x014E
  765. -#define MT6397_TEST_OUT_H 0x0150
  766. -#define MT6397_TDSEL_CON 0x0152
  767. -#define MT6397_RDSEL_CON 0x0154
  768. -#define MT6397_GPIO_SMT_CON0 0x0156
  769. -#define MT6397_GPIO_SMT_CON1 0x0158
  770. -#define MT6397_GPIO_SMT_CON2 0x015A
  771. -#define MT6397_GPIO_SMT_CON3 0x015C
  772. -#define MT6397_DRV_CON0 0x015E
  773. -#define MT6397_DRV_CON1 0x0160
  774. -#define MT6397_DRV_CON2 0x0162
  775. -#define MT6397_DRV_CON3 0x0164
  776. -#define MT6397_DRV_CON4 0x0166
  777. -#define MT6397_DRV_CON5 0x0168
  778. -#define MT6397_DRV_CON6 0x016A
  779. -#define MT6397_DRV_CON7 0x016C
  780. -#define MT6397_DRV_CON8 0x016E
  781. -#define MT6397_DRV_CON9 0x0170
  782. -#define MT6397_DRV_CON10 0x0172
  783. -#define MT6397_DRV_CON11 0x0174
  784. -#define MT6397_DRV_CON12 0x0176
  785. -#define MT6397_INT_CON0 0x0178
  786. -#define MT6397_INT_CON1 0x017E
  787. -#define MT6397_INT_STATUS0 0x0184
  788. -#define MT6397_INT_STATUS1 0x0186
  789. -#define MT6397_FQMTR_CON0 0x0188
  790. -#define MT6397_FQMTR_CON1 0x018A
  791. -#define MT6397_FQMTR_CON2 0x018C
  792. -#define MT6397_EFUSE_DOUT_0_15 0x01C4
  793. -#define MT6397_EFUSE_DOUT_16_31 0x01C6
  794. -#define MT6397_EFUSE_DOUT_32_47 0x01C8
  795. -#define MT6397_EFUSE_DOUT_48_63 0x01CA
  796. -#define MT6397_SPI_CON 0x01CC
  797. -#define MT6397_TOP_CKPDN3 0x01CE
  798. -#define MT6397_TOP_CKCON3 0x01D4
  799. -#define MT6397_EFUSE_DOUT_64_79 0x01D6
  800. -#define MT6397_EFUSE_DOUT_80_95 0x01D8
  801. -#define MT6397_EFUSE_DOUT_96_111 0x01DA
  802. -#define MT6397_EFUSE_DOUT_112_127 0x01DC
  803. -#define MT6397_EFUSE_DOUT_128_143 0x01DE
  804. -#define MT6397_EFUSE_DOUT_144_159 0x01E0
  805. -#define MT6397_EFUSE_DOUT_160_175 0x01E2
  806. -#define MT6397_EFUSE_DOUT_176_191 0x01E4
  807. -#define MT6397_EFUSE_DOUT_192_207 0x01E6
  808. -#define MT6397_EFUSE_DOUT_208_223 0x01E8
  809. -#define MT6397_EFUSE_DOUT_224_239 0x01EA
  810. -#define MT6397_EFUSE_DOUT_240_255 0x01EC
  811. -#define MT6397_EFUSE_DOUT_256_271 0x01EE
  812. -#define MT6397_EFUSE_DOUT_272_287 0x01F0
  813. -#define MT6397_EFUSE_DOUT_288_300 0x01F2
  814. -#define MT6397_EFUSE_DOUT_304_319 0x01F4
  815. -#define MT6397_BUCK_CON0 0x0200
  816. -#define MT6397_BUCK_CON1 0x0202
  817. -#define MT6397_BUCK_CON2 0x0204
  818. -#define MT6397_BUCK_CON3 0x0206
  819. -#define MT6397_BUCK_CON4 0x0208
  820. -#define MT6397_BUCK_CON5 0x020A
  821. -#define MT6397_BUCK_CON6 0x020C
  822. -#define MT6397_BUCK_CON7 0x020E
  823. -#define MT6397_BUCK_CON8 0x0210
  824. -#define MT6397_BUCK_CON9 0x0212
  825. -#define MT6397_VCA15_CON0 0x0214
  826. -#define MT6397_VCA15_CON1 0x0216
  827. -#define MT6397_VCA15_CON2 0x0218
  828. -#define MT6397_VCA15_CON3 0x021A
  829. -#define MT6397_VCA15_CON4 0x021C
  830. -#define MT6397_VCA15_CON5 0x021E
  831. -#define MT6397_VCA15_CON6 0x0220
  832. -#define MT6397_VCA15_CON7 0x0222
  833. -#define MT6397_VCA15_CON8 0x0224
  834. -#define MT6397_VCA15_CON9 0x0226
  835. -#define MT6397_VCA15_CON10 0x0228
  836. -#define MT6397_VCA15_CON11 0x022A
  837. -#define MT6397_VCA15_CON12 0x022C
  838. -#define MT6397_VCA15_CON13 0x022E
  839. -#define MT6397_VCA15_CON14 0x0230
  840. -#define MT6397_VCA15_CON15 0x0232
  841. -#define MT6397_VCA15_CON16 0x0234
  842. -#define MT6397_VCA15_CON17 0x0236
  843. -#define MT6397_VCA15_CON18 0x0238
  844. -#define MT6397_VSRMCA15_CON0 0x023A
  845. -#define MT6397_VSRMCA15_CON1 0x023C
  846. -#define MT6397_VSRMCA15_CON2 0x023E
  847. -#define MT6397_VSRMCA15_CON3 0x0240
  848. -#define MT6397_VSRMCA15_CON4 0x0242
  849. -#define MT6397_VSRMCA15_CON5 0x0244
  850. -#define MT6397_VSRMCA15_CON6 0x0246
  851. -#define MT6397_VSRMCA15_CON7 0x0248
  852. -#define MT6397_VSRMCA15_CON8 0x024A
  853. -#define MT6397_VSRMCA15_CON9 0x024C
  854. -#define MT6397_VSRMCA15_CON10 0x024E
  855. -#define MT6397_VSRMCA15_CON11 0x0250
  856. -#define MT6397_VSRMCA15_CON12 0x0252
  857. -#define MT6397_VSRMCA15_CON13 0x0254
  858. -#define MT6397_VSRMCA15_CON14 0x0256
  859. -#define MT6397_VSRMCA15_CON15 0x0258
  860. -#define MT6397_VSRMCA15_CON16 0x025A
  861. -#define MT6397_VSRMCA15_CON17 0x025C
  862. -#define MT6397_VSRMCA15_CON18 0x025E
  863. -#define MT6397_VSRMCA15_CON19 0x0260
  864. -#define MT6397_VSRMCA15_CON20 0x0262
  865. -#define MT6397_VSRMCA15_CON21 0x0264
  866. -#define MT6397_VCORE_CON0 0x0266
  867. -#define MT6397_VCORE_CON1 0x0268
  868. -#define MT6397_VCORE_CON2 0x026A
  869. -#define MT6397_VCORE_CON3 0x026C
  870. -#define MT6397_VCORE_CON4 0x026E
  871. -#define MT6397_VCORE_CON5 0x0270
  872. -#define MT6397_VCORE_CON6 0x0272
  873. -#define MT6397_VCORE_CON7 0x0274
  874. -#define MT6397_VCORE_CON8 0x0276
  875. -#define MT6397_VCORE_CON9 0x0278
  876. -#define MT6397_VCORE_CON10 0x027A
  877. -#define MT6397_VCORE_CON11 0x027C
  878. -#define MT6397_VCORE_CON12 0x027E
  879. -#define MT6397_VCORE_CON13 0x0280
  880. -#define MT6397_VCORE_CON14 0x0282
  881. -#define MT6397_VCORE_CON15 0x0284
  882. -#define MT6397_VCORE_CON16 0x0286
  883. -#define MT6397_VCORE_CON17 0x0288
  884. -#define MT6397_VCORE_CON18 0x028A
  885. -#define MT6397_VGPU_CON0 0x028C
  886. -#define MT6397_VGPU_CON1 0x028E
  887. -#define MT6397_VGPU_CON2 0x0290
  888. -#define MT6397_VGPU_CON3 0x0292
  889. -#define MT6397_VGPU_CON4 0x0294
  890. -#define MT6397_VGPU_CON5 0x0296
  891. -#define MT6397_VGPU_CON6 0x0298
  892. -#define MT6397_VGPU_CON7 0x029A
  893. -#define MT6397_VGPU_CON8 0x029C
  894. -#define MT6397_VGPU_CON9 0x029E
  895. -#define MT6397_VGPU_CON10 0x02A0
  896. -#define MT6397_VGPU_CON11 0x02A2
  897. -#define MT6397_VGPU_CON12 0x02A4
  898. -#define MT6397_VGPU_CON13 0x02A6
  899. -#define MT6397_VGPU_CON14 0x02A8
  900. -#define MT6397_VGPU_CON15 0x02AA
  901. -#define MT6397_VGPU_CON16 0x02AC
  902. -#define MT6397_VGPU_CON17 0x02AE
  903. -#define MT6397_VGPU_CON18 0x02B0
  904. -#define MT6397_VIO18_CON0 0x0300
  905. -#define MT6397_VIO18_CON1 0x0302
  906. -#define MT6397_VIO18_CON2 0x0304
  907. -#define MT6397_VIO18_CON3 0x0306
  908. -#define MT6397_VIO18_CON4 0x0308
  909. -#define MT6397_VIO18_CON5 0x030A
  910. -#define MT6397_VIO18_CON6 0x030C
  911. -#define MT6397_VIO18_CON7 0x030E
  912. -#define MT6397_VIO18_CON8 0x0310
  913. -#define MT6397_VIO18_CON9 0x0312
  914. -#define MT6397_VIO18_CON10 0x0314
  915. -#define MT6397_VIO18_CON11 0x0316
  916. -#define MT6397_VIO18_CON12 0x0318
  917. -#define MT6397_VIO18_CON13 0x031A
  918. -#define MT6397_VIO18_CON14 0x031C
  919. -#define MT6397_VIO18_CON15 0x031E
  920. -#define MT6397_VIO18_CON16 0x0320
  921. -#define MT6397_VIO18_CON17 0x0322
  922. -#define MT6397_VIO18_CON18 0x0324
  923. -#define MT6397_VPCA7_CON0 0x0326
  924. -#define MT6397_VPCA7_CON1 0x0328
  925. -#define MT6397_VPCA7_CON2 0x032A
  926. -#define MT6397_VPCA7_CON3 0x032C
  927. -#define MT6397_VPCA7_CON4 0x032E
  928. -#define MT6397_VPCA7_CON5 0x0330
  929. -#define MT6397_VPCA7_CON6 0x0332
  930. -#define MT6397_VPCA7_CON7 0x0334
  931. -#define MT6397_VPCA7_CON8 0x0336
  932. -#define MT6397_VPCA7_CON9 0x0338
  933. -#define MT6397_VPCA7_CON10 0x033A
  934. -#define MT6397_VPCA7_CON11 0x033C
  935. -#define MT6397_VPCA7_CON12 0x033E
  936. -#define MT6397_VPCA7_CON13 0x0340
  937. -#define MT6397_VPCA7_CON14 0x0342
  938. -#define MT6397_VPCA7_CON15 0x0344
  939. -#define MT6397_VPCA7_CON16 0x0346
  940. -#define MT6397_VPCA7_CON17 0x0348
  941. -#define MT6397_VPCA7_CON18 0x034A
  942. -#define MT6397_VSRMCA7_CON0 0x034C
  943. -#define MT6397_VSRMCA7_CON1 0x034E
  944. -#define MT6397_VSRMCA7_CON2 0x0350
  945. -#define MT6397_VSRMCA7_CON3 0x0352
  946. -#define MT6397_VSRMCA7_CON4 0x0354
  947. -#define MT6397_VSRMCA7_CON5 0x0356
  948. -#define MT6397_VSRMCA7_CON6 0x0358
  949. -#define MT6397_VSRMCA7_CON7 0x035A
  950. -#define MT6397_VSRMCA7_CON8 0x035C
  951. -#define MT6397_VSRMCA7_CON9 0x035E
  952. -#define MT6397_VSRMCA7_CON10 0x0360
  953. -#define MT6397_VSRMCA7_CON11 0x0362
  954. -#define MT6397_VSRMCA7_CON12 0x0364
  955. -#define MT6397_VSRMCA7_CON13 0x0366
  956. -#define MT6397_VSRMCA7_CON14 0x0368
  957. -#define MT6397_VSRMCA7_CON15 0x036A
  958. -#define MT6397_VSRMCA7_CON16 0x036C
  959. -#define MT6397_VSRMCA7_CON17 0x036E
  960. -#define MT6397_VSRMCA7_CON18 0x0370
  961. -#define MT6397_VSRMCA7_CON19 0x0372
  962. -#define MT6397_VSRMCA7_CON20 0x0374
  963. -#define MT6397_VSRMCA7_CON21 0x0376
  964. -#define MT6397_VDRM_CON0 0x0378
  965. -#define MT6397_VDRM_CON1 0x037A
  966. -#define MT6397_VDRM_CON2 0x037C
  967. -#define MT6397_VDRM_CON3 0x037E
  968. -#define MT6397_VDRM_CON4 0x0380
  969. -#define MT6397_VDRM_CON5 0x0382
  970. -#define MT6397_VDRM_CON6 0x0384
  971. -#define MT6397_VDRM_CON7 0x0386
  972. -#define MT6397_VDRM_CON8 0x0388
  973. -#define MT6397_VDRM_CON9 0x038A
  974. -#define MT6397_VDRM_CON10 0x038C
  975. -#define MT6397_VDRM_CON11 0x038E
  976. -#define MT6397_VDRM_CON12 0x0390
  977. -#define MT6397_VDRM_CON13 0x0392
  978. -#define MT6397_VDRM_CON14 0x0394
  979. -#define MT6397_VDRM_CON15 0x0396
  980. -#define MT6397_VDRM_CON16 0x0398
  981. -#define MT6397_VDRM_CON17 0x039A
  982. -#define MT6397_VDRM_CON18 0x039C
  983. -#define MT6397_BUCK_K_CON0 0x039E
  984. -#define MT6397_BUCK_K_CON1 0x03A0
  985. -#define MT6397_ANALDO_CON0 0x0400
  986. -#define MT6397_ANALDO_CON1 0x0402
  987. -#define MT6397_ANALDO_CON2 0x0404
  988. -#define MT6397_ANALDO_CON3 0x0406
  989. -#define MT6397_ANALDO_CON4 0x0408
  990. -#define MT6397_ANALDO_CON5 0x040A
  991. -#define MT6397_ANALDO_CON6 0x040C
  992. -#define MT6397_ANALDO_CON7 0x040E
  993. -#define MT6397_DIGLDO_CON0 0x0410
  994. -#define MT6397_DIGLDO_CON1 0x0412
  995. -#define MT6397_DIGLDO_CON2 0x0414
  996. -#define MT6397_DIGLDO_CON3 0x0416
  997. -#define MT6397_DIGLDO_CON4 0x0418
  998. -#define MT6397_DIGLDO_CON5 0x041A
  999. -#define MT6397_DIGLDO_CON6 0x041C
  1000. -#define MT6397_DIGLDO_CON7 0x041E
  1001. -#define MT6397_DIGLDO_CON8 0x0420
  1002. -#define MT6397_DIGLDO_CON9 0x0422
  1003. -#define MT6397_DIGLDO_CON10 0x0424
  1004. -#define MT6397_DIGLDO_CON11 0x0426
  1005. -#define MT6397_DIGLDO_CON12 0x0428
  1006. -#define MT6397_DIGLDO_CON13 0x042A
  1007. -#define MT6397_DIGLDO_CON14 0x042C
  1008. -#define MT6397_DIGLDO_CON15 0x042E
  1009. -#define MT6397_DIGLDO_CON16 0x0430
  1010. -#define MT6397_DIGLDO_CON17 0x0432
  1011. -#define MT6397_DIGLDO_CON18 0x0434
  1012. -#define MT6397_DIGLDO_CON19 0x0436
  1013. -#define MT6397_DIGLDO_CON20 0x0438
  1014. -#define MT6397_DIGLDO_CON21 0x043A
  1015. -#define MT6397_DIGLDO_CON22 0x043C
  1016. -#define MT6397_DIGLDO_CON23 0x043E
  1017. -#define MT6397_DIGLDO_CON24 0x0440
  1018. -#define MT6397_DIGLDO_CON25 0x0442
  1019. -#define MT6397_DIGLDO_CON26 0x0444
  1020. -#define MT6397_DIGLDO_CON27 0x0446
  1021. -#define MT6397_DIGLDO_CON28 0x0448
  1022. -#define MT6397_DIGLDO_CON29 0x044A
  1023. -#define MT6397_DIGLDO_CON30 0x044C
  1024. -#define MT6397_DIGLDO_CON31 0x044E
  1025. -#define MT6397_DIGLDO_CON32 0x0450
  1026. -#define MT6397_DIGLDO_CON33 0x045A
  1027. -#define MT6397_SPK_CON0 0x0600
  1028. -#define MT6397_SPK_CON1 0x0602
  1029. -#define MT6397_SPK_CON2 0x0604
  1030. -#define MT6397_SPK_CON3 0x0606
  1031. -#define MT6397_SPK_CON4 0x0608
  1032. -#define MT6397_SPK_CON5 0x060A
  1033. -#define MT6397_SPK_CON6 0x060C
  1034. -#define MT6397_SPK_CON7 0x060E
  1035. -#define MT6397_SPK_CON8 0x0610
  1036. -#define MT6397_SPK_CON9 0x0612
  1037. -#define MT6397_SPK_CON10 0x0614
  1038. -#define MT6397_SPK_CON11 0x0616
  1039. -#define MT6397_AUDDAC_CON0 0x0700
  1040. -#define MT6397_AUDBUF_CFG0 0x0702
  1041. -#define MT6397_AUDBUF_CFG1 0x0704
  1042. -#define MT6397_AUDBUF_CFG2 0x0706
  1043. -#define MT6397_AUDBUF_CFG3 0x0708
  1044. -#define MT6397_AUDBUF_CFG4 0x070A
  1045. -#define MT6397_IBIASDIST_CFG0 0x070C
  1046. -#define MT6397_AUDACCDEPOP_CFG0 0x070E
  1047. -#define MT6397_AUD_IV_CFG0 0x0710
  1048. -#define MT6397_AUDCLKGEN_CFG0 0x0712
  1049. -#define MT6397_AUDLDO_CFG0 0x0714
  1050. -#define MT6397_AUDLDO_CFG1 0x0716
  1051. -#define MT6397_AUDNVREGGLB_CFG0 0x0718
  1052. -#define MT6397_AUD_NCP0 0x071A
  1053. -#define MT6397_AUDPREAMP_CON0 0x071C
  1054. -#define MT6397_AUDADC_CON0 0x071E
  1055. -#define MT6397_AUDADC_CON1 0x0720
  1056. -#define MT6397_AUDADC_CON2 0x0722
  1057. -#define MT6397_AUDADC_CON3 0x0724
  1058. -#define MT6397_AUDADC_CON4 0x0726
  1059. -#define MT6397_AUDADC_CON5 0x0728
  1060. -#define MT6397_AUDADC_CON6 0x072A
  1061. -#define MT6397_AUDDIGMI_CON0 0x072C
  1062. -#define MT6397_AUDLSBUF_CON0 0x072E
  1063. -#define MT6397_AUDLSBUF_CON1 0x0730
  1064. -#define MT6397_AUDENCSPARE_CON0 0x0732
  1065. -#define MT6397_AUDENCCLKSQ_CON0 0x0734
  1066. -#define MT6397_AUDPREAMPGAIN_CON0 0x0736
  1067. -#define MT6397_ZCD_CON0 0x0738
  1068. -#define MT6397_ZCD_CON1 0x073A
  1069. -#define MT6397_ZCD_CON2 0x073C
  1070. -#define MT6397_ZCD_CON3 0x073E
  1071. -#define MT6397_ZCD_CON4 0x0740
  1072. -#define MT6397_ZCD_CON5 0x0742
  1073. -#define MT6397_NCP_CLKDIV_CON0 0x0744
  1074. -#define MT6397_NCP_CLKDIV_CON1 0x0746
  1075. +#define MT6323_CHR_CON0 0x0000
  1076. +#define MT6323_CHR_CON1 0x0002
  1077. +#define MT6323_CHR_CON2 0x0004
  1078. +#define MT6323_CHR_CON3 0x0006
  1079. +#define MT6323_CHR_CON4 0x0008
  1080. +#define MT6323_CHR_CON5 0x000A
  1081. +#define MT6323_CHR_CON6 0x000C
  1082. +#define MT6323_CHR_CON7 0x000E
  1083. +#define MT6323_CHR_CON8 0x0010
  1084. +#define MT6323_CHR_CON9 0x0012
  1085. +#define MT6323_CHR_CON10 0x0014
  1086. +#define MT6323_CHR_CON11 0x0016
  1087. +#define MT6323_CHR_CON12 0x0018
  1088. +#define MT6323_CHR_CON13 0x001A
  1089. +#define MT6323_CHR_CON14 0x001C
  1090. +#define MT6323_CHR_CON15 0x001E
  1091. +#define MT6323_CHR_CON16 0x0020
  1092. +#define MT6323_CHR_CON17 0x0022
  1093. +#define MT6323_CHR_CON18 0x0024
  1094. +#define MT6323_CHR_CON19 0x0026
  1095. +#define MT6323_CHR_CON20 0x0028
  1096. +#define MT6323_CHR_CON21 0x002A
  1097. +#define MT6323_CHR_CON22 0x002C
  1098. +#define MT6323_CHR_CON23 0x002E
  1099. +#define MT6323_CHR_CON24 0x0030
  1100. +#define MT6323_CHR_CON25 0x0032
  1101. +#define MT6323_CHR_CON26 0x0034
  1102. +#define MT6323_CHR_CON27 0x0036
  1103. +#define MT6323_CHR_CON28 0x0038
  1104. +#define MT6323_CHR_CON29 0x003A
  1105. +#define MT6323_STRUP_CON0 0x003C
  1106. +#define MT6323_STRUP_CON2 0x003E
  1107. +#define MT6323_STRUP_CON3 0x0040
  1108. +#define MT6323_STRUP_CON4 0x0042
  1109. +#define MT6323_STRUP_CON5 0x0044
  1110. +#define MT6323_STRUP_CON6 0x0046
  1111. +#define MT6323_STRUP_CON7 0x0048
  1112. +#define MT6323_STRUP_CON8 0x004A
  1113. +#define MT6323_STRUP_CON9 0x004C
  1114. +#define MT6323_STRUP_CON10 0x004E
  1115. +#define MT6323_STRUP_CON11 0x0050
  1116. +#define MT6323_SPK_CON0 0x0052
  1117. +#define MT6323_SPK_CON1 0x0054
  1118. +#define MT6323_SPK_CON2 0x0056
  1119. +#define MT6323_SPK_CON6 0x005E
  1120. +#define MT6323_SPK_CON7 0x0060
  1121. +#define MT6323_SPK_CON8 0x0062
  1122. +#define MT6323_SPK_CON9 0x0064
  1123. +#define MT6323_SPK_CON10 0x0066
  1124. +#define MT6323_SPK_CON11 0x0068
  1125. +#define MT6323_SPK_CON12 0x006A
  1126. +#define MT6323_CID 0x0100
  1127. +#define MT6323_TOP_CKPDN0 0x0102
  1128. +#define MT6323_TOP_CKPDN0_SET 0x0104
  1129. +#define MT6323_TOP_CKPDN0_CLR 0x0106
  1130. +#define MT6323_TOP_CKPDN1 0x0108
  1131. +#define MT6323_TOP_CKPDN1_SET 0x010A
  1132. +#define MT6323_TOP_CKPDN1_CLR 0x010C
  1133. +#define MT6323_TOP_CKPDN2 0x010E
  1134. +#define MT6323_TOP_CKPDN2_SET 0x0110
  1135. +#define MT6323_TOP_CKPDN2_CLR 0x0112
  1136. +#define MT6323_TOP_RST_CON 0x0114
  1137. +#define MT6323_TOP_RST_CON_SET 0x0116
  1138. +#define MT6323_TOP_RST_CON_CLR 0x0118
  1139. +#define MT6323_TOP_RST_MISC 0x011A
  1140. +#define MT6323_TOP_RST_MISC_SET 0x011C
  1141. +#define MT6323_TOP_RST_MISC_CLR 0x011E
  1142. +#define MT6323_TOP_CKCON0 0x0120
  1143. +#define MT6323_TOP_CKCON0_SET 0x0122
  1144. +#define MT6323_TOP_CKCON0_CLR 0x0124
  1145. +#define MT6323_TOP_CKCON1 0x0126
  1146. +#define MT6323_TOP_CKCON1_SET 0x0128
  1147. +#define MT6323_TOP_CKCON1_CLR 0x012A
  1148. +#define MT6323_TOP_CKTST0 0x012C
  1149. +#define MT6323_TOP_CKTST1 0x012E
  1150. +#define MT6323_TOP_CKTST2 0x0130
  1151. +#define MT6323_TEST_OUT 0x0132
  1152. +#define MT6323_TEST_CON0 0x0134
  1153. +#define MT6323_TEST_CON1 0x0136
  1154. +#define MT6323_EN_STATUS0 0x0138
  1155. +#define MT6323_EN_STATUS1 0x013A
  1156. +#define MT6323_OCSTATUS0 0x013C
  1157. +#define MT6323_OCSTATUS1 0x013E
  1158. +#define MT6323_PGSTATUS 0x0140
  1159. +#define MT6323_CHRSTATUS 0x0142
  1160. +#define MT6323_TDSEL_CON 0x0144
  1161. +#define MT6323_RDSEL_CON 0x0146
  1162. +#define MT6323_SMT_CON0 0x0148
  1163. +#define MT6323_SMT_CON1 0x014A
  1164. +#define MT6323_SMT_CON2 0x014C
  1165. +#define MT6323_SMT_CON3 0x014E
  1166. +#define MT6323_SMT_CON4 0x0150
  1167. +#define MT6323_DRV_CON0 0x0152
  1168. +#define MT6323_DRV_CON1 0x0154
  1169. +#define MT6323_DRV_CON2 0x0156
  1170. +#define MT6323_DRV_CON3 0x0158
  1171. +#define MT6323_DRV_CON4 0x015A
  1172. +#define MT6323_SIMLS1_CON 0x015C
  1173. +#define MT6323_SIMLS2_CON 0x015E
  1174. +#define MT6323_INT_CON0 0x0160
  1175. +#define MT6323_INT_CON0_SET 0x0162
  1176. +#define MT6323_INT_CON0_CLR 0x0164
  1177. +#define MT6323_INT_CON1 0x0166
  1178. +#define MT6323_INT_CON1_SET 0x0168
  1179. +#define MT6323_INT_CON1_CLR 0x016A
  1180. +#define MT6323_INT_MISC_CON 0x016C
  1181. +#define MT6323_INT_MISC_CON_SET 0x016E
  1182. +#define MT6323_INT_MISC_CON_CLR 0x0170
  1183. +#define MT6323_INT_STATUS0 0x0172
  1184. +#define MT6323_INT_STATUS1 0x0174
  1185. +#define MT6323_OC_GEAR_0 0x0176
  1186. +#define MT6323_OC_GEAR_1 0x0178
  1187. +#define MT6323_OC_GEAR_2 0x017A
  1188. +#define MT6323_OC_CTL_VPROC 0x017C
  1189. +#define MT6323_OC_CTL_VSYS 0x017E
  1190. +#define MT6323_OC_CTL_VPA 0x0180
  1191. +#define MT6323_FQMTR_CON0 0x0182
  1192. +#define MT6323_FQMTR_CON1 0x0184
  1193. +#define MT6323_FQMTR_CON2 0x0186
  1194. +#define MT6323_RG_SPI_CON 0x0188
  1195. +#define MT6323_DEW_DIO_EN 0x018A
  1196. +#define MT6323_DEW_READ_TEST 0x018C
  1197. +#define MT6323_DEW_WRITE_TEST 0x018E
  1198. +#define MT6323_DEW_CRC_SWRST 0x0190
  1199. +#define MT6323_DEW_CRC_EN 0x0192
  1200. +#define MT6323_DEW_CRC_VAL 0x0194
  1201. +#define MT6323_DEW_DBG_MON_SEL 0x0196
  1202. +#define MT6323_DEW_CIPHER_KEY_SEL 0x0198
  1203. +#define MT6323_DEW_CIPHER_IV_SEL 0x019A
  1204. +#define MT6323_DEW_CIPHER_EN 0x019C
  1205. +#define MT6323_DEW_CIPHER_RDY 0x019E
  1206. +#define MT6323_DEW_CIPHER_MODE 0x01A0
  1207. +#define MT6323_DEW_CIPHER_SWRST 0x01A2
  1208. +#define MT6323_DEW_RDDMY_NO 0x01A4
  1209. +#define MT6323_DEW_RDATA_DLY_SEL 0x01A6
  1210. +#define MT6323_BUCK_CON0 0x0200
  1211. +#define MT6323_BUCK_CON1 0x0202
  1212. +#define MT6323_BUCK_CON2 0x0204
  1213. +#define MT6323_BUCK_CON3 0x0206
  1214. +#define MT6323_BUCK_CON4 0x0208
  1215. +#define MT6323_BUCK_CON5 0x020A
  1216. +#define MT6323_VPROC_CON0 0x020C
  1217. +#define MT6323_VPROC_CON1 0x020E
  1218. +#define MT6323_VPROC_CON2 0x0210
  1219. +#define MT6323_VPROC_CON3 0x0212
  1220. +#define MT6323_VPROC_CON4 0x0214
  1221. +#define MT6323_VPROC_CON5 0x0216
  1222. +#define MT6323_VPROC_CON7 0x021A
  1223. +#define MT6323_VPROC_CON8 0x021C
  1224. +#define MT6323_VPROC_CON9 0x021E
  1225. +#define MT6323_VPROC_CON10 0x0220
  1226. +#define MT6323_VPROC_CON11 0x0222
  1227. +#define MT6323_VPROC_CON12 0x0224
  1228. +#define MT6323_VPROC_CON13 0x0226
  1229. +#define MT6323_VPROC_CON14 0x0228
  1230. +#define MT6323_VPROC_CON15 0x022A
  1231. +#define MT6323_VPROC_CON18 0x0230
  1232. +#define MT6323_VSYS_CON0 0x0232
  1233. +#define MT6323_VSYS_CON1 0x0234
  1234. +#define MT6323_VSYS_CON2 0x0236
  1235. +#define MT6323_VSYS_CON3 0x0238
  1236. +#define MT6323_VSYS_CON4 0x023A
  1237. +#define MT6323_VSYS_CON5 0x023C
  1238. +#define MT6323_VSYS_CON7 0x0240
  1239. +#define MT6323_VSYS_CON8 0x0242
  1240. +#define MT6323_VSYS_CON9 0x0244
  1241. +#define MT6323_VSYS_CON10 0x0246
  1242. +#define MT6323_VSYS_CON11 0x0248
  1243. +#define MT6323_VSYS_CON12 0x024A
  1244. +#define MT6323_VSYS_CON13 0x024C
  1245. +#define MT6323_VSYS_CON14 0x024E
  1246. +#define MT6323_VSYS_CON15 0x0250
  1247. +#define MT6323_VSYS_CON18 0x0256
  1248. +#define MT6323_VPA_CON0 0x0300
  1249. +#define MT6323_VPA_CON1 0x0302
  1250. +#define MT6323_VPA_CON2 0x0304
  1251. +#define MT6323_VPA_CON3 0x0306
  1252. +#define MT6323_VPA_CON4 0x0308
  1253. +#define MT6323_VPA_CON5 0x030A
  1254. +#define MT6323_VPA_CON7 0x030E
  1255. +#define MT6323_VPA_CON8 0x0310
  1256. +#define MT6323_VPA_CON9 0x0312
  1257. +#define MT6323_VPA_CON10 0x0314
  1258. +#define MT6323_VPA_CON11 0x0316
  1259. +#define MT6323_VPA_CON12 0x0318
  1260. +#define MT6323_VPA_CON14 0x031C
  1261. +#define MT6323_VPA_CON16 0x0320
  1262. +#define MT6323_VPA_CON17 0x0322
  1263. +#define MT6323_VPA_CON18 0x0324
  1264. +#define MT6323_VPA_CON19 0x0326
  1265. +#define MT6323_VPA_CON20 0x0328
  1266. +#define MT6323_BUCK_K_CON0 0x032A
  1267. +#define MT6323_BUCK_K_CON1 0x032C
  1268. +#define MT6323_BUCK_K_CON2 0x032E
  1269. +#define MT6323_ISINK0_CON0 0x0330
  1270. +#define MT6323_ISINK0_CON1 0x0332
  1271. +#define MT6323_ISINK0_CON2 0x0334
  1272. +#define MT6323_ISINK0_CON3 0x0336
  1273. +#define MT6323_ISINK1_CON0 0x0338
  1274. +#define MT6323_ISINK1_CON1 0x033A
  1275. +#define MT6323_ISINK1_CON2 0x033C
  1276. +#define MT6323_ISINK1_CON3 0x033E
  1277. +#define MT6323_ISINK2_CON0 0x0340
  1278. +#define MT6323_ISINK2_CON1 0x0342
  1279. +#define MT6323_ISINK2_CON2 0x0344
  1280. +#define MT6323_ISINK2_CON3 0x0346
  1281. +#define MT6323_ISINK3_CON0 0x0348
  1282. +#define MT6323_ISINK3_CON1 0x034A
  1283. +#define MT6323_ISINK3_CON2 0x034C
  1284. +#define MT6323_ISINK3_CON3 0x034E
  1285. +#define MT6323_ISINK_ANA0 0x0350
  1286. +#define MT6323_ISINK_ANA1 0x0352
  1287. +#define MT6323_ISINK_PHASE_DLY 0x0354
  1288. +#define MT6323_ISINK_EN_CTRL 0x0356
  1289. +#define MT6323_ANALDO_CON0 0x0400
  1290. +#define MT6323_ANALDO_CON1 0x0402
  1291. +#define MT6323_ANALDO_CON2 0x0404
  1292. +#define MT6323_ANALDO_CON3 0x0406
  1293. +#define MT6323_ANALDO_CON4 0x0408
  1294. +#define MT6323_ANALDO_CON5 0x040A
  1295. +#define MT6323_ANALDO_CON6 0x040C
  1296. +#define MT6323_ANALDO_CON7 0x040E
  1297. +#define MT6323_ANALDO_CON8 0x0410
  1298. +#define MT6323_ANALDO_CON10 0x0412
  1299. +#define MT6323_ANALDO_CON15 0x0414
  1300. +#define MT6323_ANALDO_CON16 0x0416
  1301. +#define MT6323_ANALDO_CON17 0x0418
  1302. +#define MT6323_ANALDO_CON18 0x041A
  1303. +#define MT6323_ANALDO_CON19 0x041C
  1304. +#define MT6323_ANALDO_CON20 0x041E
  1305. +#define MT6323_ANALDO_CON21 0x0420
  1306. +#define MT6323_DIGLDO_CON0 0x0500
  1307. +#define MT6323_DIGLDO_CON2 0x0502
  1308. +#define MT6323_DIGLDO_CON3 0x0504
  1309. +#define MT6323_DIGLDO_CON5 0x0506
  1310. +#define MT6323_DIGLDO_CON6 0x0508
  1311. +#define MT6323_DIGLDO_CON7 0x050A
  1312. +#define MT6323_DIGLDO_CON8 0x050C
  1313. +#define MT6323_DIGLDO_CON9 0x050E
  1314. +#define MT6323_DIGLDO_CON10 0x0510
  1315. +#define MT6323_DIGLDO_CON11 0x0512
  1316. +#define MT6323_DIGLDO_CON12 0x0514
  1317. +#define MT6323_DIGLDO_CON13 0x0516
  1318. +#define MT6323_DIGLDO_CON14 0x0518
  1319. +#define MT6323_DIGLDO_CON15 0x051A
  1320. +#define MT6323_DIGLDO_CON16 0x051C
  1321. +#define MT6323_DIGLDO_CON17 0x051E
  1322. +#define MT6323_DIGLDO_CON18 0x0520
  1323. +#define MT6323_DIGLDO_CON19 0x0522
  1324. +#define MT6323_DIGLDO_CON20 0x0524
  1325. +#define MT6323_DIGLDO_CON21 0x0526
  1326. +#define MT6323_DIGLDO_CON23 0x0528
  1327. +#define MT6323_DIGLDO_CON24 0x052A
  1328. +#define MT6323_DIGLDO_CON26 0x052C
  1329. +#define MT6323_DIGLDO_CON27 0x052E
  1330. +#define MT6323_DIGLDO_CON28 0x0530
  1331. +#define MT6323_DIGLDO_CON29 0x0532
  1332. +#define MT6323_DIGLDO_CON30 0x0534
  1333. +#define MT6323_DIGLDO_CON31 0x0536
  1334. +#define MT6323_DIGLDO_CON32 0x0538
  1335. +#define MT6323_DIGLDO_CON33 0x053A
  1336. +#define MT6323_DIGLDO_CON34 0x053C
  1337. +#define MT6323_DIGLDO_CON35 0x053E
  1338. +#define MT6323_DIGLDO_CON36 0x0540
  1339. +#define MT6323_DIGLDO_CON39 0x0542
  1340. +#define MT6323_DIGLDO_CON40 0x0544
  1341. +#define MT6323_DIGLDO_CON41 0x0546
  1342. +#define MT6323_DIGLDO_CON42 0x0548
  1343. +#define MT6323_DIGLDO_CON43 0x054A
  1344. +#define MT6323_DIGLDO_CON44 0x054C
  1345. +#define MT6323_DIGLDO_CON45 0x054E
  1346. +#define MT6323_DIGLDO_CON46 0x0550
  1347. +#define MT6323_DIGLDO_CON47 0x0552
  1348. +#define MT6323_DIGLDO_CON48 0x0554
  1349. +#define MT6323_DIGLDO_CON49 0x0556
  1350. +#define MT6323_DIGLDO_CON50 0x0558
  1351. +#define MT6323_DIGLDO_CON51 0x055A
  1352. +#define MT6323_DIGLDO_CON52 0x055C
  1353. +#define MT6323_DIGLDO_CON53 0x055E
  1354. +#define MT6323_DIGLDO_CON54 0x0560
  1355. +#define MT6323_EFUSE_CON0 0x0600
  1356. +#define MT6323_EFUSE_CON1 0x0602
  1357. +#define MT6323_EFUSE_CON2 0x0604
  1358. +#define MT6323_EFUSE_CON3 0x0606
  1359. +#define MT6323_EFUSE_CON4 0x0608
  1360. +#define MT6323_EFUSE_CON5 0x060A
  1361. +#define MT6323_EFUSE_CON6 0x060C
  1362. +#define MT6323_EFUSE_VAL_0_15 0x060E
  1363. +#define MT6323_EFUSE_VAL_16_31 0x0610
  1364. +#define MT6323_EFUSE_VAL_32_47 0x0612
  1365. +#define MT6323_EFUSE_VAL_48_63 0x0614
  1366. +#define MT6323_EFUSE_VAL_64_79 0x0616
  1367. +#define MT6323_EFUSE_VAL_80_95 0x0618
  1368. +#define MT6323_EFUSE_VAL_96_111 0x061A
  1369. +#define MT6323_EFUSE_VAL_112_127 0x061C
  1370. +#define MT6323_EFUSE_VAL_128_143 0x061E
  1371. +#define MT6323_EFUSE_VAL_144_159 0x0620
  1372. +#define MT6323_EFUSE_VAL_160_175 0x0622
  1373. +#define MT6323_EFUSE_VAL_176_191 0x0624
  1374. +#define MT6323_EFUSE_DOUT_0_15 0x0626
  1375. +#define MT6323_EFUSE_DOUT_16_31 0x0628
  1376. +#define MT6323_EFUSE_DOUT_32_47 0x062A
  1377. +#define MT6323_EFUSE_DOUT_48_63 0x062C
  1378. +#define MT6323_EFUSE_DOUT_64_79 0x062E
  1379. +#define MT6323_EFUSE_DOUT_80_95 0x0630
  1380. +#define MT6323_EFUSE_DOUT_96_111 0x0632
  1381. +#define MT6323_EFUSE_DOUT_112_127 0x0634
  1382. +#define MT6323_EFUSE_DOUT_128_143 0x0636
  1383. +#define MT6323_EFUSE_DOUT_144_159 0x0638
  1384. +#define MT6323_EFUSE_DOUT_160_175 0x063A
  1385. +#define MT6323_EFUSE_DOUT_176_191 0x063C
  1386. +#define MT6323_EFUSE_CON7 0x063E
  1387. +#define MT6323_EFUSE_CON8 0x0640
  1388. +#define MT6323_EFUSE_CON9 0x0642
  1389. +#define MT6323_RTC_MIX_CON0 0x0644
  1390. +#define MT6323_RTC_MIX_CON1 0x0646
  1391. +#define MT6323_AUDTOP_CON0 0x0700
  1392. +#define MT6323_AUDTOP_CON1 0x0702
  1393. +#define MT6323_AUDTOP_CON2 0x0704
  1394. +#define MT6323_AUDTOP_CON3 0x0706
  1395. +#define MT6323_AUDTOP_CON4 0x0708
  1396. +#define MT6323_AUDTOP_CON5 0x070A
  1397. +#define MT6323_AUDTOP_CON6 0x070C
  1398. +#define MT6323_AUDTOP_CON7 0x070E
  1399. +#define MT6323_AUDTOP_CON8 0x0710
  1400. +#define MT6323_AUDTOP_CON9 0x0712
  1401. +#define MT6323_AUXADC_ADC0 0x0714
  1402. +#define MT6323_AUXADC_ADC1 0x0716
  1403. +#define MT6323_AUXADC_ADC2 0x0718
  1404. +#define MT6323_AUXADC_ADC3 0x071A
  1405. +#define MT6323_AUXADC_ADC4 0x071C
  1406. +#define MT6323_AUXADC_ADC5 0x071E
  1407. +#define MT6323_AUXADC_ADC6 0x0720
  1408. +#define MT6323_AUXADC_ADC7 0x0722
  1409. +#define MT6323_AUXADC_ADC8 0x0724
  1410. +#define MT6323_AUXADC_ADC9 0x0726
  1411. +#define MT6323_AUXADC_ADC10 0x0728
  1412. +#define MT6323_AUXADC_ADC11 0x072A
  1413. +#define MT6323_AUXADC_ADC12 0x072C
  1414. +#define MT6323_AUXADC_ADC13 0x072E
  1415. +#define MT6323_AUXADC_ADC14 0x0730
  1416. +#define MT6323_AUXADC_ADC15 0x0732
  1417. +#define MT6323_AUXADC_ADC16 0x0734
  1418. +#define MT6323_AUXADC_ADC17 0x0736
  1419. +#define MT6323_AUXADC_ADC18 0x0738
  1420. +#define MT6323_AUXADC_ADC19 0x073A
  1421. +#define MT6323_AUXADC_ADC20 0x073C
  1422. +#define MT6323_AUXADC_RSV1 0x073E
  1423. +#define MT6323_AUXADC_RSV2 0x0740
  1424. +#define MT6323_AUXADC_CON0 0x0742
  1425. +#define MT6323_AUXADC_CON1 0x0744
  1426. +#define MT6323_AUXADC_CON2 0x0746
  1427. +#define MT6323_AUXADC_CON3 0x0748
  1428. +#define MT6323_AUXADC_CON4 0x074A
  1429. +#define MT6323_AUXADC_CON5 0x074C
  1430. +#define MT6323_AUXADC_CON6 0x074E
  1431. +#define MT6323_AUXADC_CON7 0x0750
  1432. +#define MT6323_AUXADC_CON8 0x0752
  1433. +#define MT6323_AUXADC_CON9 0x0754
  1434. +#define MT6323_AUXADC_CON10 0x0756
  1435. +#define MT6323_AUXADC_CON11 0x0758
  1436. +#define MT6323_AUXADC_CON12 0x075A
  1437. +#define MT6323_AUXADC_CON13 0x075C
  1438. +#define MT6323_AUXADC_CON14 0x075E
  1439. +#define MT6323_AUXADC_CON15 0x0760
  1440. +#define MT6323_AUXADC_CON16 0x0762
  1441. +#define MT6323_AUXADC_CON17 0x0764
  1442. +#define MT6323_AUXADC_CON18 0x0766
  1443. +#define MT6323_AUXADC_CON19 0x0768
  1444. +#define MT6323_AUXADC_CON20 0x076A
  1445. +#define MT6323_AUXADC_CON21 0x076C
  1446. +#define MT6323_AUXADC_CON22 0x076E
  1447. +#define MT6323_AUXADC_CON23 0x0770
  1448. +#define MT6323_AUXADC_CON24 0x0772
  1449. +#define MT6323_AUXADC_CON25 0x0774
  1450. +#define MT6323_AUXADC_CON26 0x0776
  1451. +#define MT6323_AUXADC_CON27 0x0778
  1452. +#define MT6323_ACCDET_CON0 0x077A
  1453. +#define MT6323_ACCDET_CON1 0x077C
  1454. +#define MT6323_ACCDET_CON2 0x077E
  1455. +#define MT6323_ACCDET_CON3 0x0780
  1456. +#define MT6323_ACCDET_CON4 0x0782
  1457. +#define MT6323_ACCDET_CON5 0x0784
  1458. +#define MT6323_ACCDET_CON6 0x0786
  1459. +#define MT6323_ACCDET_CON7 0x0788
  1460. +#define MT6323_ACCDET_CON8 0x078A
  1461. +#define MT6323_ACCDET_CON9 0x078C
  1462. +#define MT6323_ACCDET_CON10 0x078E
  1463. +#define MT6323_ACCDET_CON11 0x0790
  1464. +#define MT6323_ACCDET_CON12 0x0792
  1465. +#define MT6323_ACCDET_CON13 0x0794
  1466. +#define MT6323_ACCDET_CON14 0x0796
  1467. +#define MT6323_ACCDET_CON15 0x0798
  1468. +#define MT6323_ACCDET_CON16 0x079A
  1469. -#endif /* __MFD_MT6397_REGISTERS_H__ */
  1470. +#endif
  1471. diff --git a/include/linux/regulator/mt6323-regulator.h b/include/linux/regulator/mt6323-regulator.h
  1472. new file mode 100644
  1473. index 0000000..620b0e3
  1474. --- /dev/null
  1475. +++ b/include/linux/regulator/mt6323-regulator.h
  1476. @@ -0,0 +1,37 @@
  1477. +/*
  1478. + * Copyright (c) 2015 MediaTek Inc.
  1479. + * Author: John Crispin <[email protected]>
  1480. + *
  1481. + * This program is free software; you can redistribute it and/or modify
  1482. + * it under the terms of the GNU General Public License version 2 as
  1483. + * published by the Free Software Foundation.
  1484. + *
  1485. + * This program is distributed in the hope that it will be useful,
  1486. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1487. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1488. + * GNU General Public License for more details.
  1489. + */
  1490. +
  1491. +#ifndef __LINUX_REGULATOR_MT6323_H
  1492. +#define __LINUX_REGULATOR_MT6323_H
  1493. +
  1494. +enum {
  1495. + MT6323_ID_VPROC = 0,
  1496. + MT6323_ID_VSYS,
  1497. + MT6323_ID_VPA,
  1498. + MT6323_ID_VTCXO,
  1499. + MT6323_ID_VA,
  1500. + MT6323_ID_VCN28,
  1501. + MT6323_ID_VCN33,
  1502. + MT6323_ID_VIO28,
  1503. + MT6323_ID_VUSB,
  1504. + MT6323_ID_VMC,
  1505. + MT6323_ID_VMCH,
  1506. + MT6323_ID_VGP1,
  1507. + MT6323_ID_VGP2,
  1508. + MT6323_ID_RG_MAX,
  1509. +};
  1510. +
  1511. +#define MT6323_MAX_REGULATOR MT6323_ID_RG_MAX
  1512. +
  1513. +#endif /* __LINUX_REGULATOR_MT6323_H */
  1514. --
  1515. 1.7.10.4