dispcc-pineapple.c 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/clk.h>
  6. #include <linux/clk-provider.h>
  7. #include <linux/err.h>
  8. #include <linux/kernel.h>
  9. #include <linux/module.h>
  10. #include <linux/of_device.h>
  11. #include <linux/of.h>
  12. #include <linux/regmap.h>
  13. #include <linux/pm_runtime.h>
  14. #include <dt-bindings/clock/qcom,dispcc-pineapple.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 "clk-regmap-mux.h"
  22. #include "common.h"
  23. #include "reset.h"
  24. #include "vdd-level.h"
  25. #define DISP_CC_MISC_CMD 0xF000
  26. static DEFINE_VDD_REGULATORS(vdd_mm, VDD_HIGH + 1, 1, vdd_corner);
  27. static DEFINE_VDD_REGULATORS(vdd_mxa, VDD_HIGH + 1, 1, vdd_corner);
  28. static struct clk_vdd_class *disp_cc_pineapple_regulators[] = {
  29. &vdd_mm,
  30. &vdd_mxa,
  31. };
  32. enum {
  33. P_BI_TCXO,
  34. P_DISP_CC_PLL0_OUT_MAIN,
  35. P_DISP_CC_PLL1_OUT_EVEN,
  36. P_DISP_CC_PLL1_OUT_MAIN,
  37. P_DP0_PHY_PLL_LINK_CLK,
  38. P_DP0_PHY_PLL_VCO_DIV_CLK,
  39. P_DP1_PHY_PLL_LINK_CLK,
  40. P_DP1_PHY_PLL_VCO_DIV_CLK,
  41. P_DP2_PHY_PLL_LINK_CLK,
  42. P_DP2_PHY_PLL_VCO_DIV_CLK,
  43. P_DP3_PHY_PLL_LINK_CLK,
  44. P_DP3_PHY_PLL_VCO_DIV_CLK,
  45. P_DSI0_PHY_PLL_OUT_BYTECLK,
  46. P_DSI0_PHY_PLL_OUT_DSICLK,
  47. P_DSI1_PHY_PLL_OUT_BYTECLK,
  48. P_DSI1_PHY_PLL_OUT_DSICLK,
  49. P_SLEEP_CLK,
  50. };
  51. static const struct pll_vco lucid_ole_vco[] = {
  52. { 249600000, 2300000000, 0 },
  53. };
  54. static const struct alpha_pll_config disp_cc_pll0_config = {
  55. .l = 0xD,
  56. .cal_l = 0x44,
  57. .cal_l_ringosc = 0x44,
  58. .alpha = 0x6492,
  59. .config_ctl_val = 0x20485699,
  60. .config_ctl_hi_val = 0x00182261,
  61. .config_ctl_hi1_val = 0x82AA299C,
  62. .test_ctl_val = 0x00000000,
  63. .test_ctl_hi_val = 0x00000003,
  64. .test_ctl_hi1_val = 0x00009000,
  65. .test_ctl_hi2_val = 0x00000034,
  66. .user_ctl_val = 0x00000000,
  67. .user_ctl_hi_val = 0x00000005,
  68. };
  69. static struct clk_alpha_pll disp_cc_pll0 = {
  70. .offset = 0x0,
  71. .vco_table = lucid_ole_vco,
  72. .num_vco = ARRAY_SIZE(lucid_ole_vco),
  73. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  74. .clkr = {
  75. .hw.init = &(const struct clk_init_data){
  76. .name = "disp_cc_pll0",
  77. .parent_data = &(const struct clk_parent_data){
  78. .fw_name = "bi_tcxo",
  79. .name = "bi_tcxo",
  80. },
  81. .num_parents = 1,
  82. .ops = &clk_alpha_pll_lucid_ole_ops,
  83. },
  84. .vdd_data = {
  85. .vdd_class = &vdd_mm,
  86. .num_rate_max = VDD_NUM,
  87. .rate_max = (unsigned long[VDD_NUM]) {
  88. [VDD_LOWER_D1] = 615000000,
  89. [VDD_LOW] = 1100000000,
  90. [VDD_LOW_L1] = 1600000000,
  91. [VDD_NOMINAL] = 2000000000,
  92. [VDD_HIGH_L1] = 2300000000},
  93. },
  94. },
  95. };
  96. static const struct alpha_pll_config disp_cc_pll1_config = {
  97. .l = 0x1F,
  98. .cal_l = 0x44,
  99. .cal_l_ringosc = 0x44,
  100. .alpha = 0x4000,
  101. .config_ctl_val = 0x20485699,
  102. .config_ctl_hi_val = 0x00182261,
  103. .config_ctl_hi1_val = 0x82AA299C,
  104. .test_ctl_val = 0x00000000,
  105. .test_ctl_hi_val = 0x00000003,
  106. .test_ctl_hi1_val = 0x00009000,
  107. .test_ctl_hi2_val = 0x00000034,
  108. .user_ctl_val = 0x00000000,
  109. .user_ctl_hi_val = 0x00000005,
  110. };
  111. static struct clk_alpha_pll disp_cc_pll1 = {
  112. .offset = 0x1000,
  113. .vco_table = lucid_ole_vco,
  114. .num_vco = ARRAY_SIZE(lucid_ole_vco),
  115. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_OLE],
  116. .clkr = {
  117. .hw.init = &(const struct clk_init_data){
  118. .name = "disp_cc_pll1",
  119. .parent_data = &(const struct clk_parent_data){
  120. .fw_name = "bi_tcxo",
  121. .name = "bi_tcxo",
  122. },
  123. .num_parents = 1,
  124. .ops = &clk_alpha_pll_lucid_ole_ops,
  125. },
  126. .vdd_data = {
  127. .vdd_class = &vdd_mm,
  128. .num_rate_max = VDD_NUM,
  129. .rate_max = (unsigned long[VDD_NUM]) {
  130. [VDD_LOWER_D1] = 615000000,
  131. [VDD_LOW] = 1100000000,
  132. [VDD_LOW_L1] = 1600000000,
  133. [VDD_NOMINAL] = 2000000000,
  134. [VDD_HIGH_L1] = 2300000000},
  135. },
  136. },
  137. };
  138. static const struct parent_map disp_cc_parent_map_0[] = {
  139. { P_BI_TCXO, 0 },
  140. };
  141. static const struct clk_parent_data disp_cc_parent_data_0[] = {
  142. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  143. };
  144. static const struct clk_parent_data disp_cc_parent_data_0_ao[] = {
  145. { .fw_name = "bi_tcxo_ao", .name = "bi_tcxo_ao" },
  146. };
  147. static const struct parent_map disp_cc_parent_map_1[] = {
  148. { P_BI_TCXO, 0 },
  149. { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
  150. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  151. { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
  152. };
  153. static const struct clk_parent_data disp_cc_parent_data_1[] = {
  154. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  155. { .fw_name = "dp3_phy_pll_vco_div_clk", .name = "dp3_phy_pll_vco_div_clk" },
  156. { .fw_name = "dp1_phy_pll_vco_div_clk", .name = "dp1_phy_pll_vco_div_clk" },
  157. { .fw_name = "dp2_phy_pll_vco_div_clk", .name = "dp2_phy_pll_vco_div_clk" },
  158. };
  159. static const struct parent_map disp_cc_parent_map_2[] = {
  160. { P_BI_TCXO, 0 },
  161. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  162. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  163. { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
  164. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  165. };
  166. static const struct clk_parent_data disp_cc_parent_data_2[] = {
  167. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  168. { .fw_name = "dsi0_phy_pll_out_dsiclk", .name = "dsi0_phy_pll_out_dsiclk" },
  169. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  170. { .fw_name = "dsi1_phy_pll_out_dsiclk", .name = "dsi1_phy_pll_out_dsiclk" },
  171. { .fw_name = "dsi1_phy_pll_out_byteclk", .name = "dsi1_phy_pll_out_byteclk" },
  172. };
  173. static const struct parent_map disp_cc_parent_map_3[] = {
  174. { P_BI_TCXO, 0 },
  175. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  176. { P_DP2_PHY_PLL_LINK_CLK, 3 },
  177. { P_DP3_PHY_PLL_LINK_CLK, 4 },
  178. };
  179. static const struct clk_parent_data disp_cc_parent_data_3[] = {
  180. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  181. { .fw_name = "dp1_phy_pll_link_clk", .name = "dp1_phy_pll_link_clk" },
  182. { .fw_name = "dp2_phy_pll_link_clk", .name = "dp2_phy_pll_link_clk" },
  183. { .fw_name = "dp3_phy_pll_link_clk", .name = "dp3_phy_pll_link_clk" },
  184. };
  185. static const struct parent_map disp_cc_parent_map_4[] = {
  186. { P_BI_TCXO, 0 },
  187. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  188. { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
  189. { P_DP3_PHY_PLL_VCO_DIV_CLK, 3 },
  190. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  191. { P_DP2_PHY_PLL_VCO_DIV_CLK, 6 },
  192. };
  193. static const struct clk_parent_data disp_cc_parent_data_4[] = {
  194. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  195. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  196. { .fw_name = "dp0_phy_pll_vco_div_clk", .name = "dp0_phy_pll_vco_div_clk" },
  197. { .fw_name = "dp3_phy_pll_vco_div_clk", .name = "dp3_phy_pll_vco_div_clk" },
  198. { .fw_name = "dp1_phy_pll_vco_div_clk", .name = "dp1_phy_pll_vco_div_clk" },
  199. { .fw_name = "dp2_phy_pll_vco_div_clk", .name = "dp2_phy_pll_vco_div_clk" },
  200. };
  201. static const struct parent_map disp_cc_parent_map_5[] = {
  202. { P_BI_TCXO, 0 },
  203. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  204. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  205. };
  206. static const struct clk_parent_data disp_cc_parent_data_5[] = {
  207. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  208. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  209. { .fw_name = "dsi1_phy_pll_out_byteclk", .name = "dsi1_phy_pll_out_byteclk" },
  210. };
  211. static const struct parent_map disp_cc_parent_map_6[] = {
  212. { P_BI_TCXO, 0 },
  213. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  214. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  215. };
  216. static const struct clk_parent_data disp_cc_parent_data_6[] = {
  217. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  218. { .hw = &disp_cc_pll1.clkr.hw },
  219. { .hw = &disp_cc_pll1.clkr.hw },
  220. };
  221. static const struct parent_map disp_cc_parent_map_7[] = {
  222. { P_BI_TCXO, 0 },
  223. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  224. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  225. { P_DP2_PHY_PLL_LINK_CLK, 3 },
  226. { P_DP3_PHY_PLL_LINK_CLK, 4 },
  227. };
  228. static const struct clk_parent_data disp_cc_parent_data_7[] = {
  229. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  230. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  231. { .fw_name = "dp1_phy_pll_link_clk", .name = "dp1_phy_pll_link_clk" },
  232. { .fw_name = "dp2_phy_pll_link_clk", .name = "dp2_phy_pll_link_clk" },
  233. { .fw_name = "dp3_phy_pll_link_clk", .name = "dp3_phy_pll_link_clk" },
  234. };
  235. static const struct parent_map disp_cc_parent_map_8[] = {
  236. { P_BI_TCXO, 0 },
  237. { P_DISP_CC_PLL0_OUT_MAIN, 1 },
  238. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  239. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  240. };
  241. static const struct clk_parent_data disp_cc_parent_data_8[] = {
  242. { .fw_name = "bi_tcxo", .name = "bi_tcxo" },
  243. { .hw = &disp_cc_pll0.clkr.hw },
  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_9[] = {
  248. { P_SLEEP_CLK, 0 },
  249. };
  250. static const struct clk_parent_data disp_cc_parent_data_9[] = {
  251. { .fw_name = "sleep_clk", .name = "sleep_clk" },
  252. };
  253. static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
  254. F(19200000, P_BI_TCXO, 1, 0, 0),
  255. F(37500000, P_DISP_CC_PLL1_OUT_MAIN, 16, 0, 0),
  256. F(75000000, P_DISP_CC_PLL1_OUT_MAIN, 8, 0, 0),
  257. { }
  258. };
  259. static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
  260. .cmd_rcgr = 0x82e8,
  261. .mnd_width = 0,
  262. .hid_width = 5,
  263. .parent_map = disp_cc_parent_map_6,
  264. .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
  265. .enable_safe_config = true,
  266. .flags = HW_CLK_CTRL_MODE,
  267. .clkr.hw.init = &(const struct clk_init_data){
  268. .name = "disp_cc_mdss_ahb_clk_src",
  269. .parent_data = disp_cc_parent_data_6,
  270. .num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
  271. .flags = CLK_SET_RATE_PARENT,
  272. .ops = &clk_rcg2_ops,
  273. },
  274. .clkr.vdd_data = {
  275. .vdd_class = &vdd_mm,
  276. .num_rate_max = VDD_NUM,
  277. .rate_max = (unsigned long[VDD_NUM]) {
  278. [VDD_LOWER_D1] = 19200000,
  279. [VDD_LOW] = 37500000,
  280. [VDD_NOMINAL] = 75000000},
  281. },
  282. };
  283. static const struct freq_tbl ftbl_disp_cc_mdss_byte0_clk_src[] = {
  284. F(12800000, P_BI_TCXO, 1.5, 0, 0),
  285. F(19200000, P_BI_TCXO, 1, 0, 0),
  286. { }
  287. };
  288. static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
  289. .cmd_rcgr = 0x8108,
  290. .mnd_width = 0,
  291. .hid_width = 5,
  292. .parent_map = disp_cc_parent_map_2,
  293. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  294. .clkr.hw.init = &(const struct clk_init_data){
  295. .name = "disp_cc_mdss_byte0_clk_src",
  296. .parent_data = disp_cc_parent_data_2,
  297. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  298. .flags = CLK_SET_RATE_PARENT,
  299. .ops = &clk_byte2_ops,
  300. },
  301. .clkr.vdd_data = {
  302. .vdd_classes = disp_cc_pineapple_regulators,
  303. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  304. .num_rate_max = VDD_NUM,
  305. .rate_max = (unsigned long[VDD_NUM]) {
  306. [VDD_LOWER_D1] = 140630000,
  307. [VDD_LOWER] = 187500000,
  308. [VDD_LOW] = 300000000,
  309. [VDD_LOW_L1] = 358000000},
  310. },
  311. };
  312. static struct clk_rcg2 disp_cc_mdss_byte1_clk_src = {
  313. .cmd_rcgr = 0x8124,
  314. .mnd_width = 0,
  315. .hid_width = 5,
  316. .parent_map = disp_cc_parent_map_2,
  317. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  318. .clkr.hw.init = &(const struct clk_init_data){
  319. .name = "disp_cc_mdss_byte1_clk_src",
  320. .parent_data = disp_cc_parent_data_2,
  321. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  322. .flags = CLK_SET_RATE_PARENT,
  323. .ops = &clk_byte2_ops,
  324. },
  325. .clkr.vdd_data = {
  326. .vdd_classes = disp_cc_pineapple_regulators,
  327. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  328. .num_rate_max = VDD_NUM,
  329. .rate_max = (unsigned long[VDD_NUM]) {
  330. [VDD_LOWER_D1] = 140630000,
  331. [VDD_LOWER] = 187500000,
  332. [VDD_LOW] = 300000000,
  333. [VDD_LOW_L1] = 358000000},
  334. },
  335. };
  336. static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
  337. .cmd_rcgr = 0x81bc,
  338. .mnd_width = 0,
  339. .hid_width = 5,
  340. .parent_map = disp_cc_parent_map_0,
  341. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  342. .clkr.hw.init = &(const struct clk_init_data){
  343. .name = "disp_cc_mdss_dptx0_aux_clk_src",
  344. .parent_data = disp_cc_parent_data_0,
  345. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  346. .flags = CLK_SET_RATE_PARENT,
  347. .ops = &clk_rcg2_ops,
  348. },
  349. .clkr.vdd_data = {
  350. .vdd_class = &vdd_mm,
  351. .num_rate_max = VDD_NUM,
  352. .rate_max = (unsigned long[VDD_NUM]) {
  353. [VDD_LOWER_D1] = 19200000},
  354. },
  355. };
  356. static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
  357. .cmd_rcgr = 0x8170,
  358. .mnd_width = 0,
  359. .hid_width = 5,
  360. .parent_map = disp_cc_parent_map_7,
  361. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  362. .clkr.hw.init = &(const struct clk_init_data){
  363. .name = "disp_cc_mdss_dptx0_link_clk_src",
  364. .parent_data = disp_cc_parent_data_7,
  365. .num_parents = ARRAY_SIZE(disp_cc_parent_data_7),
  366. .flags = CLK_SET_RATE_PARENT,
  367. .ops = &clk_byte2_ops,
  368. },
  369. .clkr.vdd_data = {
  370. .vdd_classes = disp_cc_pineapple_regulators,
  371. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  372. .num_rate_max = VDD_NUM,
  373. .rate_max = (unsigned long[VDD_NUM]) {
  374. [VDD_LOWER_D1] = 19200000,
  375. [VDD_LOWER] = 270000000,
  376. [VDD_LOW_L1] = 540000000,
  377. [VDD_NOMINAL] = 810000000},
  378. },
  379. };
  380. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
  381. .cmd_rcgr = 0x818c,
  382. .mnd_width = 16,
  383. .hid_width = 5,
  384. .parent_map = disp_cc_parent_map_4,
  385. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  386. .clkr.hw.init = &(const struct clk_init_data){
  387. .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
  388. .parent_data = disp_cc_parent_data_4,
  389. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  390. .flags = CLK_SET_RATE_PARENT,
  391. .ops = &clk_dp_ops,
  392. },
  393. .clkr.vdd_data = {
  394. .vdd_classes = disp_cc_pineapple_regulators,
  395. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  396. .num_rate_max = VDD_NUM,
  397. .rate_max = (unsigned long[VDD_NUM]) {
  398. [VDD_LOWER_D1] = 19200000,
  399. [VDD_LOWER] = 337500000,
  400. [VDD_LOW_L1] = 405000000,
  401. [VDD_NOMINAL] = 675000000},
  402. },
  403. };
  404. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
  405. .cmd_rcgr = 0x81a4,
  406. .mnd_width = 16,
  407. .hid_width = 5,
  408. .parent_map = disp_cc_parent_map_4,
  409. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  410. .clkr.hw.init = &(const struct clk_init_data){
  411. .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
  412. .parent_data = disp_cc_parent_data_4,
  413. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  414. .flags = CLK_SET_RATE_PARENT,
  415. .ops = &clk_dp_ops,
  416. },
  417. .clkr.vdd_data = {
  418. .vdd_classes = disp_cc_pineapple_regulators,
  419. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  420. .num_rate_max = VDD_NUM,
  421. .rate_max = (unsigned long[VDD_NUM]) {
  422. [VDD_LOWER_D1] = 19200000,
  423. [VDD_LOWER] = 337500000,
  424. [VDD_LOW_L1] = 405000000,
  425. [VDD_NOMINAL] = 675000000},
  426. },
  427. };
  428. static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = {
  429. .cmd_rcgr = 0x8220,
  430. .mnd_width = 0,
  431. .hid_width = 5,
  432. .parent_map = disp_cc_parent_map_0,
  433. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  434. .clkr.hw.init = &(const struct clk_init_data){
  435. .name = "disp_cc_mdss_dptx1_aux_clk_src",
  436. .parent_data = disp_cc_parent_data_0,
  437. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  438. .flags = CLK_SET_RATE_PARENT,
  439. .ops = &clk_rcg2_ops,
  440. },
  441. .clkr.vdd_data = {
  442. .vdd_class = &vdd_mm,
  443. .num_rate_max = VDD_NUM,
  444. .rate_max = (unsigned long[VDD_NUM]) {
  445. [VDD_LOWER_D1] = 19200000},
  446. },
  447. };
  448. static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = {
  449. .cmd_rcgr = 0x8204,
  450. .mnd_width = 0,
  451. .hid_width = 5,
  452. .parent_map = disp_cc_parent_map_3,
  453. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  454. .clkr.hw.init = &(const struct clk_init_data){
  455. .name = "disp_cc_mdss_dptx1_link_clk_src",
  456. .parent_data = disp_cc_parent_data_3,
  457. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  458. .flags = CLK_SET_RATE_PARENT,
  459. .ops = &clk_byte2_ops,
  460. },
  461. .clkr.vdd_data = {
  462. .vdd_class = &vdd_mm,
  463. .num_rate_max = VDD_NUM,
  464. .rate_max = (unsigned long[VDD_NUM]) {
  465. [VDD_LOWER_D1] = 19200000,
  466. [VDD_LOWER] = 270000000,
  467. [VDD_LOW_L1] = 540000000,
  468. [VDD_NOMINAL] = 810000000},
  469. },
  470. };
  471. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel0_clk_src = {
  472. .cmd_rcgr = 0x81d4,
  473. .mnd_width = 16,
  474. .hid_width = 5,
  475. .parent_map = disp_cc_parent_map_1,
  476. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  477. .clkr.hw.init = &(const struct clk_init_data){
  478. .name = "disp_cc_mdss_dptx1_pixel0_clk_src",
  479. .parent_data = disp_cc_parent_data_1,
  480. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  481. .flags = CLK_SET_RATE_PARENT,
  482. .ops = &clk_dp_ops,
  483. },
  484. .clkr.vdd_data = {
  485. .vdd_class = &vdd_mm,
  486. .num_rate_max = VDD_NUM,
  487. .rate_max = (unsigned long[VDD_NUM]) {
  488. [VDD_LOWER_D1] = 19200000,
  489. [VDD_LOWER] = 337500000,
  490. [VDD_LOW_L1] = 405000000,
  491. [VDD_NOMINAL] = 675000000},
  492. },
  493. };
  494. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel1_clk_src = {
  495. .cmd_rcgr = 0x81ec,
  496. .mnd_width = 16,
  497. .hid_width = 5,
  498. .parent_map = disp_cc_parent_map_1,
  499. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  500. .clkr.hw.init = &(const struct clk_init_data){
  501. .name = "disp_cc_mdss_dptx1_pixel1_clk_src",
  502. .parent_data = disp_cc_parent_data_1,
  503. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  504. .flags = CLK_SET_RATE_PARENT,
  505. .ops = &clk_dp_ops,
  506. },
  507. .clkr.vdd_data = {
  508. .vdd_class = &vdd_mm,
  509. .num_rate_max = VDD_NUM,
  510. .rate_max = (unsigned long[VDD_NUM]) {
  511. [VDD_LOWER_D1] = 19200000,
  512. [VDD_LOWER] = 337500000,
  513. [VDD_LOW_L1] = 405000000,
  514. [VDD_NOMINAL] = 675000000},
  515. },
  516. };
  517. static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = {
  518. .cmd_rcgr = 0x8284,
  519. .mnd_width = 0,
  520. .hid_width = 5,
  521. .parent_map = disp_cc_parent_map_0,
  522. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  523. .clkr.hw.init = &(const struct clk_init_data){
  524. .name = "disp_cc_mdss_dptx2_aux_clk_src",
  525. .parent_data = disp_cc_parent_data_0,
  526. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  527. .flags = CLK_SET_RATE_PARENT,
  528. .ops = &clk_rcg2_ops,
  529. },
  530. .clkr.vdd_data = {
  531. .vdd_class = &vdd_mm,
  532. .num_rate_max = VDD_NUM,
  533. .rate_max = (unsigned long[VDD_NUM]) {
  534. [VDD_LOWER_D1] = 19200000},
  535. },
  536. };
  537. static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = {
  538. .cmd_rcgr = 0x8238,
  539. .mnd_width = 0,
  540. .hid_width = 5,
  541. .parent_map = disp_cc_parent_map_3,
  542. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  543. .clkr.hw.init = &(const struct clk_init_data){
  544. .name = "disp_cc_mdss_dptx2_link_clk_src",
  545. .parent_data = disp_cc_parent_data_3,
  546. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  547. .flags = CLK_SET_RATE_PARENT,
  548. .ops = &clk_byte2_ops,
  549. },
  550. .clkr.vdd_data = {
  551. .vdd_class = &vdd_mm,
  552. .num_rate_max = VDD_NUM,
  553. .rate_max = (unsigned long[VDD_NUM]) {
  554. [VDD_LOWER_D1] = 19200000,
  555. [VDD_LOWER] = 270000000,
  556. [VDD_LOW_L1] = 540000000,
  557. [VDD_NOMINAL] = 810000000},
  558. },
  559. };
  560. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel0_clk_src = {
  561. .cmd_rcgr = 0x8254,
  562. .mnd_width = 16,
  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_dptx2_pixel0_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_dp_ops,
  572. },
  573. .clkr.vdd_data = {
  574. .vdd_class = &vdd_mm,
  575. .num_rate_max = VDD_NUM,
  576. .rate_max = (unsigned long[VDD_NUM]) {
  577. [VDD_LOWER_D1] = 19200000,
  578. [VDD_LOWER] = 337500000,
  579. [VDD_LOW_L1] = 405000000,
  580. [VDD_NOMINAL] = 675000000},
  581. },
  582. };
  583. static struct clk_rcg2 disp_cc_mdss_dptx2_pixel1_clk_src = {
  584. .cmd_rcgr = 0x826c,
  585. .mnd_width = 16,
  586. .hid_width = 5,
  587. .parent_map = disp_cc_parent_map_1,
  588. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  589. .clkr.hw.init = &(const struct clk_init_data){
  590. .name = "disp_cc_mdss_dptx2_pixel1_clk_src",
  591. .parent_data = disp_cc_parent_data_1,
  592. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  593. .flags = CLK_SET_RATE_PARENT,
  594. .ops = &clk_dp_ops,
  595. },
  596. .clkr.vdd_data = {
  597. .vdd_class = &vdd_mm,
  598. .num_rate_max = VDD_NUM,
  599. .rate_max = (unsigned long[VDD_NUM]) {
  600. [VDD_LOWER_D1] = 19200000,
  601. [VDD_LOWER] = 337500000,
  602. [VDD_LOW_L1] = 405000000,
  603. [VDD_NOMINAL] = 675000000},
  604. },
  605. };
  606. static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = {
  607. .cmd_rcgr = 0x82d0,
  608. .mnd_width = 0,
  609. .hid_width = 5,
  610. .parent_map = disp_cc_parent_map_0,
  611. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  612. .clkr.hw.init = &(const struct clk_init_data){
  613. .name = "disp_cc_mdss_dptx3_aux_clk_src",
  614. .parent_data = disp_cc_parent_data_0,
  615. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  616. .flags = CLK_SET_RATE_PARENT,
  617. .ops = &clk_rcg2_ops,
  618. },
  619. .clkr.vdd_data = {
  620. .vdd_class = &vdd_mm,
  621. .num_rate_max = VDD_NUM,
  622. .rate_max = (unsigned long[VDD_NUM]) {
  623. [VDD_LOWER_D1] = 19200000},
  624. },
  625. };
  626. static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = {
  627. .cmd_rcgr = 0x82b4,
  628. .mnd_width = 0,
  629. .hid_width = 5,
  630. .parent_map = disp_cc_parent_map_3,
  631. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  632. .clkr.hw.init = &(const struct clk_init_data){
  633. .name = "disp_cc_mdss_dptx3_link_clk_src",
  634. .parent_data = disp_cc_parent_data_3,
  635. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  636. .flags = CLK_SET_RATE_PARENT,
  637. .ops = &clk_byte2_ops,
  638. },
  639. .clkr.vdd_data = {
  640. .vdd_class = &vdd_mm,
  641. .num_rate_max = VDD_NUM,
  642. .rate_max = (unsigned long[VDD_NUM]) {
  643. [VDD_LOWER_D1] = 19200000,
  644. [VDD_LOWER] = 270000000,
  645. [VDD_LOW] = 594000000,
  646. [VDD_NOMINAL] = 810000000},
  647. },
  648. };
  649. static struct clk_rcg2 disp_cc_mdss_dptx3_pixel0_clk_src = {
  650. .cmd_rcgr = 0x829c,
  651. .mnd_width = 16,
  652. .hid_width = 5,
  653. .parent_map = disp_cc_parent_map_1,
  654. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  655. .clkr.hw.init = &(const struct clk_init_data){
  656. .name = "disp_cc_mdss_dptx3_pixel0_clk_src",
  657. .parent_data = disp_cc_parent_data_1,
  658. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  659. .flags = CLK_SET_RATE_PARENT,
  660. .ops = &clk_dp_ops,
  661. },
  662. .clkr.vdd_data = {
  663. .vdd_class = &vdd_mm,
  664. .num_rate_max = VDD_NUM,
  665. .rate_max = (unsigned long[VDD_NUM]) {
  666. [VDD_LOWER_D1] = 19200000,
  667. [VDD_LOWER] = 337500000,
  668. [VDD_LOW_L1] = 405000000,
  669. [VDD_NOMINAL] = 675000000},
  670. },
  671. };
  672. static const struct freq_tbl ftbl_disp_cc_mdss_esc0_clk_src[] = {
  673. F(9600000, P_BI_TCXO, 2, 0, 0),
  674. F(12800000, P_BI_TCXO, 1.5, 0, 0),
  675. F(19200000, P_BI_TCXO, 1, 0, 0),
  676. { }
  677. };
  678. static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
  679. .cmd_rcgr = 0x8140,
  680. .mnd_width = 0,
  681. .hid_width = 5,
  682. .parent_map = disp_cc_parent_map_5,
  683. .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
  684. .clkr.hw.init = &(const struct clk_init_data){
  685. .name = "disp_cc_mdss_esc0_clk_src",
  686. .parent_data = disp_cc_parent_data_5,
  687. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  688. .flags = CLK_SET_RATE_PARENT,
  689. .ops = &clk_rcg2_ops,
  690. },
  691. .clkr.vdd_data = {
  692. .vdd_classes = disp_cc_pineapple_regulators,
  693. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  694. .num_rate_max = VDD_NUM,
  695. .rate_max = (unsigned long[VDD_NUM]) {
  696. [VDD_LOWER_D1] = 19200000},
  697. },
  698. };
  699. static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = {
  700. .cmd_rcgr = 0x8158,
  701. .mnd_width = 0,
  702. .hid_width = 5,
  703. .parent_map = disp_cc_parent_map_5,
  704. .freq_tbl = ftbl_disp_cc_mdss_esc0_clk_src,
  705. .clkr.hw.init = &(const struct clk_init_data){
  706. .name = "disp_cc_mdss_esc1_clk_src",
  707. .parent_data = disp_cc_parent_data_5,
  708. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  709. .flags = CLK_SET_RATE_PARENT,
  710. .ops = &clk_rcg2_ops,
  711. },
  712. .clkr.vdd_data = {
  713. .vdd_classes = disp_cc_pineapple_regulators,
  714. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  715. .num_rate_max = VDD_NUM,
  716. .rate_max = (unsigned long[VDD_NUM]) {
  717. [VDD_LOWER_D1] = 19200000},
  718. },
  719. };
  720. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
  721. F(19200000, P_BI_TCXO, 1, 0, 0),
  722. F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  723. F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  724. F(150000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  725. F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  726. F(325000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  727. F(402000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  728. F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  729. { }
  730. };
  731. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src_cliffs[] = {
  732. F(19200000, P_BI_TCXO, 1, 0, 0),
  733. F(85714286, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  734. F(100000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  735. F(155000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  736. F(200000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  737. F(342000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  738. F(402000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  739. F(514000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  740. F(600000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  741. { }
  742. };
  743. static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
  744. .cmd_rcgr = 0x80d8,
  745. .mnd_width = 0,
  746. .hid_width = 5,
  747. .parent_map = disp_cc_parent_map_8,
  748. .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
  749. .enable_safe_config = true,
  750. .flags = HW_CLK_CTRL_MODE,
  751. .clkr.hw.init = &(const struct clk_init_data){
  752. .name = "disp_cc_mdss_mdp_clk_src",
  753. .parent_data = disp_cc_parent_data_8,
  754. .num_parents = ARRAY_SIZE(disp_cc_parent_data_8),
  755. .flags = CLK_SET_RATE_PARENT,
  756. .ops = &clk_rcg2_ops,
  757. },
  758. .clkr.vdd_data = {
  759. .vdd_classes = disp_cc_pineapple_regulators,
  760. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  761. .num_rate_max = VDD_NUM,
  762. .rate_max = (unsigned long[VDD_NUM]) {
  763. [VDD_LOWER_D1] = 150000000,
  764. [VDD_LOWER] = 200000000,
  765. [VDD_LOW] = 325000000,
  766. [VDD_LOW_L1] = 402000000,
  767. [VDD_NOMINAL] = 514000000},
  768. },
  769. };
  770. static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
  771. .cmd_rcgr = 0x80a8,
  772. .mnd_width = 8,
  773. .hid_width = 5,
  774. .parent_map = disp_cc_parent_map_2,
  775. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  776. .clkr.hw.init = &(const struct clk_init_data){
  777. .name = "disp_cc_mdss_pclk0_clk_src",
  778. .parent_data = disp_cc_parent_data_2,
  779. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  780. .flags = CLK_SET_RATE_PARENT,
  781. .ops = &clk_pixel_ops,
  782. },
  783. .clkr.vdd_data = {
  784. .vdd_classes = disp_cc_pineapple_regulators,
  785. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  786. .num_rate_max = VDD_NUM,
  787. .rate_max = (unsigned long[VDD_NUM]) {
  788. [VDD_LOWER_D1] = 225000000,
  789. [VDD_LOWER] = 300000000,
  790. [VDD_LOW] = 480000000,
  791. [VDD_LOW_L1] = 625000000},
  792. },
  793. };
  794. static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
  795. .cmd_rcgr = 0x80c0,
  796. .mnd_width = 8,
  797. .hid_width = 5,
  798. .parent_map = disp_cc_parent_map_2,
  799. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  800. .clkr.hw.init = &(const struct clk_init_data){
  801. .name = "disp_cc_mdss_pclk1_clk_src",
  802. .parent_data = disp_cc_parent_data_2,
  803. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  804. .flags = CLK_SET_RATE_PARENT,
  805. .ops = &clk_pixel_ops,
  806. },
  807. .clkr.vdd_data = {
  808. .vdd_classes = disp_cc_pineapple_regulators,
  809. .num_vdd_classes = ARRAY_SIZE(disp_cc_pineapple_regulators),
  810. .num_rate_max = VDD_NUM,
  811. .rate_max = (unsigned long[VDD_NUM]) {
  812. [VDD_LOWER_D1] = 225000000,
  813. [VDD_LOWER] = 300000000,
  814. [VDD_LOW] = 480000000,
  815. [VDD_LOW_L1] = 625000000},
  816. },
  817. };
  818. static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
  819. .cmd_rcgr = 0x80f0,
  820. .mnd_width = 0,
  821. .hid_width = 5,
  822. .parent_map = disp_cc_parent_map_0,
  823. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  824. .clkr.hw.init = &(const struct clk_init_data){
  825. .name = "disp_cc_mdss_vsync_clk_src",
  826. .parent_data = disp_cc_parent_data_0,
  827. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  828. .flags = CLK_SET_RATE_PARENT,
  829. .ops = &clk_rcg2_ops,
  830. },
  831. .clkr.vdd_data = {
  832. .vdd_class = &vdd_mm,
  833. .num_rate_max = VDD_NUM,
  834. .rate_max = (unsigned long[VDD_NUM]) {
  835. [VDD_LOWER_D1] = 19200000},
  836. },
  837. };
  838. static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = {
  839. F(32000, P_SLEEP_CLK, 1, 0, 0),
  840. { }
  841. };
  842. static struct clk_rcg2 disp_cc_sleep_clk_src = {
  843. .cmd_rcgr = 0xe05c,
  844. .mnd_width = 0,
  845. .hid_width = 5,
  846. .parent_map = disp_cc_parent_map_9,
  847. .freq_tbl = ftbl_disp_cc_sleep_clk_src,
  848. .clkr.hw.init = &(const struct clk_init_data){
  849. .name = "disp_cc_sleep_clk_src",
  850. .parent_data = disp_cc_parent_data_9,
  851. .num_parents = ARRAY_SIZE(disp_cc_parent_data_9),
  852. .flags = CLK_SET_RATE_PARENT,
  853. .ops = &clk_rcg2_ops,
  854. },
  855. .clkr.vdd_data = {
  856. .vdd_class = &vdd_mm,
  857. .num_rate_max = VDD_NUM,
  858. .rate_max = (unsigned long[VDD_NUM]) {
  859. [VDD_LOWER_D1] = 32000},
  860. },
  861. };
  862. static struct clk_rcg2 disp_cc_xo_clk_src = {
  863. .cmd_rcgr = 0xe03c,
  864. .mnd_width = 0,
  865. .hid_width = 5,
  866. .parent_map = disp_cc_parent_map_0,
  867. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  868. .clkr.hw.init = &(const struct clk_init_data){
  869. .name = "disp_cc_xo_clk_src",
  870. .parent_data = disp_cc_parent_data_0_ao,
  871. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0_ao),
  872. .flags = CLK_SET_RATE_PARENT,
  873. .ops = &clk_rcg2_ops,
  874. },
  875. };
  876. static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
  877. .reg = 0x8120,
  878. .shift = 0,
  879. .width = 4,
  880. .clkr.hw.init = &(const struct clk_init_data) {
  881. .name = "disp_cc_mdss_byte0_div_clk_src",
  882. .parent_hws = (const struct clk_hw*[]){
  883. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  884. },
  885. .num_parents = 1,
  886. .flags = CLK_SET_RATE_PARENT,
  887. .ops = &clk_regmap_div_ops,
  888. },
  889. };
  890. static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = {
  891. .reg = 0x813c,
  892. .shift = 0,
  893. .width = 4,
  894. .clkr.hw.init = &(const struct clk_init_data) {
  895. .name = "disp_cc_mdss_byte1_div_clk_src",
  896. .parent_hws = (const struct clk_hw*[]){
  897. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  898. },
  899. .num_parents = 1,
  900. .flags = CLK_SET_RATE_PARENT,
  901. .ops = &clk_regmap_div_ops,
  902. },
  903. };
  904. static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
  905. .reg = 0x8188,
  906. .shift = 0,
  907. .width = 4,
  908. .clkr.hw.init = &(const struct clk_init_data) {
  909. .name = "disp_cc_mdss_dptx0_link_div_clk_src",
  910. .parent_hws = (const struct clk_hw*[]){
  911. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  912. },
  913. .num_parents = 1,
  914. .flags = CLK_SET_RATE_PARENT,
  915. .ops = &clk_regmap_div_ro_ops,
  916. },
  917. };
  918. static struct clk_regmap_div disp_cc_mdss_dptx1_link_div_clk_src = {
  919. .reg = 0x821c,
  920. .shift = 0,
  921. .width = 4,
  922. .clkr.hw.init = &(const struct clk_init_data) {
  923. .name = "disp_cc_mdss_dptx1_link_div_clk_src",
  924. .parent_hws = (const struct clk_hw*[]){
  925. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  926. },
  927. .num_parents = 1,
  928. .flags = CLK_SET_RATE_PARENT,
  929. .ops = &clk_regmap_div_ro_ops,
  930. },
  931. };
  932. static struct clk_regmap_div disp_cc_mdss_dptx2_link_div_clk_src = {
  933. .reg = 0x8250,
  934. .shift = 0,
  935. .width = 4,
  936. .clkr.hw.init = &(const struct clk_init_data) {
  937. .name = "disp_cc_mdss_dptx2_link_div_clk_src",
  938. .parent_hws = (const struct clk_hw*[]){
  939. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  940. },
  941. .num_parents = 1,
  942. .flags = CLK_SET_RATE_PARENT,
  943. .ops = &clk_regmap_div_ro_ops,
  944. },
  945. };
  946. static struct clk_regmap_div disp_cc_mdss_dptx3_link_div_clk_src = {
  947. .reg = 0x82cc,
  948. .shift = 0,
  949. .width = 4,
  950. .clkr.hw.init = &(const struct clk_init_data) {
  951. .name = "disp_cc_mdss_dptx3_link_div_clk_src",
  952. .parent_hws = (const struct clk_hw*[]){
  953. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  954. },
  955. .num_parents = 1,
  956. .flags = CLK_SET_RATE_PARENT,
  957. .ops = &clk_regmap_div_ro_ops,
  958. },
  959. };
  960. static struct clk_branch disp_cc_mdss_accu_clk = {
  961. .halt_reg = 0xe058,
  962. .halt_check = BRANCH_HALT_VOTED,
  963. .clkr = {
  964. .enable_reg = 0xe058,
  965. .enable_mask = BIT(0),
  966. .hw.init = &(const struct clk_init_data){
  967. .name = "disp_cc_mdss_accu_clk",
  968. .parent_hws = (const struct clk_hw*[]){
  969. &disp_cc_xo_clk_src.clkr.hw,
  970. },
  971. .num_parents = 1,
  972. .flags = CLK_SET_RATE_PARENT,
  973. .ops = &clk_branch2_ops,
  974. },
  975. },
  976. };
  977. static struct clk_branch disp_cc_mdss_ahb1_clk = {
  978. .halt_reg = 0xa020,
  979. .halt_check = BRANCH_HALT,
  980. .clkr = {
  981. .enable_reg = 0xa020,
  982. .enable_mask = BIT(0),
  983. .hw.init = &(const struct clk_init_data){
  984. .name = "disp_cc_mdss_ahb1_clk",
  985. .parent_hws = (const struct clk_hw*[]){
  986. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  987. },
  988. .num_parents = 1,
  989. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  990. .ops = &clk_branch2_ops,
  991. },
  992. },
  993. };
  994. static struct clk_branch disp_cc_mdss_ahb_clk = {
  995. .halt_reg = 0x80a4,
  996. .halt_check = BRANCH_HALT,
  997. .clkr = {
  998. .enable_reg = 0x80a4,
  999. .enable_mask = BIT(0),
  1000. .hw.init = &(const struct clk_init_data){
  1001. .name = "disp_cc_mdss_ahb_clk",
  1002. .parent_hws = (const struct clk_hw*[]){
  1003. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1004. },
  1005. .num_parents = 1,
  1006. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  1007. .ops = &clk_branch2_ops,
  1008. },
  1009. },
  1010. };
  1011. static struct clk_branch disp_cc_mdss_byte0_clk = {
  1012. .halt_reg = 0x8028,
  1013. .halt_check = BRANCH_HALT,
  1014. .clkr = {
  1015. .enable_reg = 0x8028,
  1016. .enable_mask = BIT(0),
  1017. .hw.init = &(const struct clk_init_data){
  1018. .name = "disp_cc_mdss_byte0_clk",
  1019. .parent_hws = (const struct clk_hw*[]){
  1020. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  1021. },
  1022. .num_parents = 1,
  1023. .flags = CLK_SET_RATE_PARENT,
  1024. .ops = &clk_branch2_ops,
  1025. },
  1026. },
  1027. };
  1028. static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
  1029. .halt_reg = 0x802c,
  1030. .halt_check = BRANCH_HALT,
  1031. .clkr = {
  1032. .enable_reg = 0x802c,
  1033. .enable_mask = BIT(0),
  1034. .hw.init = &(const struct clk_init_data){
  1035. .name = "disp_cc_mdss_byte0_intf_clk",
  1036. .parent_hws = (const struct clk_hw*[]){
  1037. &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
  1038. },
  1039. .num_parents = 1,
  1040. .flags = CLK_SET_RATE_PARENT,
  1041. .ops = &clk_branch2_ops,
  1042. },
  1043. },
  1044. };
  1045. static struct clk_branch disp_cc_mdss_byte1_clk = {
  1046. .halt_reg = 0x8030,
  1047. .halt_check = BRANCH_HALT,
  1048. .clkr = {
  1049. .enable_reg = 0x8030,
  1050. .enable_mask = BIT(0),
  1051. .hw.init = &(const struct clk_init_data){
  1052. .name = "disp_cc_mdss_byte1_clk",
  1053. .parent_hws = (const struct clk_hw*[]){
  1054. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  1055. },
  1056. .num_parents = 1,
  1057. .flags = CLK_SET_RATE_PARENT,
  1058. .ops = &clk_branch2_ops,
  1059. },
  1060. },
  1061. };
  1062. static struct clk_branch disp_cc_mdss_byte1_intf_clk = {
  1063. .halt_reg = 0x8034,
  1064. .halt_check = BRANCH_HALT,
  1065. .clkr = {
  1066. .enable_reg = 0x8034,
  1067. .enable_mask = BIT(0),
  1068. .hw.init = &(const struct clk_init_data){
  1069. .name = "disp_cc_mdss_byte1_intf_clk",
  1070. .parent_hws = (const struct clk_hw*[]){
  1071. &disp_cc_mdss_byte1_div_clk_src.clkr.hw,
  1072. },
  1073. .num_parents = 1,
  1074. .flags = CLK_SET_RATE_PARENT,
  1075. .ops = &clk_branch2_ops,
  1076. },
  1077. },
  1078. };
  1079. static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
  1080. .halt_reg = 0x8058,
  1081. .halt_check = BRANCH_HALT,
  1082. .clkr = {
  1083. .enable_reg = 0x8058,
  1084. .enable_mask = BIT(0),
  1085. .hw.init = &(const struct clk_init_data){
  1086. .name = "disp_cc_mdss_dptx0_aux_clk",
  1087. .parent_hws = (const struct clk_hw*[]){
  1088. &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
  1089. },
  1090. .num_parents = 1,
  1091. .flags = CLK_SET_RATE_PARENT,
  1092. .ops = &clk_branch2_ops,
  1093. },
  1094. },
  1095. };
  1096. static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = {
  1097. .halt_reg = 0x804c,
  1098. .halt_check = BRANCH_HALT,
  1099. .clkr = {
  1100. .enable_reg = 0x804c,
  1101. .enable_mask = BIT(0),
  1102. .hw.init = &(const struct clk_init_data){
  1103. .name = "disp_cc_mdss_dptx0_crypto_clk",
  1104. .parent_hws = (const struct clk_hw*[]){
  1105. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  1106. },
  1107. .num_parents = 1,
  1108. .flags = CLK_SET_RATE_PARENT,
  1109. .ops = &clk_branch2_ops,
  1110. },
  1111. },
  1112. };
  1113. static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
  1114. .halt_reg = 0x8040,
  1115. .halt_check = BRANCH_HALT,
  1116. .clkr = {
  1117. .enable_reg = 0x8040,
  1118. .enable_mask = BIT(0),
  1119. .hw.init = &(const struct clk_init_data){
  1120. .name = "disp_cc_mdss_dptx0_link_clk",
  1121. .parent_hws = (const struct clk_hw*[]){
  1122. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  1123. },
  1124. .num_parents = 1,
  1125. .flags = CLK_SET_RATE_PARENT,
  1126. .ops = &clk_branch2_ops,
  1127. },
  1128. },
  1129. };
  1130. static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
  1131. .halt_reg = 0x8048,
  1132. .halt_check = BRANCH_HALT,
  1133. .clkr = {
  1134. .enable_reg = 0x8048,
  1135. .enable_mask = BIT(0),
  1136. .hw.init = &(const struct clk_init_data){
  1137. .name = "disp_cc_mdss_dptx0_link_intf_clk",
  1138. .parent_hws = (const struct clk_hw*[]){
  1139. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  1140. },
  1141. .num_parents = 1,
  1142. .flags = CLK_SET_RATE_PARENT,
  1143. .ops = &clk_branch2_ops,
  1144. },
  1145. },
  1146. };
  1147. static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
  1148. .halt_reg = 0x8050,
  1149. .halt_check = BRANCH_HALT,
  1150. .clkr = {
  1151. .enable_reg = 0x8050,
  1152. .enable_mask = BIT(0),
  1153. .hw.init = &(const struct clk_init_data){
  1154. .name = "disp_cc_mdss_dptx0_pixel0_clk",
  1155. .parent_hws = (const struct clk_hw*[]){
  1156. &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
  1157. },
  1158. .num_parents = 1,
  1159. .flags = CLK_SET_RATE_PARENT,
  1160. .ops = &clk_branch2_ops,
  1161. },
  1162. },
  1163. };
  1164. static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
  1165. .halt_reg = 0x8054,
  1166. .halt_check = BRANCH_HALT,
  1167. .clkr = {
  1168. .enable_reg = 0x8054,
  1169. .enable_mask = BIT(0),
  1170. .hw.init = &(const struct clk_init_data){
  1171. .name = "disp_cc_mdss_dptx0_pixel1_clk",
  1172. .parent_hws = (const struct clk_hw*[]){
  1173. &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
  1174. },
  1175. .num_parents = 1,
  1176. .flags = CLK_SET_RATE_PARENT,
  1177. .ops = &clk_branch2_ops,
  1178. },
  1179. },
  1180. };
  1181. static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
  1182. .halt_reg = 0x8044,
  1183. .halt_check = BRANCH_HALT,
  1184. .clkr = {
  1185. .enable_reg = 0x8044,
  1186. .enable_mask = BIT(0),
  1187. .hw.init = &(const struct clk_init_data){
  1188. .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  1189. .parent_hws = (const struct clk_hw*[]){
  1190. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  1191. },
  1192. .num_parents = 1,
  1193. .flags = CLK_SET_RATE_PARENT,
  1194. .ops = &clk_branch2_ops,
  1195. },
  1196. },
  1197. };
  1198. static struct clk_branch disp_cc_mdss_dptx1_aux_clk = {
  1199. .halt_reg = 0x8074,
  1200. .halt_check = BRANCH_HALT,
  1201. .clkr = {
  1202. .enable_reg = 0x8074,
  1203. .enable_mask = BIT(0),
  1204. .hw.init = &(const struct clk_init_data){
  1205. .name = "disp_cc_mdss_dptx1_aux_clk",
  1206. .parent_hws = (const struct clk_hw*[]){
  1207. &disp_cc_mdss_dptx1_aux_clk_src.clkr.hw,
  1208. },
  1209. .num_parents = 1,
  1210. .flags = CLK_SET_RATE_PARENT,
  1211. .ops = &clk_branch2_ops,
  1212. },
  1213. },
  1214. };
  1215. static struct clk_branch disp_cc_mdss_dptx1_crypto_clk = {
  1216. .halt_reg = 0x8070,
  1217. .halt_check = BRANCH_HALT,
  1218. .clkr = {
  1219. .enable_reg = 0x8070,
  1220. .enable_mask = BIT(0),
  1221. .hw.init = &(const struct clk_init_data){
  1222. .name = "disp_cc_mdss_dptx1_crypto_clk",
  1223. .parent_hws = (const struct clk_hw*[]){
  1224. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  1225. },
  1226. .num_parents = 1,
  1227. .flags = CLK_SET_RATE_PARENT,
  1228. .ops = &clk_branch2_ops,
  1229. },
  1230. },
  1231. };
  1232. static struct clk_branch disp_cc_mdss_dptx1_link_clk = {
  1233. .halt_reg = 0x8064,
  1234. .halt_check = BRANCH_HALT,
  1235. .clkr = {
  1236. .enable_reg = 0x8064,
  1237. .enable_mask = BIT(0),
  1238. .hw.init = &(const struct clk_init_data){
  1239. .name = "disp_cc_mdss_dptx1_link_clk",
  1240. .parent_hws = (const struct clk_hw*[]){
  1241. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  1242. },
  1243. .num_parents = 1,
  1244. .flags = CLK_SET_RATE_PARENT,
  1245. .ops = &clk_branch2_ops,
  1246. },
  1247. },
  1248. };
  1249. static struct clk_branch disp_cc_mdss_dptx1_link_intf_clk = {
  1250. .halt_reg = 0x806c,
  1251. .halt_check = BRANCH_HALT,
  1252. .clkr = {
  1253. .enable_reg = 0x806c,
  1254. .enable_mask = BIT(0),
  1255. .hw.init = &(const struct clk_init_data){
  1256. .name = "disp_cc_mdss_dptx1_link_intf_clk",
  1257. .parent_hws = (const struct clk_hw*[]){
  1258. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1259. },
  1260. .num_parents = 1,
  1261. .flags = CLK_SET_RATE_PARENT,
  1262. .ops = &clk_branch2_ops,
  1263. },
  1264. },
  1265. };
  1266. static struct clk_branch disp_cc_mdss_dptx1_pixel0_clk = {
  1267. .halt_reg = 0x805c,
  1268. .halt_check = BRANCH_HALT,
  1269. .clkr = {
  1270. .enable_reg = 0x805c,
  1271. .enable_mask = BIT(0),
  1272. .hw.init = &(const struct clk_init_data){
  1273. .name = "disp_cc_mdss_dptx1_pixel0_clk",
  1274. .parent_hws = (const struct clk_hw*[]){
  1275. &disp_cc_mdss_dptx1_pixel0_clk_src.clkr.hw,
  1276. },
  1277. .num_parents = 1,
  1278. .flags = CLK_SET_RATE_PARENT,
  1279. .ops = &clk_branch2_ops,
  1280. },
  1281. },
  1282. };
  1283. static struct clk_branch disp_cc_mdss_dptx1_pixel1_clk = {
  1284. .halt_reg = 0x8060,
  1285. .halt_check = BRANCH_HALT,
  1286. .clkr = {
  1287. .enable_reg = 0x8060,
  1288. .enable_mask = BIT(0),
  1289. .hw.init = &(const struct clk_init_data){
  1290. .name = "disp_cc_mdss_dptx1_pixel1_clk",
  1291. .parent_hws = (const struct clk_hw*[]){
  1292. &disp_cc_mdss_dptx1_pixel1_clk_src.clkr.hw,
  1293. },
  1294. .num_parents = 1,
  1295. .flags = CLK_SET_RATE_PARENT,
  1296. .ops = &clk_branch2_ops,
  1297. },
  1298. },
  1299. };
  1300. static struct clk_branch disp_cc_mdss_dptx1_usb_router_link_intf_clk = {
  1301. .halt_reg = 0x8068,
  1302. .halt_check = BRANCH_HALT,
  1303. .clkr = {
  1304. .enable_reg = 0x8068,
  1305. .enable_mask = BIT(0),
  1306. .hw.init = &(const struct clk_init_data){
  1307. .name = "disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  1308. .parent_hws = (const struct clk_hw*[]){
  1309. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1310. },
  1311. .num_parents = 1,
  1312. .flags = CLK_SET_RATE_PARENT,
  1313. .ops = &clk_branch2_ops,
  1314. },
  1315. },
  1316. };
  1317. static struct clk_branch disp_cc_mdss_dptx2_aux_clk = {
  1318. .halt_reg = 0x808c,
  1319. .halt_check = BRANCH_HALT,
  1320. .clkr = {
  1321. .enable_reg = 0x808c,
  1322. .enable_mask = BIT(0),
  1323. .hw.init = &(const struct clk_init_data){
  1324. .name = "disp_cc_mdss_dptx2_aux_clk",
  1325. .parent_hws = (const struct clk_hw*[]){
  1326. &disp_cc_mdss_dptx2_aux_clk_src.clkr.hw,
  1327. },
  1328. .num_parents = 1,
  1329. .flags = CLK_SET_RATE_PARENT,
  1330. .ops = &clk_branch2_ops,
  1331. },
  1332. },
  1333. };
  1334. static struct clk_branch disp_cc_mdss_dptx2_crypto_clk = {
  1335. .halt_reg = 0x8088,
  1336. .halt_check = BRANCH_HALT,
  1337. .clkr = {
  1338. .enable_reg = 0x8088,
  1339. .enable_mask = BIT(0),
  1340. .hw.init = &(const struct clk_init_data){
  1341. .name = "disp_cc_mdss_dptx2_crypto_clk",
  1342. .parent_hws = (const struct clk_hw*[]){
  1343. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  1344. },
  1345. .num_parents = 1,
  1346. .flags = CLK_SET_RATE_PARENT,
  1347. .ops = &clk_branch2_ops,
  1348. },
  1349. },
  1350. };
  1351. static struct clk_branch disp_cc_mdss_dptx2_link_clk = {
  1352. .halt_reg = 0x8080,
  1353. .halt_check = BRANCH_HALT,
  1354. .clkr = {
  1355. .enable_reg = 0x8080,
  1356. .enable_mask = BIT(0),
  1357. .hw.init = &(const struct clk_init_data){
  1358. .name = "disp_cc_mdss_dptx2_link_clk",
  1359. .parent_hws = (const struct clk_hw*[]){
  1360. &disp_cc_mdss_dptx2_link_clk_src.clkr.hw,
  1361. },
  1362. .num_parents = 1,
  1363. .flags = CLK_SET_RATE_PARENT,
  1364. .ops = &clk_branch2_ops,
  1365. },
  1366. },
  1367. };
  1368. static struct clk_branch disp_cc_mdss_dptx2_link_intf_clk = {
  1369. .halt_reg = 0x8084,
  1370. .halt_check = BRANCH_HALT,
  1371. .clkr = {
  1372. .enable_reg = 0x8084,
  1373. .enable_mask = BIT(0),
  1374. .hw.init = &(const struct clk_init_data){
  1375. .name = "disp_cc_mdss_dptx2_link_intf_clk",
  1376. .parent_hws = (const struct clk_hw*[]){
  1377. &disp_cc_mdss_dptx2_link_div_clk_src.clkr.hw,
  1378. },
  1379. .num_parents = 1,
  1380. .flags = CLK_SET_RATE_PARENT,
  1381. .ops = &clk_branch2_ops,
  1382. },
  1383. },
  1384. };
  1385. static struct clk_branch disp_cc_mdss_dptx2_pixel0_clk = {
  1386. .halt_reg = 0x8078,
  1387. .halt_check = BRANCH_HALT,
  1388. .clkr = {
  1389. .enable_reg = 0x8078,
  1390. .enable_mask = BIT(0),
  1391. .hw.init = &(const struct clk_init_data){
  1392. .name = "disp_cc_mdss_dptx2_pixel0_clk",
  1393. .parent_hws = (const struct clk_hw*[]){
  1394. &disp_cc_mdss_dptx2_pixel0_clk_src.clkr.hw,
  1395. },
  1396. .num_parents = 1,
  1397. .flags = CLK_SET_RATE_PARENT,
  1398. .ops = &clk_branch2_ops,
  1399. },
  1400. },
  1401. };
  1402. static struct clk_branch disp_cc_mdss_dptx2_pixel1_clk = {
  1403. .halt_reg = 0x807c,
  1404. .halt_check = BRANCH_HALT,
  1405. .clkr = {
  1406. .enable_reg = 0x807c,
  1407. .enable_mask = BIT(0),
  1408. .hw.init = &(const struct clk_init_data){
  1409. .name = "disp_cc_mdss_dptx2_pixel1_clk",
  1410. .parent_hws = (const struct clk_hw*[]){
  1411. &disp_cc_mdss_dptx2_pixel1_clk_src.clkr.hw,
  1412. },
  1413. .num_parents = 1,
  1414. .flags = CLK_SET_RATE_PARENT,
  1415. .ops = &clk_branch2_ops,
  1416. },
  1417. },
  1418. };
  1419. static struct clk_branch disp_cc_mdss_dptx3_aux_clk = {
  1420. .halt_reg = 0x809c,
  1421. .halt_check = BRANCH_HALT,
  1422. .clkr = {
  1423. .enable_reg = 0x809c,
  1424. .enable_mask = BIT(0),
  1425. .hw.init = &(const struct clk_init_data){
  1426. .name = "disp_cc_mdss_dptx3_aux_clk",
  1427. .parent_hws = (const struct clk_hw*[]){
  1428. &disp_cc_mdss_dptx3_aux_clk_src.clkr.hw,
  1429. },
  1430. .num_parents = 1,
  1431. .flags = CLK_SET_RATE_PARENT,
  1432. .ops = &clk_branch2_ops,
  1433. },
  1434. },
  1435. };
  1436. static struct clk_branch disp_cc_mdss_dptx3_crypto_clk = {
  1437. .halt_reg = 0x80a0,
  1438. .halt_check = BRANCH_HALT,
  1439. .clkr = {
  1440. .enable_reg = 0x80a0,
  1441. .enable_mask = BIT(0),
  1442. .hw.init = &(const struct clk_init_data){
  1443. .name = "disp_cc_mdss_dptx3_crypto_clk",
  1444. .parent_hws = (const struct clk_hw*[]){
  1445. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  1446. },
  1447. .num_parents = 1,
  1448. .flags = CLK_SET_RATE_PARENT,
  1449. .ops = &clk_branch2_ops,
  1450. },
  1451. },
  1452. };
  1453. static struct clk_branch disp_cc_mdss_dptx3_link_clk = {
  1454. .halt_reg = 0x8094,
  1455. .halt_check = BRANCH_HALT,
  1456. .clkr = {
  1457. .enable_reg = 0x8094,
  1458. .enable_mask = BIT(0),
  1459. .hw.init = &(const struct clk_init_data){
  1460. .name = "disp_cc_mdss_dptx3_link_clk",
  1461. .parent_hws = (const struct clk_hw*[]){
  1462. &disp_cc_mdss_dptx3_link_clk_src.clkr.hw,
  1463. },
  1464. .num_parents = 1,
  1465. .flags = CLK_SET_RATE_PARENT,
  1466. .ops = &clk_branch2_ops,
  1467. },
  1468. },
  1469. };
  1470. static struct clk_branch disp_cc_mdss_dptx3_link_intf_clk = {
  1471. .halt_reg = 0x8098,
  1472. .halt_check = BRANCH_HALT,
  1473. .clkr = {
  1474. .enable_reg = 0x8098,
  1475. .enable_mask = BIT(0),
  1476. .hw.init = &(const struct clk_init_data){
  1477. .name = "disp_cc_mdss_dptx3_link_intf_clk",
  1478. .parent_hws = (const struct clk_hw*[]){
  1479. &disp_cc_mdss_dptx3_link_div_clk_src.clkr.hw,
  1480. },
  1481. .num_parents = 1,
  1482. .flags = CLK_SET_RATE_PARENT,
  1483. .ops = &clk_branch2_ops,
  1484. },
  1485. },
  1486. };
  1487. static struct clk_branch disp_cc_mdss_dptx3_pixel0_clk = {
  1488. .halt_reg = 0x8090,
  1489. .halt_check = BRANCH_HALT,
  1490. .clkr = {
  1491. .enable_reg = 0x8090,
  1492. .enable_mask = BIT(0),
  1493. .hw.init = &(const struct clk_init_data){
  1494. .name = "disp_cc_mdss_dptx3_pixel0_clk",
  1495. .parent_hws = (const struct clk_hw*[]){
  1496. &disp_cc_mdss_dptx3_pixel0_clk_src.clkr.hw,
  1497. },
  1498. .num_parents = 1,
  1499. .flags = CLK_SET_RATE_PARENT,
  1500. .ops = &clk_branch2_ops,
  1501. },
  1502. },
  1503. };
  1504. static struct clk_branch disp_cc_mdss_esc0_clk = {
  1505. .halt_reg = 0x8038,
  1506. .halt_check = BRANCH_HALT,
  1507. .clkr = {
  1508. .enable_reg = 0x8038,
  1509. .enable_mask = BIT(0),
  1510. .hw.init = &(const struct clk_init_data){
  1511. .name = "disp_cc_mdss_esc0_clk",
  1512. .parent_hws = (const struct clk_hw*[]){
  1513. &disp_cc_mdss_esc0_clk_src.clkr.hw,
  1514. },
  1515. .num_parents = 1,
  1516. .flags = CLK_SET_RATE_PARENT,
  1517. .ops = &clk_branch2_ops,
  1518. },
  1519. },
  1520. };
  1521. static struct clk_branch disp_cc_mdss_esc1_clk = {
  1522. .halt_reg = 0x803c,
  1523. .halt_check = BRANCH_HALT,
  1524. .clkr = {
  1525. .enable_reg = 0x803c,
  1526. .enable_mask = BIT(0),
  1527. .hw.init = &(const struct clk_init_data){
  1528. .name = "disp_cc_mdss_esc1_clk",
  1529. .parent_hws = (const struct clk_hw*[]){
  1530. &disp_cc_mdss_esc1_clk_src.clkr.hw,
  1531. },
  1532. .num_parents = 1,
  1533. .flags = CLK_SET_RATE_PARENT,
  1534. .ops = &clk_branch2_ops,
  1535. },
  1536. },
  1537. };
  1538. static struct clk_branch disp_cc_mdss_mdp1_clk = {
  1539. .halt_reg = 0xa004,
  1540. .halt_check = BRANCH_HALT,
  1541. .clkr = {
  1542. .enable_reg = 0xa004,
  1543. .enable_mask = BIT(0),
  1544. .hw.init = &(const struct clk_init_data){
  1545. .name = "disp_cc_mdss_mdp1_clk",
  1546. .parent_hws = (const struct clk_hw*[]){
  1547. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1548. },
  1549. .num_parents = 1,
  1550. .flags = CLK_SET_RATE_PARENT,
  1551. .ops = &clk_branch2_ops,
  1552. },
  1553. },
  1554. };
  1555. static struct clk_branch disp_cc_mdss_mdp_clk = {
  1556. .halt_reg = 0x800c,
  1557. .halt_check = BRANCH_HALT,
  1558. .clkr = {
  1559. .enable_reg = 0x800c,
  1560. .enable_mask = BIT(0),
  1561. .hw.init = &(const struct clk_init_data){
  1562. .name = "disp_cc_mdss_mdp_clk",
  1563. .parent_hws = (const struct clk_hw*[]){
  1564. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1565. },
  1566. .num_parents = 1,
  1567. .flags = CLK_SET_RATE_PARENT,
  1568. .ops = &clk_branch2_ops,
  1569. },
  1570. },
  1571. };
  1572. static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
  1573. .halt_reg = 0xa010,
  1574. .halt_check = BRANCH_HALT,
  1575. .clkr = {
  1576. .enable_reg = 0xa010,
  1577. .enable_mask = BIT(0),
  1578. .hw.init = &(const struct clk_init_data){
  1579. .name = "disp_cc_mdss_mdp_lut1_clk",
  1580. .parent_hws = (const struct clk_hw*[]){
  1581. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1582. },
  1583. .num_parents = 1,
  1584. .flags = CLK_SET_RATE_PARENT,
  1585. .ops = &clk_branch2_ops,
  1586. },
  1587. },
  1588. };
  1589. static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
  1590. .halt_reg = 0x8018,
  1591. .halt_check = BRANCH_HALT_VOTED,
  1592. .clkr = {
  1593. .enable_reg = 0x8018,
  1594. .enable_mask = BIT(0),
  1595. .hw.init = &(const struct clk_init_data){
  1596. .name = "disp_cc_mdss_mdp_lut_clk",
  1597. .parent_hws = (const struct clk_hw*[]){
  1598. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1599. },
  1600. .num_parents = 1,
  1601. .flags = CLK_SET_RATE_PARENT,
  1602. .ops = &clk_branch2_ops,
  1603. },
  1604. },
  1605. };
  1606. static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
  1607. .halt_reg = 0xc004,
  1608. .halt_check = BRANCH_HALT_VOTED,
  1609. .clkr = {
  1610. .enable_reg = 0xc004,
  1611. .enable_mask = BIT(0),
  1612. .hw.init = &(const struct clk_init_data){
  1613. .name = "disp_cc_mdss_non_gdsc_ahb_clk",
  1614. .parent_hws = (const struct clk_hw*[]){
  1615. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1616. },
  1617. .num_parents = 1,
  1618. .flags = CLK_SET_RATE_PARENT,
  1619. .ops = &clk_branch2_ops,
  1620. },
  1621. },
  1622. };
  1623. static struct clk_branch disp_cc_mdss_pclk0_clk = {
  1624. .halt_reg = 0x8004,
  1625. .halt_check = BRANCH_HALT,
  1626. .clkr = {
  1627. .enable_reg = 0x8004,
  1628. .enable_mask = BIT(0),
  1629. .hw.init = &(const struct clk_init_data){
  1630. .name = "disp_cc_mdss_pclk0_clk",
  1631. .parent_hws = (const struct clk_hw*[]){
  1632. &disp_cc_mdss_pclk0_clk_src.clkr.hw,
  1633. },
  1634. .num_parents = 1,
  1635. .flags = CLK_SET_RATE_PARENT,
  1636. .ops = &clk_branch2_ops,
  1637. },
  1638. },
  1639. };
  1640. static struct clk_branch disp_cc_mdss_pclk1_clk = {
  1641. .halt_reg = 0x8008,
  1642. .halt_check = BRANCH_HALT,
  1643. .clkr = {
  1644. .enable_reg = 0x8008,
  1645. .enable_mask = BIT(0),
  1646. .hw.init = &(const struct clk_init_data){
  1647. .name = "disp_cc_mdss_pclk1_clk",
  1648. .parent_hws = (const struct clk_hw*[]){
  1649. &disp_cc_mdss_pclk1_clk_src.clkr.hw,
  1650. },
  1651. .num_parents = 1,
  1652. .flags = CLK_SET_RATE_PARENT,
  1653. .ops = &clk_branch2_ops,
  1654. },
  1655. },
  1656. };
  1657. static struct clk_branch disp_cc_mdss_rscc_ahb_clk = {
  1658. .halt_reg = 0xc00c,
  1659. .halt_check = BRANCH_HALT,
  1660. .clkr = {
  1661. .enable_reg = 0xc00c,
  1662. .enable_mask = BIT(0),
  1663. .flags = QCOM_CLK_BOOT_CRITICAL,
  1664. .hw.init = &(const struct clk_init_data){
  1665. .name = "disp_cc_mdss_rscc_ahb_clk",
  1666. .parent_hws = (const struct clk_hw*[]){
  1667. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1668. },
  1669. .num_parents = 1,
  1670. .flags = CLK_SET_RATE_PARENT,
  1671. .ops = &clk_branch2_ops,
  1672. },
  1673. },
  1674. };
  1675. static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
  1676. .halt_reg = 0xc008,
  1677. .halt_check = BRANCH_HALT,
  1678. .clkr = {
  1679. .enable_reg = 0xc008,
  1680. .enable_mask = BIT(0),
  1681. .flags = QCOM_CLK_BOOT_CRITICAL,
  1682. .hw.init = &(const struct clk_init_data){
  1683. .name = "disp_cc_mdss_rscc_vsync_clk",
  1684. .parent_hws = (const struct clk_hw*[]){
  1685. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1686. },
  1687. .num_parents = 1,
  1688. .flags = CLK_SET_RATE_PARENT,
  1689. .ops = &clk_branch2_ops,
  1690. },
  1691. },
  1692. };
  1693. static struct clk_branch disp_cc_mdss_vsync1_clk = {
  1694. .halt_reg = 0xa01c,
  1695. .halt_check = BRANCH_HALT,
  1696. .clkr = {
  1697. .enable_reg = 0xa01c,
  1698. .enable_mask = BIT(0),
  1699. .hw.init = &(const struct clk_init_data){
  1700. .name = "disp_cc_mdss_vsync1_clk",
  1701. .parent_hws = (const struct clk_hw*[]){
  1702. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1703. },
  1704. .num_parents = 1,
  1705. .flags = CLK_SET_RATE_PARENT,
  1706. .ops = &clk_branch2_ops,
  1707. },
  1708. },
  1709. };
  1710. static struct clk_branch disp_cc_mdss_vsync_clk = {
  1711. .halt_reg = 0x8024,
  1712. .halt_check = BRANCH_HALT,
  1713. .clkr = {
  1714. .enable_reg = 0x8024,
  1715. .enable_mask = BIT(0),
  1716. .hw.init = &(const struct clk_init_data){
  1717. .name = "disp_cc_mdss_vsync_clk",
  1718. .parent_hws = (const struct clk_hw*[]){
  1719. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1720. },
  1721. .num_parents = 1,
  1722. .flags = CLK_SET_RATE_PARENT,
  1723. .ops = &clk_branch2_ops,
  1724. },
  1725. },
  1726. };
  1727. static struct clk_branch disp_cc_sleep_clk = {
  1728. .halt_reg = 0xe074,
  1729. .halt_check = BRANCH_HALT,
  1730. .clkr = {
  1731. .enable_reg = 0xe074,
  1732. .enable_mask = BIT(0),
  1733. .hw.init = &(const struct clk_init_data){
  1734. .name = "disp_cc_sleep_clk",
  1735. .parent_hws = (const struct clk_hw*[]){
  1736. &disp_cc_sleep_clk_src.clkr.hw,
  1737. },
  1738. .num_parents = 1,
  1739. .flags = CLK_SET_RATE_PARENT,
  1740. .ops = &clk_branch2_ops,
  1741. },
  1742. },
  1743. };
  1744. static struct clk_regmap *disp_cc_pineapple_clocks[] = {
  1745. [DISP_CC_MDSS_ACCU_CLK] = &disp_cc_mdss_accu_clk.clkr,
  1746. [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
  1747. [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
  1748. [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
  1749. [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
  1750. [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
  1751. [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
  1752. [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
  1753. [DISP_CC_MDSS_BYTE1_CLK] = &disp_cc_mdss_byte1_clk.clkr,
  1754. [DISP_CC_MDSS_BYTE1_CLK_SRC] = &disp_cc_mdss_byte1_clk_src.clkr,
  1755. [DISP_CC_MDSS_BYTE1_DIV_CLK_SRC] = &disp_cc_mdss_byte1_div_clk_src.clkr,
  1756. [DISP_CC_MDSS_BYTE1_INTF_CLK] = &disp_cc_mdss_byte1_intf_clk.clkr,
  1757. [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
  1758. [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
  1759. [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr,
  1760. [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
  1761. [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
  1762. [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
  1763. [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
  1764. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
  1765. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
  1766. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
  1767. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
  1768. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
  1769. &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
  1770. [DISP_CC_MDSS_DPTX1_AUX_CLK] = &disp_cc_mdss_dptx1_aux_clk.clkr,
  1771. [DISP_CC_MDSS_DPTX1_AUX_CLK_SRC] = &disp_cc_mdss_dptx1_aux_clk_src.clkr,
  1772. [DISP_CC_MDSS_DPTX1_CRYPTO_CLK] = &disp_cc_mdss_dptx1_crypto_clk.clkr,
  1773. [DISP_CC_MDSS_DPTX1_LINK_CLK] = &disp_cc_mdss_dptx1_link_clk.clkr,
  1774. [DISP_CC_MDSS_DPTX1_LINK_CLK_SRC] = &disp_cc_mdss_dptx1_link_clk_src.clkr,
  1775. [DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx1_link_div_clk_src.clkr,
  1776. [DISP_CC_MDSS_DPTX1_LINK_INTF_CLK] = &disp_cc_mdss_dptx1_link_intf_clk.clkr,
  1777. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK] = &disp_cc_mdss_dptx1_pixel0_clk.clkr,
  1778. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx1_pixel0_clk_src.clkr,
  1779. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK] = &disp_cc_mdss_dptx1_pixel1_clk.clkr,
  1780. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx1_pixel1_clk_src.clkr,
  1781. [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK] =
  1782. &disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr,
  1783. [DISP_CC_MDSS_DPTX2_AUX_CLK] = &disp_cc_mdss_dptx2_aux_clk.clkr,
  1784. [DISP_CC_MDSS_DPTX2_AUX_CLK_SRC] = &disp_cc_mdss_dptx2_aux_clk_src.clkr,
  1785. [DISP_CC_MDSS_DPTX2_CRYPTO_CLK] = &disp_cc_mdss_dptx2_crypto_clk.clkr,
  1786. [DISP_CC_MDSS_DPTX2_LINK_CLK] = &disp_cc_mdss_dptx2_link_clk.clkr,
  1787. [DISP_CC_MDSS_DPTX2_LINK_CLK_SRC] = &disp_cc_mdss_dptx2_link_clk_src.clkr,
  1788. [DISP_CC_MDSS_DPTX2_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx2_link_div_clk_src.clkr,
  1789. [DISP_CC_MDSS_DPTX2_LINK_INTF_CLK] = &disp_cc_mdss_dptx2_link_intf_clk.clkr,
  1790. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK] = &disp_cc_mdss_dptx2_pixel0_clk.clkr,
  1791. [DISP_CC_MDSS_DPTX2_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx2_pixel0_clk_src.clkr,
  1792. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK] = &disp_cc_mdss_dptx2_pixel1_clk.clkr,
  1793. [DISP_CC_MDSS_DPTX2_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx2_pixel1_clk_src.clkr,
  1794. [DISP_CC_MDSS_DPTX3_AUX_CLK] = &disp_cc_mdss_dptx3_aux_clk.clkr,
  1795. [DISP_CC_MDSS_DPTX3_AUX_CLK_SRC] = &disp_cc_mdss_dptx3_aux_clk_src.clkr,
  1796. [DISP_CC_MDSS_DPTX3_CRYPTO_CLK] = &disp_cc_mdss_dptx3_crypto_clk.clkr,
  1797. [DISP_CC_MDSS_DPTX3_LINK_CLK] = &disp_cc_mdss_dptx3_link_clk.clkr,
  1798. [DISP_CC_MDSS_DPTX3_LINK_CLK_SRC] = &disp_cc_mdss_dptx3_link_clk_src.clkr,
  1799. [DISP_CC_MDSS_DPTX3_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx3_link_div_clk_src.clkr,
  1800. [DISP_CC_MDSS_DPTX3_LINK_INTF_CLK] = &disp_cc_mdss_dptx3_link_intf_clk.clkr,
  1801. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK] = &disp_cc_mdss_dptx3_pixel0_clk.clkr,
  1802. [DISP_CC_MDSS_DPTX3_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx3_pixel0_clk_src.clkr,
  1803. [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
  1804. [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
  1805. [DISP_CC_MDSS_ESC1_CLK] = &disp_cc_mdss_esc1_clk.clkr,
  1806. [DISP_CC_MDSS_ESC1_CLK_SRC] = &disp_cc_mdss_esc1_clk_src.clkr,
  1807. [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
  1808. [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
  1809. [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
  1810. [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
  1811. [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
  1812. [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
  1813. [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
  1814. [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
  1815. [DISP_CC_MDSS_PCLK1_CLK] = &disp_cc_mdss_pclk1_clk.clkr,
  1816. [DISP_CC_MDSS_PCLK1_CLK_SRC] = &disp_cc_mdss_pclk1_clk_src.clkr,
  1817. [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr,
  1818. [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
  1819. [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
  1820. [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
  1821. [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
  1822. [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
  1823. [DISP_CC_PLL1] = &disp_cc_pll1.clkr,
  1824. [DISP_CC_SLEEP_CLK] = &disp_cc_sleep_clk.clkr,
  1825. [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr,
  1826. [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr,
  1827. };
  1828. static const struct qcom_reset_map disp_cc_pineapple_resets[] = {
  1829. [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
  1830. [DISP_CC_MDSS_CORE_INT2_BCR] = { 0xa000 },
  1831. [DISP_CC_MDSS_RSCC_BCR] = { 0xc000 },
  1832. };
  1833. static const struct regmap_config disp_cc_pineapple_regmap_config = {
  1834. .reg_bits = 32,
  1835. .reg_stride = 4,
  1836. .val_bits = 32,
  1837. .max_register = 0x11008,
  1838. .fast_io = true,
  1839. };
  1840. static struct qcom_cc_desc disp_cc_pineapple_desc = {
  1841. .config = &disp_cc_pineapple_regmap_config,
  1842. .clks = disp_cc_pineapple_clocks,
  1843. .num_clks = ARRAY_SIZE(disp_cc_pineapple_clocks),
  1844. .resets = disp_cc_pineapple_resets,
  1845. .num_resets = ARRAY_SIZE(disp_cc_pineapple_resets),
  1846. .clk_regulators = disp_cc_pineapple_regulators,
  1847. .num_clk_regulators = ARRAY_SIZE(disp_cc_pineapple_regulators),
  1848. };
  1849. static const struct of_device_id disp_cc_pineapple_match_table[] = {
  1850. { .compatible = "qcom,pineapple-dispcc" },
  1851. { .compatible = "qcom,cliffs-dispcc" },
  1852. { }
  1853. };
  1854. MODULE_DEVICE_TABLE(of, disp_cc_pineapple_match_table);
  1855. static void disp_cc_pineapple_fixup_cliffs(struct regmap *regmap)
  1856. {
  1857. disp_cc_mdss_mdp_clk_src.freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src_cliffs;
  1858. disp_cc_mdss_mdp_clk_src.clkr.vdd_data.rate_max[VDD_LOWER_D1] = 155000000;
  1859. disp_cc_mdss_mdp_clk_src.clkr.vdd_data.rate_max[VDD_LOW] = 342000000;
  1860. disp_cc_mdss_mdp_clk_src.clkr.vdd_data.rate_max[VDD_HIGH] = 600000000;
  1861. }
  1862. static int disp_cc_pineapple_fixup(struct platform_device *pdev, struct regmap *regmap)
  1863. {
  1864. const char *compat = NULL;
  1865. int compatlen = 0;
  1866. compat = of_get_property(pdev->dev.of_node, "compatible", &compatlen);
  1867. if (!compat || compatlen <= 0)
  1868. return -EINVAL;
  1869. if (!strcmp(compat, "qcom,cliffs-dispcc"))
  1870. disp_cc_pineapple_fixup_cliffs(regmap);
  1871. return 0;
  1872. }
  1873. static int disp_cc_pineapple_probe(struct platform_device *pdev)
  1874. {
  1875. struct regmap *regmap;
  1876. int ret;
  1877. regmap = qcom_cc_map(pdev, &disp_cc_pineapple_desc);
  1878. if (IS_ERR(regmap))
  1879. return PTR_ERR(regmap);
  1880. ret = qcom_cc_runtime_init(pdev, &disp_cc_pineapple_desc);
  1881. if (ret)
  1882. return ret;
  1883. ret = pm_runtime_get_sync(&pdev->dev);
  1884. if (ret)
  1885. return ret;
  1886. clk_lucid_ole_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
  1887. clk_lucid_ole_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
  1888. ret = disp_cc_pineapple_fixup(pdev, regmap);
  1889. if (ret)
  1890. return ret;
  1891. /* Enable clock gating for MDP clocks */
  1892. regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
  1893. /*
  1894. * Keep clocks always enabled:
  1895. * disp_cc_xo_clk
  1896. */
  1897. regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0));
  1898. ret = qcom_cc_really_probe(pdev, &disp_cc_pineapple_desc, regmap);
  1899. if (ret) {
  1900. dev_err(&pdev->dev, "Failed to register DISP CC clocks\n");
  1901. return ret;
  1902. }
  1903. pm_runtime_put_sync(&pdev->dev);
  1904. dev_info(&pdev->dev, "Registered DISP CC clocks\n");
  1905. return ret;
  1906. }
  1907. static void disp_cc_pineapple_sync_state(struct device *dev)
  1908. {
  1909. qcom_cc_sync_state(dev, &disp_cc_pineapple_desc);
  1910. }
  1911. static const struct dev_pm_ops disp_cc_pineapple_pm_ops = {
  1912. SET_RUNTIME_PM_OPS(qcom_cc_runtime_suspend, qcom_cc_runtime_resume, NULL)
  1913. SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
  1914. pm_runtime_force_resume)
  1915. };
  1916. static struct platform_driver disp_cc_pineapple_driver = {
  1917. .probe = disp_cc_pineapple_probe,
  1918. .driver = {
  1919. .name = "disp_cc-pineapple",
  1920. .of_match_table = disp_cc_pineapple_match_table,
  1921. .sync_state = disp_cc_pineapple_sync_state,
  1922. .pm = &disp_cc_pineapple_pm_ops,
  1923. },
  1924. };
  1925. static int __init disp_cc_pineapple_init(void)
  1926. {
  1927. return platform_driver_register(&disp_cc_pineapple_driver);
  1928. }
  1929. subsys_initcall(disp_cc_pineapple_init);
  1930. static void __exit disp_cc_pineapple_exit(void)
  1931. {
  1932. platform_driver_unregister(&disp_cc_pineapple_driver);
  1933. }
  1934. module_exit(disp_cc_pineapple_exit);
  1935. MODULE_DESCRIPTION("QTI DISP_CC PINEAPPLE Driver");
  1936. MODULE_LICENSE("GPL v2");