dispcc-x1e80100.c 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/clk-provider.h>
  6. #include <linux/err.h>
  7. #include <linux/kernel.h>
  8. #include <linux/mod_devicetable.h>
  9. #include <linux/module.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/pm_runtime.h>
  12. #include <linux/regmap.h>
  13. #include <dt-bindings/clock/qcom,x1e80100-dispcc.h>
  14. #include "common.h"
  15. #include "clk-alpha-pll.h"
  16. #include "clk-branch.h"
  17. #include "clk-pll.h"
  18. #include "clk-rcg.h"
  19. #include "clk-regmap.h"
  20. #include "clk-regmap-divider.h"
  21. #include "reset.h"
  22. #include "gdsc.h"
  23. /* Need to match the order of clocks in DT binding */
  24. enum {
  25. DT_BI_TCXO,
  26. DT_BI_TCXO_AO,
  27. DT_AHB_CLK,
  28. DT_SLEEP_CLK,
  29. DT_DSI0_PHY_PLL_OUT_BYTECLK,
  30. DT_DSI0_PHY_PLL_OUT_DSICLK,
  31. DT_DSI1_PHY_PLL_OUT_BYTECLK,
  32. DT_DSI1_PHY_PLL_OUT_DSICLK,
  33. DT_DP0_PHY_PLL_LINK_CLK,
  34. DT_DP0_PHY_PLL_VCO_DIV_CLK,
  35. DT_DP1_PHY_PLL_LINK_CLK,
  36. DT_DP1_PHY_PLL_VCO_DIV_CLK,
  37. DT_DP2_PHY_PLL_LINK_CLK,
  38. DT_DP2_PHY_PLL_VCO_DIV_CLK,
  39. DT_DP3_PHY_PLL_LINK_CLK,
  40. DT_DP3_PHY_PLL_VCO_DIV_CLK,
  41. };
  42. #define DISP_CC_MISC_CMD 0xF000
  43. enum {
  44. P_BI_TCXO,
  45. P_BI_TCXO_AO,
  46. P_DISP_CC_PLL0_OUT_MAIN,
  47. P_DISP_CC_PLL1_OUT_EVEN,
  48. P_DISP_CC_PLL1_OUT_MAIN,
  49. P_DP0_PHY_PLL_LINK_CLK,
  50. P_DP0_PHY_PLL_VCO_DIV_CLK,
  51. P_DP1_PHY_PLL_LINK_CLK,
  52. P_DP1_PHY_PLL_VCO_DIV_CLK,
  53. P_DP2_PHY_PLL_LINK_CLK,
  54. P_DP2_PHY_PLL_VCO_DIV_CLK,
  55. P_DP3_PHY_PLL_LINK_CLK,
  56. P_DP3_PHY_PLL_VCO_DIV_CLK,
  57. P_DSI0_PHY_PLL_OUT_BYTECLK,
  58. P_DSI0_PHY_PLL_OUT_DSICLK,
  59. P_DSI1_PHY_PLL_OUT_BYTECLK,
  60. P_DSI1_PHY_PLL_OUT_DSICLK,
  61. P_SLEEP_CLK,
  62. };
  63. static const struct pll_vco lucid_ole_vco[] = {
  64. { 249600000, 2300000000, 0 },
  65. };
  66. static const struct alpha_pll_config disp_cc_pll0_config = {
  67. .l = 0xd,
  68. .alpha = 0x6492,
  69. .config_ctl_val = 0x20485699,
  70. .config_ctl_hi_val = 0x00182261,
  71. .config_ctl_hi1_val = 0x82aa299c,
  72. .test_ctl_val = 0x00000000,
  73. .test_ctl_hi_val = 0x00000003,
  74. .test_ctl_hi1_val = 0x00009000,
  75. .test_ctl_hi2_val = 0x00000034,
  76. .user_ctl_val = 0x00000000,
  77. .user_ctl_hi_val = 0x00000005,
  78. };
  79. static struct clk_alpha_pll disp_cc_pll0 = {
  80. .offset = 0x0,
  81. .vco_table = lucid_ole_vco,
  82. .num_vco = ARRAY_SIZE(lucid_ole_vco),
  83. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  84. .clkr = {
  85. .hw.init = &(const struct clk_init_data) {
  86. .name = "disp_cc_pll0",
  87. .parent_data = &(const struct clk_parent_data) {
  88. .index = DT_BI_TCXO,
  89. },
  90. .num_parents = 1,
  91. .ops = &clk_alpha_pll_reset_lucid_ole_ops,
  92. },
  93. },
  94. };
  95. static const struct alpha_pll_config disp_cc_pll1_config = {
  96. .l = 0x1f,
  97. .alpha = 0x4000,
  98. .config_ctl_val = 0x20485699,
  99. .config_ctl_hi_val = 0x00182261,
  100. .config_ctl_hi1_val = 0x82aa299c,
  101. .test_ctl_val = 0x00000000,
  102. .test_ctl_hi_val = 0x00000003,
  103. .test_ctl_hi1_val = 0x00009000,
  104. .test_ctl_hi2_val = 0x00000034,
  105. .user_ctl_val = 0x00000000,
  106. .user_ctl_hi_val = 0x00000005,
  107. };
  108. static struct clk_alpha_pll disp_cc_pll1 = {
  109. .offset = 0x1000,
  110. .vco_table = lucid_ole_vco,
  111. .num_vco = ARRAY_SIZE(lucid_ole_vco),
  112. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  113. .clkr = {
  114. .hw.init = &(const struct clk_init_data) {
  115. .name = "disp_cc_pll1",
  116. .parent_data = &(const struct clk_parent_data) {
  117. .index = DT_BI_TCXO,
  118. },
  119. .num_parents = 1,
  120. .ops = &clk_alpha_pll_reset_lucid_ole_ops,
  121. },
  122. },
  123. };
  124. static const struct parent_map disp_cc_parent_map_0[] = {
  125. { P_BI_TCXO, 0 },
  126. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  127. { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
  128. { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
  129. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  130. { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
  131. };
  132. static const struct clk_parent_data disp_cc_parent_data_0[] = {
  133. { .index = DT_BI_TCXO },
  134. { .index = DT_DP0_PHY_PLL_LINK_CLK },
  135. { .index = DT_DP0_PHY_PLL_VCO_DIV_CLK },
  136. { .index = DT_DP3_PHY_PLL_VCO_DIV_CLK },
  137. { .index = DT_DP1_PHY_PLL_VCO_DIV_CLK },
  138. { .index = DT_DP2_PHY_PLL_VCO_DIV_CLK },
  139. };
  140. static const struct parent_map disp_cc_parent_map_1[] = {
  141. { P_BI_TCXO, 0 },
  142. };
  143. static const struct clk_parent_data disp_cc_parent_data_1[] = {
  144. { .index = DT_BI_TCXO },
  145. };
  146. static const struct clk_parent_data disp_cc_parent_data_1_ao[] = {
  147. { .index = DT_BI_TCXO_AO },
  148. };
  149. static const struct parent_map disp_cc_parent_map_2[] = {
  150. { P_BI_TCXO, 0 },
  151. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  152. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  153. { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
  154. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  155. };
  156. static const struct clk_parent_data disp_cc_parent_data_2[] = {
  157. { .index = DT_BI_TCXO },
  158. { .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
  159. { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
  160. { .index = DT_DSI1_PHY_PLL_OUT_DSICLK },
  161. { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
  162. };
  163. static const struct parent_map disp_cc_parent_map_3[] = {
  164. { P_BI_TCXO, 0 },
  165. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  166. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  167. { P_DP2_PHY_PLL_LINK_CLK, 3 },
  168. { P_DP3_PHY_PLL_LINK_CLK, 4 },
  169. };
  170. static const struct clk_parent_data disp_cc_parent_data_3[] = {
  171. { .index = DT_BI_TCXO },
  172. { .index = DT_DP0_PHY_PLL_LINK_CLK },
  173. { .index = DT_DP1_PHY_PLL_LINK_CLK },
  174. { .index = DT_DP2_PHY_PLL_LINK_CLK },
  175. { .index = DT_DP3_PHY_PLL_LINK_CLK },
  176. };
  177. static const struct parent_map disp_cc_parent_map_4[] = {
  178. { P_BI_TCXO, 0 },
  179. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  180. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  181. };
  182. static const struct clk_parent_data disp_cc_parent_data_4[] = {
  183. { .index = DT_BI_TCXO },
  184. { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
  185. { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
  186. };
  187. static const struct parent_map disp_cc_parent_map_5[] = {
  188. { P_BI_TCXO, 0 },
  189. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  190. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  191. };
  192. static const struct clk_parent_data disp_cc_parent_data_5[] = {
  193. { .index = DT_BI_TCXO },
  194. { .hw = &disp_cc_pll1.clkr.hw },
  195. { .hw = &disp_cc_pll1.clkr.hw },
  196. };
  197. static const struct parent_map disp_cc_parent_map_6[] = {
  198. { P_BI_TCXO, 0 },
  199. { P_DISP_CC_PLL0_OUT_MAIN, 1 },
  200. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  201. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  202. };
  203. static const struct clk_parent_data disp_cc_parent_data_6[] = {
  204. { .index = DT_BI_TCXO },
  205. { .hw = &disp_cc_pll0.clkr.hw },
  206. { .hw = &disp_cc_pll1.clkr.hw },
  207. { .hw = &disp_cc_pll1.clkr.hw },
  208. };
  209. static const struct parent_map disp_cc_parent_map_7[] = {
  210. { P_SLEEP_CLK, 0 },
  211. };
  212. static const struct clk_parent_data disp_cc_parent_data_7[] = {
  213. { .index = DT_SLEEP_CLK },
  214. };
  215. static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
  216. F(19200000, P_BI_TCXO, 1, 0, 0),
  217. F(37500000, P_DISP_CC_PLL1_OUT_MAIN, 16, 0, 0),
  218. F(75000000, P_DISP_CC_PLL1_OUT_MAIN, 8, 0, 0),
  219. { }
  220. };
  221. static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
  222. .cmd_rcgr = 0x82ec,
  223. .mnd_width = 0,
  224. .hid_width = 5,
  225. .parent_map = disp_cc_parent_map_5,
  226. .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
  227. .clkr.hw.init = &(const struct clk_init_data) {
  228. .name = "disp_cc_mdss_ahb_clk_src",
  229. .parent_data = disp_cc_parent_data_5,
  230. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  231. .flags = CLK_SET_RATE_PARENT,
  232. .ops = &clk_rcg2_ops,
  233. },
  234. };
  235. static const struct freq_tbl ftbl_disp_cc_mdss_byte0_clk_src[] = {
  236. F(19200000, P_BI_TCXO, 1, 0, 0),
  237. { }
  238. };
  239. static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
  240. .cmd_rcgr = 0x810c,
  241. .mnd_width = 0,
  242. .hid_width = 5,
  243. .parent_map = disp_cc_parent_map_2,
  244. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  245. .clkr.hw.init = &(const struct clk_init_data) {
  246. .name = "disp_cc_mdss_byte0_clk_src",
  247. .parent_data = disp_cc_parent_data_2,
  248. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  249. .flags = CLK_SET_RATE_PARENT,
  250. .ops = &clk_byte2_ops,
  251. },
  252. };
  253. static struct clk_rcg2 disp_cc_mdss_byte1_clk_src = {
  254. .cmd_rcgr = 0x8128,
  255. .mnd_width = 0,
  256. .hid_width = 5,
  257. .parent_map = disp_cc_parent_map_2,
  258. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  259. .clkr.hw.init = &(const struct clk_init_data) {
  260. .name = "disp_cc_mdss_byte1_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_byte2_ops,
  265. },
  266. };
  267. static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
  268. .cmd_rcgr = 0x81c0,
  269. .mnd_width = 0,
  270. .hid_width = 5,
  271. .parent_map = disp_cc_parent_map_1,
  272. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  273. .clkr.hw.init = &(const struct clk_init_data) {
  274. .name = "disp_cc_mdss_dptx0_aux_clk_src",
  275. .parent_data = disp_cc_parent_data_1,
  276. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  277. .flags = CLK_SET_RATE_PARENT,
  278. .ops = &clk_rcg2_ops,
  279. },
  280. };
  281. static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
  282. .cmd_rcgr = 0x8174,
  283. .mnd_width = 0,
  284. .hid_width = 5,
  285. .parent_map = disp_cc_parent_map_3,
  286. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  287. .clkr.hw.init = &(const struct clk_init_data) {
  288. .name = "disp_cc_mdss_dptx0_link_clk_src",
  289. .parent_data = disp_cc_parent_data_3,
  290. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  291. .flags = CLK_SET_RATE_PARENT,
  292. .ops = &clk_byte2_ops,
  293. },
  294. };
  295. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
  296. .cmd_rcgr = 0x8190,
  297. .mnd_width = 16,
  298. .hid_width = 5,
  299. .parent_map = disp_cc_parent_map_0,
  300. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  301. .clkr.hw.init = &(const struct clk_init_data) {
  302. .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
  303. .parent_data = disp_cc_parent_data_0,
  304. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  305. .flags = CLK_SET_RATE_PARENT,
  306. .ops = &clk_dp_ops,
  307. },
  308. };
  309. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
  310. .cmd_rcgr = 0x81a8,
  311. .mnd_width = 16,
  312. .hid_width = 5,
  313. .parent_map = disp_cc_parent_map_0,
  314. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  315. .clkr.hw.init = &(const struct clk_init_data) {
  316. .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
  317. .parent_data = disp_cc_parent_data_0,
  318. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  319. .flags = CLK_SET_RATE_PARENT,
  320. .ops = &clk_dp_ops,
  321. },
  322. };
  323. static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = {
  324. .cmd_rcgr = 0x8224,
  325. .mnd_width = 0,
  326. .hid_width = 5,
  327. .parent_map = disp_cc_parent_map_1,
  328. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  329. .clkr.hw.init = &(const struct clk_init_data) {
  330. .name = "disp_cc_mdss_dptx1_aux_clk_src",
  331. .parent_data = disp_cc_parent_data_1,
  332. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  333. .flags = CLK_SET_RATE_PARENT,
  334. .ops = &clk_rcg2_ops,
  335. },
  336. };
  337. static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = {
  338. .cmd_rcgr = 0x8208,
  339. .mnd_width = 0,
  340. .hid_width = 5,
  341. .parent_map = disp_cc_parent_map_3,
  342. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  343. .clkr.hw.init = &(const struct clk_init_data) {
  344. .name = "disp_cc_mdss_dptx1_link_clk_src",
  345. .parent_data = disp_cc_parent_data_3,
  346. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  347. .flags = CLK_SET_RATE_PARENT,
  348. .ops = &clk_byte2_ops,
  349. },
  350. };
  351. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel0_clk_src = {
  352. .cmd_rcgr = 0x81d8,
  353. .mnd_width = 16,
  354. .hid_width = 5,
  355. .parent_map = disp_cc_parent_map_0,
  356. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  357. .clkr.hw.init = &(const struct clk_init_data) {
  358. .name = "disp_cc_mdss_dptx1_pixel0_clk_src",
  359. .parent_data = disp_cc_parent_data_0,
  360. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  361. .flags = CLK_SET_RATE_PARENT,
  362. .ops = &clk_dp_ops,
  363. },
  364. };
  365. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel1_clk_src = {
  366. .cmd_rcgr = 0x81f0,
  367. .mnd_width = 16,
  368. .hid_width = 5,
  369. .parent_map = disp_cc_parent_map_0,
  370. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  371. .clkr.hw.init = &(const struct clk_init_data) {
  372. .name = "disp_cc_mdss_dptx1_pixel1_clk_src",
  373. .parent_data = disp_cc_parent_data_0,
  374. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  375. .flags = CLK_SET_RATE_PARENT,
  376. .ops = &clk_dp_ops,
  377. },
  378. };
  379. static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = {
  380. .cmd_rcgr = 0x8288,
  381. .mnd_width = 0,
  382. .hid_width = 5,
  383. .parent_map = disp_cc_parent_map_1,
  384. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  385. .clkr.hw.init = &(const struct clk_init_data) {
  386. .name = "disp_cc_mdss_dptx2_aux_clk_src",
  387. .parent_data = disp_cc_parent_data_1,
  388. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  389. .flags = CLK_SET_RATE_PARENT,
  390. .ops = &clk_rcg2_ops,
  391. },
  392. };
  393. static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = {
  394. .cmd_rcgr = 0x823c,
  395. .mnd_width = 0,
  396. .hid_width = 5,
  397. .parent_map = disp_cc_parent_map_3,
  398. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  399. .clkr.hw.init = &(const struct clk_init_data) {
  400. .name = "disp_cc_mdss_dptx2_link_clk_src",
  401. .parent_data = disp_cc_parent_data_3,
  402. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  403. .flags = CLK_SET_RATE_PARENT,
  404. .ops = &clk_byte2_ops,
  405. },
  406. };
  407. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel0_clk_src = {
  408. .cmd_rcgr = 0x8258,
  409. .mnd_width = 16,
  410. .hid_width = 5,
  411. .parent_map = disp_cc_parent_map_0,
  412. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  413. .clkr.hw.init = &(const struct clk_init_data) {
  414. .name = "disp_cc_mdss_dptx2_pixel0_clk_src",
  415. .parent_data = disp_cc_parent_data_0,
  416. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  417. .flags = CLK_SET_RATE_PARENT,
  418. .ops = &clk_dp_ops,
  419. },
  420. };
  421. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel1_clk_src = {
  422. .cmd_rcgr = 0x8270,
  423. .mnd_width = 16,
  424. .hid_width = 5,
  425. .parent_map = disp_cc_parent_map_0,
  426. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  427. .clkr.hw.init = &(const struct clk_init_data) {
  428. .name = "disp_cc_mdss_dptx2_pixel1_clk_src",
  429. .parent_data = disp_cc_parent_data_0,
  430. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  431. .flags = CLK_SET_RATE_PARENT,
  432. .ops = &clk_dp_ops,
  433. },
  434. };
  435. static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = {
  436. .cmd_rcgr = 0x82d4,
  437. .mnd_width = 0,
  438. .hid_width = 5,
  439. .parent_map = disp_cc_parent_map_1,
  440. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  441. .clkr.hw.init = &(const struct clk_init_data) {
  442. .name = "disp_cc_mdss_dptx3_aux_clk_src",
  443. .parent_data = disp_cc_parent_data_1,
  444. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  445. .flags = CLK_SET_RATE_PARENT,
  446. .ops = &clk_rcg2_ops,
  447. },
  448. };
  449. static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = {
  450. .cmd_rcgr = 0x82b8,
  451. .mnd_width = 0,
  452. .hid_width = 5,
  453. .parent_map = disp_cc_parent_map_3,
  454. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  455. .clkr.hw.init = &(const struct clk_init_data) {
  456. .name = "disp_cc_mdss_dptx3_link_clk_src",
  457. .parent_data = disp_cc_parent_data_3,
  458. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  459. .flags = CLK_SET_RATE_PARENT,
  460. .ops = &clk_byte2_ops,
  461. },
  462. };
  463. static struct clk_rcg2 disp_cc_mdss_dptx3_pixel0_clk_src = {
  464. .cmd_rcgr = 0x82a0,
  465. .mnd_width = 16,
  466. .hid_width = 5,
  467. .parent_map = disp_cc_parent_map_0,
  468. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  469. .clkr.hw.init = &(const struct clk_init_data) {
  470. .name = "disp_cc_mdss_dptx3_pixel0_clk_src",
  471. .parent_data = disp_cc_parent_data_0,
  472. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  473. .flags = CLK_SET_RATE_PARENT,
  474. .ops = &clk_dp_ops,
  475. },
  476. };
  477. static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
  478. .cmd_rcgr = 0x8144,
  479. .mnd_width = 0,
  480. .hid_width = 5,
  481. .parent_map = disp_cc_parent_map_4,
  482. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  483. .clkr.hw.init = &(const struct clk_init_data) {
  484. .name = "disp_cc_mdss_esc0_clk_src",
  485. .parent_data = disp_cc_parent_data_4,
  486. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  487. .flags = CLK_SET_RATE_PARENT,
  488. .ops = &clk_rcg2_ops,
  489. },
  490. };
  491. static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = {
  492. .cmd_rcgr = 0x815c,
  493. .mnd_width = 0,
  494. .hid_width = 5,
  495. .parent_map = disp_cc_parent_map_4,
  496. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  497. .clkr.hw.init = &(const struct clk_init_data) {
  498. .name = "disp_cc_mdss_esc1_clk_src",
  499. .parent_data = disp_cc_parent_data_4,
  500. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  501. .flags = CLK_SET_RATE_PARENT,
  502. .ops = &clk_rcg2_ops,
  503. },
  504. };
  505. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
  506. F(19200000, P_BI_TCXO, 1, 0, 0),
  507. F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  508. F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  509. F(150000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  510. F(172000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  511. F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  512. F(325000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  513. F(375000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  514. F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  515. F(575000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  516. { }
  517. };
  518. static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
  519. .cmd_rcgr = 0x80dc,
  520. .mnd_width = 0,
  521. .hid_width = 5,
  522. .parent_map = disp_cc_parent_map_6,
  523. .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
  524. .clkr.hw.init = &(const struct clk_init_data) {
  525. .name = "disp_cc_mdss_mdp_clk_src",
  526. .parent_data = disp_cc_parent_data_6,
  527. .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
  528. .flags = CLK_SET_RATE_PARENT,
  529. .ops = &clk_rcg2_shared_ops,
  530. },
  531. };
  532. static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
  533. .cmd_rcgr = 0x80ac,
  534. .mnd_width = 8,
  535. .hid_width = 5,
  536. .parent_map = disp_cc_parent_map_2,
  537. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  538. .clkr.hw.init = &(const struct clk_init_data) {
  539. .name = "disp_cc_mdss_pclk0_clk_src",
  540. .parent_data = disp_cc_parent_data_2,
  541. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  542. .flags = CLK_SET_RATE_PARENT,
  543. .ops = &clk_pixel_ops,
  544. },
  545. };
  546. static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
  547. .cmd_rcgr = 0x80c4,
  548. .mnd_width = 8,
  549. .hid_width = 5,
  550. .parent_map = disp_cc_parent_map_2,
  551. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  552. .clkr.hw.init = &(const struct clk_init_data) {
  553. .name = "disp_cc_mdss_pclk1_clk_src",
  554. .parent_data = disp_cc_parent_data_2,
  555. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  556. .flags = CLK_SET_RATE_PARENT,
  557. .ops = &clk_pixel_ops,
  558. },
  559. };
  560. static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
  561. .cmd_rcgr = 0x80f4,
  562. .mnd_width = 0,
  563. .hid_width = 5,
  564. .parent_map = disp_cc_parent_map_1,
  565. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  566. .clkr.hw.init = &(const struct clk_init_data) {
  567. .name = "disp_cc_mdss_vsync_clk_src",
  568. .parent_data = disp_cc_parent_data_1,
  569. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  570. .flags = CLK_SET_RATE_PARENT,
  571. .ops = &clk_rcg2_ops,
  572. },
  573. };
  574. static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = {
  575. F(32000, P_SLEEP_CLK, 1, 0, 0),
  576. { }
  577. };
  578. static struct clk_rcg2 disp_cc_sleep_clk_src = {
  579. .cmd_rcgr = 0xe05c,
  580. .mnd_width = 0,
  581. .hid_width = 5,
  582. .parent_map = disp_cc_parent_map_7,
  583. .freq_tbl = ftbl_disp_cc_sleep_clk_src,
  584. .clkr.hw.init = &(const struct clk_init_data) {
  585. .name = "disp_cc_sleep_clk_src",
  586. .parent_data = disp_cc_parent_data_7,
  587. .num_parents = ARRAY_SIZE(disp_cc_parent_data_7),
  588. .flags = CLK_SET_RATE_PARENT,
  589. .ops = &clk_rcg2_ops,
  590. },
  591. };
  592. static struct clk_rcg2 disp_cc_xo_clk_src = {
  593. .cmd_rcgr = 0xe03c,
  594. .mnd_width = 0,
  595. .hid_width = 5,
  596. .parent_map = disp_cc_parent_map_1,
  597. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  598. .clkr.hw.init = &(const struct clk_init_data) {
  599. .name = "disp_cc_xo_clk_src",
  600. .parent_data = disp_cc_parent_data_1_ao,
  601. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1_ao),
  602. .flags = CLK_SET_RATE_PARENT,
  603. .ops = &clk_rcg2_ops,
  604. },
  605. };
  606. static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
  607. .reg = 0x8124,
  608. .shift = 0,
  609. .width = 4,
  610. .clkr.hw.init = &(const struct clk_init_data) {
  611. .name = "disp_cc_mdss_byte0_div_clk_src",
  612. .parent_hws = (const struct clk_hw*[]) {
  613. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  614. },
  615. .num_parents = 1,
  616. .flags = CLK_SET_RATE_PARENT,
  617. .ops = &clk_regmap_div_ro_ops,
  618. },
  619. };
  620. static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = {
  621. .reg = 0x8140,
  622. .shift = 0,
  623. .width = 4,
  624. .clkr.hw.init = &(const struct clk_init_data) {
  625. .name = "disp_cc_mdss_byte1_div_clk_src",
  626. .parent_hws = (const struct clk_hw*[]) {
  627. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  628. },
  629. .num_parents = 1,
  630. .flags = CLK_SET_RATE_PARENT,
  631. .ops = &clk_regmap_div_ro_ops,
  632. },
  633. };
  634. static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
  635. .reg = 0x818c,
  636. .shift = 0,
  637. .width = 4,
  638. .clkr.hw.init = &(const struct clk_init_data) {
  639. .name = "disp_cc_mdss_dptx0_link_div_clk_src",
  640. .parent_hws = (const struct clk_hw*[]) {
  641. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  642. },
  643. .num_parents = 1,
  644. .flags = CLK_SET_RATE_PARENT,
  645. .ops = &clk_regmap_div_ro_ops,
  646. },
  647. };
  648. static struct clk_regmap_div disp_cc_mdss_dptx1_link_div_clk_src = {
  649. .reg = 0x8220,
  650. .shift = 0,
  651. .width = 4,
  652. .clkr.hw.init = &(const struct clk_init_data) {
  653. .name = "disp_cc_mdss_dptx1_link_div_clk_src",
  654. .parent_hws = (const struct clk_hw*[]) {
  655. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  656. },
  657. .num_parents = 1,
  658. .flags = CLK_SET_RATE_PARENT,
  659. .ops = &clk_regmap_div_ro_ops,
  660. },
  661. };
  662. static struct clk_regmap_div disp_cc_mdss_dptx2_link_div_clk_src = {
  663. .reg = 0x8254,
  664. .shift = 0,
  665. .width = 4,
  666. .clkr.hw.init = &(const struct clk_init_data) {
  667. .name = "disp_cc_mdss_dptx2_link_div_clk_src",
  668. .parent_hws = (const struct clk_hw*[]) {
  669. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  670. },
  671. .num_parents = 1,
  672. .flags = CLK_SET_RATE_PARENT,
  673. .ops = &clk_regmap_div_ro_ops,
  674. },
  675. };
  676. static struct clk_regmap_div disp_cc_mdss_dptx3_link_div_clk_src = {
  677. .reg = 0x82d0,
  678. .shift = 0,
  679. .width = 4,
  680. .clkr.hw.init = &(const struct clk_init_data) {
  681. .name = "disp_cc_mdss_dptx3_link_div_clk_src",
  682. .parent_hws = (const struct clk_hw*[]) {
  683. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  684. },
  685. .num_parents = 1,
  686. .flags = CLK_SET_RATE_PARENT,
  687. .ops = &clk_regmap_div_ro_ops,
  688. },
  689. };
  690. static struct clk_branch disp_cc_mdss_accu_clk = {
  691. .halt_reg = 0xe058,
  692. .halt_check = BRANCH_HALT_VOTED,
  693. .clkr = {
  694. .enable_reg = 0xe058,
  695. .enable_mask = BIT(0),
  696. .hw.init = &(const struct clk_init_data) {
  697. .name = "disp_cc_mdss_accu_clk",
  698. .parent_hws = (const struct clk_hw*[]) {
  699. &disp_cc_xo_clk_src.clkr.hw,
  700. },
  701. .num_parents = 1,
  702. .flags = CLK_SET_RATE_PARENT,
  703. .ops = &clk_branch2_ops,
  704. },
  705. },
  706. };
  707. static struct clk_branch disp_cc_mdss_ahb1_clk = {
  708. .halt_reg = 0xa020,
  709. .halt_check = BRANCH_HALT,
  710. .clkr = {
  711. .enable_reg = 0xa020,
  712. .enable_mask = BIT(0),
  713. .hw.init = &(const struct clk_init_data) {
  714. .name = "disp_cc_mdss_ahb1_clk",
  715. .parent_hws = (const struct clk_hw*[]) {
  716. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  717. },
  718. .num_parents = 1,
  719. .flags = CLK_SET_RATE_PARENT,
  720. .ops = &clk_branch2_ops,
  721. },
  722. },
  723. };
  724. static struct clk_branch disp_cc_mdss_ahb_clk = {
  725. .halt_reg = 0x80a8,
  726. .halt_check = BRANCH_HALT,
  727. .clkr = {
  728. .enable_reg = 0x80a8,
  729. .enable_mask = BIT(0),
  730. .hw.init = &(const struct clk_init_data) {
  731. .name = "disp_cc_mdss_ahb_clk",
  732. .parent_hws = (const struct clk_hw*[]) {
  733. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  734. },
  735. .num_parents = 1,
  736. .flags = CLK_SET_RATE_PARENT,
  737. .ops = &clk_branch2_ops,
  738. },
  739. },
  740. };
  741. static struct clk_branch disp_cc_mdss_byte0_clk = {
  742. .halt_reg = 0x8028,
  743. .halt_check = BRANCH_HALT,
  744. .clkr = {
  745. .enable_reg = 0x8028,
  746. .enable_mask = BIT(0),
  747. .hw.init = &(const struct clk_init_data) {
  748. .name = "disp_cc_mdss_byte0_clk",
  749. .parent_hws = (const struct clk_hw*[]) {
  750. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  751. },
  752. .num_parents = 1,
  753. .flags = CLK_SET_RATE_PARENT,
  754. .ops = &clk_branch2_ops,
  755. },
  756. },
  757. };
  758. static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
  759. .halt_reg = 0x802c,
  760. .halt_check = BRANCH_HALT,
  761. .clkr = {
  762. .enable_reg = 0x802c,
  763. .enable_mask = BIT(0),
  764. .hw.init = &(const struct clk_init_data) {
  765. .name = "disp_cc_mdss_byte0_intf_clk",
  766. .parent_hws = (const struct clk_hw*[]) {
  767. &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
  768. },
  769. .num_parents = 1,
  770. .flags = CLK_SET_RATE_PARENT,
  771. .ops = &clk_branch2_ops,
  772. },
  773. },
  774. };
  775. static struct clk_branch disp_cc_mdss_byte1_clk = {
  776. .halt_reg = 0x8030,
  777. .halt_check = BRANCH_HALT,
  778. .clkr = {
  779. .enable_reg = 0x8030,
  780. .enable_mask = BIT(0),
  781. .hw.init = &(const struct clk_init_data) {
  782. .name = "disp_cc_mdss_byte1_clk",
  783. .parent_hws = (const struct clk_hw*[]) {
  784. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  785. },
  786. .num_parents = 1,
  787. .flags = CLK_SET_RATE_PARENT,
  788. .ops = &clk_branch2_ops,
  789. },
  790. },
  791. };
  792. static struct clk_branch disp_cc_mdss_byte1_intf_clk = {
  793. .halt_reg = 0x8034,
  794. .halt_check = BRANCH_HALT,
  795. .clkr = {
  796. .enable_reg = 0x8034,
  797. .enable_mask = BIT(0),
  798. .hw.init = &(const struct clk_init_data) {
  799. .name = "disp_cc_mdss_byte1_intf_clk",
  800. .parent_hws = (const struct clk_hw*[]) {
  801. &disp_cc_mdss_byte1_div_clk_src.clkr.hw,
  802. },
  803. .num_parents = 1,
  804. .flags = CLK_SET_RATE_PARENT,
  805. .ops = &clk_branch2_ops,
  806. },
  807. },
  808. };
  809. static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
  810. .halt_reg = 0x8058,
  811. .halt_check = BRANCH_HALT,
  812. .clkr = {
  813. .enable_reg = 0x8058,
  814. .enable_mask = BIT(0),
  815. .hw.init = &(const struct clk_init_data) {
  816. .name = "disp_cc_mdss_dptx0_aux_clk",
  817. .parent_hws = (const struct clk_hw*[]) {
  818. &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
  819. },
  820. .num_parents = 1,
  821. .flags = CLK_SET_RATE_PARENT,
  822. .ops = &clk_branch2_ops,
  823. },
  824. },
  825. };
  826. static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
  827. .halt_reg = 0x8040,
  828. .halt_check = BRANCH_HALT,
  829. .clkr = {
  830. .enable_reg = 0x8040,
  831. .enable_mask = BIT(0),
  832. .hw.init = &(const struct clk_init_data) {
  833. .name = "disp_cc_mdss_dptx0_link_clk",
  834. .parent_hws = (const struct clk_hw*[]) {
  835. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  836. },
  837. .num_parents = 1,
  838. .flags = CLK_SET_RATE_PARENT,
  839. .ops = &clk_branch2_ops,
  840. },
  841. },
  842. };
  843. static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
  844. .halt_reg = 0x8048,
  845. .halt_check = BRANCH_HALT,
  846. .clkr = {
  847. .enable_reg = 0x8048,
  848. .enable_mask = BIT(0),
  849. .hw.init = &(const struct clk_init_data) {
  850. .name = "disp_cc_mdss_dptx0_link_intf_clk",
  851. .parent_hws = (const struct clk_hw*[]) {
  852. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  853. },
  854. .num_parents = 1,
  855. .flags = CLK_SET_RATE_PARENT,
  856. .ops = &clk_branch2_ops,
  857. },
  858. },
  859. };
  860. static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
  861. .halt_reg = 0x8050,
  862. .halt_check = BRANCH_HALT,
  863. .clkr = {
  864. .enable_reg = 0x8050,
  865. .enable_mask = BIT(0),
  866. .hw.init = &(const struct clk_init_data) {
  867. .name = "disp_cc_mdss_dptx0_pixel0_clk",
  868. .parent_hws = (const struct clk_hw*[]) {
  869. &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
  870. },
  871. .num_parents = 1,
  872. .flags = CLK_SET_RATE_PARENT,
  873. .ops = &clk_branch2_ops,
  874. },
  875. },
  876. };
  877. static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
  878. .halt_reg = 0x8054,
  879. .halt_check = BRANCH_HALT,
  880. .clkr = {
  881. .enable_reg = 0x8054,
  882. .enable_mask = BIT(0),
  883. .hw.init = &(const struct clk_init_data) {
  884. .name = "disp_cc_mdss_dptx0_pixel1_clk",
  885. .parent_hws = (const struct clk_hw*[]) {
  886. &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
  887. },
  888. .num_parents = 1,
  889. .flags = CLK_SET_RATE_PARENT,
  890. .ops = &clk_branch2_ops,
  891. },
  892. },
  893. };
  894. static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
  895. .halt_reg = 0x8044,
  896. .halt_check = BRANCH_HALT,
  897. .clkr = {
  898. .enable_reg = 0x8044,
  899. .enable_mask = BIT(0),
  900. .hw.init = &(const struct clk_init_data) {
  901. .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  902. .parent_hws = (const struct clk_hw*[]) {
  903. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  904. },
  905. .num_parents = 1,
  906. .flags = CLK_SET_RATE_PARENT,
  907. .ops = &clk_branch2_ops,
  908. },
  909. },
  910. };
  911. static struct clk_branch disp_cc_mdss_dptx1_aux_clk = {
  912. .halt_reg = 0x8074,
  913. .halt_check = BRANCH_HALT,
  914. .clkr = {
  915. .enable_reg = 0x8074,
  916. .enable_mask = BIT(0),
  917. .hw.init = &(const struct clk_init_data) {
  918. .name = "disp_cc_mdss_dptx1_aux_clk",
  919. .parent_hws = (const struct clk_hw*[]) {
  920. &disp_cc_mdss_dptx1_aux_clk_src.clkr.hw,
  921. },
  922. .num_parents = 1,
  923. .flags = CLK_SET_RATE_PARENT,
  924. .ops = &clk_branch2_ops,
  925. },
  926. },
  927. };
  928. static struct clk_branch disp_cc_mdss_dptx1_link_clk = {
  929. .halt_reg = 0x8064,
  930. .halt_check = BRANCH_HALT,
  931. .clkr = {
  932. .enable_reg = 0x8064,
  933. .enable_mask = BIT(0),
  934. .hw.init = &(const struct clk_init_data) {
  935. .name = "disp_cc_mdss_dptx1_link_clk",
  936. .parent_hws = (const struct clk_hw*[]) {
  937. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  938. },
  939. .num_parents = 1,
  940. .flags = CLK_SET_RATE_PARENT,
  941. .ops = &clk_branch2_ops,
  942. },
  943. },
  944. };
  945. static struct clk_branch disp_cc_mdss_dptx1_link_intf_clk = {
  946. .halt_reg = 0x806c,
  947. .halt_check = BRANCH_HALT,
  948. .clkr = {
  949. .enable_reg = 0x806c,
  950. .enable_mask = BIT(0),
  951. .hw.init = &(const struct clk_init_data) {
  952. .name = "disp_cc_mdss_dptx1_link_intf_clk",
  953. .parent_hws = (const struct clk_hw*[]) {
  954. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  955. },
  956. .num_parents = 1,
  957. .flags = CLK_SET_RATE_PARENT,
  958. .ops = &clk_branch2_ops,
  959. },
  960. },
  961. };
  962. static struct clk_branch disp_cc_mdss_dptx1_pixel0_clk = {
  963. .halt_reg = 0x805c,
  964. .halt_check = BRANCH_HALT,
  965. .clkr = {
  966. .enable_reg = 0x805c,
  967. .enable_mask = BIT(0),
  968. .hw.init = &(const struct clk_init_data) {
  969. .name = "disp_cc_mdss_dptx1_pixel0_clk",
  970. .parent_hws = (const struct clk_hw*[]) {
  971. &disp_cc_mdss_dptx1_pixel0_clk_src.clkr.hw,
  972. },
  973. .num_parents = 1,
  974. .flags = CLK_SET_RATE_PARENT,
  975. .ops = &clk_branch2_ops,
  976. },
  977. },
  978. };
  979. static struct clk_branch disp_cc_mdss_dptx1_pixel1_clk = {
  980. .halt_reg = 0x8060,
  981. .halt_check = BRANCH_HALT,
  982. .clkr = {
  983. .enable_reg = 0x8060,
  984. .enable_mask = BIT(0),
  985. .hw.init = &(const struct clk_init_data) {
  986. .name = "disp_cc_mdss_dptx1_pixel1_clk",
  987. .parent_hws = (const struct clk_hw*[]) {
  988. &disp_cc_mdss_dptx1_pixel1_clk_src.clkr.hw,
  989. },
  990. .num_parents = 1,
  991. .flags = CLK_SET_RATE_PARENT,
  992. .ops = &clk_branch2_ops,
  993. },
  994. },
  995. };
  996. static struct clk_branch disp_cc_mdss_dptx1_usb_router_link_intf_clk = {
  997. .halt_reg = 0x8068,
  998. .halt_check = BRANCH_HALT,
  999. .clkr = {
  1000. .enable_reg = 0x8068,
  1001. .enable_mask = BIT(0),
  1002. .hw.init = &(const struct clk_init_data) {
  1003. .name = "disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  1004. .parent_hws = (const struct clk_hw*[]) {
  1005. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1006. },
  1007. .num_parents = 1,
  1008. .flags = CLK_SET_RATE_PARENT,
  1009. .ops = &clk_branch2_ops,
  1010. },
  1011. },
  1012. };
  1013. static struct clk_branch disp_cc_mdss_dptx2_aux_clk = {
  1014. .halt_reg = 0x8090,
  1015. .halt_check = BRANCH_HALT,
  1016. .clkr = {
  1017. .enable_reg = 0x8090,
  1018. .enable_mask = BIT(0),
  1019. .hw.init = &(const struct clk_init_data) {
  1020. .name = "disp_cc_mdss_dptx2_aux_clk",
  1021. .parent_hws = (const struct clk_hw*[]) {
  1022. &disp_cc_mdss_dptx2_aux_clk_src.clkr.hw,
  1023. },
  1024. .num_parents = 1,
  1025. .flags = CLK_SET_RATE_PARENT,
  1026. .ops = &clk_branch2_ops,
  1027. },
  1028. },
  1029. };
  1030. static struct clk_branch disp_cc_mdss_dptx2_link_clk = {
  1031. .halt_reg = 0x8080,
  1032. .halt_check = BRANCH_HALT,
  1033. .clkr = {
  1034. .enable_reg = 0x8080,
  1035. .enable_mask = BIT(0),
  1036. .hw.init = &(const struct clk_init_data) {
  1037. .name = "disp_cc_mdss_dptx2_link_clk",
  1038. .parent_hws = (const struct clk_hw*[]) {
  1039. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  1040. },
  1041. .num_parents = 1,
  1042. .flags = CLK_SET_RATE_PARENT,
  1043. .ops = &clk_branch2_ops,
  1044. },
  1045. },
  1046. };
  1047. static struct clk_branch disp_cc_mdss_dptx2_link_intf_clk = {
  1048. .halt_reg = 0x8084,
  1049. .halt_check = BRANCH_HALT,
  1050. .clkr = {
  1051. .enable_reg = 0x8084,
  1052. .enable_mask = BIT(0),
  1053. .hw.init = &(const struct clk_init_data) {
  1054. .name = "disp_cc_mdss_dptx2_link_intf_clk",
  1055. .parent_hws = (const struct clk_hw*[]) {
  1056. &disp_cc_mdss_dptx2_link_div_clk_src.clkr.hw,
  1057. },
  1058. .num_parents = 1,
  1059. .flags = CLK_SET_RATE_PARENT,
  1060. .ops = &clk_branch2_ops,
  1061. },
  1062. },
  1063. };
  1064. static struct clk_branch disp_cc_mdss_dptx2_pixel0_clk = {
  1065. .halt_reg = 0x8078,
  1066. .halt_check = BRANCH_HALT,
  1067. .clkr = {
  1068. .enable_reg = 0x8078,
  1069. .enable_mask = BIT(0),
  1070. .hw.init = &(const struct clk_init_data) {
  1071. .name = "disp_cc_mdss_dptx2_pixel0_clk",
  1072. .parent_hws = (const struct clk_hw*[]) {
  1073. &disp_cc_mdss_dptx2_pixel0_clk_src.clkr.hw,
  1074. },
  1075. .num_parents = 1,
  1076. .flags = CLK_SET_RATE_PARENT,
  1077. .ops = &clk_branch2_ops,
  1078. },
  1079. },
  1080. };
  1081. static struct clk_branch disp_cc_mdss_dptx2_pixel1_clk = {
  1082. .halt_reg = 0x807c,
  1083. .halt_check = BRANCH_HALT,
  1084. .clkr = {
  1085. .enable_reg = 0x807c,
  1086. .enable_mask = BIT(0),
  1087. .hw.init = &(const struct clk_init_data) {
  1088. .name = "disp_cc_mdss_dptx2_pixel1_clk",
  1089. .parent_hws = (const struct clk_hw*[]) {
  1090. &disp_cc_mdss_dptx2_pixel1_clk_src.clkr.hw,
  1091. },
  1092. .num_parents = 1,
  1093. .flags = CLK_SET_RATE_PARENT,
  1094. .ops = &clk_branch2_ops,
  1095. },
  1096. },
  1097. };
  1098. static struct clk_branch disp_cc_mdss_dptx2_usb_router_link_intf_clk = {
  1099. .halt_reg = 0x8088,
  1100. .halt_check = BRANCH_HALT,
  1101. .clkr = {
  1102. .enable_reg = 0x8088,
  1103. .enable_mask = BIT(0),
  1104. .hw.init = &(const struct clk_init_data) {
  1105. .name = "disp_cc_mdss_dptx2_usb_router_link_intf_clk",
  1106. .parent_hws = (const struct clk_hw*[]) {
  1107. &disp_cc_mdss_dptx2_link_div_clk_src.clkr.hw,
  1108. },
  1109. .num_parents = 1,
  1110. .flags = CLK_SET_RATE_PARENT,
  1111. .ops = &clk_branch2_ops,
  1112. },
  1113. },
  1114. };
  1115. static struct clk_branch disp_cc_mdss_dptx3_aux_clk = {
  1116. .halt_reg = 0x80a0,
  1117. .halt_check = BRANCH_HALT,
  1118. .clkr = {
  1119. .enable_reg = 0x80a0,
  1120. .enable_mask = BIT(0),
  1121. .hw.init = &(const struct clk_init_data) {
  1122. .name = "disp_cc_mdss_dptx3_aux_clk",
  1123. .parent_hws = (const struct clk_hw*[]) {
  1124. &disp_cc_mdss_dptx3_aux_clk_src.clkr.hw,
  1125. },
  1126. .num_parents = 1,
  1127. .flags = CLK_SET_RATE_PARENT,
  1128. .ops = &clk_branch2_ops,
  1129. },
  1130. },
  1131. };
  1132. static struct clk_branch disp_cc_mdss_dptx3_link_clk = {
  1133. .halt_reg = 0x8098,
  1134. .halt_check = BRANCH_HALT,
  1135. .clkr = {
  1136. .enable_reg = 0x8098,
  1137. .enable_mask = BIT(0),
  1138. .hw.init = &(const struct clk_init_data) {
  1139. .name = "disp_cc_mdss_dptx3_link_clk",
  1140. .parent_hws = (const struct clk_hw*[]) {
  1141. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  1142. },
  1143. .num_parents = 1,
  1144. .flags = CLK_SET_RATE_PARENT,
  1145. .ops = &clk_branch2_ops,
  1146. },
  1147. },
  1148. };
  1149. static struct clk_branch disp_cc_mdss_dptx3_link_intf_clk = {
  1150. .halt_reg = 0x809c,
  1151. .halt_check = BRANCH_HALT,
  1152. .clkr = {
  1153. .enable_reg = 0x809c,
  1154. .enable_mask = BIT(0),
  1155. .hw.init = &(const struct clk_init_data) {
  1156. .name = "disp_cc_mdss_dptx3_link_intf_clk",
  1157. .parent_hws = (const struct clk_hw*[]) {
  1158. &disp_cc_mdss_dptx3_link_div_clk_src.clkr.hw,
  1159. },
  1160. .num_parents = 1,
  1161. .flags = CLK_SET_RATE_PARENT,
  1162. .ops = &clk_branch2_ops,
  1163. },
  1164. },
  1165. };
  1166. static struct clk_branch disp_cc_mdss_dptx3_pixel0_clk = {
  1167. .halt_reg = 0x8094,
  1168. .halt_check = BRANCH_HALT,
  1169. .clkr = {
  1170. .enable_reg = 0x8094,
  1171. .enable_mask = BIT(0),
  1172. .hw.init = &(const struct clk_init_data) {
  1173. .name = "disp_cc_mdss_dptx3_pixel0_clk",
  1174. .parent_hws = (const struct clk_hw*[]) {
  1175. &disp_cc_mdss_dptx3_pixel0_clk_src.clkr.hw,
  1176. },
  1177. .num_parents = 1,
  1178. .flags = CLK_SET_RATE_PARENT,
  1179. .ops = &clk_branch2_ops,
  1180. },
  1181. },
  1182. };
  1183. static struct clk_branch disp_cc_mdss_esc0_clk = {
  1184. .halt_reg = 0x8038,
  1185. .halt_check = BRANCH_HALT,
  1186. .clkr = {
  1187. .enable_reg = 0x8038,
  1188. .enable_mask = BIT(0),
  1189. .hw.init = &(const struct clk_init_data) {
  1190. .name = "disp_cc_mdss_esc0_clk",
  1191. .parent_hws = (const struct clk_hw*[]) {
  1192. &disp_cc_mdss_esc0_clk_src.clkr.hw,
  1193. },
  1194. .num_parents = 1,
  1195. .flags = CLK_SET_RATE_PARENT,
  1196. .ops = &clk_branch2_ops,
  1197. },
  1198. },
  1199. };
  1200. static struct clk_branch disp_cc_mdss_esc1_clk = {
  1201. .halt_reg = 0x803c,
  1202. .halt_check = BRANCH_HALT,
  1203. .clkr = {
  1204. .enable_reg = 0x803c,
  1205. .enable_mask = BIT(0),
  1206. .hw.init = &(const struct clk_init_data) {
  1207. .name = "disp_cc_mdss_esc1_clk",
  1208. .parent_hws = (const struct clk_hw*[]) {
  1209. &disp_cc_mdss_esc1_clk_src.clkr.hw,
  1210. },
  1211. .num_parents = 1,
  1212. .flags = CLK_SET_RATE_PARENT,
  1213. .ops = &clk_branch2_ops,
  1214. },
  1215. },
  1216. };
  1217. static struct clk_branch disp_cc_mdss_mdp1_clk = {
  1218. .halt_reg = 0xa004,
  1219. .halt_check = BRANCH_HALT,
  1220. .clkr = {
  1221. .enable_reg = 0xa004,
  1222. .enable_mask = BIT(0),
  1223. .hw.init = &(const struct clk_init_data) {
  1224. .name = "disp_cc_mdss_mdp1_clk",
  1225. .parent_hws = (const struct clk_hw*[]) {
  1226. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1227. },
  1228. .num_parents = 1,
  1229. .flags = CLK_SET_RATE_PARENT,
  1230. .ops = &clk_branch2_ops,
  1231. },
  1232. },
  1233. };
  1234. static struct clk_branch disp_cc_mdss_mdp_clk = {
  1235. .halt_reg = 0x800c,
  1236. .halt_check = BRANCH_HALT,
  1237. .clkr = {
  1238. .enable_reg = 0x800c,
  1239. .enable_mask = BIT(0),
  1240. .hw.init = &(const struct clk_init_data) {
  1241. .name = "disp_cc_mdss_mdp_clk",
  1242. .parent_hws = (const struct clk_hw*[]) {
  1243. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1244. },
  1245. .num_parents = 1,
  1246. .flags = CLK_SET_RATE_PARENT,
  1247. .ops = &clk_branch2_ops,
  1248. },
  1249. },
  1250. };
  1251. static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
  1252. .halt_reg = 0xa010,
  1253. .halt_check = BRANCH_HALT,
  1254. .clkr = {
  1255. .enable_reg = 0xa010,
  1256. .enable_mask = BIT(0),
  1257. .hw.init = &(const struct clk_init_data) {
  1258. .name = "disp_cc_mdss_mdp_lut1_clk",
  1259. .parent_hws = (const struct clk_hw*[]) {
  1260. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1261. },
  1262. .num_parents = 1,
  1263. .flags = CLK_SET_RATE_PARENT,
  1264. .ops = &clk_branch2_ops,
  1265. },
  1266. },
  1267. };
  1268. static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
  1269. .halt_reg = 0x8018,
  1270. .halt_check = BRANCH_HALT_VOTED,
  1271. .clkr = {
  1272. .enable_reg = 0x8018,
  1273. .enable_mask = BIT(0),
  1274. .hw.init = &(const struct clk_init_data) {
  1275. .name = "disp_cc_mdss_mdp_lut_clk",
  1276. .parent_hws = (const struct clk_hw*[]) {
  1277. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1278. },
  1279. .num_parents = 1,
  1280. .flags = CLK_SET_RATE_PARENT,
  1281. .ops = &clk_branch2_ops,
  1282. },
  1283. },
  1284. };
  1285. static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
  1286. .halt_reg = 0xc004,
  1287. .halt_check = BRANCH_HALT_VOTED,
  1288. .clkr = {
  1289. .enable_reg = 0xc004,
  1290. .enable_mask = BIT(0),
  1291. .hw.init = &(const struct clk_init_data) {
  1292. .name = "disp_cc_mdss_non_gdsc_ahb_clk",
  1293. .parent_hws = (const struct clk_hw*[]) {
  1294. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1295. },
  1296. .num_parents = 1,
  1297. .flags = CLK_SET_RATE_PARENT,
  1298. .ops = &clk_branch2_ops,
  1299. },
  1300. },
  1301. };
  1302. static struct clk_branch disp_cc_mdss_pclk0_clk = {
  1303. .halt_reg = 0x8004,
  1304. .halt_check = BRANCH_HALT,
  1305. .clkr = {
  1306. .enable_reg = 0x8004,
  1307. .enable_mask = BIT(0),
  1308. .hw.init = &(const struct clk_init_data) {
  1309. .name = "disp_cc_mdss_pclk0_clk",
  1310. .parent_hws = (const struct clk_hw*[]) {
  1311. &disp_cc_mdss_pclk0_clk_src.clkr.hw,
  1312. },
  1313. .num_parents = 1,
  1314. .flags = CLK_SET_RATE_PARENT,
  1315. .ops = &clk_branch2_ops,
  1316. },
  1317. },
  1318. };
  1319. static struct clk_branch disp_cc_mdss_pclk1_clk = {
  1320. .halt_reg = 0x8008,
  1321. .halt_check = BRANCH_HALT,
  1322. .clkr = {
  1323. .enable_reg = 0x8008,
  1324. .enable_mask = BIT(0),
  1325. .hw.init = &(const struct clk_init_data) {
  1326. .name = "disp_cc_mdss_pclk1_clk",
  1327. .parent_hws = (const struct clk_hw*[]) {
  1328. &disp_cc_mdss_pclk1_clk_src.clkr.hw,
  1329. },
  1330. .num_parents = 1,
  1331. .flags = CLK_SET_RATE_PARENT,
  1332. .ops = &clk_branch2_ops,
  1333. },
  1334. },
  1335. };
  1336. static struct clk_branch disp_cc_mdss_rscc_ahb_clk = {
  1337. .halt_reg = 0xc00c,
  1338. .halt_check = BRANCH_HALT,
  1339. .clkr = {
  1340. .enable_reg = 0xc00c,
  1341. .enable_mask = BIT(0),
  1342. .hw.init = &(const struct clk_init_data) {
  1343. .name = "disp_cc_mdss_rscc_ahb_clk",
  1344. .parent_hws = (const struct clk_hw*[]) {
  1345. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1346. },
  1347. .num_parents = 1,
  1348. .flags = CLK_SET_RATE_PARENT,
  1349. .ops = &clk_branch2_ops,
  1350. },
  1351. },
  1352. };
  1353. static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
  1354. .halt_reg = 0xc008,
  1355. .halt_check = BRANCH_HALT,
  1356. .clkr = {
  1357. .enable_reg = 0xc008,
  1358. .enable_mask = BIT(0),
  1359. .hw.init = &(const struct clk_init_data) {
  1360. .name = "disp_cc_mdss_rscc_vsync_clk",
  1361. .parent_hws = (const struct clk_hw*[]) {
  1362. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1363. },
  1364. .num_parents = 1,
  1365. .flags = CLK_SET_RATE_PARENT,
  1366. .ops = &clk_branch2_ops,
  1367. },
  1368. },
  1369. };
  1370. static struct clk_branch disp_cc_mdss_vsync1_clk = {
  1371. .halt_reg = 0xa01c,
  1372. .halt_check = BRANCH_HALT,
  1373. .clkr = {
  1374. .enable_reg = 0xa01c,
  1375. .enable_mask = BIT(0),
  1376. .hw.init = &(const struct clk_init_data) {
  1377. .name = "disp_cc_mdss_vsync1_clk",
  1378. .parent_hws = (const struct clk_hw*[]) {
  1379. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1380. },
  1381. .num_parents = 1,
  1382. .flags = CLK_SET_RATE_PARENT,
  1383. .ops = &clk_branch2_ops,
  1384. },
  1385. },
  1386. };
  1387. static struct clk_branch disp_cc_mdss_vsync_clk = {
  1388. .halt_reg = 0x8024,
  1389. .halt_check = BRANCH_HALT,
  1390. .clkr = {
  1391. .enable_reg = 0x8024,
  1392. .enable_mask = BIT(0),
  1393. .hw.init = &(const struct clk_init_data) {
  1394. .name = "disp_cc_mdss_vsync_clk",
  1395. .parent_hws = (const struct clk_hw*[]) {
  1396. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1397. },
  1398. .num_parents = 1,
  1399. .flags = CLK_SET_RATE_PARENT,
  1400. .ops = &clk_branch2_ops,
  1401. },
  1402. },
  1403. };
  1404. static struct gdsc mdss_gdsc = {
  1405. .gdscr = 0x9000,
  1406. .en_rest_wait_val = 0x2,
  1407. .en_few_wait_val = 0x2,
  1408. .clk_dis_wait_val = 0xf,
  1409. .pd = {
  1410. .name = "mdss_gdsc",
  1411. },
  1412. .pwrsts = PWRSTS_OFF_ON,
  1413. .flags = HW_CTRL | RETAIN_FF_ENABLE,
  1414. };
  1415. static struct gdsc mdss_int2_gdsc = {
  1416. .gdscr = 0xb000,
  1417. .en_rest_wait_val = 0x2,
  1418. .en_few_wait_val = 0x2,
  1419. .clk_dis_wait_val = 0xf,
  1420. .pd = {
  1421. .name = "mdss_int2_gdsc",
  1422. },
  1423. .pwrsts = PWRSTS_OFF_ON,
  1424. .flags = HW_CTRL | RETAIN_FF_ENABLE,
  1425. };
  1426. static struct clk_regmap *disp_cc_x1e80100_clocks[] = {
  1427. [DISP_CC_MDSS_ACCU_CLK] = &disp_cc_mdss_accu_clk.clkr,
  1428. [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
  1429. [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
  1430. [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
  1431. [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
  1432. [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
  1433. [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
  1434. [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
  1435. [DISP_CC_MDSS_BYTE1_CLK] = &disp_cc_mdss_byte1_clk.clkr,
  1436. [DISP_CC_MDSS_BYTE1_CLK_SRC] = &disp_cc_mdss_byte1_clk_src.clkr,
  1437. [DISP_CC_MDSS_BYTE1_DIV_CLK_SRC] = &disp_cc_mdss_byte1_div_clk_src.clkr,
  1438. [DISP_CC_MDSS_BYTE1_INTF_CLK] = &disp_cc_mdss_byte1_intf_clk.clkr,
  1439. [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
  1440. [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
  1441. [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
  1442. [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
  1443. [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
  1444. [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
  1445. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
  1446. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
  1447. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
  1448. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
  1449. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
  1450. &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
  1451. [DISP_CC_MDSS_DPTX1_AUX_CLK] = &disp_cc_mdss_dptx1_aux_clk.clkr,
  1452. [DISP_CC_MDSS_DPTX1_AUX_CLK_SRC] = &disp_cc_mdss_dptx1_aux_clk_src.clkr,
  1453. [DISP_CC_MDSS_DPTX1_LINK_CLK] = &disp_cc_mdss_dptx1_link_clk.clkr,
  1454. [DISP_CC_MDSS_DPTX1_LINK_CLK_SRC] = &disp_cc_mdss_dptx1_link_clk_src.clkr,
  1455. [DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx1_link_div_clk_src.clkr,
  1456. [DISP_CC_MDSS_DPTX1_LINK_INTF_CLK] = &disp_cc_mdss_dptx1_link_intf_clk.clkr,
  1457. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK] = &disp_cc_mdss_dptx1_pixel0_clk.clkr,
  1458. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx1_pixel0_clk_src.clkr,
  1459. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK] = &disp_cc_mdss_dptx1_pixel1_clk.clkr,
  1460. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx1_pixel1_clk_src.clkr,
  1461. [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK] =
  1462. &disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr,
  1463. [DISP_CC_MDSS_DPTX2_AUX_CLK] = &disp_cc_mdss_dptx2_aux_clk.clkr,
  1464. [DISP_CC_MDSS_DPTX2_AUX_CLK_SRC] = &disp_cc_mdss_dptx2_aux_clk_src.clkr,
  1465. [DISP_CC_MDSS_DPTX2_LINK_CLK] = &disp_cc_mdss_dptx2_link_clk.clkr,
  1466. [DISP_CC_MDSS_DPTX2_LINK_CLK_SRC] = &disp_cc_mdss_dptx2_link_clk_src.clkr,
  1467. [DISP_CC_MDSS_DPTX2_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx2_link_div_clk_src.clkr,
  1468. [DISP_CC_MDSS_DPTX2_LINK_INTF_CLK] = &disp_cc_mdss_dptx2_link_intf_clk.clkr,
  1469. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK] = &disp_cc_mdss_dptx2_pixel0_clk.clkr,
  1470. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx2_pixel0_clk_src.clkr,
  1471. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK] = &disp_cc_mdss_dptx2_pixel1_clk.clkr,
  1472. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx2_pixel1_clk_src.clkr,
  1473. [DISP_CC_MDSS_DPTX2_USB_ROUTER_LINK_INTF_CLK] =
  1474. &disp_cc_mdss_dptx2_usb_router_link_intf_clk.clkr,
  1475. [DISP_CC_MDSS_DPTX3_AUX_CLK] = &disp_cc_mdss_dptx3_aux_clk.clkr,
  1476. [DISP_CC_MDSS_DPTX3_AUX_CLK_SRC] = &disp_cc_mdss_dptx3_aux_clk_src.clkr,
  1477. [DISP_CC_MDSS_DPTX3_LINK_CLK] = &disp_cc_mdss_dptx3_link_clk.clkr,
  1478. [DISP_CC_MDSS_DPTX3_LINK_CLK_SRC] = &disp_cc_mdss_dptx3_link_clk_src.clkr,
  1479. [DISP_CC_MDSS_DPTX3_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx3_link_div_clk_src.clkr,
  1480. [DISP_CC_MDSS_DPTX3_LINK_INTF_CLK] = &disp_cc_mdss_dptx3_link_intf_clk.clkr,
  1481. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK] = &disp_cc_mdss_dptx3_pixel0_clk.clkr,
  1482. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx3_pixel0_clk_src.clkr,
  1483. [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
  1484. [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
  1485. [DISP_CC_MDSS_ESC1_CLK] = &disp_cc_mdss_esc1_clk.clkr,
  1486. [DISP_CC_MDSS_ESC1_CLK_SRC] = &disp_cc_mdss_esc1_clk_src.clkr,
  1487. [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
  1488. [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
  1489. [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
  1490. [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
  1491. [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
  1492. [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
  1493. [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
  1494. [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
  1495. [DISP_CC_MDSS_PCLK1_CLK] = &disp_cc_mdss_pclk1_clk.clkr,
  1496. [DISP_CC_MDSS_PCLK1_CLK_SRC] = &disp_cc_mdss_pclk1_clk_src.clkr,
  1497. [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr,
  1498. [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
  1499. [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
  1500. [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
  1501. [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
  1502. [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
  1503. [DISP_CC_PLL1] = &disp_cc_pll1.clkr,
  1504. [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr,
  1505. [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr,
  1506. };
  1507. static const struct qcom_reset_map disp_cc_x1e80100_resets[] = {
  1508. [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
  1509. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK_ARES] = { .reg = 0x8044, .bit = 2 },
  1510. [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK_ARES] = { .reg = 0x8068, .bit = 2 },
  1511. [DISP_CC_MDSS_DPTX2_USB_ROUTER_LINK_INTF_CLK_ARES] = { .reg = 0x8088, .bit = 2 },
  1512. [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
  1513. [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
  1514. };
  1515. static struct gdsc *disp_cc_x1e80100_gdscs[] = {
  1516. [MDSS_GDSC] = &mdss_gdsc,
  1517. [MDSS_INT2_GDSC] = &mdss_int2_gdsc,
  1518. };
  1519. static const struct regmap_config disp_cc_x1e80100_regmap_config = {
  1520. .reg_bits = 32,
  1521. .reg_stride = 4,
  1522. .val_bits = 32,
  1523. .max_register = 0x11008,
  1524. .fast_io = true,
  1525. };
  1526. static const struct qcom_cc_desc disp_cc_x1e80100_desc = {
  1527. .config = &disp_cc_x1e80100_regmap_config,
  1528. .clks = disp_cc_x1e80100_clocks,
  1529. .num_clks = ARRAY_SIZE(disp_cc_x1e80100_clocks),
  1530. .resets = disp_cc_x1e80100_resets,
  1531. .num_resets = ARRAY_SIZE(disp_cc_x1e80100_resets),
  1532. .gdscs = disp_cc_x1e80100_gdscs,
  1533. .num_gdscs = ARRAY_SIZE(disp_cc_x1e80100_gdscs),
  1534. };
  1535. static const struct of_device_id disp_cc_x1e80100_match_table[] = {
  1536. { .compatible = "qcom,x1e80100-dispcc" },
  1537. { }
  1538. };
  1539. MODULE_DEVICE_TABLE(of, disp_cc_x1e80100_match_table);
  1540. static int disp_cc_x1e80100_probe(struct platform_device *pdev)
  1541. {
  1542. struct regmap *regmap;
  1543. int ret;
  1544. ret = devm_pm_runtime_enable(&pdev->dev);
  1545. if (ret)
  1546. return ret;
  1547. ret = pm_runtime_resume_and_get(&pdev->dev);
  1548. if (ret)
  1549. return ret;
  1550. regmap = qcom_cc_map(pdev, &disp_cc_x1e80100_desc);
  1551. if (IS_ERR(regmap)) {
  1552. ret = PTR_ERR(regmap);
  1553. goto err_put_rpm;
  1554. }
  1555. clk_lucid_evo_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
  1556. clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
  1557. /* Enable clock gating for MDP clocks */
  1558. regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
  1559. /* Keep clocks always enabled */
  1560. qcom_branch_set_clk_en(regmap, 0xe074); /* DISP_CC_SLEEP_CLK */
  1561. qcom_branch_set_clk_en(regmap, 0xe054); /* DISP_CC_XO_CLK */
  1562. ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_x1e80100_desc, regmap);
  1563. if (ret)
  1564. goto err_put_rpm;
  1565. pm_runtime_put(&pdev->dev);
  1566. return 0;
  1567. err_put_rpm:
  1568. pm_runtime_put_sync(&pdev->dev);
  1569. return ret;
  1570. }
  1571. static struct platform_driver disp_cc_x1e80100_driver = {
  1572. .probe = disp_cc_x1e80100_probe,
  1573. .driver = {
  1574. .name = "dispcc-x1e80100",
  1575. .of_match_table = disp_cc_x1e80100_match_table,
  1576. },
  1577. };
  1578. static int __init disp_cc_x1e80100_init(void)
  1579. {
  1580. return platform_driver_register(&disp_cc_x1e80100_driver);
  1581. }
  1582. subsys_initcall(disp_cc_x1e80100_init);
  1583. static void __exit disp_cc_x1e80100_exit(void)
  1584. {
  1585. platform_driver_unregister(&disp_cc_x1e80100_driver);
  1586. }
  1587. module_exit(disp_cc_x1e80100_exit);
  1588. MODULE_DESCRIPTION("QTI Display Clock Controller X1E80100 Driver");
  1589. MODULE_LICENSE("GPL");