dispcc-sm8750.c 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023-2024, Linaro Ltd.
  5. */
  6. #include <linux/clk-provider.h>
  7. #include <linux/err.h>
  8. #include <linux/kernel.h>
  9. #include <linux/mod_devicetable.h>
  10. #include <linux/module.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/regmap.h>
  13. #include <linux/pm_runtime.h>
  14. #include <dt-bindings/clock/qcom,sm8750-dispcc.h>
  15. #include "common.h"
  16. #include "clk-alpha-pll.h"
  17. #include "clk-branch.h"
  18. #include "clk-pll.h"
  19. #include "clk-rcg.h"
  20. #include "clk-regmap.h"
  21. #include "clk-regmap-divider.h"
  22. #include "clk-regmap-mux.h"
  23. #include "reset.h"
  24. #include "gdsc.h"
  25. /* Need to match the order of clocks in DT binding */
  26. enum {
  27. DT_BI_TCXO,
  28. DT_BI_TCXO_AO,
  29. DT_AHB_CLK,
  30. DT_SLEEP_CLK,
  31. DT_DSI0_PHY_PLL_OUT_BYTECLK,
  32. DT_DSI0_PHY_PLL_OUT_DSICLK,
  33. DT_DSI1_PHY_PLL_OUT_BYTECLK,
  34. DT_DSI1_PHY_PLL_OUT_DSICLK,
  35. DT_DP0_PHY_PLL_LINK_CLK,
  36. DT_DP0_PHY_PLL_VCO_DIV_CLK,
  37. DT_DP1_PHY_PLL_LINK_CLK,
  38. DT_DP1_PHY_PLL_VCO_DIV_CLK,
  39. DT_DP2_PHY_PLL_LINK_CLK,
  40. DT_DP2_PHY_PLL_VCO_DIV_CLK,
  41. DT_DP3_PHY_PLL_LINK_CLK,
  42. DT_DP3_PHY_PLL_VCO_DIV_CLK,
  43. };
  44. #define DISP_CC_MISC_CMD 0xF000
  45. enum {
  46. P_BI_TCXO,
  47. P_DISP_CC_PLL0_OUT_MAIN,
  48. P_DISP_CC_PLL1_OUT_EVEN,
  49. P_DISP_CC_PLL1_OUT_MAIN,
  50. P_DISP_CC_PLL2_OUT_MAIN,
  51. P_DP0_PHY_PLL_LINK_CLK,
  52. P_DP0_PHY_PLL_VCO_DIV_CLK,
  53. P_DP1_PHY_PLL_LINK_CLK,
  54. P_DP1_PHY_PLL_VCO_DIV_CLK,
  55. P_DP2_PHY_PLL_LINK_CLK,
  56. P_DP2_PHY_PLL_VCO_DIV_CLK,
  57. P_DP3_PHY_PLL_LINK_CLK,
  58. P_DP3_PHY_PLL_VCO_DIV_CLK,
  59. P_DSI0_PHY_PLL_OUT_BYTECLK,
  60. P_DSI0_PHY_PLL_OUT_DSICLK,
  61. P_DSI1_PHY_PLL_OUT_BYTECLK,
  62. P_DSI1_PHY_PLL_OUT_DSICLK,
  63. P_SLEEP_CLK,
  64. };
  65. static const struct pll_vco pongo_elu_vco[] = {
  66. { 38400000, 38400000, 0 },
  67. };
  68. static const struct pll_vco taycan_elu_vco[] = {
  69. { 249600000, 2500000000, 0 },
  70. };
  71. static struct alpha_pll_config disp_cc_pll0_config = {
  72. .l = 0xd,
  73. .alpha = 0x6492,
  74. .config_ctl_val = 0x19660387,
  75. .config_ctl_hi_val = 0x098060a0,
  76. .config_ctl_hi1_val = 0xb416cb20,
  77. .user_ctl_val = 0x00000000,
  78. .user_ctl_hi_val = 0x00000002,
  79. };
  80. static struct clk_alpha_pll disp_cc_pll0 = {
  81. .offset = 0x0,
  82. .vco_table = taycan_elu_vco,
  83. .num_vco = ARRAY_SIZE(taycan_elu_vco),
  84. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU],
  85. .clkr = {
  86. .hw.init = &(const struct clk_init_data) {
  87. .name = "disp_cc_pll0",
  88. .parent_data = &(const struct clk_parent_data) {
  89. .index = DT_BI_TCXO,
  90. },
  91. .num_parents = 1,
  92. .ops = &clk_alpha_pll_taycan_elu_ops,
  93. },
  94. },
  95. };
  96. static struct alpha_pll_config disp_cc_pll1_config = {
  97. .l = 0x1f,
  98. .alpha = 0x4000,
  99. .config_ctl_val = 0x19660387,
  100. .config_ctl_hi_val = 0x098060a0,
  101. .config_ctl_hi1_val = 0xb416cb20,
  102. .user_ctl_val = 0x00000000,
  103. .user_ctl_hi_val = 0x00000002,
  104. };
  105. static struct clk_alpha_pll disp_cc_pll1 = {
  106. .offset = 0x1000,
  107. .vco_table = taycan_elu_vco,
  108. .num_vco = ARRAY_SIZE(taycan_elu_vco),
  109. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TAYCAN_ELU],
  110. .clkr = {
  111. .hw.init = &(const struct clk_init_data) {
  112. .name = "disp_cc_pll1",
  113. .parent_data = &(const struct clk_parent_data) {
  114. .index = DT_BI_TCXO,
  115. },
  116. .num_parents = 1,
  117. .ops = &clk_alpha_pll_taycan_elu_ops,
  118. },
  119. },
  120. };
  121. static const struct alpha_pll_config disp_cc_pll2_config = {
  122. .l = 0x493,
  123. .alpha = 0x0,
  124. .config_ctl_val = 0x60000f68,
  125. .config_ctl_hi_val = 0x0001c808,
  126. .config_ctl_hi1_val = 0x00000000,
  127. .config_ctl_hi2_val = 0x040082f4,
  128. .test_ctl_val = 0x00008000,
  129. .test_ctl_hi_val = 0x0080c496,
  130. .test_ctl_hi1_val = 0x40100180,
  131. .test_ctl_hi2_val = 0x441001bc,
  132. .test_ctl_hi3_val = 0x002003d8,
  133. .user_ctl_val = 0x00000400,
  134. .user_ctl_hi_val = 0x00e50302,
  135. };
  136. static struct clk_alpha_pll disp_cc_pll2 = {
  137. .offset = 0x2000,
  138. .vco_table = pongo_elu_vco,
  139. .num_vco = ARRAY_SIZE(pongo_elu_vco),
  140. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_PONGO_ELU],
  141. .clkr = {
  142. .hw.init = &(const struct clk_init_data) {
  143. .name = "disp_cc_pll2",
  144. .parent_data = &(const struct clk_parent_data) {
  145. .index = DT_SLEEP_CLK,
  146. },
  147. .num_parents = 1,
  148. .ops = &clk_alpha_pll_pongo_elu_ops,
  149. },
  150. },
  151. };
  152. static const struct parent_map disp_cc_parent_map_0[] = {
  153. { P_BI_TCXO, 0 },
  154. };
  155. static const struct clk_parent_data disp_cc_parent_data_0[] = {
  156. { .index = DT_BI_TCXO },
  157. };
  158. static const struct clk_parent_data disp_cc_parent_data_0_ao[] = {
  159. { .index = DT_BI_TCXO_AO },
  160. };
  161. static const struct parent_map disp_cc_parent_map_1[] = {
  162. { P_BI_TCXO, 0 },
  163. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  164. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  165. { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
  166. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  167. };
  168. static const struct clk_parent_data disp_cc_parent_data_1[] = {
  169. { .index = DT_BI_TCXO },
  170. { .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
  171. { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
  172. { .index = DT_DSI1_PHY_PLL_OUT_DSICLK },
  173. { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
  174. };
  175. static const struct parent_map disp_cc_parent_map_2[] = {
  176. { P_BI_TCXO, 0 },
  177. { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
  178. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  179. { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
  180. };
  181. static const struct clk_parent_data disp_cc_parent_data_2[] = {
  182. { .index = DT_BI_TCXO },
  183. { .index = DT_DP3_PHY_PLL_VCO_DIV_CLK },
  184. { .index = DT_DP1_PHY_PLL_VCO_DIV_CLK },
  185. { .index = DT_DP2_PHY_PLL_VCO_DIV_CLK },
  186. };
  187. static const struct parent_map disp_cc_parent_map_3[] = {
  188. { P_BI_TCXO, 0 },
  189. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  190. { P_DP2_PHY_PLL_LINK_CLK, 3 },
  191. { P_DP3_PHY_PLL_LINK_CLK, 4 },
  192. };
  193. static const struct clk_parent_data disp_cc_parent_data_3[] = {
  194. { .index = DT_BI_TCXO },
  195. { .index = DT_DP1_PHY_PLL_LINK_CLK },
  196. { .index = DT_DP2_PHY_PLL_LINK_CLK },
  197. { .index = DT_DP3_PHY_PLL_LINK_CLK },
  198. };
  199. static const struct parent_map disp_cc_parent_map_4[] = {
  200. { P_BI_TCXO, 0 },
  201. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  202. { P_DISP_CC_PLL2_OUT_MAIN, 2 },
  203. { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
  204. };
  205. static const struct clk_parent_data disp_cc_parent_data_4[] = {
  206. { .index = DT_BI_TCXO },
  207. { .index = DT_DSI0_PHY_PLL_OUT_DSICLK },
  208. { .hw = &disp_cc_pll2.clkr.hw },
  209. { .index = DT_DSI1_PHY_PLL_OUT_DSICLK },
  210. };
  211. static const struct parent_map disp_cc_parent_map_5[] = {
  212. { P_BI_TCXO, 0 },
  213. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  214. { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
  215. { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
  216. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  217. { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
  218. };
  219. static const struct clk_parent_data disp_cc_parent_data_5[] = {
  220. { .index = DT_BI_TCXO },
  221. { .index = DT_DP0_PHY_PLL_LINK_CLK },
  222. { .index = DT_DP0_PHY_PLL_VCO_DIV_CLK },
  223. { .index = DT_DP3_PHY_PLL_VCO_DIV_CLK },
  224. { .index = DT_DP1_PHY_PLL_VCO_DIV_CLK },
  225. { .index = DT_DP2_PHY_PLL_VCO_DIV_CLK },
  226. };
  227. static const struct parent_map disp_cc_parent_map_6[] = {
  228. { P_BI_TCXO, 0 },
  229. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  230. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  231. };
  232. static const struct clk_parent_data disp_cc_parent_data_6[] = {
  233. { .index = DT_BI_TCXO },
  234. { .index = DT_DSI0_PHY_PLL_OUT_BYTECLK },
  235. { .index = DT_DSI1_PHY_PLL_OUT_BYTECLK },
  236. };
  237. static const struct parent_map disp_cc_parent_map_7[] = {
  238. { P_BI_TCXO, 0 },
  239. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  240. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  241. };
  242. static const struct clk_parent_data disp_cc_parent_data_7[] = {
  243. { .index = DT_BI_TCXO },
  244. { .hw = &disp_cc_pll1.clkr.hw },
  245. { .hw = &disp_cc_pll1.clkr.hw },
  246. };
  247. static const struct parent_map disp_cc_parent_map_8[] = {
  248. { P_BI_TCXO, 0 },
  249. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  250. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  251. { P_DP2_PHY_PLL_LINK_CLK, 3 },
  252. { P_DP3_PHY_PLL_LINK_CLK, 4 },
  253. };
  254. static const struct clk_parent_data disp_cc_parent_data_8[] = {
  255. { .index = DT_BI_TCXO },
  256. { .index = DT_DP0_PHY_PLL_LINK_CLK },
  257. { .index = DT_DP1_PHY_PLL_LINK_CLK },
  258. { .index = DT_DP2_PHY_PLL_LINK_CLK },
  259. { .index = DT_DP3_PHY_PLL_LINK_CLK },
  260. };
  261. static const struct parent_map disp_cc_parent_map_9[] = {
  262. { P_BI_TCXO, 0 },
  263. { P_DISP_CC_PLL0_OUT_MAIN, 1 },
  264. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  265. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  266. };
  267. static const struct clk_parent_data disp_cc_parent_data_9[] = {
  268. { .index = DT_BI_TCXO },
  269. { .hw = &disp_cc_pll0.clkr.hw },
  270. { .hw = &disp_cc_pll1.clkr.hw },
  271. { .hw = &disp_cc_pll1.clkr.hw },
  272. };
  273. static const struct parent_map disp_cc_parent_map_10[] = {
  274. { P_BI_TCXO, 0 },
  275. { P_DISP_CC_PLL2_OUT_MAIN, 2 },
  276. };
  277. static const struct clk_parent_data disp_cc_parent_data_10[] = {
  278. { .index = DT_BI_TCXO },
  279. { .hw = &disp_cc_pll2.clkr.hw },
  280. };
  281. static const struct parent_map disp_cc_parent_map_11[] = {
  282. { P_SLEEP_CLK, 0 },
  283. };
  284. static const struct clk_parent_data disp_cc_parent_data_11[] = {
  285. { .index = DT_SLEEP_CLK },
  286. };
  287. static const struct freq_tbl ftbl_disp_cc_esync0_clk_src[] = {
  288. F(19200000, P_BI_TCXO, 1, 0, 0),
  289. { }
  290. };
  291. static struct clk_rcg2 disp_cc_esync0_clk_src = {
  292. .cmd_rcgr = 0x80c0,
  293. .mnd_width = 16,
  294. .hid_width = 5,
  295. .parent_map = disp_cc_parent_map_4,
  296. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  297. .clkr.hw.init = &(const struct clk_init_data) {
  298. .name = "disp_cc_esync0_clk_src",
  299. .parent_data = disp_cc_parent_data_4,
  300. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  301. .flags = CLK_SET_RATE_PARENT,
  302. .ops = &clk_byte2_ops,
  303. },
  304. };
  305. static struct clk_rcg2 disp_cc_esync1_clk_src = {
  306. .cmd_rcgr = 0x80d8,
  307. .mnd_width = 16,
  308. .hid_width = 5,
  309. .parent_map = disp_cc_parent_map_4,
  310. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  311. .clkr.hw.init = &(const struct clk_init_data) {
  312. .name = "disp_cc_esync1_clk_src",
  313. .parent_data = disp_cc_parent_data_4,
  314. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  315. .flags = CLK_SET_RATE_PARENT,
  316. .ops = &clk_byte2_ops,
  317. },
  318. };
  319. static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
  320. F(19200000, P_BI_TCXO, 1, 0, 0),
  321. F(37500000, P_DISP_CC_PLL1_OUT_MAIN, 16, 0, 0),
  322. F(75000000, P_DISP_CC_PLL1_OUT_MAIN, 8, 0, 0),
  323. { }
  324. };
  325. static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
  326. .cmd_rcgr = 0x8360,
  327. .mnd_width = 0,
  328. .hid_width = 5,
  329. .parent_map = disp_cc_parent_map_7,
  330. .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
  331. .clkr.hw.init = &(const struct clk_init_data) {
  332. .name = "disp_cc_mdss_ahb_clk_src",
  333. .parent_data = disp_cc_parent_data_7,
  334. .num_parents = ARRAY_SIZE(disp_cc_parent_data_7),
  335. .flags = CLK_SET_RATE_PARENT,
  336. .ops = &clk_rcg2_shared_ops,
  337. },
  338. };
  339. static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
  340. .cmd_rcgr = 0x8180,
  341. .mnd_width = 0,
  342. .hid_width = 5,
  343. .parent_map = disp_cc_parent_map_1,
  344. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  345. .clkr.hw.init = &(const struct clk_init_data) {
  346. .name = "disp_cc_mdss_byte0_clk_src",
  347. .parent_data = disp_cc_parent_data_1,
  348. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  349. .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
  350. .ops = &clk_byte2_ops,
  351. },
  352. };
  353. static struct clk_rcg2 disp_cc_mdss_byte1_clk_src = {
  354. .cmd_rcgr = 0x819c,
  355. .mnd_width = 0,
  356. .hid_width = 5,
  357. .parent_map = disp_cc_parent_map_1,
  358. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  359. .clkr.hw.init = &(const struct clk_init_data) {
  360. .name = "disp_cc_mdss_byte1_clk_src",
  361. .parent_data = disp_cc_parent_data_1,
  362. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  363. .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
  364. .ops = &clk_byte2_ops,
  365. },
  366. };
  367. static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
  368. .cmd_rcgr = 0x8234,
  369. .mnd_width = 0,
  370. .hid_width = 5,
  371. .parent_map = disp_cc_parent_map_0,
  372. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  373. .clkr.hw.init = &(const struct clk_init_data) {
  374. .name = "disp_cc_mdss_dptx0_aux_clk_src",
  375. .parent_data = disp_cc_parent_data_0,
  376. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  377. .flags = CLK_SET_RATE_PARENT,
  378. .ops = &clk_rcg2_ops,
  379. },
  380. };
  381. static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
  382. .cmd_rcgr = 0x81e8,
  383. .mnd_width = 0,
  384. .hid_width = 5,
  385. .parent_map = disp_cc_parent_map_8,
  386. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  387. .clkr.hw.init = &(const struct clk_init_data) {
  388. .name = "disp_cc_mdss_dptx0_link_clk_src",
  389. .parent_data = disp_cc_parent_data_8,
  390. .num_parents = ARRAY_SIZE(disp_cc_parent_data_8),
  391. .flags = CLK_SET_RATE_PARENT,
  392. .ops = &clk_byte2_ops,
  393. },
  394. };
  395. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
  396. .cmd_rcgr = 0x8204,
  397. .mnd_width = 16,
  398. .hid_width = 5,
  399. .parent_map = disp_cc_parent_map_5,
  400. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  401. .clkr.hw.init = &(const struct clk_init_data) {
  402. .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
  403. .parent_data = disp_cc_parent_data_5,
  404. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  405. .flags = CLK_SET_RATE_PARENT,
  406. .ops = &clk_dp_ops,
  407. },
  408. };
  409. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
  410. .cmd_rcgr = 0x821c,
  411. .mnd_width = 16,
  412. .hid_width = 5,
  413. .parent_map = disp_cc_parent_map_5,
  414. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  415. .clkr.hw.init = &(const struct clk_init_data) {
  416. .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
  417. .parent_data = disp_cc_parent_data_5,
  418. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  419. .flags = CLK_SET_RATE_PARENT,
  420. .ops = &clk_dp_ops,
  421. },
  422. };
  423. static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = {
  424. .cmd_rcgr = 0x8298,
  425. .mnd_width = 0,
  426. .hid_width = 5,
  427. .parent_map = disp_cc_parent_map_0,
  428. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  429. .clkr.hw.init = &(const struct clk_init_data) {
  430. .name = "disp_cc_mdss_dptx1_aux_clk_src",
  431. .parent_data = disp_cc_parent_data_0,
  432. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  433. .flags = CLK_SET_RATE_PARENT,
  434. .ops = &clk_rcg2_ops,
  435. },
  436. };
  437. static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = {
  438. .cmd_rcgr = 0x827c,
  439. .mnd_width = 0,
  440. .hid_width = 5,
  441. .parent_map = disp_cc_parent_map_3,
  442. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  443. .clkr.hw.init = &(const struct clk_init_data) {
  444. .name = "disp_cc_mdss_dptx1_link_clk_src",
  445. .parent_data = disp_cc_parent_data_3,
  446. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  447. .flags = CLK_SET_RATE_PARENT,
  448. .ops = &clk_byte2_ops,
  449. },
  450. };
  451. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel0_clk_src = {
  452. .cmd_rcgr = 0x824c,
  453. .mnd_width = 16,
  454. .hid_width = 5,
  455. .parent_map = disp_cc_parent_map_2,
  456. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  457. .clkr.hw.init = &(const struct clk_init_data) {
  458. .name = "disp_cc_mdss_dptx1_pixel0_clk_src",
  459. .parent_data = disp_cc_parent_data_2,
  460. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  461. .flags = CLK_SET_RATE_PARENT,
  462. .ops = &clk_dp_ops,
  463. },
  464. };
  465. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel1_clk_src = {
  466. .cmd_rcgr = 0x8264,
  467. .mnd_width = 16,
  468. .hid_width = 5,
  469. .parent_map = disp_cc_parent_map_2,
  470. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  471. .clkr.hw.init = &(const struct clk_init_data) {
  472. .name = "disp_cc_mdss_dptx1_pixel1_clk_src",
  473. .parent_data = disp_cc_parent_data_2,
  474. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  475. .flags = CLK_SET_RATE_PARENT,
  476. .ops = &clk_dp_ops,
  477. },
  478. };
  479. static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = {
  480. .cmd_rcgr = 0x82fc,
  481. .mnd_width = 0,
  482. .hid_width = 5,
  483. .parent_map = disp_cc_parent_map_0,
  484. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  485. .clkr.hw.init = &(const struct clk_init_data) {
  486. .name = "disp_cc_mdss_dptx2_aux_clk_src",
  487. .parent_data = disp_cc_parent_data_0,
  488. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  489. .flags = CLK_SET_RATE_PARENT,
  490. .ops = &clk_rcg2_ops,
  491. },
  492. };
  493. static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = {
  494. .cmd_rcgr = 0x82b0,
  495. .mnd_width = 0,
  496. .hid_width = 5,
  497. .parent_map = disp_cc_parent_map_3,
  498. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  499. .clkr.hw.init = &(const struct clk_init_data) {
  500. .name = "disp_cc_mdss_dptx2_link_clk_src",
  501. .parent_data = disp_cc_parent_data_3,
  502. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  503. .flags = CLK_SET_RATE_PARENT,
  504. .ops = &clk_byte2_ops,
  505. },
  506. };
  507. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel0_clk_src = {
  508. .cmd_rcgr = 0x82cc,
  509. .mnd_width = 16,
  510. .hid_width = 5,
  511. .parent_map = disp_cc_parent_map_2,
  512. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  513. .clkr.hw.init = &(const struct clk_init_data) {
  514. .name = "disp_cc_mdss_dptx2_pixel0_clk_src",
  515. .parent_data = disp_cc_parent_data_2,
  516. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  517. .flags = CLK_SET_RATE_PARENT,
  518. .ops = &clk_dp_ops,
  519. },
  520. };
  521. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel1_clk_src = {
  522. .cmd_rcgr = 0x82e4,
  523. .mnd_width = 16,
  524. .hid_width = 5,
  525. .parent_map = disp_cc_parent_map_2,
  526. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  527. .clkr.hw.init = &(const struct clk_init_data) {
  528. .name = "disp_cc_mdss_dptx2_pixel1_clk_src",
  529. .parent_data = disp_cc_parent_data_2,
  530. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  531. .flags = CLK_SET_RATE_PARENT,
  532. .ops = &clk_dp_ops,
  533. },
  534. };
  535. static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = {
  536. .cmd_rcgr = 0x8348,
  537. .mnd_width = 0,
  538. .hid_width = 5,
  539. .parent_map = disp_cc_parent_map_0,
  540. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  541. .clkr.hw.init = &(const struct clk_init_data) {
  542. .name = "disp_cc_mdss_dptx3_aux_clk_src",
  543. .parent_data = disp_cc_parent_data_0,
  544. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  545. .flags = CLK_SET_RATE_PARENT,
  546. .ops = &clk_rcg2_ops,
  547. },
  548. };
  549. static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = {
  550. .cmd_rcgr = 0x832c,
  551. .mnd_width = 0,
  552. .hid_width = 5,
  553. .parent_map = disp_cc_parent_map_3,
  554. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  555. .clkr.hw.init = &(const struct clk_init_data) {
  556. .name = "disp_cc_mdss_dptx3_link_clk_src",
  557. .parent_data = disp_cc_parent_data_3,
  558. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  559. .flags = CLK_SET_RATE_PARENT,
  560. .ops = &clk_byte2_ops,
  561. },
  562. };
  563. static struct clk_rcg2 disp_cc_mdss_dptx3_pixel0_clk_src = {
  564. .cmd_rcgr = 0x8314,
  565. .mnd_width = 16,
  566. .hid_width = 5,
  567. .parent_map = disp_cc_parent_map_2,
  568. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  569. .clkr.hw.init = &(const struct clk_init_data) {
  570. .name = "disp_cc_mdss_dptx3_pixel0_clk_src",
  571. .parent_data = disp_cc_parent_data_2,
  572. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  573. .flags = CLK_SET_RATE_PARENT,
  574. .ops = &clk_dp_ops,
  575. },
  576. };
  577. static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
  578. .cmd_rcgr = 0x81b8,
  579. .mnd_width = 0,
  580. .hid_width = 5,
  581. .parent_map = disp_cc_parent_map_6,
  582. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  583. .clkr.hw.init = &(const struct clk_init_data) {
  584. .name = "disp_cc_mdss_esc0_clk_src",
  585. .parent_data = disp_cc_parent_data_6,
  586. .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
  587. .flags = CLK_SET_RATE_PARENT,
  588. .ops = &clk_rcg2_shared_ops,
  589. },
  590. };
  591. static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = {
  592. .cmd_rcgr = 0x81d0,
  593. .mnd_width = 0,
  594. .hid_width = 5,
  595. .parent_map = disp_cc_parent_map_6,
  596. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  597. .clkr.hw.init = &(const struct clk_init_data) {
  598. .name = "disp_cc_mdss_esc1_clk_src",
  599. .parent_data = disp_cc_parent_data_6,
  600. .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
  601. .flags = CLK_SET_RATE_PARENT,
  602. .ops = &clk_rcg2_shared_ops,
  603. },
  604. };
  605. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
  606. F(19200000, P_BI_TCXO, 1, 0, 0),
  607. F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  608. F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  609. F(156000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  610. F(207000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  611. F(337000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  612. F(417000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  613. F(532000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  614. F(575000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  615. { }
  616. };
  617. static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
  618. .cmd_rcgr = 0x8150,
  619. .mnd_width = 0,
  620. .hid_width = 5,
  621. .parent_map = disp_cc_parent_map_9,
  622. .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
  623. .clkr.hw.init = &(const struct clk_init_data) {
  624. .name = "disp_cc_mdss_mdp_clk_src",
  625. .parent_data = disp_cc_parent_data_9,
  626. .num_parents = ARRAY_SIZE(disp_cc_parent_data_9),
  627. .flags = CLK_SET_RATE_PARENT,
  628. /*
  629. * TODO: Downstream does not manage the clock directly, but
  630. * places votes via new hardware block called "cesta".
  631. * It is not clear whether such approach should be taken instead
  632. * of manual control.
  633. */
  634. .ops = &clk_rcg2_shared_ops,
  635. },
  636. };
  637. static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
  638. .cmd_rcgr = 0x8108,
  639. .mnd_width = 8,
  640. .hid_width = 5,
  641. .parent_map = disp_cc_parent_map_1,
  642. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  643. .clkr.hw.init = &(const struct clk_init_data) {
  644. .name = "disp_cc_mdss_pclk0_clk_src",
  645. .parent_data = disp_cc_parent_data_1,
  646. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  647. .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
  648. .ops = &clk_pixel_ops,
  649. },
  650. };
  651. static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
  652. .cmd_rcgr = 0x8120,
  653. .mnd_width = 8,
  654. .hid_width = 5,
  655. .parent_map = disp_cc_parent_map_1,
  656. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  657. .clkr.hw.init = &(const struct clk_init_data) {
  658. .name = "disp_cc_mdss_pclk1_clk_src",
  659. .parent_data = disp_cc_parent_data_1,
  660. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  661. .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
  662. .ops = &clk_pixel_ops,
  663. },
  664. };
  665. static struct clk_rcg2 disp_cc_mdss_pclk2_clk_src = {
  666. .cmd_rcgr = 0x8138,
  667. .mnd_width = 8,
  668. .hid_width = 5,
  669. .parent_map = disp_cc_parent_map_1,
  670. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  671. .clkr.hw.init = &(const struct clk_init_data) {
  672. .name = "disp_cc_mdss_pclk2_clk_src",
  673. .parent_data = disp_cc_parent_data_1,
  674. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  675. .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
  676. .ops = &clk_pixel_ops,
  677. },
  678. };
  679. static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
  680. .cmd_rcgr = 0x8168,
  681. .mnd_width = 0,
  682. .hid_width = 5,
  683. .parent_map = disp_cc_parent_map_0,
  684. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  685. .clkr.hw.init = &(const struct clk_init_data) {
  686. .name = "disp_cc_mdss_vsync_clk_src",
  687. .parent_data = disp_cc_parent_data_0,
  688. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  689. .flags = CLK_SET_RATE_PARENT,
  690. .ops = &clk_rcg2_ops,
  691. },
  692. };
  693. static const struct freq_tbl ftbl_disp_cc_osc_clk_src[] = {
  694. F(38400000, P_DISP_CC_PLL2_OUT_MAIN, 1, 0, 0),
  695. { }
  696. };
  697. static struct clk_rcg2 disp_cc_osc_clk_src = {
  698. .cmd_rcgr = 0x80f0,
  699. .mnd_width = 0,
  700. .hid_width = 5,
  701. .parent_map = disp_cc_parent_map_10,
  702. .freq_tbl = ftbl_disp_cc_osc_clk_src,
  703. .clkr.hw.init = &(const struct clk_init_data) {
  704. .name = "disp_cc_osc_clk_src",
  705. .parent_data = disp_cc_parent_data_10,
  706. .num_parents = ARRAY_SIZE(disp_cc_parent_data_10),
  707. .flags = CLK_SET_RATE_PARENT,
  708. .ops = &clk_rcg2_ops,
  709. },
  710. };
  711. static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = {
  712. F(32000, P_SLEEP_CLK, 1, 0, 0),
  713. { }
  714. };
  715. static struct clk_rcg2 disp_cc_sleep_clk_src = {
  716. .cmd_rcgr = 0xe064,
  717. .mnd_width = 0,
  718. .hid_width = 5,
  719. .parent_map = disp_cc_parent_map_11,
  720. .freq_tbl = ftbl_disp_cc_sleep_clk_src,
  721. .clkr.hw.init = &(const struct clk_init_data) {
  722. .name = "disp_cc_sleep_clk_src",
  723. .parent_data = disp_cc_parent_data_11,
  724. .num_parents = ARRAY_SIZE(disp_cc_parent_data_11),
  725. .flags = CLK_SET_RATE_PARENT,
  726. .ops = &clk_rcg2_ops,
  727. },
  728. };
  729. static struct clk_rcg2 disp_cc_xo_clk_src = {
  730. .cmd_rcgr = 0xe044,
  731. .mnd_width = 0,
  732. .hid_width = 5,
  733. .parent_map = disp_cc_parent_map_0,
  734. .freq_tbl = ftbl_disp_cc_esync0_clk_src,
  735. .clkr.hw.init = &(const struct clk_init_data) {
  736. .name = "disp_cc_xo_clk_src",
  737. .parent_data = disp_cc_parent_data_0_ao,
  738. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0_ao),
  739. .flags = CLK_SET_RATE_PARENT,
  740. .ops = &clk_rcg2_ops,
  741. },
  742. };
  743. static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
  744. .reg = 0x8198,
  745. .shift = 0,
  746. .width = 4,
  747. .clkr.hw.init = &(const struct clk_init_data) {
  748. .name = "disp_cc_mdss_byte0_div_clk_src",
  749. .parent_hws = (const struct clk_hw*[]) {
  750. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  751. },
  752. .num_parents = 1,
  753. .ops = &clk_regmap_div_ops,
  754. },
  755. };
  756. static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = {
  757. .reg = 0x81b4,
  758. .shift = 0,
  759. .width = 4,
  760. .clkr.hw.init = &(const struct clk_init_data) {
  761. .name = "disp_cc_mdss_byte1_div_clk_src",
  762. .parent_hws = (const struct clk_hw*[]) {
  763. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  764. },
  765. .num_parents = 1,
  766. .ops = &clk_regmap_div_ops,
  767. },
  768. };
  769. static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
  770. .reg = 0x8200,
  771. .shift = 0,
  772. .width = 4,
  773. .clkr.hw.init = &(const struct clk_init_data) {
  774. .name = "disp_cc_mdss_dptx0_link_div_clk_src",
  775. .parent_hws = (const struct clk_hw*[]) {
  776. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  777. },
  778. .num_parents = 1,
  779. .flags = CLK_SET_RATE_PARENT,
  780. .ops = &clk_regmap_div_ro_ops,
  781. },
  782. };
  783. static struct clk_regmap_div disp_cc_mdss_dptx1_link_div_clk_src = {
  784. .reg = 0x8294,
  785. .shift = 0,
  786. .width = 4,
  787. .clkr.hw.init = &(const struct clk_init_data) {
  788. .name = "disp_cc_mdss_dptx1_link_div_clk_src",
  789. .parent_hws = (const struct clk_hw*[]) {
  790. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  791. },
  792. .num_parents = 1,
  793. .flags = CLK_SET_RATE_PARENT,
  794. .ops = &clk_regmap_div_ro_ops,
  795. },
  796. };
  797. static struct clk_regmap_div disp_cc_mdss_dptx2_link_div_clk_src = {
  798. .reg = 0x82c8,
  799. .shift = 0,
  800. .width = 4,
  801. .clkr.hw.init = &(const struct clk_init_data) {
  802. .name = "disp_cc_mdss_dptx2_link_div_clk_src",
  803. .parent_hws = (const struct clk_hw*[]) {
  804. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  805. },
  806. .num_parents = 1,
  807. .flags = CLK_SET_RATE_PARENT,
  808. .ops = &clk_regmap_div_ro_ops,
  809. },
  810. };
  811. static struct clk_regmap_div disp_cc_mdss_dptx3_link_div_clk_src = {
  812. .reg = 0x8344,
  813. .shift = 0,
  814. .width = 4,
  815. .clkr.hw.init = &(const struct clk_init_data) {
  816. .name = "disp_cc_mdss_dptx3_link_div_clk_src",
  817. .parent_hws = (const struct clk_hw*[]) {
  818. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  819. },
  820. .num_parents = 1,
  821. .flags = CLK_SET_RATE_PARENT,
  822. .ops = &clk_regmap_div_ro_ops,
  823. },
  824. };
  825. static struct clk_branch disp_cc_esync0_clk = {
  826. .halt_reg = 0x80b8,
  827. .halt_check = BRANCH_HALT,
  828. .clkr = {
  829. .enable_reg = 0x80b8,
  830. .enable_mask = BIT(0),
  831. .hw.init = &(const struct clk_init_data) {
  832. .name = "disp_cc_esync0_clk",
  833. .parent_hws = (const struct clk_hw*[]) {
  834. &disp_cc_esync0_clk_src.clkr.hw,
  835. },
  836. .num_parents = 1,
  837. .flags = CLK_SET_RATE_PARENT,
  838. .ops = &clk_branch2_ops,
  839. },
  840. },
  841. };
  842. static struct clk_branch disp_cc_esync1_clk = {
  843. .halt_reg = 0x80bc,
  844. .halt_check = BRANCH_HALT,
  845. .clkr = {
  846. .enable_reg = 0x80bc,
  847. .enable_mask = BIT(0),
  848. .hw.init = &(const struct clk_init_data) {
  849. .name = "disp_cc_esync1_clk",
  850. .parent_hws = (const struct clk_hw*[]) {
  851. &disp_cc_esync1_clk_src.clkr.hw,
  852. },
  853. .num_parents = 1,
  854. .flags = CLK_SET_RATE_PARENT,
  855. .ops = &clk_branch2_ops,
  856. },
  857. },
  858. };
  859. static struct clk_branch disp_cc_mdss_accu_shift_clk = {
  860. .halt_reg = 0xe060,
  861. .halt_check = BRANCH_HALT_VOTED,
  862. .clkr = {
  863. .enable_reg = 0xe060,
  864. .enable_mask = BIT(0),
  865. .hw.init = &(const struct clk_init_data) {
  866. .name = "disp_cc_mdss_accu_shift_clk",
  867. .parent_hws = (const struct clk_hw*[]) {
  868. &disp_cc_xo_clk_src.clkr.hw,
  869. },
  870. .num_parents = 1,
  871. .flags = CLK_SET_RATE_PARENT,
  872. .ops = &clk_branch2_ops,
  873. },
  874. },
  875. };
  876. static struct clk_branch disp_cc_mdss_ahb1_clk = {
  877. .halt_reg = 0xa028,
  878. .halt_check = BRANCH_HALT,
  879. .clkr = {
  880. .enable_reg = 0xa028,
  881. .enable_mask = BIT(0),
  882. .hw.init = &(const struct clk_init_data) {
  883. .name = "disp_cc_mdss_ahb1_clk",
  884. .parent_hws = (const struct clk_hw*[]) {
  885. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  886. },
  887. .num_parents = 1,
  888. .flags = CLK_SET_RATE_PARENT,
  889. .ops = &clk_branch2_ops,
  890. },
  891. },
  892. };
  893. static struct clk_branch disp_cc_mdss_ahb_clk = {
  894. .halt_reg = 0x80b0,
  895. .halt_check = BRANCH_HALT,
  896. .clkr = {
  897. .enable_reg = 0x80b0,
  898. .enable_mask = BIT(0),
  899. .hw.init = &(const struct clk_init_data) {
  900. .name = "disp_cc_mdss_ahb_clk",
  901. .parent_hws = (const struct clk_hw*[]) {
  902. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  903. },
  904. .num_parents = 1,
  905. .flags = CLK_SET_RATE_PARENT,
  906. .ops = &clk_branch2_ops,
  907. },
  908. },
  909. };
  910. static struct clk_branch disp_cc_mdss_byte0_clk = {
  911. .halt_reg = 0x8034,
  912. .halt_check = BRANCH_HALT,
  913. .clkr = {
  914. .enable_reg = 0x8034,
  915. .enable_mask = BIT(0),
  916. .hw.init = &(const struct clk_init_data) {
  917. .name = "disp_cc_mdss_byte0_clk",
  918. .parent_hws = (const struct clk_hw*[]) {
  919. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  920. },
  921. .num_parents = 1,
  922. .flags = CLK_SET_RATE_PARENT,
  923. .ops = &clk_branch2_ops,
  924. },
  925. },
  926. };
  927. static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
  928. .halt_reg = 0x8038,
  929. .halt_check = BRANCH_HALT,
  930. .clkr = {
  931. .enable_reg = 0x8038,
  932. .enable_mask = BIT(0),
  933. .hw.init = &(const struct clk_init_data) {
  934. .name = "disp_cc_mdss_byte0_intf_clk",
  935. .parent_hws = (const struct clk_hw*[]) {
  936. &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
  937. },
  938. .num_parents = 1,
  939. .flags = CLK_SET_RATE_PARENT,
  940. .ops = &clk_branch2_ops,
  941. },
  942. },
  943. };
  944. static struct clk_branch disp_cc_mdss_byte1_clk = {
  945. .halt_reg = 0x803c,
  946. .halt_check = BRANCH_HALT,
  947. .clkr = {
  948. .enable_reg = 0x803c,
  949. .enable_mask = BIT(0),
  950. .hw.init = &(const struct clk_init_data) {
  951. .name = "disp_cc_mdss_byte1_clk",
  952. .parent_hws = (const struct clk_hw*[]) {
  953. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  954. },
  955. .num_parents = 1,
  956. .flags = CLK_SET_RATE_PARENT,
  957. .ops = &clk_branch2_ops,
  958. },
  959. },
  960. };
  961. static struct clk_branch disp_cc_mdss_byte1_intf_clk = {
  962. .halt_reg = 0x8040,
  963. .halt_check = BRANCH_HALT,
  964. .clkr = {
  965. .enable_reg = 0x8040,
  966. .enable_mask = BIT(0),
  967. .hw.init = &(const struct clk_init_data) {
  968. .name = "disp_cc_mdss_byte1_intf_clk",
  969. .parent_hws = (const struct clk_hw*[]) {
  970. &disp_cc_mdss_byte1_div_clk_src.clkr.hw,
  971. },
  972. .num_parents = 1,
  973. .flags = CLK_SET_RATE_PARENT,
  974. .ops = &clk_branch2_ops,
  975. },
  976. },
  977. };
  978. static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
  979. .halt_reg = 0x8064,
  980. .halt_check = BRANCH_HALT,
  981. .clkr = {
  982. .enable_reg = 0x8064,
  983. .enable_mask = BIT(0),
  984. .hw.init = &(const struct clk_init_data) {
  985. .name = "disp_cc_mdss_dptx0_aux_clk",
  986. .parent_hws = (const struct clk_hw*[]) {
  987. &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
  988. },
  989. .num_parents = 1,
  990. .flags = CLK_SET_RATE_PARENT,
  991. .ops = &clk_branch2_ops,
  992. },
  993. },
  994. };
  995. static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = {
  996. .halt_reg = 0x8058,
  997. .halt_check = BRANCH_HALT,
  998. .clkr = {
  999. .enable_reg = 0x8058,
  1000. .enable_mask = BIT(0),
  1001. .hw.init = &(const struct clk_init_data) {
  1002. .name = "disp_cc_mdss_dptx0_crypto_clk",
  1003. .parent_hws = (const struct clk_hw*[]) {
  1004. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  1005. },
  1006. .num_parents = 1,
  1007. .flags = CLK_SET_RATE_PARENT,
  1008. .ops = &clk_branch2_ops,
  1009. },
  1010. },
  1011. };
  1012. static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
  1013. .halt_reg = 0x804c,
  1014. .halt_check = BRANCH_HALT,
  1015. .clkr = {
  1016. .enable_reg = 0x804c,
  1017. .enable_mask = BIT(0),
  1018. .hw.init = &(const struct clk_init_data) {
  1019. .name = "disp_cc_mdss_dptx0_link_clk",
  1020. .parent_hws = (const struct clk_hw*[]) {
  1021. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  1022. },
  1023. .num_parents = 1,
  1024. .flags = CLK_SET_RATE_PARENT,
  1025. .ops = &clk_branch2_ops,
  1026. },
  1027. },
  1028. };
  1029. static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
  1030. .halt_reg = 0x8054,
  1031. .halt_check = BRANCH_HALT,
  1032. .clkr = {
  1033. .enable_reg = 0x8054,
  1034. .enable_mask = BIT(0),
  1035. .hw.init = &(const struct clk_init_data) {
  1036. .name = "disp_cc_mdss_dptx0_link_intf_clk",
  1037. .parent_hws = (const struct clk_hw*[]) {
  1038. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  1039. },
  1040. .num_parents = 1,
  1041. .flags = CLK_SET_RATE_PARENT,
  1042. .ops = &clk_branch2_ops,
  1043. },
  1044. },
  1045. };
  1046. static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
  1047. .halt_reg = 0x805c,
  1048. .halt_check = BRANCH_HALT,
  1049. .clkr = {
  1050. .enable_reg = 0x805c,
  1051. .enable_mask = BIT(0),
  1052. .hw.init = &(const struct clk_init_data) {
  1053. .name = "disp_cc_mdss_dptx0_pixel0_clk",
  1054. .parent_hws = (const struct clk_hw*[]) {
  1055. &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
  1056. },
  1057. .num_parents = 1,
  1058. .flags = CLK_SET_RATE_PARENT,
  1059. .ops = &clk_branch2_ops,
  1060. },
  1061. },
  1062. };
  1063. static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
  1064. .halt_reg = 0x8060,
  1065. .halt_check = BRANCH_HALT,
  1066. .clkr = {
  1067. .enable_reg = 0x8060,
  1068. .enable_mask = BIT(0),
  1069. .hw.init = &(const struct clk_init_data) {
  1070. .name = "disp_cc_mdss_dptx0_pixel1_clk",
  1071. .parent_hws = (const struct clk_hw*[]) {
  1072. &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
  1073. },
  1074. .num_parents = 1,
  1075. .flags = CLK_SET_RATE_PARENT,
  1076. .ops = &clk_branch2_ops,
  1077. },
  1078. },
  1079. };
  1080. static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
  1081. .halt_reg = 0x8050,
  1082. .halt_check = BRANCH_HALT,
  1083. .clkr = {
  1084. .enable_reg = 0x8050,
  1085. .enable_mask = BIT(0),
  1086. .hw.init = &(const struct clk_init_data) {
  1087. .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  1088. .parent_hws = (const struct clk_hw*[]) {
  1089. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  1090. },
  1091. .num_parents = 1,
  1092. .flags = CLK_SET_RATE_PARENT,
  1093. .ops = &clk_branch2_ops,
  1094. },
  1095. },
  1096. };
  1097. static struct clk_branch disp_cc_mdss_dptx1_aux_clk = {
  1098. .halt_reg = 0x8080,
  1099. .halt_check = BRANCH_HALT,
  1100. .clkr = {
  1101. .enable_reg = 0x8080,
  1102. .enable_mask = BIT(0),
  1103. .hw.init = &(const struct clk_init_data) {
  1104. .name = "disp_cc_mdss_dptx1_aux_clk",
  1105. .parent_hws = (const struct clk_hw*[]) {
  1106. &disp_cc_mdss_dptx1_aux_clk_src.clkr.hw,
  1107. },
  1108. .num_parents = 1,
  1109. .flags = CLK_SET_RATE_PARENT,
  1110. .ops = &clk_branch2_ops,
  1111. },
  1112. },
  1113. };
  1114. static struct clk_branch disp_cc_mdss_dptx1_crypto_clk = {
  1115. .halt_reg = 0x807c,
  1116. .halt_check = BRANCH_HALT,
  1117. .clkr = {
  1118. .enable_reg = 0x807c,
  1119. .enable_mask = BIT(0),
  1120. .hw.init = &(const struct clk_init_data) {
  1121. .name = "disp_cc_mdss_dptx1_crypto_clk",
  1122. .parent_hws = (const struct clk_hw*[]) {
  1123. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  1124. },
  1125. .num_parents = 1,
  1126. .flags = CLK_SET_RATE_PARENT,
  1127. .ops = &clk_branch2_ops,
  1128. },
  1129. },
  1130. };
  1131. static struct clk_branch disp_cc_mdss_dptx1_link_clk = {
  1132. .halt_reg = 0x8070,
  1133. .halt_check = BRANCH_HALT,
  1134. .clkr = {
  1135. .enable_reg = 0x8070,
  1136. .enable_mask = BIT(0),
  1137. .hw.init = &(const struct clk_init_data) {
  1138. .name = "disp_cc_mdss_dptx1_link_clk",
  1139. .parent_hws = (const struct clk_hw*[]) {
  1140. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  1141. },
  1142. .num_parents = 1,
  1143. .flags = CLK_SET_RATE_PARENT,
  1144. .ops = &clk_branch2_ops,
  1145. },
  1146. },
  1147. };
  1148. static struct clk_branch disp_cc_mdss_dptx1_link_intf_clk = {
  1149. .halt_reg = 0x8078,
  1150. .halt_check = BRANCH_HALT,
  1151. .clkr = {
  1152. .enable_reg = 0x8078,
  1153. .enable_mask = BIT(0),
  1154. .hw.init = &(const struct clk_init_data) {
  1155. .name = "disp_cc_mdss_dptx1_link_intf_clk",
  1156. .parent_hws = (const struct clk_hw*[]) {
  1157. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1158. },
  1159. .num_parents = 1,
  1160. .flags = CLK_SET_RATE_PARENT,
  1161. .ops = &clk_branch2_ops,
  1162. },
  1163. },
  1164. };
  1165. static struct clk_branch disp_cc_mdss_dptx1_pixel0_clk = {
  1166. .halt_reg = 0x8068,
  1167. .halt_check = BRANCH_HALT,
  1168. .clkr = {
  1169. .enable_reg = 0x8068,
  1170. .enable_mask = BIT(0),
  1171. .hw.init = &(const struct clk_init_data) {
  1172. .name = "disp_cc_mdss_dptx1_pixel0_clk",
  1173. .parent_hws = (const struct clk_hw*[]) {
  1174. &disp_cc_mdss_dptx1_pixel0_clk_src.clkr.hw,
  1175. },
  1176. .num_parents = 1,
  1177. .flags = CLK_SET_RATE_PARENT,
  1178. .ops = &clk_branch2_ops,
  1179. },
  1180. },
  1181. };
  1182. static struct clk_branch disp_cc_mdss_dptx1_pixel1_clk = {
  1183. .halt_reg = 0x806c,
  1184. .halt_check = BRANCH_HALT,
  1185. .clkr = {
  1186. .enable_reg = 0x806c,
  1187. .enable_mask = BIT(0),
  1188. .hw.init = &(const struct clk_init_data) {
  1189. .name = "disp_cc_mdss_dptx1_pixel1_clk",
  1190. .parent_hws = (const struct clk_hw*[]) {
  1191. &disp_cc_mdss_dptx1_pixel1_clk_src.clkr.hw,
  1192. },
  1193. .num_parents = 1,
  1194. .flags = CLK_SET_RATE_PARENT,
  1195. .ops = &clk_branch2_ops,
  1196. },
  1197. },
  1198. };
  1199. static struct clk_branch disp_cc_mdss_dptx1_usb_router_link_intf_clk = {
  1200. .halt_reg = 0x8074,
  1201. .halt_check = BRANCH_HALT,
  1202. .clkr = {
  1203. .enable_reg = 0x8074,
  1204. .enable_mask = BIT(0),
  1205. .hw.init = &(const struct clk_init_data) {
  1206. .name = "disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  1207. .parent_hws = (const struct clk_hw*[]) {
  1208. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1209. },
  1210. .num_parents = 1,
  1211. .flags = CLK_SET_RATE_PARENT,
  1212. .ops = &clk_branch2_ops,
  1213. },
  1214. },
  1215. };
  1216. static struct clk_branch disp_cc_mdss_dptx2_aux_clk = {
  1217. .halt_reg = 0x8098,
  1218. .halt_check = BRANCH_HALT,
  1219. .clkr = {
  1220. .enable_reg = 0x8098,
  1221. .enable_mask = BIT(0),
  1222. .hw.init = &(const struct clk_init_data) {
  1223. .name = "disp_cc_mdss_dptx2_aux_clk",
  1224. .parent_hws = (const struct clk_hw*[]) {
  1225. &disp_cc_mdss_dptx2_aux_clk_src.clkr.hw,
  1226. },
  1227. .num_parents = 1,
  1228. .flags = CLK_SET_RATE_PARENT,
  1229. .ops = &clk_branch2_ops,
  1230. },
  1231. },
  1232. };
  1233. static struct clk_branch disp_cc_mdss_dptx2_crypto_clk = {
  1234. .halt_reg = 0x8094,
  1235. .halt_check = BRANCH_HALT,
  1236. .clkr = {
  1237. .enable_reg = 0x8094,
  1238. .enable_mask = BIT(0),
  1239. .hw.init = &(const struct clk_init_data) {
  1240. .name = "disp_cc_mdss_dptx2_crypto_clk",
  1241. .parent_hws = (const struct clk_hw*[]) {
  1242. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  1243. },
  1244. .num_parents = 1,
  1245. .flags = CLK_SET_RATE_PARENT,
  1246. .ops = &clk_branch2_ops,
  1247. },
  1248. },
  1249. };
  1250. static struct clk_branch disp_cc_mdss_dptx2_link_clk = {
  1251. .halt_reg = 0x808c,
  1252. .halt_check = BRANCH_HALT,
  1253. .clkr = {
  1254. .enable_reg = 0x808c,
  1255. .enable_mask = BIT(0),
  1256. .hw.init = &(const struct clk_init_data) {
  1257. .name = "disp_cc_mdss_dptx2_link_clk",
  1258. .parent_hws = (const struct clk_hw*[]) {
  1259. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  1260. },
  1261. .num_parents = 1,
  1262. .flags = CLK_SET_RATE_PARENT,
  1263. .ops = &clk_branch2_ops,
  1264. },
  1265. },
  1266. };
  1267. static struct clk_branch disp_cc_mdss_dptx2_link_intf_clk = {
  1268. .halt_reg = 0x8090,
  1269. .halt_check = BRANCH_HALT,
  1270. .clkr = {
  1271. .enable_reg = 0x8090,
  1272. .enable_mask = BIT(0),
  1273. .hw.init = &(const struct clk_init_data) {
  1274. .name = "disp_cc_mdss_dptx2_link_intf_clk",
  1275. .parent_hws = (const struct clk_hw*[]) {
  1276. &disp_cc_mdss_dptx2_link_div_clk_src.clkr.hw,
  1277. },
  1278. .num_parents = 1,
  1279. .flags = CLK_SET_RATE_PARENT,
  1280. .ops = &clk_branch2_ops,
  1281. },
  1282. },
  1283. };
  1284. static struct clk_branch disp_cc_mdss_dptx2_pixel0_clk = {
  1285. .halt_reg = 0x8084,
  1286. .halt_check = BRANCH_HALT,
  1287. .clkr = {
  1288. .enable_reg = 0x8084,
  1289. .enable_mask = BIT(0),
  1290. .hw.init = &(const struct clk_init_data) {
  1291. .name = "disp_cc_mdss_dptx2_pixel0_clk",
  1292. .parent_hws = (const struct clk_hw*[]) {
  1293. &disp_cc_mdss_dptx2_pixel0_clk_src.clkr.hw,
  1294. },
  1295. .num_parents = 1,
  1296. .flags = CLK_SET_RATE_PARENT,
  1297. .ops = &clk_branch2_ops,
  1298. },
  1299. },
  1300. };
  1301. static struct clk_branch disp_cc_mdss_dptx2_pixel1_clk = {
  1302. .halt_reg = 0x8088,
  1303. .halt_check = BRANCH_HALT,
  1304. .clkr = {
  1305. .enable_reg = 0x8088,
  1306. .enable_mask = BIT(0),
  1307. .hw.init = &(const struct clk_init_data) {
  1308. .name = "disp_cc_mdss_dptx2_pixel1_clk",
  1309. .parent_hws = (const struct clk_hw*[]) {
  1310. &disp_cc_mdss_dptx2_pixel1_clk_src.clkr.hw,
  1311. },
  1312. .num_parents = 1,
  1313. .flags = CLK_SET_RATE_PARENT,
  1314. .ops = &clk_branch2_ops,
  1315. },
  1316. },
  1317. };
  1318. static struct clk_branch disp_cc_mdss_dptx3_aux_clk = {
  1319. .halt_reg = 0x80a8,
  1320. .halt_check = BRANCH_HALT,
  1321. .clkr = {
  1322. .enable_reg = 0x80a8,
  1323. .enable_mask = BIT(0),
  1324. .hw.init = &(const struct clk_init_data) {
  1325. .name = "disp_cc_mdss_dptx3_aux_clk",
  1326. .parent_hws = (const struct clk_hw*[]) {
  1327. &disp_cc_mdss_dptx3_aux_clk_src.clkr.hw,
  1328. },
  1329. .num_parents = 1,
  1330. .flags = CLK_SET_RATE_PARENT,
  1331. .ops = &clk_branch2_ops,
  1332. },
  1333. },
  1334. };
  1335. static struct clk_branch disp_cc_mdss_dptx3_crypto_clk = {
  1336. .halt_reg = 0x80ac,
  1337. .halt_check = BRANCH_HALT,
  1338. .clkr = {
  1339. .enable_reg = 0x80ac,
  1340. .enable_mask = BIT(0),
  1341. .hw.init = &(const struct clk_init_data) {
  1342. .name = "disp_cc_mdss_dptx3_crypto_clk",
  1343. .parent_hws = (const struct clk_hw*[]) {
  1344. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  1345. },
  1346. .num_parents = 1,
  1347. .flags = CLK_SET_RATE_PARENT,
  1348. .ops = &clk_branch2_ops,
  1349. },
  1350. },
  1351. };
  1352. static struct clk_branch disp_cc_mdss_dptx3_link_clk = {
  1353. .halt_reg = 0x80a0,
  1354. .halt_check = BRANCH_HALT,
  1355. .clkr = {
  1356. .enable_reg = 0x80a0,
  1357. .enable_mask = BIT(0),
  1358. .hw.init = &(const struct clk_init_data) {
  1359. .name = "disp_cc_mdss_dptx3_link_clk",
  1360. .parent_hws = (const struct clk_hw*[]) {
  1361. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  1362. },
  1363. .num_parents = 1,
  1364. .flags = CLK_SET_RATE_PARENT,
  1365. .ops = &clk_branch2_ops,
  1366. },
  1367. },
  1368. };
  1369. static struct clk_branch disp_cc_mdss_dptx3_link_intf_clk = {
  1370. .halt_reg = 0x80a4,
  1371. .halt_check = BRANCH_HALT,
  1372. .clkr = {
  1373. .enable_reg = 0x80a4,
  1374. .enable_mask = BIT(0),
  1375. .hw.init = &(const struct clk_init_data) {
  1376. .name = "disp_cc_mdss_dptx3_link_intf_clk",
  1377. .parent_hws = (const struct clk_hw*[]) {
  1378. &disp_cc_mdss_dptx3_link_div_clk_src.clkr.hw,
  1379. },
  1380. .num_parents = 1,
  1381. .flags = CLK_SET_RATE_PARENT,
  1382. .ops = &clk_branch2_ops,
  1383. },
  1384. },
  1385. };
  1386. static struct clk_branch disp_cc_mdss_dptx3_pixel0_clk = {
  1387. .halt_reg = 0x809c,
  1388. .halt_check = BRANCH_HALT,
  1389. .clkr = {
  1390. .enable_reg = 0x809c,
  1391. .enable_mask = BIT(0),
  1392. .hw.init = &(const struct clk_init_data) {
  1393. .name = "disp_cc_mdss_dptx3_pixel0_clk",
  1394. .parent_hws = (const struct clk_hw*[]) {
  1395. &disp_cc_mdss_dptx3_pixel0_clk_src.clkr.hw,
  1396. },
  1397. .num_parents = 1,
  1398. .flags = CLK_SET_RATE_PARENT,
  1399. .ops = &clk_branch2_ops,
  1400. },
  1401. },
  1402. };
  1403. static struct clk_branch disp_cc_mdss_esc0_clk = {
  1404. .halt_reg = 0x8044,
  1405. .halt_check = BRANCH_HALT,
  1406. .clkr = {
  1407. .enable_reg = 0x8044,
  1408. .enable_mask = BIT(0),
  1409. .hw.init = &(const struct clk_init_data) {
  1410. .name = "disp_cc_mdss_esc0_clk",
  1411. .parent_hws = (const struct clk_hw*[]) {
  1412. &disp_cc_mdss_esc0_clk_src.clkr.hw,
  1413. },
  1414. .num_parents = 1,
  1415. .flags = CLK_SET_RATE_PARENT,
  1416. .ops = &clk_branch2_ops,
  1417. },
  1418. },
  1419. };
  1420. static struct clk_branch disp_cc_mdss_esc1_clk = {
  1421. .halt_reg = 0x8048,
  1422. .halt_check = BRANCH_HALT,
  1423. .clkr = {
  1424. .enable_reg = 0x8048,
  1425. .enable_mask = BIT(0),
  1426. .hw.init = &(const struct clk_init_data) {
  1427. .name = "disp_cc_mdss_esc1_clk",
  1428. .parent_hws = (const struct clk_hw*[]) {
  1429. &disp_cc_mdss_esc1_clk_src.clkr.hw,
  1430. },
  1431. .num_parents = 1,
  1432. .flags = CLK_SET_RATE_PARENT,
  1433. .ops = &clk_branch2_ops,
  1434. },
  1435. },
  1436. };
  1437. static struct clk_branch disp_cc_mdss_mdp1_clk = {
  1438. .halt_reg = 0xa004,
  1439. .halt_check = BRANCH_HALT,
  1440. .clkr = {
  1441. .enable_reg = 0xa004,
  1442. .enable_mask = BIT(0),
  1443. .hw.init = &(const struct clk_init_data) {
  1444. .name = "disp_cc_mdss_mdp1_clk",
  1445. .parent_hws = (const struct clk_hw*[]) {
  1446. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1447. },
  1448. .num_parents = 1,
  1449. .flags = CLK_SET_RATE_PARENT,
  1450. .ops = &clk_branch2_ops,
  1451. },
  1452. },
  1453. };
  1454. static struct clk_branch disp_cc_mdss_mdp_clk = {
  1455. .halt_reg = 0x8010,
  1456. .halt_check = BRANCH_HALT,
  1457. .clkr = {
  1458. .enable_reg = 0x8010,
  1459. .enable_mask = BIT(0),
  1460. .hw.init = &(const struct clk_init_data) {
  1461. .name = "disp_cc_mdss_mdp_clk",
  1462. .parent_hws = (const struct clk_hw*[]) {
  1463. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1464. },
  1465. .num_parents = 1,
  1466. .flags = CLK_SET_RATE_PARENT,
  1467. .ops = &clk_branch2_aon_ops,
  1468. },
  1469. },
  1470. };
  1471. static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
  1472. .halt_reg = 0xa014,
  1473. .halt_check = BRANCH_HALT,
  1474. .clkr = {
  1475. .enable_reg = 0xa014,
  1476. .enable_mask = BIT(0),
  1477. .hw.init = &(const struct clk_init_data) {
  1478. .name = "disp_cc_mdss_mdp_lut1_clk",
  1479. .parent_hws = (const struct clk_hw*[]) {
  1480. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1481. },
  1482. .num_parents = 1,
  1483. .flags = CLK_SET_RATE_PARENT,
  1484. .ops = &clk_branch2_ops,
  1485. },
  1486. },
  1487. };
  1488. static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
  1489. .halt_reg = 0x8020,
  1490. .halt_check = BRANCH_HALT_VOTED,
  1491. .clkr = {
  1492. .enable_reg = 0x8020,
  1493. .enable_mask = BIT(0),
  1494. .hw.init = &(const struct clk_init_data) {
  1495. .name = "disp_cc_mdss_mdp_lut_clk",
  1496. .parent_hws = (const struct clk_hw*[]) {
  1497. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1498. },
  1499. .num_parents = 1,
  1500. .flags = CLK_SET_RATE_PARENT,
  1501. .ops = &clk_branch2_ops,
  1502. },
  1503. },
  1504. };
  1505. static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
  1506. .halt_reg = 0xc004,
  1507. .halt_check = BRANCH_HALT_VOTED,
  1508. .clkr = {
  1509. .enable_reg = 0xc004,
  1510. .enable_mask = BIT(0),
  1511. .hw.init = &(const struct clk_init_data) {
  1512. .name = "disp_cc_mdss_non_gdsc_ahb_clk",
  1513. .parent_hws = (const struct clk_hw*[]) {
  1514. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1515. },
  1516. .num_parents = 1,
  1517. .flags = CLK_SET_RATE_PARENT,
  1518. .ops = &clk_branch2_ops,
  1519. },
  1520. },
  1521. };
  1522. static struct clk_branch disp_cc_mdss_pclk0_clk = {
  1523. .halt_reg = 0x8004,
  1524. .halt_check = BRANCH_HALT,
  1525. .clkr = {
  1526. .enable_reg = 0x8004,
  1527. .enable_mask = BIT(0),
  1528. .hw.init = &(const struct clk_init_data) {
  1529. .name = "disp_cc_mdss_pclk0_clk",
  1530. .parent_hws = (const struct clk_hw*[]) {
  1531. &disp_cc_mdss_pclk0_clk_src.clkr.hw,
  1532. },
  1533. .num_parents = 1,
  1534. .flags = CLK_SET_RATE_PARENT,
  1535. .ops = &clk_branch2_ops,
  1536. },
  1537. },
  1538. };
  1539. static struct clk_branch disp_cc_mdss_pclk1_clk = {
  1540. .halt_reg = 0x8008,
  1541. .halt_check = BRANCH_HALT,
  1542. .clkr = {
  1543. .enable_reg = 0x8008,
  1544. .enable_mask = BIT(0),
  1545. .hw.init = &(const struct clk_init_data) {
  1546. .name = "disp_cc_mdss_pclk1_clk",
  1547. .parent_hws = (const struct clk_hw*[]) {
  1548. &disp_cc_mdss_pclk1_clk_src.clkr.hw,
  1549. },
  1550. .num_parents = 1,
  1551. .flags = CLK_SET_RATE_PARENT,
  1552. .ops = &clk_branch2_ops,
  1553. },
  1554. },
  1555. };
  1556. static struct clk_branch disp_cc_mdss_pclk2_clk = {
  1557. .halt_reg = 0x800c,
  1558. .halt_check = BRANCH_HALT,
  1559. .clkr = {
  1560. .enable_reg = 0x800c,
  1561. .enable_mask = BIT(0),
  1562. .hw.init = &(const struct clk_init_data) {
  1563. .name = "disp_cc_mdss_pclk2_clk",
  1564. .parent_hws = (const struct clk_hw*[]) {
  1565. &disp_cc_mdss_pclk2_clk_src.clkr.hw,
  1566. },
  1567. .num_parents = 1,
  1568. .flags = CLK_SET_RATE_PARENT,
  1569. .ops = &clk_branch2_ops,
  1570. },
  1571. },
  1572. };
  1573. static struct clk_branch disp_cc_mdss_vsync1_clk = {
  1574. .halt_reg = 0xa024,
  1575. .halt_check = BRANCH_HALT,
  1576. .clkr = {
  1577. .enable_reg = 0xa024,
  1578. .enable_mask = BIT(0),
  1579. .hw.init = &(const struct clk_init_data) {
  1580. .name = "disp_cc_mdss_vsync1_clk",
  1581. .parent_hws = (const struct clk_hw*[]) {
  1582. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1583. },
  1584. .num_parents = 1,
  1585. .flags = CLK_SET_RATE_PARENT,
  1586. .ops = &clk_branch2_ops,
  1587. },
  1588. },
  1589. };
  1590. static struct clk_branch disp_cc_mdss_vsync_clk = {
  1591. .halt_reg = 0x8030,
  1592. .halt_check = BRANCH_HALT,
  1593. .clkr = {
  1594. .enable_reg = 0x8030,
  1595. .enable_mask = BIT(0),
  1596. .hw.init = &(const struct clk_init_data) {
  1597. .name = "disp_cc_mdss_vsync_clk",
  1598. .parent_hws = (const struct clk_hw*[]) {
  1599. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1600. },
  1601. .num_parents = 1,
  1602. .flags = CLK_SET_RATE_PARENT,
  1603. .ops = &clk_branch2_ops,
  1604. },
  1605. },
  1606. };
  1607. static struct clk_branch disp_cc_osc_clk = {
  1608. .halt_reg = 0x80b4,
  1609. .halt_check = BRANCH_HALT,
  1610. .clkr = {
  1611. .enable_reg = 0x80b4,
  1612. .enable_mask = BIT(0),
  1613. .hw.init = &(const struct clk_init_data) {
  1614. .name = "disp_cc_osc_clk",
  1615. .parent_hws = (const struct clk_hw*[]) {
  1616. &disp_cc_osc_clk_src.clkr.hw,
  1617. },
  1618. .num_parents = 1,
  1619. .flags = CLK_SET_RATE_PARENT,
  1620. .ops = &clk_branch2_ops,
  1621. },
  1622. },
  1623. };
  1624. static struct gdsc mdss_gdsc = {
  1625. .gdscr = 0x9000,
  1626. .en_rest_wait_val = 0x2,
  1627. .en_few_wait_val = 0x2,
  1628. .clk_dis_wait_val = 0xf,
  1629. .pd = {
  1630. .name = "mdss_gdsc",
  1631. },
  1632. .pwrsts = PWRSTS_OFF_ON,
  1633. .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE,
  1634. };
  1635. static struct gdsc mdss_int2_gdsc = {
  1636. .gdscr = 0xb000,
  1637. .en_rest_wait_val = 0x2,
  1638. .en_few_wait_val = 0x2,
  1639. .clk_dis_wait_val = 0xf,
  1640. .pd = {
  1641. .name = "mdss_int2_gdsc",
  1642. },
  1643. .pwrsts = PWRSTS_OFF_ON,
  1644. .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE,
  1645. };
  1646. static struct clk_regmap *disp_cc_sm8750_clocks[] = {
  1647. [DISP_CC_ESYNC0_CLK] = &disp_cc_esync0_clk.clkr,
  1648. [DISP_CC_ESYNC0_CLK_SRC] = &disp_cc_esync0_clk_src.clkr,
  1649. [DISP_CC_ESYNC1_CLK] = &disp_cc_esync1_clk.clkr,
  1650. [DISP_CC_ESYNC1_CLK_SRC] = &disp_cc_esync1_clk_src.clkr,
  1651. [DISP_CC_MDSS_ACCU_SHIFT_CLK] = &disp_cc_mdss_accu_shift_clk.clkr,
  1652. [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
  1653. [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
  1654. [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
  1655. [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
  1656. [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
  1657. [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
  1658. [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
  1659. [DISP_CC_MDSS_BYTE1_CLK] = &disp_cc_mdss_byte1_clk.clkr,
  1660. [DISP_CC_MDSS_BYTE1_CLK_SRC] = &disp_cc_mdss_byte1_clk_src.clkr,
  1661. [DISP_CC_MDSS_BYTE1_DIV_CLK_SRC] = &disp_cc_mdss_byte1_div_clk_src.clkr,
  1662. [DISP_CC_MDSS_BYTE1_INTF_CLK] = &disp_cc_mdss_byte1_intf_clk.clkr,
  1663. [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
  1664. [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
  1665. [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr,
  1666. [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
  1667. [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
  1668. [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
  1669. [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
  1670. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
  1671. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
  1672. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
  1673. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
  1674. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
  1675. &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
  1676. [DISP_CC_MDSS_DPTX1_AUX_CLK] = &disp_cc_mdss_dptx1_aux_clk.clkr,
  1677. [DISP_CC_MDSS_DPTX1_AUX_CLK_SRC] = &disp_cc_mdss_dptx1_aux_clk_src.clkr,
  1678. [DISP_CC_MDSS_DPTX1_CRYPTO_CLK] = &disp_cc_mdss_dptx1_crypto_clk.clkr,
  1679. [DISP_CC_MDSS_DPTX1_LINK_CLK] = &disp_cc_mdss_dptx1_link_clk.clkr,
  1680. [DISP_CC_MDSS_DPTX1_LINK_CLK_SRC] = &disp_cc_mdss_dptx1_link_clk_src.clkr,
  1681. [DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx1_link_div_clk_src.clkr,
  1682. [DISP_CC_MDSS_DPTX1_LINK_INTF_CLK] = &disp_cc_mdss_dptx1_link_intf_clk.clkr,
  1683. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK] = &disp_cc_mdss_dptx1_pixel0_clk.clkr,
  1684. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx1_pixel0_clk_src.clkr,
  1685. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK] = &disp_cc_mdss_dptx1_pixel1_clk.clkr,
  1686. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx1_pixel1_clk_src.clkr,
  1687. [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK] =
  1688. &disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr,
  1689. [DISP_CC_MDSS_DPTX2_AUX_CLK] = &disp_cc_mdss_dptx2_aux_clk.clkr,
  1690. [DISP_CC_MDSS_DPTX2_AUX_CLK_SRC] = &disp_cc_mdss_dptx2_aux_clk_src.clkr,
  1691. [DISP_CC_MDSS_DPTX2_CRYPTO_CLK] = &disp_cc_mdss_dptx2_crypto_clk.clkr,
  1692. [DISP_CC_MDSS_DPTX2_LINK_CLK] = &disp_cc_mdss_dptx2_link_clk.clkr,
  1693. [DISP_CC_MDSS_DPTX2_LINK_CLK_SRC] = &disp_cc_mdss_dptx2_link_clk_src.clkr,
  1694. [DISP_CC_MDSS_DPTX2_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx2_link_div_clk_src.clkr,
  1695. [DISP_CC_MDSS_DPTX2_LINK_INTF_CLK] = &disp_cc_mdss_dptx2_link_intf_clk.clkr,
  1696. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK] = &disp_cc_mdss_dptx2_pixel0_clk.clkr,
  1697. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx2_pixel0_clk_src.clkr,
  1698. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK] = &disp_cc_mdss_dptx2_pixel1_clk.clkr,
  1699. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx2_pixel1_clk_src.clkr,
  1700. [DISP_CC_MDSS_DPTX3_AUX_CLK] = &disp_cc_mdss_dptx3_aux_clk.clkr,
  1701. [DISP_CC_MDSS_DPTX3_AUX_CLK_SRC] = &disp_cc_mdss_dptx3_aux_clk_src.clkr,
  1702. [DISP_CC_MDSS_DPTX3_CRYPTO_CLK] = &disp_cc_mdss_dptx3_crypto_clk.clkr,
  1703. [DISP_CC_MDSS_DPTX3_LINK_CLK] = &disp_cc_mdss_dptx3_link_clk.clkr,
  1704. [DISP_CC_MDSS_DPTX3_LINK_CLK_SRC] = &disp_cc_mdss_dptx3_link_clk_src.clkr,
  1705. [DISP_CC_MDSS_DPTX3_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx3_link_div_clk_src.clkr,
  1706. [DISP_CC_MDSS_DPTX3_LINK_INTF_CLK] = &disp_cc_mdss_dptx3_link_intf_clk.clkr,
  1707. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK] = &disp_cc_mdss_dptx3_pixel0_clk.clkr,
  1708. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx3_pixel0_clk_src.clkr,
  1709. [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
  1710. [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
  1711. [DISP_CC_MDSS_ESC1_CLK] = &disp_cc_mdss_esc1_clk.clkr,
  1712. [DISP_CC_MDSS_ESC1_CLK_SRC] = &disp_cc_mdss_esc1_clk_src.clkr,
  1713. [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
  1714. [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
  1715. [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
  1716. [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
  1717. [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
  1718. [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
  1719. [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
  1720. [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
  1721. [DISP_CC_MDSS_PCLK1_CLK] = &disp_cc_mdss_pclk1_clk.clkr,
  1722. [DISP_CC_MDSS_PCLK1_CLK_SRC] = &disp_cc_mdss_pclk1_clk_src.clkr,
  1723. [DISP_CC_MDSS_PCLK2_CLK] = &disp_cc_mdss_pclk2_clk.clkr,
  1724. [DISP_CC_MDSS_PCLK2_CLK_SRC] = &disp_cc_mdss_pclk2_clk_src.clkr,
  1725. [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
  1726. [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
  1727. [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
  1728. [DISP_CC_OSC_CLK] = &disp_cc_osc_clk.clkr,
  1729. [DISP_CC_OSC_CLK_SRC] = &disp_cc_osc_clk_src.clkr,
  1730. [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
  1731. [DISP_CC_PLL1] = &disp_cc_pll1.clkr,
  1732. [DISP_CC_PLL2] = &disp_cc_pll2.clkr,
  1733. [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr,
  1734. [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr,
  1735. };
  1736. static const struct qcom_reset_map disp_cc_sm8750_resets[] = {
  1737. [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
  1738. [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
  1739. [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
  1740. };
  1741. static struct gdsc *disp_cc_sm8750_gdscs[] = {
  1742. [MDSS_GDSC] = &mdss_gdsc,
  1743. [MDSS_INT2_GDSC] = &mdss_int2_gdsc,
  1744. };
  1745. static const struct regmap_config disp_cc_sm8750_regmap_config = {
  1746. .reg_bits = 32,
  1747. .reg_stride = 4,
  1748. .val_bits = 32,
  1749. .max_register = 0xf004, /* 0x10000, 0x10004 and maybe others are for TZ */
  1750. .fast_io = true,
  1751. };
  1752. static const struct qcom_cc_desc disp_cc_sm8750_desc = {
  1753. .config = &disp_cc_sm8750_regmap_config,
  1754. .clks = disp_cc_sm8750_clocks,
  1755. .num_clks = ARRAY_SIZE(disp_cc_sm8750_clocks),
  1756. .resets = disp_cc_sm8750_resets,
  1757. .num_resets = ARRAY_SIZE(disp_cc_sm8750_resets),
  1758. .gdscs = disp_cc_sm8750_gdscs,
  1759. .num_gdscs = ARRAY_SIZE(disp_cc_sm8750_gdscs),
  1760. };
  1761. static const struct of_device_id disp_cc_sm8750_match_table[] = {
  1762. { .compatible = "qcom,sm8750-dispcc" },
  1763. { }
  1764. };
  1765. MODULE_DEVICE_TABLE(of, disp_cc_sm8750_match_table);
  1766. static int disp_cc_sm8750_probe(struct platform_device *pdev)
  1767. {
  1768. struct regmap *regmap;
  1769. int ret;
  1770. ret = devm_pm_runtime_enable(&pdev->dev);
  1771. if (ret)
  1772. return ret;
  1773. ret = pm_runtime_resume_and_get(&pdev->dev);
  1774. if (ret)
  1775. return ret;
  1776. regmap = qcom_cc_map(pdev, &disp_cc_sm8750_desc);
  1777. if (IS_ERR(regmap)) {
  1778. ret = PTR_ERR(regmap);
  1779. goto err_put_rpm;
  1780. }
  1781. clk_taycan_elu_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
  1782. clk_taycan_elu_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
  1783. clk_pongo_elu_pll_configure(&disp_cc_pll2, regmap, &disp_cc_pll2_config);
  1784. /* Enable clock gating for MDP clocks */
  1785. regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
  1786. /* Keep some clocks always-on */
  1787. qcom_branch_set_clk_en(regmap, 0xe07c); /* DISP_CC_SLEEP_CLK */
  1788. qcom_branch_set_clk_en(regmap, 0xe05c); /* DISP_CC_XO_CLK */
  1789. qcom_branch_set_clk_en(regmap, 0xc00c); /* DISP_CC_MDSS_RSCC_AHB_CLK */
  1790. qcom_branch_set_clk_en(regmap, 0xc008); /* DISP_CC_MDSS_RSCC_VSYNC_CLK */
  1791. ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_sm8750_desc, regmap);
  1792. if (ret)
  1793. goto err_put_rpm;
  1794. pm_runtime_put(&pdev->dev);
  1795. return 0;
  1796. err_put_rpm:
  1797. pm_runtime_put_sync(&pdev->dev);
  1798. return ret;
  1799. }
  1800. static struct platform_driver disp_cc_sm8750_driver = {
  1801. .probe = disp_cc_sm8750_probe,
  1802. .driver = {
  1803. .name = "disp_cc-sm8750",
  1804. .of_match_table = disp_cc_sm8750_match_table,
  1805. },
  1806. };
  1807. module_platform_driver(disp_cc_sm8750_driver);
  1808. MODULE_DESCRIPTION("QTI DISPCC SM8750 Driver");
  1809. MODULE_LICENSE("GPL");