dispcc-volcano.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/clk.h>
  6. #include <linux/clk-provider.h>
  7. #include <linux/err.h>
  8. #include <linux/kernel.h>
  9. #include <linux/module.h>
  10. #include <linux/of_device.h>
  11. #include <linux/of.h>
  12. #include <linux/regmap.h>
  13. #include <dt-bindings/clock/qcom,dispcc-volcano.h>
  14. #include "clk-alpha-pll.h"
  15. #include "clk-branch.h"
  16. #include "clk-pll.h"
  17. #include "clk-rcg.h"
  18. #include "clk-regmap.h"
  19. #include "clk-regmap-divider.h"
  20. #include "clk-regmap-mux.h"
  21. #include "common.h"
  22. #include "reset.h"
  23. #include "vdd-level.h"
  24. #define DISP_CC_MISC_CMD 0xF000
  25. static DEFINE_VDD_REGULATORS(vdd_cx, VDD_HIGH + 1, 1, vdd_corner);
  26. static DEFINE_VDD_REGULATORS(vdd_mx, VDD_HIGH + 1, 1, vdd_corner);
  27. static struct clk_vdd_class *disp_cc_volcano_regulators[] = {
  28. &vdd_cx,
  29. &vdd_mx,
  30. };
  31. enum {
  32. P_BI_TCXO,
  33. P_DISP_CC_PLL0_OUT_EVEN,
  34. P_DISP_CC_PLL0_OUT_MAIN,
  35. P_DP0_PHY_PLL_LINK_CLK,
  36. P_DP0_PHY_PLL_VCO_DIV_CLK,
  37. P_DSI0_PHY_PLL_OUT_BYTECLK,
  38. P_DSI0_PHY_PLL_OUT_DSICLK,
  39. P_GCC_DISP_GPLL0_CLK,
  40. P_SLEEP_CLK,
  41. };
  42. static const struct pll_vco lucid_ole_vco[] = {
  43. { 249600000, 2300000000, 0 },
  44. };
  45. /* 257.142858 MHz Configuration */
  46. static const struct alpha_pll_config disp_cc_pll0_config = {
  47. .l = 0xd,
  48. .cal_l = 0x44,
  49. .cal_l_ringosc = 0x44,
  50. .alpha = 0x6492,
  51. .config_ctl_val = 0x20485699,
  52. .config_ctl_hi_val = 0x00182261,
  53. .config_ctl_hi1_val = 0x82aa299c,
  54. .test_ctl_val = 0x00000000,
  55. .test_ctl_hi_val = 0x00000003,
  56. .test_ctl_hi1_val = 0x00009000,
  57. .test_ctl_hi2_val = 0x00000034,
  58. .user_ctl_val = 0x00000000,
  59. .user_ctl_hi_val = 0x00000005,
  60. };
  61. static struct clk_alpha_pll disp_cc_pll0 = {
  62. .offset = 0x0,
  63. .vco_table = lucid_ole_vco,
  64. .num_vco = ARRAY_SIZE(lucid_ole_vco),
  65. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  66. .clkr = {
  67. .hw.init = &(const struct clk_init_data) {
  68. .name = "disp_cc_pll0",
  69. .parent_data = &(const struct clk_parent_data) {
  70. .fw_name = "bi_tcxo",
  71. .name = "bi_tcxo",
  72. },
  73. .num_parents = 1,
  74. .ops = &clk_alpha_pll_lucid_ole_ops,
  75. },
  76. .vdd_data = {
  77. .vdd_class = &vdd_cx,
  78. .num_rate_max = VDD_NUM,
  79. .rate_max = (unsigned long[VDD_NUM]) {
  80. [VDD_LOWER_D1] = 615000000,
  81. [VDD_LOW] = 1100000000,
  82. [VDD_LOW_L1] = 1600000000,
  83. [VDD_NOMINAL] = 2000000000,
  84. [VDD_HIGH_L1] = 2300000000},
  85. },
  86. },
  87. };
  88. static const struct parent_map disp_cc_parent_map_0[] = {
  89. { P_BI_TCXO, 0 },
  90. };
  91. static const struct clk_parent_data disp_cc_parent_data_0[] = {
  92. { .fw_name = "bi_tcxo" },
  93. };
  94. static const struct parent_map disp_cc_parent_map_1[] = {
  95. { P_BI_TCXO, 0 },
  96. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  97. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  98. };
  99. static const struct clk_parent_data disp_cc_parent_data_1[] = {
  100. { .fw_name = "bi_tcxo" },
  101. { .fw_name = "dsi0_phy_pll_out_dsiclk", .name = "dsi0_phy_pll_out_dsiclk" },
  102. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  103. };
  104. static const struct parent_map disp_cc_parent_map_2[] = {
  105. { P_BI_TCXO, 0 },
  106. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  107. { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
  108. };
  109. static const struct clk_parent_data disp_cc_parent_data_2[] = {
  110. { .fw_name = "bi_tcxo" },
  111. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  112. { .fw_name = "dp0_phy_pll_vco_div_clk", .name = "dp0_phy_pll_vco_div_clk" },
  113. };
  114. static const struct parent_map disp_cc_parent_map_3[] = {
  115. { P_BI_TCXO, 0 },
  116. { P_GCC_DISP_GPLL0_CLK, 4 },
  117. };
  118. static const struct clk_parent_data disp_cc_parent_data_3[] = {
  119. { .fw_name = "bi_tcxo" },
  120. { .fw_name = "gcc_disp_gpll0_clk", .name = "gcc_disp_gpll0_clk" },
  121. };
  122. static const struct parent_map disp_cc_parent_map_4[] = {
  123. { P_BI_TCXO, 0 },
  124. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  125. };
  126. static const struct clk_parent_data disp_cc_parent_data_4[] = {
  127. { .fw_name = "bi_tcxo" },
  128. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  129. };
  130. static const struct parent_map disp_cc_parent_map_5[] = {
  131. { P_BI_TCXO, 0 },
  132. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  133. };
  134. static const struct clk_parent_data disp_cc_parent_data_5[] = {
  135. { .fw_name = "bi_tcxo" },
  136. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  137. };
  138. static const struct parent_map disp_cc_parent_map_6[] = {
  139. { P_BI_TCXO, 0 },
  140. { P_DISP_CC_PLL0_OUT_MAIN, 1 },
  141. { P_GCC_DISP_GPLL0_CLK, 4 },
  142. { P_DISP_CC_PLL0_OUT_EVEN, 6 },
  143. };
  144. static const struct clk_parent_data disp_cc_parent_data_6[] = {
  145. { .fw_name = "bi_tcxo" },
  146. { .hw = &disp_cc_pll0.clkr.hw },
  147. { .fw_name = "gcc_disp_gpll0_clk", .name = "gcc_disp_gpll0_clk" },
  148. { .hw = &disp_cc_pll0.clkr.hw },
  149. };
  150. static const struct parent_map disp_cc_parent_map_7[] = {
  151. { P_SLEEP_CLK, 0 },
  152. };
  153. static const struct clk_parent_data disp_cc_parent_data_7_ao[] = {
  154. { .fw_name = "sleep_clk" },
  155. };
  156. static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
  157. F(19200000, P_BI_TCXO, 1, 0, 0),
  158. F(37500000, P_GCC_DISP_GPLL0_CLK, 8, 0, 0),
  159. F(75000000, P_GCC_DISP_GPLL0_CLK, 4, 0, 0),
  160. { }
  161. };
  162. static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
  163. .cmd_rcgr = 0x8130,
  164. .mnd_width = 0,
  165. .hid_width = 5,
  166. .parent_map = disp_cc_parent_map_3,
  167. .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
  168. .enable_safe_config = true,
  169. .flags = HW_CLK_CTRL_MODE,
  170. .clkr.hw.init = &(const struct clk_init_data) {
  171. .name = "disp_cc_mdss_ahb_clk_src",
  172. .parent_data = disp_cc_parent_data_3,
  173. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  174. .flags = CLK_SET_RATE_PARENT,
  175. .ops = &clk_rcg2_ops,
  176. },
  177. .clkr.vdd_data = {
  178. .vdd_class = &vdd_cx,
  179. .num_rate_max = VDD_NUM,
  180. .rate_max = (unsigned long[VDD_NUM]) {
  181. [VDD_LOWER] = 19200000,
  182. [VDD_LOW] = 37500000,
  183. [VDD_NOMINAL] = 75000000},
  184. },
  185. };
  186. static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
  187. .cmd_rcgr = 0x8098,
  188. .mnd_width = 0,
  189. .hid_width = 5,
  190. .parent_map = disp_cc_parent_map_1,
  191. .clkr.hw.init = &(const struct clk_init_data) {
  192. .name = "disp_cc_mdss_byte0_clk_src",
  193. .parent_data = disp_cc_parent_data_1,
  194. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  195. .flags = CLK_SET_RATE_PARENT,
  196. .ops = &clk_byte2_ops,
  197. },
  198. .clkr.vdd_data = {
  199. .vdd_classes = disp_cc_volcano_regulators,
  200. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  201. .num_rate_max = VDD_NUM,
  202. .rate_max = (unsigned long[VDD_NUM]) {
  203. [VDD_LOWER] = 187500000,
  204. [VDD_LOW] = 300000000,
  205. [VDD_LOW_L1] = 358000000},
  206. },
  207. };
  208. static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_aux_clk_src[] = {
  209. F(19200000, P_BI_TCXO, 1, 0, 0),
  210. { }
  211. };
  212. static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
  213. .cmd_rcgr = 0x8118,
  214. .mnd_width = 0,
  215. .hid_width = 5,
  216. .parent_map = disp_cc_parent_map_0,
  217. .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src,
  218. .clkr.hw.init = &(const struct clk_init_data) {
  219. .name = "disp_cc_mdss_dptx0_aux_clk_src",
  220. .parent_data = disp_cc_parent_data_0,
  221. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  222. .flags = CLK_SET_RATE_PARENT,
  223. .ops = &clk_rcg2_ops,
  224. },
  225. .clkr.vdd_data = {
  226. .vdd_class = &vdd_cx,
  227. .num_rate_max = VDD_NUM,
  228. .rate_max = (unsigned long[VDD_NUM]) {
  229. [VDD_LOWER] = 19200000},
  230. },
  231. };
  232. static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
  233. .cmd_rcgr = 0x80cc,
  234. .mnd_width = 0,
  235. .hid_width = 5,
  236. .parent_map = disp_cc_parent_map_4,
  237. .clkr.hw.init = &(const struct clk_init_data) {
  238. .name = "disp_cc_mdss_dptx0_link_clk_src",
  239. .parent_data = disp_cc_parent_data_4,
  240. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  241. .flags = CLK_SET_RATE_PARENT,
  242. .ops = &clk_byte2_ops,
  243. },
  244. .clkr.vdd_data = {
  245. .vdd_classes = disp_cc_volcano_regulators,
  246. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  247. .num_rate_max = VDD_NUM,
  248. .rate_max = (unsigned long[VDD_NUM]) {
  249. [VDD_LOWER] = 270000000,
  250. [VDD_LOW_L1] = 540000000,
  251. [VDD_NOMINAL] = 810000000},
  252. },
  253. };
  254. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
  255. .cmd_rcgr = 0x80e8,
  256. .mnd_width = 16,
  257. .hid_width = 5,
  258. .parent_map = disp_cc_parent_map_2,
  259. .clkr.hw.init = &(const struct clk_init_data) {
  260. .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
  261. .parent_data = disp_cc_parent_data_2,
  262. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  263. .flags = CLK_SET_RATE_PARENT,
  264. .ops = &clk_dp_ops,
  265. },
  266. .clkr.vdd_data = {
  267. .vdd_classes = disp_cc_volcano_regulators,
  268. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  269. .num_rate_max = VDD_NUM,
  270. .rate_max = (unsigned long[VDD_NUM]) {
  271. [VDD_LOWER] = 337500000,
  272. [VDD_LOW_L1] = 405000000,
  273. [VDD_NOMINAL] = 675000000},
  274. },
  275. };
  276. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
  277. .cmd_rcgr = 0x8100,
  278. .mnd_width = 16,
  279. .hid_width = 5,
  280. .parent_map = disp_cc_parent_map_2,
  281. .clkr.hw.init = &(const struct clk_init_data) {
  282. .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
  283. .parent_data = disp_cc_parent_data_2,
  284. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  285. .flags = CLK_SET_RATE_PARENT,
  286. .ops = &clk_dp_ops,
  287. },
  288. .clkr.vdd_data = {
  289. .vdd_classes = disp_cc_volcano_regulators,
  290. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  291. .num_rate_max = VDD_NUM,
  292. .rate_max = (unsigned long[VDD_NUM]) {
  293. [VDD_LOWER] = 337500000,
  294. [VDD_LOW_L1] = 405000000,
  295. [VDD_NOMINAL] = 675000000},
  296. },
  297. };
  298. static const struct freq_tbl ftbl_disp_cc_mdss_esc0_clk_src[] = {
  299. F(9600000, P_BI_TCXO, 2, 0, 0),
  300. F(12800000, P_BI_TCXO, 1.5, 0, 0),
  301. F(19200000, P_BI_TCXO, 1, 0, 0),
  302. { }
  303. };
  304. static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
  305. .cmd_rcgr = 0x80b4,
  306. .mnd_width = 0,
  307. .hid_width = 5,
  308. .parent_map = disp_cc_parent_map_5,
  309. .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
  310. .clkr.hw.init = &(const struct clk_init_data) {
  311. .name = "disp_cc_mdss_esc0_clk_src",
  312. .parent_data = disp_cc_parent_data_5,
  313. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  314. .flags = CLK_SET_RATE_PARENT,
  315. .ops = &clk_rcg2_ops,
  316. },
  317. .clkr.vdd_data = {
  318. .vdd_classes = disp_cc_volcano_regulators,
  319. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  320. .num_rate_max = VDD_NUM,
  321. .rate_max = (unsigned long[VDD_NUM]) {
  322. [VDD_LOWER] = 19200000},
  323. },
  324. };
  325. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
  326. F(19200000, P_BI_TCXO, 1, 0, 0),
  327. F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  328. F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  329. F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  330. F(342000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  331. F(402000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  332. F(535000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  333. F(600000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  334. F(630000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  335. { }
  336. };
  337. static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
  338. .cmd_rcgr = 0x8068,
  339. .mnd_width = 0,
  340. .hid_width = 5,
  341. .parent_map = disp_cc_parent_map_6,
  342. .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
  343. .enable_safe_config = true,
  344. .flags = HW_CLK_CTRL_MODE,
  345. .clkr.hw.init = &(const struct clk_init_data) {
  346. .name = "disp_cc_mdss_mdp_clk_src",
  347. .parent_data = disp_cc_parent_data_6,
  348. .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
  349. .flags = CLK_SET_RATE_PARENT,
  350. .ops = &clk_rcg2_ops,
  351. },
  352. .clkr.vdd_data = {
  353. .vdd_classes = disp_cc_volcano_regulators,
  354. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  355. .num_rate_max = VDD_NUM,
  356. .rate_max = (unsigned long[VDD_NUM]) {
  357. [VDD_LOWER] = 200000000,
  358. [VDD_LOW] = 342000000,
  359. [VDD_LOW_L1] = 402000000,
  360. [VDD_NOMINAL] = 535000000,
  361. [VDD_NOMINAL_L1] = 600000000,
  362. [VDD_HIGH] = 630000000},
  363. },
  364. };
  365. static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
  366. .cmd_rcgr = 0x8050,
  367. .mnd_width = 8,
  368. .hid_width = 5,
  369. .parent_map = disp_cc_parent_map_1,
  370. .clkr.hw.init = &(const struct clk_init_data) {
  371. .name = "disp_cc_mdss_pclk0_clk_src",
  372. .parent_data = disp_cc_parent_data_1,
  373. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  374. .flags = CLK_SET_RATE_PARENT,
  375. .ops = &clk_pixel_ops,
  376. },
  377. .clkr.vdd_data = {
  378. .vdd_classes = disp_cc_volcano_regulators,
  379. .num_vdd_classes = ARRAY_SIZE(disp_cc_volcano_regulators),
  380. .num_rate_max = VDD_NUM,
  381. .rate_max = (unsigned long[VDD_NUM]) {
  382. [VDD_LOWER] = 300000000,
  383. [VDD_LOW] = 480000000,
  384. [VDD_LOW_L1] = 625000000},
  385. },
  386. };
  387. static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
  388. .cmd_rcgr = 0x8080,
  389. .mnd_width = 0,
  390. .hid_width = 5,
  391. .parent_map = disp_cc_parent_map_0,
  392. .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src,
  393. .clkr.hw.init = &(const struct clk_init_data) {
  394. .name = "disp_cc_mdss_vsync_clk_src",
  395. .parent_data = disp_cc_parent_data_0,
  396. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  397. .flags = CLK_SET_RATE_PARENT,
  398. .ops = &clk_rcg2_ops,
  399. },
  400. .clkr.vdd_data = {
  401. .vdd_class = &vdd_cx,
  402. .num_rate_max = VDD_NUM,
  403. .rate_max = (unsigned long[VDD_NUM]) {
  404. [VDD_LOWER] = 19200000},
  405. },
  406. };
  407. static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = {
  408. F(32000, P_SLEEP_CLK, 1, 0, 0),
  409. { }
  410. };
  411. static struct clk_rcg2 disp_cc_sleep_clk_src = {
  412. .cmd_rcgr = 0xe054,
  413. .mnd_width = 0,
  414. .hid_width = 5,
  415. .parent_map = disp_cc_parent_map_7,
  416. .freq_tbl = ftbl_disp_cc_sleep_clk_src,
  417. .clkr.hw.init = &(const struct clk_init_data) {
  418. .name = "disp_cc_sleep_clk_src",
  419. .parent_data = disp_cc_parent_data_7_ao,
  420. .num_parents = ARRAY_SIZE(disp_cc_parent_data_7_ao),
  421. .flags = CLK_SET_RATE_PARENT,
  422. .ops = &clk_rcg2_ops,
  423. },
  424. };
  425. static struct clk_rcg2 disp_cc_xo_clk_src = {
  426. .cmd_rcgr = 0xe034,
  427. .mnd_width = 0,
  428. .hid_width = 5,
  429. .parent_map = disp_cc_parent_map_0,
  430. .freq_tbl = ftbl_disp_cc_mdss_dptx0_aux_clk_src,
  431. .clkr.hw.init = &(const struct clk_init_data) {
  432. .name = "disp_cc_xo_clk_src",
  433. .parent_data = disp_cc_parent_data_0,
  434. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  435. .flags = CLK_SET_RATE_PARENT,
  436. .ops = &clk_rcg2_ops,
  437. },
  438. .clkr.vdd_data = {
  439. .vdd_class = &vdd_cx,
  440. .num_rate_max = VDD_NUM,
  441. .rate_max = (unsigned long[VDD_NUM]) {
  442. [VDD_LOWER] = 19200000},
  443. },
  444. };
  445. static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
  446. .reg = 0x80b0,
  447. .shift = 0,
  448. .width = 4,
  449. .clkr.hw.init = &(const struct clk_init_data) {
  450. .name = "disp_cc_mdss_byte0_div_clk_src",
  451. .parent_hws = (const struct clk_hw*[]) {
  452. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  453. },
  454. .num_parents = 1,
  455. .flags = CLK_SET_RATE_PARENT,
  456. .ops = &clk_regmap_div_ops,
  457. },
  458. };
  459. static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
  460. .reg = 0x80e4,
  461. .shift = 0,
  462. .width = 4,
  463. .clkr.hw.init = &(const struct clk_init_data) {
  464. .name = "disp_cc_mdss_dptx0_link_div_clk_src",
  465. .parent_hws = (const struct clk_hw*[]) {
  466. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  467. },
  468. .num_parents = 1,
  469. .flags = CLK_SET_RATE_PARENT,
  470. .ops = &clk_regmap_div_ro_ops,
  471. },
  472. };
  473. static struct clk_branch disp_cc_mdss_accu_clk = {
  474. .halt_reg = 0xe050,
  475. .halt_check = BRANCH_HALT_VOTED,
  476. .clkr = {
  477. .enable_reg = 0xe050,
  478. .enable_mask = BIT(0),
  479. .hw.init = &(const struct clk_init_data) {
  480. .name = "disp_cc_mdss_accu_clk",
  481. .parent_hws = (const struct clk_hw*[]) {
  482. &disp_cc_xo_clk_src.clkr.hw,
  483. },
  484. .num_parents = 1,
  485. .flags = CLK_SET_RATE_PARENT,
  486. .ops = &clk_branch2_ops,
  487. },
  488. },
  489. };
  490. static struct clk_branch disp_cc_mdss_ahb1_clk = {
  491. .halt_reg = 0xa020,
  492. .halt_check = BRANCH_HALT,
  493. .clkr = {
  494. .enable_reg = 0xa020,
  495. .enable_mask = BIT(0),
  496. .hw.init = &(const struct clk_init_data) {
  497. .name = "disp_cc_mdss_ahb1_clk",
  498. .parent_hws = (const struct clk_hw*[]) {
  499. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  500. },
  501. .num_parents = 1,
  502. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  503. .ops = &clk_branch2_ops,
  504. },
  505. },
  506. };
  507. static struct clk_branch disp_cc_mdss_ahb_clk = {
  508. .halt_reg = 0x804c,
  509. .halt_check = BRANCH_HALT,
  510. .clkr = {
  511. .enable_reg = 0x804c,
  512. .enable_mask = BIT(0),
  513. .hw.init = &(const struct clk_init_data) {
  514. .name = "disp_cc_mdss_ahb_clk",
  515. .parent_hws = (const struct clk_hw*[]) {
  516. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  517. },
  518. .num_parents = 1,
  519. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  520. .ops = &clk_branch2_ops,
  521. },
  522. },
  523. };
  524. static struct clk_branch disp_cc_mdss_byte0_clk = {
  525. .halt_reg = 0x8024,
  526. .halt_check = BRANCH_HALT,
  527. .clkr = {
  528. .enable_reg = 0x8024,
  529. .enable_mask = BIT(0),
  530. .hw.init = &(const struct clk_init_data) {
  531. .name = "disp_cc_mdss_byte0_clk",
  532. .parent_hws = (const struct clk_hw*[]) {
  533. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  534. },
  535. .num_parents = 1,
  536. .flags = CLK_SET_RATE_PARENT,
  537. .ops = &clk_branch2_ops,
  538. },
  539. },
  540. };
  541. static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
  542. .halt_reg = 0x8028,
  543. .halt_check = BRANCH_HALT,
  544. .clkr = {
  545. .enable_reg = 0x8028,
  546. .enable_mask = BIT(0),
  547. .hw.init = &(const struct clk_init_data) {
  548. .name = "disp_cc_mdss_byte0_intf_clk",
  549. .parent_hws = (const struct clk_hw*[]) {
  550. &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
  551. },
  552. .num_parents = 1,
  553. .flags = CLK_SET_RATE_PARENT,
  554. .ops = &clk_branch2_ops,
  555. },
  556. },
  557. };
  558. static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
  559. .halt_reg = 0x8048,
  560. .halt_check = BRANCH_HALT,
  561. .clkr = {
  562. .enable_reg = 0x8048,
  563. .enable_mask = BIT(0),
  564. .hw.init = &(const struct clk_init_data) {
  565. .name = "disp_cc_mdss_dptx0_aux_clk",
  566. .parent_hws = (const struct clk_hw*[]) {
  567. &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
  568. },
  569. .num_parents = 1,
  570. .flags = CLK_SET_RATE_PARENT,
  571. .ops = &clk_branch2_ops,
  572. },
  573. },
  574. };
  575. static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = {
  576. .halt_reg = 0x803c,
  577. .halt_check = BRANCH_HALT,
  578. .clkr = {
  579. .enable_reg = 0x803c,
  580. .enable_mask = BIT(0),
  581. .hw.init = &(const struct clk_init_data) {
  582. .name = "disp_cc_mdss_dptx0_crypto_clk",
  583. .parent_hws = (const struct clk_hw*[]) {
  584. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  585. },
  586. .num_parents = 1,
  587. .flags = CLK_SET_RATE_PARENT,
  588. .ops = &clk_branch2_ops,
  589. },
  590. },
  591. };
  592. static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
  593. .halt_reg = 0x8030,
  594. .halt_check = BRANCH_HALT,
  595. .clkr = {
  596. .enable_reg = 0x8030,
  597. .enable_mask = BIT(0),
  598. .hw.init = &(const struct clk_init_data) {
  599. .name = "disp_cc_mdss_dptx0_link_clk",
  600. .parent_hws = (const struct clk_hw*[]) {
  601. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  602. },
  603. .num_parents = 1,
  604. .flags = CLK_SET_RATE_PARENT,
  605. .ops = &clk_branch2_ops,
  606. },
  607. },
  608. };
  609. static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
  610. .halt_reg = 0x8038,
  611. .halt_check = BRANCH_HALT,
  612. .clkr = {
  613. .enable_reg = 0x8038,
  614. .enable_mask = BIT(0),
  615. .hw.init = &(const struct clk_init_data) {
  616. .name = "disp_cc_mdss_dptx0_link_intf_clk",
  617. .parent_hws = (const struct clk_hw*[]) {
  618. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  619. },
  620. .num_parents = 1,
  621. .flags = CLK_SET_RATE_PARENT,
  622. .ops = &clk_branch2_ops,
  623. },
  624. },
  625. };
  626. static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
  627. .halt_reg = 0x8040,
  628. .halt_check = BRANCH_HALT,
  629. .clkr = {
  630. .enable_reg = 0x8040,
  631. .enable_mask = BIT(0),
  632. .hw.init = &(const struct clk_init_data) {
  633. .name = "disp_cc_mdss_dptx0_pixel0_clk",
  634. .parent_hws = (const struct clk_hw*[]) {
  635. &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
  636. },
  637. .num_parents = 1,
  638. .flags = CLK_SET_RATE_PARENT,
  639. .ops = &clk_branch2_ops,
  640. },
  641. },
  642. };
  643. static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
  644. .halt_reg = 0x8044,
  645. .halt_check = BRANCH_HALT,
  646. .clkr = {
  647. .enable_reg = 0x8044,
  648. .enable_mask = BIT(0),
  649. .hw.init = &(const struct clk_init_data) {
  650. .name = "disp_cc_mdss_dptx0_pixel1_clk",
  651. .parent_hws = (const struct clk_hw*[]) {
  652. &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
  653. },
  654. .num_parents = 1,
  655. .flags = CLK_SET_RATE_PARENT,
  656. .ops = &clk_branch2_ops,
  657. },
  658. },
  659. };
  660. static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
  661. .halt_reg = 0x8034,
  662. .halt_check = BRANCH_HALT,
  663. .clkr = {
  664. .enable_reg = 0x8034,
  665. .enable_mask = BIT(0),
  666. .hw.init = &(const struct clk_init_data) {
  667. .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  668. .parent_hws = (const struct clk_hw*[]) {
  669. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  670. },
  671. .num_parents = 1,
  672. .flags = CLK_SET_RATE_PARENT,
  673. .ops = &clk_branch2_ops,
  674. },
  675. },
  676. };
  677. static struct clk_branch disp_cc_mdss_esc0_clk = {
  678. .halt_reg = 0x802c,
  679. .halt_check = BRANCH_HALT,
  680. .clkr = {
  681. .enable_reg = 0x802c,
  682. .enable_mask = BIT(0),
  683. .hw.init = &(const struct clk_init_data) {
  684. .name = "disp_cc_mdss_esc0_clk",
  685. .parent_hws = (const struct clk_hw*[]) {
  686. &disp_cc_mdss_esc0_clk_src.clkr.hw,
  687. },
  688. .num_parents = 1,
  689. .flags = CLK_SET_RATE_PARENT,
  690. .ops = &clk_branch2_ops,
  691. },
  692. },
  693. };
  694. static struct clk_branch disp_cc_mdss_mdp1_clk = {
  695. .halt_reg = 0xa004,
  696. .halt_check = BRANCH_HALT,
  697. .clkr = {
  698. .enable_reg = 0xa004,
  699. .enable_mask = BIT(0),
  700. .hw.init = &(const struct clk_init_data) {
  701. .name = "disp_cc_mdss_mdp1_clk",
  702. .parent_hws = (const struct clk_hw*[]) {
  703. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  704. },
  705. .num_parents = 1,
  706. .flags = CLK_SET_RATE_PARENT,
  707. .ops = &clk_branch2_ops,
  708. },
  709. },
  710. };
  711. static struct clk_branch disp_cc_mdss_mdp_clk = {
  712. .halt_reg = 0x8008,
  713. .halt_check = BRANCH_HALT,
  714. .clkr = {
  715. .enable_reg = 0x8008,
  716. .enable_mask = BIT(0),
  717. .hw.init = &(const struct clk_init_data) {
  718. .name = "disp_cc_mdss_mdp_clk",
  719. .parent_hws = (const struct clk_hw*[]) {
  720. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  721. },
  722. .num_parents = 1,
  723. .flags = CLK_SET_RATE_PARENT,
  724. .ops = &clk_branch2_ops,
  725. },
  726. },
  727. };
  728. static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
  729. .halt_reg = 0xa010,
  730. .halt_check = BRANCH_HALT,
  731. .clkr = {
  732. .enable_reg = 0xa010,
  733. .enable_mask = BIT(0),
  734. .hw.init = &(const struct clk_init_data) {
  735. .name = "disp_cc_mdss_mdp_lut1_clk",
  736. .parent_hws = (const struct clk_hw*[]) {
  737. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  738. },
  739. .num_parents = 1,
  740. .flags = CLK_SET_RATE_PARENT,
  741. .ops = &clk_branch2_ops,
  742. },
  743. },
  744. };
  745. static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
  746. .halt_reg = 0x8014,
  747. .halt_check = BRANCH_HALT_VOTED,
  748. .clkr = {
  749. .enable_reg = 0x8014,
  750. .enable_mask = BIT(0),
  751. .hw.init = &(const struct clk_init_data) {
  752. .name = "disp_cc_mdss_mdp_lut_clk",
  753. .parent_hws = (const struct clk_hw*[]) {
  754. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  755. },
  756. .num_parents = 1,
  757. .flags = CLK_SET_RATE_PARENT,
  758. .ops = &clk_branch2_ops,
  759. },
  760. },
  761. };
  762. static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
  763. .halt_reg = 0xc004,
  764. .halt_check = BRANCH_HALT_VOTED,
  765. .clkr = {
  766. .enable_reg = 0xc004,
  767. .enable_mask = BIT(0),
  768. .hw.init = &(const struct clk_init_data) {
  769. .name = "disp_cc_mdss_non_gdsc_ahb_clk",
  770. .parent_hws = (const struct clk_hw*[]) {
  771. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  772. },
  773. .num_parents = 1,
  774. .flags = CLK_SET_RATE_PARENT,
  775. .ops = &clk_branch2_ops,
  776. },
  777. },
  778. };
  779. static struct clk_branch disp_cc_mdss_pclk0_clk = {
  780. .halt_reg = 0x8004,
  781. .halt_check = BRANCH_HALT,
  782. .clkr = {
  783. .enable_reg = 0x8004,
  784. .enable_mask = BIT(0),
  785. .hw.init = &(const struct clk_init_data) {
  786. .name = "disp_cc_mdss_pclk0_clk",
  787. .parent_hws = (const struct clk_hw*[]) {
  788. &disp_cc_mdss_pclk0_clk_src.clkr.hw,
  789. },
  790. .num_parents = 1,
  791. .flags = CLK_SET_RATE_PARENT,
  792. .ops = &clk_branch2_ops,
  793. },
  794. },
  795. };
  796. static struct clk_branch disp_cc_mdss_rscc_ahb_clk = {
  797. .halt_reg = 0xc00c,
  798. .halt_check = BRANCH_HALT,
  799. .clkr = {
  800. .enable_reg = 0xc00c,
  801. .enable_mask = BIT(0),
  802. .flags = QCOM_CLK_BOOT_CRITICAL,
  803. .hw.init = &(const struct clk_init_data) {
  804. .name = "disp_cc_mdss_rscc_ahb_clk",
  805. .parent_hws = (const struct clk_hw*[]) {
  806. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  807. },
  808. .num_parents = 1,
  809. .flags = CLK_SET_RATE_PARENT,
  810. .ops = &clk_branch2_ops,
  811. },
  812. },
  813. };
  814. static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
  815. .halt_reg = 0xc008,
  816. .halt_check = BRANCH_HALT,
  817. .clkr = {
  818. .enable_reg = 0xc008,
  819. .enable_mask = BIT(0),
  820. .flags = QCOM_CLK_BOOT_CRITICAL,
  821. .hw.init = &(const struct clk_init_data) {
  822. .name = "disp_cc_mdss_rscc_vsync_clk",
  823. .parent_hws = (const struct clk_hw*[]) {
  824. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  825. },
  826. .num_parents = 1,
  827. .flags = CLK_SET_RATE_PARENT,
  828. .ops = &clk_branch2_ops,
  829. },
  830. },
  831. };
  832. static struct clk_branch disp_cc_mdss_vsync1_clk = {
  833. .halt_reg = 0xa01c,
  834. .halt_check = BRANCH_HALT,
  835. .clkr = {
  836. .enable_reg = 0xa01c,
  837. .enable_mask = BIT(0),
  838. .hw.init = &(const struct clk_init_data) {
  839. .name = "disp_cc_mdss_vsync1_clk",
  840. .parent_hws = (const struct clk_hw*[]) {
  841. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  842. },
  843. .num_parents = 1,
  844. .flags = CLK_SET_RATE_PARENT,
  845. .ops = &clk_branch2_ops,
  846. },
  847. },
  848. };
  849. static struct clk_branch disp_cc_mdss_vsync_clk = {
  850. .halt_reg = 0x8020,
  851. .halt_check = BRANCH_HALT,
  852. .clkr = {
  853. .enable_reg = 0x8020,
  854. .enable_mask = BIT(0),
  855. .hw.init = &(const struct clk_init_data) {
  856. .name = "disp_cc_mdss_vsync_clk",
  857. .parent_hws = (const struct clk_hw*[]) {
  858. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  859. },
  860. .num_parents = 1,
  861. .flags = CLK_SET_RATE_PARENT,
  862. .ops = &clk_branch2_ops,
  863. },
  864. },
  865. };
  866. static struct clk_regmap *disp_cc_volcano_clocks[] = {
  867. [DISP_CC_MDSS_ACCU_CLK] = &disp_cc_mdss_accu_clk.clkr,
  868. [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
  869. [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
  870. [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
  871. [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
  872. [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
  873. [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
  874. [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
  875. [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
  876. [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
  877. [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr,
  878. [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
  879. [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
  880. [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
  881. [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
  882. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
  883. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
  884. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
  885. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
  886. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
  887. &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
  888. [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
  889. [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
  890. [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
  891. [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
  892. [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
  893. [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
  894. [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
  895. [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
  896. [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
  897. [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
  898. [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr,
  899. [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
  900. [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
  901. [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
  902. [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
  903. [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
  904. [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr,
  905. [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr,
  906. };
  907. static const struct qcom_reset_map disp_cc_volcano_resets[] = {
  908. [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
  909. [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
  910. [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
  911. };
  912. static const struct regmap_config disp_cc_volcano_regmap_config = {
  913. .reg_bits = 32,
  914. .reg_stride = 4,
  915. .val_bits = 32,
  916. .max_register = 0x11008,
  917. .fast_io = true,
  918. };
  919. static struct qcom_cc_desc disp_cc_volcano_desc = {
  920. .config = &disp_cc_volcano_regmap_config,
  921. .clks = disp_cc_volcano_clocks,
  922. .num_clks = ARRAY_SIZE(disp_cc_volcano_clocks),
  923. .resets = disp_cc_volcano_resets,
  924. .num_resets = ARRAY_SIZE(disp_cc_volcano_resets),
  925. .clk_regulators = disp_cc_volcano_regulators,
  926. .num_clk_regulators = ARRAY_SIZE(disp_cc_volcano_regulators),
  927. };
  928. static const struct of_device_id disp_cc_volcano_match_table[] = {
  929. { .compatible = "qcom,volcano-dispcc" },
  930. { }
  931. };
  932. MODULE_DEVICE_TABLE(of, disp_cc_volcano_match_table);
  933. static int disp_cc_volcano_probe(struct platform_device *pdev)
  934. {
  935. struct regmap *regmap;
  936. int ret;
  937. regmap = qcom_cc_map(pdev, &disp_cc_volcano_desc);
  938. if (IS_ERR(regmap))
  939. return PTR_ERR(regmap);
  940. clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
  941. /* Enable clock gating for MDP clocks */
  942. regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
  943. /*
  944. * Keep clocks always enabled:
  945. * disp_cc_sleep_clk
  946. * disp_cc_xo_clk
  947. */
  948. regmap_update_bits(regmap, 0xe06c, BIT(0), BIT(0));
  949. regmap_update_bits(regmap, 0xe04c, BIT(0), BIT(0));
  950. ret = qcom_cc_really_probe(pdev, &disp_cc_volcano_desc, regmap);
  951. if (ret) {
  952. dev_err(&pdev->dev, "Failed to register DISP CC clocks\n");
  953. return ret;
  954. }
  955. dev_info(&pdev->dev, "Registered DISP CC clocks\n");
  956. return ret;
  957. }
  958. static void disp_cc_volcano_sync_state(struct device *dev)
  959. {
  960. qcom_cc_sync_state(dev, &disp_cc_volcano_desc);
  961. }
  962. static struct platform_driver disp_cc_volcano_driver = {
  963. .probe = disp_cc_volcano_probe,
  964. .driver = {
  965. .name = "disp_cc-volcano",
  966. .of_match_table = disp_cc_volcano_match_table,
  967. .sync_state = disp_cc_volcano_sync_state,
  968. },
  969. };
  970. static int __init disp_cc_volcano_init(void)
  971. {
  972. return platform_driver_register(&disp_cc_volcano_driver);
  973. }
  974. subsys_initcall(disp_cc_volcano_init);
  975. static void __exit disp_cc_volcano_exit(void)
  976. {
  977. platform_driver_unregister(&disp_cc_volcano_driver);
  978. }
  979. module_exit(disp_cc_volcano_exit);
  980. MODULE_DESCRIPTION("QTI DISP_CC VOLCANO Driver");
  981. MODULE_LICENSE("GPL");