dispcc-monaco_auto.c 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include <linux/clk.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-monaco_auto.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 "gdsc.h"
  24. #include "reset.h"
  25. #include "vdd-level.h"
  26. static DEFINE_VDD_REGULATORS(vdd_mm, VDD_HIGH_L1 + 1, 1, vdd_corner);
  27. static struct clk_vdd_class *disp_cc_monaco_auto_regulators[] = {
  28. &vdd_mm,
  29. };
  30. enum {
  31. P_BI_TCXO,
  32. P_DISP_CC_PLL0_OUT_MAIN,
  33. P_DISP_CC_PLL1_OUT_EVEN,
  34. P_DISP_CC_PLL1_OUT_MAIN,
  35. P_DP0_PHY_PLL_LINK_CLK,
  36. P_DP0_PHY_PLL_VCO_DIV_CLK,
  37. P_DP1_PHY_PLL_LINK_CLK,
  38. P_DP1_PHY_PLL_VCO_DIV_CLK,
  39. P_DSI0_PHY_PLL_OUT_BYTECLK,
  40. P_DSI0_PHY_PLL_OUT_DSICLK,
  41. P_DSI1_PHY_PLL_OUT_BYTECLK,
  42. P_DSI1_PHY_PLL_OUT_DSICLK,
  43. P_SLEEP_CLK,
  44. };
  45. static const struct pll_vco lucid_evo_vco[] = {
  46. { 249600000, 2020000000, 0 },
  47. };
  48. /* 1125Mhz Configuration */
  49. static const struct alpha_pll_config disp_cc_pll0_config = {
  50. .l = 0x3A,
  51. .cal_l = 0x44,
  52. .alpha = 0x9800,
  53. .config_ctl_val = 0x20485699,
  54. .config_ctl_hi_val = 0x00182261,
  55. .config_ctl_hi1_val = 0x32AA299C,
  56. .user_ctl_val = 0x00000000,
  57. .user_ctl_hi_val = 0x00400805,
  58. };
  59. static struct clk_alpha_pll disp_cc_pll0 = {
  60. .offset = 0x0,
  61. .vco_table = lucid_evo_vco,
  62. .num_vco = ARRAY_SIZE(lucid_evo_vco),
  63. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
  64. .clkr = {
  65. .hw.init = &(const struct clk_init_data){
  66. .name = "disp_cc_pll0",
  67. .parent_data = &(const struct clk_parent_data){
  68. .fw_name = "bi_tcxo",
  69. .name = "bi_tcxo",
  70. },
  71. .num_parents = 1,
  72. .ops = &clk_alpha_pll_lucid_evo_ops,
  73. },
  74. .vdd_data = {
  75. .vdd_class = &vdd_mm,
  76. .num_rate_max = VDD_NUM,
  77. .rate_max = (unsigned long[VDD_NUM]) {
  78. [VDD_LOWER_D1] = 500000000,
  79. [VDD_LOWER] = 615000000,
  80. [VDD_LOW] = 1066000000,
  81. [VDD_LOW_L1] = 1500000000,
  82. [VDD_NOMINAL] = 1800000000,
  83. [VDD_HIGH] = 2020000000},
  84. },
  85. },
  86. };
  87. /* 600Mhz Configurtion */
  88. static const struct alpha_pll_config disp_cc_pll1_config = {
  89. .l = 0x1F,
  90. .cal_l = 0x44,
  91. .alpha = 0x4000,
  92. .config_ctl_val = 0x20485699,
  93. .config_ctl_hi_val = 0x00182261,
  94. .config_ctl_hi1_val = 0x32AA299C,
  95. .user_ctl_val = 0x00000000,
  96. .user_ctl_hi_val = 0x00400805,
  97. };
  98. static struct clk_alpha_pll disp_cc_pll1 = {
  99. .offset = 0x1000,
  100. .vco_table = lucid_evo_vco,
  101. .num_vco = ARRAY_SIZE(lucid_evo_vco),
  102. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
  103. .clkr = {
  104. .hw.init = &(const struct clk_init_data){
  105. .name = "disp_cc_pll1",
  106. .parent_data = &(const struct clk_parent_data){
  107. .fw_name = "bi_tcxo",
  108. .name = "bi_tcxo",
  109. },
  110. .num_parents = 1,
  111. .ops = &clk_alpha_pll_lucid_evo_ops,
  112. },
  113. .vdd_data = {
  114. .vdd_class = &vdd_mm,
  115. .num_rate_max = VDD_NUM,
  116. .rate_max = (unsigned long[VDD_NUM]) {
  117. [VDD_LOWER_D1] = 500000000,
  118. [VDD_LOWER] = 615000000,
  119. [VDD_LOW] = 1066000000,
  120. [VDD_LOW_L1] = 1500000000,
  121. [VDD_NOMINAL] = 1800000000,
  122. [VDD_HIGH] = 2020000000},
  123. },
  124. },
  125. };
  126. static const struct parent_map disp_cc_parent_map_0[] = {
  127. { P_BI_TCXO, 0 },
  128. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  129. { P_DP0_PHY_PLL_VCO_DIV_CLK, 2 },
  130. { P_DP1_PHY_PLL_VCO_DIV_CLK, 4 },
  131. };
  132. static const struct clk_parent_data disp_cc_parent_data_0[] = {
  133. { .fw_name = "bi_tcxo" },
  134. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  135. { .fw_name = "dp0_phy_pll_vco_div_clk", .name = "dp0_phy_pll_vco_div_clk" },
  136. { .fw_name = "dp1_phy_pll_vco_div_clk", .name = "dp1_phy_pll_vco_div_clk" },
  137. };
  138. static const struct parent_map disp_cc_parent_map_1[] = {
  139. { P_BI_TCXO, 0 },
  140. { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
  141. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  142. { P_DSI1_PHY_PLL_OUT_DSICLK, 3 },
  143. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  144. };
  145. static const struct clk_parent_data disp_cc_parent_data_1[] = {
  146. { .fw_name = "bi_tcxo" },
  147. { .fw_name = "dsi0_phy_pll_out_dsiclk", .name = "dsi0_phy_pll_out_dsiclk" },
  148. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  149. { .fw_name = "dsi1_phy_pll_out_dsiclk", .name = "dsi1_phy_pll_out_dsiclk" },
  150. { .fw_name = "dsi1_phy_pll_out_byteclk", .name = "dsi1_phy_pll_out_byteclk" },
  151. };
  152. static const struct parent_map disp_cc_parent_map_2[] = {
  153. { P_BI_TCXO, 0 },
  154. };
  155. static const struct clk_parent_data disp_cc_parent_data_2[] = {
  156. { .fw_name = "bi_tcxo" },
  157. };
  158. static const struct clk_parent_data disp_cc_parent_data_2_ao[] = {
  159. { .fw_name = "bi_tcxo_ao" },
  160. };
  161. static const struct parent_map disp_cc_parent_map_3[] = {
  162. { P_BI_TCXO, 0 },
  163. { P_DP0_PHY_PLL_LINK_CLK, 1 },
  164. { P_DP1_PHY_PLL_LINK_CLK, 2 },
  165. };
  166. static const struct clk_parent_data disp_cc_parent_data_3[] = {
  167. { .fw_name = "bi_tcxo" },
  168. { .fw_name = "dp0_phy_pll_link_clk", .name = "dp0_phy_pll_link_clk" },
  169. { .fw_name = "dp1_phy_pll_link_clk", .name = "dp1_phy_pll_link_clk" },
  170. };
  171. static const struct parent_map disp_cc_parent_map_4[] = {
  172. { P_BI_TCXO, 0 },
  173. { P_DSI0_PHY_PLL_OUT_BYTECLK, 2 },
  174. { P_DSI1_PHY_PLL_OUT_BYTECLK, 4 },
  175. };
  176. static const struct clk_parent_data disp_cc_parent_data_4[] = {
  177. { .fw_name = "bi_tcxo" },
  178. { .fw_name = "dsi0_phy_pll_out_byteclk", .name = "dsi0_phy_pll_out_byteclk" },
  179. { .fw_name = "dsi1_phy_pll_out_byteclk", .name = "dsi1_phy_pll_out_byteclk" },
  180. };
  181. static const struct parent_map disp_cc_parent_map_5[] = {
  182. { P_BI_TCXO, 0 },
  183. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  184. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  185. };
  186. static const struct clk_parent_data disp_cc_parent_data_5[] = {
  187. { .fw_name = "bi_tcxo" },
  188. { .hw = &disp_cc_pll1.clkr.hw },
  189. { .hw = &disp_cc_pll1.clkr.hw },
  190. };
  191. static const struct parent_map disp_cc_parent_map_6[] = {
  192. { P_BI_TCXO, 0 },
  193. { P_DISP_CC_PLL0_OUT_MAIN, 1 },
  194. { P_DISP_CC_PLL1_OUT_MAIN, 4 },
  195. { P_DISP_CC_PLL1_OUT_EVEN, 6 },
  196. };
  197. static const struct clk_parent_data disp_cc_parent_data_6[] = {
  198. { .fw_name = "bi_tcxo" },
  199. { .hw = &disp_cc_pll0.clkr.hw },
  200. { .hw = &disp_cc_pll1.clkr.hw },
  201. { .hw = &disp_cc_pll1.clkr.hw },
  202. };
  203. static const struct parent_map disp_cc_parent_map_7[] = {
  204. { P_SLEEP_CLK, 0 },
  205. };
  206. static const struct clk_parent_data disp_cc_parent_data_7_ao[] = {
  207. { .fw_name = "sleep_clk" },
  208. };
  209. static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
  210. F(37500000, P_DISP_CC_PLL1_OUT_MAIN, 16, 0, 0),
  211. F(75000000, P_DISP_CC_PLL1_OUT_MAIN, 8, 0, 0),
  212. { }
  213. };
  214. static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
  215. .cmd_rcgr = 0x824c,
  216. .mnd_width = 0,
  217. .hid_width = 5,
  218. .parent_map = disp_cc_parent_map_5,
  219. .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
  220. .enable_safe_config = true,
  221. .flags = HW_CLK_CTRL_MODE,
  222. .clkr.hw.init = &(const struct clk_init_data){
  223. .name = "disp_cc_mdss_ahb_clk_src",
  224. .parent_data = disp_cc_parent_data_5,
  225. .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
  226. .ops = &clk_rcg2_ops,
  227. },
  228. .clkr.vdd_data = {
  229. .vdd_class = &vdd_mm,
  230. .num_rate_max = VDD_NUM,
  231. .rate_max = (unsigned long[VDD_NUM]) {
  232. [VDD_LOW_L1] = 37500000,
  233. [VDD_NOMINAL] = 75000000},
  234. },
  235. };
  236. static const struct freq_tbl ftbl_disp_cc_mdss_byte0_clk_src[] = {
  237. F(19200000, P_BI_TCXO, 1, 0, 0),
  238. { }
  239. };
  240. static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
  241. .cmd_rcgr = 0x80ec,
  242. .mnd_width = 0,
  243. .hid_width = 5,
  244. .parent_map = disp_cc_parent_map_1,
  245. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  246. .clkr.hw.init = &(const struct clk_init_data){
  247. .name = "disp_cc_mdss_byte0_clk_src",
  248. .parent_data = disp_cc_parent_data_1,
  249. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  250. .flags = CLK_SET_RATE_PARENT,
  251. .ops = &clk_byte2_ops,
  252. },
  253. .clkr.vdd_data = {
  254. .vdd_class = &vdd_mm,
  255. .num_rate_max = VDD_NUM,
  256. .rate_max = (unsigned long[VDD_NUM]) {
  257. [VDD_LOW_L1] = 358000000},
  258. },
  259. };
  260. static struct clk_rcg2 disp_cc_mdss_byte1_clk_src = {
  261. .cmd_rcgr = 0x8108,
  262. .mnd_width = 0,
  263. .hid_width = 5,
  264. .parent_map = disp_cc_parent_map_1,
  265. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  266. .clkr.hw.init = &(const struct clk_init_data){
  267. .name = "disp_cc_mdss_byte1_clk_src",
  268. .parent_data = disp_cc_parent_data_1,
  269. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  270. .flags = CLK_SET_RATE_PARENT,
  271. .ops = &clk_byte2_ops,
  272. },
  273. .clkr.vdd_data = {
  274. .vdd_class = &vdd_mm,
  275. .num_rate_max = VDD_NUM,
  276. .rate_max = (unsigned long[VDD_NUM]) {
  277. [VDD_LOW_L1] = 358000000},
  278. },
  279. };
  280. static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = {
  281. .cmd_rcgr = 0x81b8,
  282. .mnd_width = 0,
  283. .hid_width = 5,
  284. .parent_map = disp_cc_parent_map_2,
  285. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  286. .clkr.hw.init = &(const struct clk_init_data){
  287. .name = "disp_cc_mdss_dptx0_aux_clk_src",
  288. .parent_data = disp_cc_parent_data_2,
  289. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  290. .ops = &clk_rcg2_ops,
  291. },
  292. .clkr.vdd_data = {
  293. .vdd_class = &vdd_mm,
  294. .num_rate_max = VDD_NUM,
  295. .rate_max = (unsigned long[VDD_NUM]) {
  296. [VDD_LOW_L1] = 19200000},
  297. },
  298. };
  299. static struct clk_rcg2 disp_cc_mdss_dptx0_crypto_clk_src = {
  300. .cmd_rcgr = 0x8170,
  301. .mnd_width = 0,
  302. .hid_width = 5,
  303. .parent_map = disp_cc_parent_map_3,
  304. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  305. .clkr.hw.init = &(const struct clk_init_data){
  306. .name = "disp_cc_mdss_dptx0_crypto_clk_src",
  307. .parent_data = disp_cc_parent_data_3,
  308. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  309. .flags = CLK_SET_RATE_PARENT,
  310. .ops = &clk_byte2_ops,
  311. },
  312. .clkr.vdd_data = {
  313. .vdd_class = &vdd_mm,
  314. .num_rate_max = VDD_NUM,
  315. .rate_max = (unsigned long[VDD_NUM]) {
  316. [VDD_LOW_L1] = 396000000,
  317. [VDD_NOMINAL] = 540000000},
  318. },
  319. };
  320. static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = {
  321. .cmd_rcgr = 0x8154,
  322. .mnd_width = 0,
  323. .hid_width = 5,
  324. .parent_map = disp_cc_parent_map_3,
  325. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  326. .clkr.hw.init = &(const struct clk_init_data){
  327. .name = "disp_cc_mdss_dptx0_link_clk_src",
  328. .parent_data = disp_cc_parent_data_3,
  329. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  330. .flags = CLK_SET_RATE_PARENT,
  331. .ops = &clk_byte2_ops,
  332. },
  333. .clkr.vdd_data = {
  334. .vdd_class = &vdd_mm,
  335. .num_rate_max = VDD_NUM,
  336. .rate_max = (unsigned long[VDD_NUM]) {
  337. [VDD_LOW_L1] = 594000000,
  338. [VDD_NOMINAL] = 810000000},
  339. },
  340. };
  341. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel0_clk_src = {
  342. .cmd_rcgr = 0x8188,
  343. .mnd_width = 16,
  344. .hid_width = 5,
  345. .parent_map = disp_cc_parent_map_0,
  346. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  347. .clkr.hw.init = &(const struct clk_init_data){
  348. .name = "disp_cc_mdss_dptx0_pixel0_clk_src",
  349. .parent_data = disp_cc_parent_data_0,
  350. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  351. .flags = CLK_SET_RATE_PARENT,
  352. .ops = &clk_dp_ops,
  353. },
  354. .clkr.vdd_data = {
  355. .vdd_class = &vdd_mm,
  356. .num_rate_max = VDD_NUM,
  357. .rate_max = (unsigned long[VDD_NUM]) {
  358. [VDD_LOW_L1] = 405000000,
  359. [VDD_NOMINAL] = 675000000},
  360. },
  361. };
  362. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel1_clk_src = {
  363. .cmd_rcgr = 0x81a0,
  364. .mnd_width = 16,
  365. .hid_width = 5,
  366. .parent_map = disp_cc_parent_map_0,
  367. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  368. .clkr.hw.init = &(const struct clk_init_data){
  369. .name = "disp_cc_mdss_dptx0_pixel1_clk_src",
  370. .parent_data = disp_cc_parent_data_0,
  371. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  372. .flags = CLK_SET_RATE_PARENT,
  373. .ops = &clk_dp_ops,
  374. },
  375. .clkr.vdd_data = {
  376. .vdd_class = &vdd_mm,
  377. .num_rate_max = VDD_NUM,
  378. .rate_max = (unsigned long[VDD_NUM]) {
  379. [VDD_LOW_L1] = 405000000,
  380. [VDD_NOMINAL] = 675000000},
  381. },
  382. };
  383. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel2_clk_src = {
  384. .cmd_rcgr = 0x826c,
  385. .mnd_width = 16,
  386. .hid_width = 5,
  387. .parent_map = disp_cc_parent_map_0,
  388. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  389. .clkr.hw.init = &(const struct clk_init_data){
  390. .name = "disp_cc_mdss_dptx0_pixel2_clk_src",
  391. .parent_data = disp_cc_parent_data_0,
  392. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  393. .flags = CLK_SET_RATE_PARENT,
  394. .ops = &clk_dp_ops,
  395. },
  396. .clkr.vdd_data = {
  397. .vdd_class = &vdd_mm,
  398. .num_rate_max = VDD_NUM,
  399. .rate_max = (unsigned long[VDD_NUM]) {
  400. [VDD_LOW_L1] = 405000000,
  401. [VDD_NOMINAL] = 675000000},
  402. },
  403. };
  404. static struct clk_rcg2 disp_cc_mdss_dptx0_pixel3_clk_src = {
  405. .cmd_rcgr = 0x8284,
  406. .mnd_width = 16,
  407. .hid_width = 5,
  408. .parent_map = disp_cc_parent_map_0,
  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_pixel3_clk_src",
  412. .parent_data = disp_cc_parent_data_0,
  413. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  414. .flags = CLK_SET_RATE_PARENT,
  415. .ops = &clk_dp_ops,
  416. },
  417. .clkr.vdd_data = {
  418. .vdd_class = &vdd_mm,
  419. .num_rate_max = VDD_NUM,
  420. .rate_max = (unsigned long[VDD_NUM]) {
  421. [VDD_LOW_L1] = 405000000,
  422. [VDD_NOMINAL] = 675000000},
  423. },
  424. };
  425. static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = {
  426. .cmd_rcgr = 0x8234,
  427. .mnd_width = 0,
  428. .hid_width = 5,
  429. .parent_map = disp_cc_parent_map_2,
  430. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  431. .clkr.hw.init = &(const struct clk_init_data){
  432. .name = "disp_cc_mdss_dptx1_aux_clk_src",
  433. .parent_data = disp_cc_parent_data_2,
  434. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  435. .ops = &clk_rcg2_ops,
  436. },
  437. .clkr.vdd_data = {
  438. .vdd_class = &vdd_mm,
  439. .num_rate_max = VDD_NUM,
  440. .rate_max = (unsigned long[VDD_NUM]) {
  441. [VDD_LOW_L1] = 19200000},
  442. },
  443. };
  444. static struct clk_rcg2 disp_cc_mdss_dptx1_crypto_clk_src = {
  445. .cmd_rcgr = 0x821c,
  446. .mnd_width = 0,
  447. .hid_width = 5,
  448. .parent_map = disp_cc_parent_map_3,
  449. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  450. .clkr.hw.init = &(const struct clk_init_data){
  451. .name = "disp_cc_mdss_dptx1_crypto_clk_src",
  452. .parent_data = disp_cc_parent_data_3,
  453. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  454. .flags = CLK_SET_RATE_PARENT,
  455. .ops = &clk_byte2_ops,
  456. },
  457. .clkr.vdd_data = {
  458. .vdd_class = &vdd_mm,
  459. .num_rate_max = VDD_NUM,
  460. .rate_max = (unsigned long[VDD_NUM]) {
  461. [VDD_LOW_L1] = 396000000,
  462. [VDD_NOMINAL] = 540000000},
  463. },
  464. };
  465. static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = {
  466. .cmd_rcgr = 0x8200,
  467. .mnd_width = 0,
  468. .hid_width = 5,
  469. .parent_map = disp_cc_parent_map_3,
  470. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  471. .clkr.hw.init = &(const struct clk_init_data){
  472. .name = "disp_cc_mdss_dptx1_link_clk_src",
  473. .parent_data = disp_cc_parent_data_3,
  474. .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
  475. .flags = CLK_SET_RATE_PARENT,
  476. .ops = &clk_byte2_ops,
  477. },
  478. .clkr.vdd_data = {
  479. .vdd_class = &vdd_mm,
  480. .num_rate_max = VDD_NUM,
  481. .rate_max = (unsigned long[VDD_NUM]) {
  482. [VDD_LOW_L1] = 594000000,
  483. [VDD_NOMINAL] = 810000000},
  484. },
  485. };
  486. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel0_clk_src = {
  487. .cmd_rcgr = 0x81d0,
  488. .mnd_width = 16,
  489. .hid_width = 5,
  490. .parent_map = disp_cc_parent_map_0,
  491. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  492. .clkr.hw.init = &(const struct clk_init_data){
  493. .name = "disp_cc_mdss_dptx1_pixel0_clk_src",
  494. .parent_data = disp_cc_parent_data_0,
  495. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  496. .flags = CLK_SET_RATE_PARENT,
  497. .ops = &clk_dp_ops,
  498. },
  499. .clkr.vdd_data = {
  500. .vdd_class = &vdd_mm,
  501. .num_rate_max = VDD_NUM,
  502. .rate_max = (unsigned long[VDD_NUM]) {
  503. [VDD_LOW_L1] = 405000000,
  504. [VDD_NOMINAL] = 675000000},
  505. },
  506. };
  507. static struct clk_rcg2 disp_cc_mdss_dptx1_pixel1_clk_src = {
  508. .cmd_rcgr = 0x81e8,
  509. .mnd_width = 16,
  510. .hid_width = 5,
  511. .parent_map = disp_cc_parent_map_0,
  512. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  513. .clkr.hw.init = &(const struct clk_init_data){
  514. .name = "disp_cc_mdss_dptx1_pixel1_clk_src",
  515. .parent_data = disp_cc_parent_data_0,
  516. .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
  517. .flags = CLK_SET_RATE_PARENT,
  518. .ops = &clk_dp_ops,
  519. },
  520. .clkr.vdd_data = {
  521. .vdd_class = &vdd_mm,
  522. .num_rate_max = VDD_NUM,
  523. .rate_max = (unsigned long[VDD_NUM]) {
  524. [VDD_LOW_L1] = 405000000,
  525. [VDD_NOMINAL] = 675000000},
  526. },
  527. };
  528. static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
  529. .cmd_rcgr = 0x8124,
  530. .mnd_width = 0,
  531. .hid_width = 5,
  532. .parent_map = disp_cc_parent_map_4,
  533. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  534. .clkr.hw.init = &(const struct clk_init_data){
  535. .name = "disp_cc_mdss_esc0_clk_src",
  536. .parent_data = disp_cc_parent_data_4,
  537. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  538. .flags = CLK_SET_RATE_PARENT,
  539. .ops = &clk_rcg2_ops,
  540. },
  541. .clkr.vdd_data = {
  542. .vdd_class = &vdd_mm,
  543. .num_rate_max = VDD_NUM,
  544. .rate_max = (unsigned long[VDD_NUM]) {
  545. [VDD_LOW_L1] = 19200000},
  546. },
  547. };
  548. static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = {
  549. .cmd_rcgr = 0x813c,
  550. .mnd_width = 0,
  551. .hid_width = 5,
  552. .parent_map = disp_cc_parent_map_4,
  553. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  554. .clkr.hw.init = &(const struct clk_init_data){
  555. .name = "disp_cc_mdss_esc1_clk_src",
  556. .parent_data = disp_cc_parent_data_4,
  557. .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
  558. .flags = CLK_SET_RATE_PARENT,
  559. .ops = &clk_rcg2_ops,
  560. },
  561. .clkr.vdd_data = {
  562. .vdd_class = &vdd_mm,
  563. .num_rate_max = VDD_NUM,
  564. .rate_max = (unsigned long[VDD_NUM]) {
  565. [VDD_LOW_L1] = 19200000},
  566. },
  567. };
  568. static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
  569. F(375000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  570. F(500000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  571. F(575000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  572. F(650000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
  573. { }
  574. };
  575. static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
  576. .cmd_rcgr = 0x80bc,
  577. .mnd_width = 0,
  578. .hid_width = 5,
  579. .parent_map = disp_cc_parent_map_6,
  580. .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
  581. .enable_safe_config = true,
  582. .flags = HW_CLK_CTRL_MODE,
  583. .clkr.hw.init = &(const struct clk_init_data){
  584. .name = "disp_cc_mdss_mdp_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_ops,
  589. },
  590. .clkr.vdd_data = {
  591. .vdd_class = &vdd_mm,
  592. .num_rate_max = VDD_NUM,
  593. .rate_max = (unsigned long[VDD_NUM]) {
  594. [VDD_LOW_L1] = 375000000,
  595. [VDD_NOMINAL] = 500000000,
  596. [VDD_HIGH] = 575000000,
  597. [VDD_HIGH_L1] = 650000000},
  598. },
  599. };
  600. static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
  601. .cmd_rcgr = 0x808c,
  602. .mnd_width = 8,
  603. .hid_width = 5,
  604. .parent_map = disp_cc_parent_map_1,
  605. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  606. .clkr.hw.init = &(const struct clk_init_data){
  607. .name = "disp_cc_mdss_pclk0_clk_src",
  608. .parent_data = disp_cc_parent_data_1,
  609. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  610. .flags = CLK_SET_RATE_PARENT,
  611. .ops = &clk_pixel_ops,
  612. },
  613. .clkr.vdd_data = {
  614. .vdd_class = &vdd_mm,
  615. .num_rate_max = VDD_NUM,
  616. .rate_max = (unsigned long[VDD_NUM]) {
  617. [VDD_LOW_L1] = 625000000},
  618. },
  619. };
  620. static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
  621. .cmd_rcgr = 0x80a4,
  622. .mnd_width = 8,
  623. .hid_width = 5,
  624. .parent_map = disp_cc_parent_map_1,
  625. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  626. .clkr.hw.init = &(const struct clk_init_data){
  627. .name = "disp_cc_mdss_pclk1_clk_src",
  628. .parent_data = disp_cc_parent_data_1,
  629. .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
  630. .flags = CLK_SET_RATE_PARENT,
  631. .ops = &clk_pixel_ops,
  632. },
  633. .clkr.vdd_data = {
  634. .vdd_class = &vdd_mm,
  635. .num_rate_max = VDD_NUM,
  636. .rate_max = (unsigned long[VDD_NUM]) {
  637. [VDD_LOW_L1] = 625000000},
  638. },
  639. };
  640. static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
  641. .cmd_rcgr = 0x80d4,
  642. .mnd_width = 0,
  643. .hid_width = 5,
  644. .parent_map = disp_cc_parent_map_2,
  645. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  646. .clkr.hw.init = &(const struct clk_init_data){
  647. .name = "disp_cc_mdss_vsync_clk_src",
  648. .parent_data = disp_cc_parent_data_2,
  649. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
  650. .ops = &clk_rcg2_ops,
  651. },
  652. .clkr.vdd_data = {
  653. .vdd_class = &vdd_mm,
  654. .num_rate_max = VDD_NUM,
  655. .rate_max = (unsigned long[VDD_NUM]) {
  656. [VDD_LOW_L1] = 19200000},
  657. },
  658. };
  659. static const struct freq_tbl ftbl_disp_cc_sleep_clk_src[] = {
  660. F(32000, P_SLEEP_CLK, 1, 0, 0),
  661. { }
  662. };
  663. static struct clk_rcg2 disp_cc_sleep_clk_src = {
  664. .cmd_rcgr = 0xc058,
  665. .mnd_width = 0,
  666. .hid_width = 5,
  667. .parent_map = disp_cc_parent_map_7,
  668. .freq_tbl = ftbl_disp_cc_sleep_clk_src,
  669. .clkr.hw.init = &(const struct clk_init_data){
  670. .name = "disp_cc_sleep_clk_src",
  671. .parent_data = disp_cc_parent_data_7_ao,
  672. .num_parents = ARRAY_SIZE(disp_cc_parent_data_7_ao),
  673. .ops = &clk_rcg2_ops,
  674. },
  675. };
  676. static struct clk_rcg2 disp_cc_xo_clk_src = {
  677. .cmd_rcgr = 0xc03c,
  678. .mnd_width = 0,
  679. .hid_width = 5,
  680. .parent_map = disp_cc_parent_map_2,
  681. .freq_tbl = ftbl_disp_cc_mdss_byte0_clk_src,
  682. .clkr.hw.init = &(const struct clk_init_data){
  683. .name = "disp_cc_xo_clk_src",
  684. .parent_data = disp_cc_parent_data_2_ao,
  685. .num_parents = ARRAY_SIZE(disp_cc_parent_data_2_ao),
  686. .ops = &clk_rcg2_ops,
  687. },
  688. };
  689. static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
  690. .reg = 0x8104,
  691. .shift = 0,
  692. .width = 4,
  693. .clkr.hw.init = &(const struct clk_init_data) {
  694. .name = "disp_cc_mdss_byte0_div_clk_src",
  695. .parent_hws = (const struct clk_hw*[]){
  696. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  697. },
  698. .num_parents = 1,
  699. .flags = CLK_SET_RATE_PARENT,
  700. .ops = &clk_regmap_div_ops,
  701. },
  702. };
  703. static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = {
  704. .reg = 0x8120,
  705. .shift = 0,
  706. .width = 4,
  707. .clkr.hw.init = &(const struct clk_init_data) {
  708. .name = "disp_cc_mdss_byte1_div_clk_src",
  709. .parent_hws = (const struct clk_hw*[]){
  710. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  711. },
  712. .num_parents = 1,
  713. .flags = CLK_SET_RATE_PARENT,
  714. .ops = &clk_regmap_div_ro_ops,
  715. },
  716. };
  717. static struct clk_regmap_div disp_cc_mdss_dptx0_link_div_clk_src = {
  718. .reg = 0x816c,
  719. .shift = 0,
  720. .width = 4,
  721. .clkr.hw.init = &(const struct clk_init_data) {
  722. .name = "disp_cc_mdss_dptx0_link_div_clk_src",
  723. .parent_hws = (const struct clk_hw*[]){
  724. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  725. },
  726. .num_parents = 1,
  727. .flags = CLK_SET_RATE_PARENT,
  728. .ops = &clk_regmap_div_ro_ops,
  729. },
  730. };
  731. static struct clk_regmap_div disp_cc_mdss_dptx1_link_div_clk_src = {
  732. .reg = 0x8218,
  733. .shift = 0,
  734. .width = 4,
  735. .clkr.hw.init = &(const struct clk_init_data) {
  736. .name = "disp_cc_mdss_dptx1_link_div_clk_src",
  737. .parent_hws = (const struct clk_hw*[]){
  738. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  739. },
  740. .num_parents = 1,
  741. .flags = CLK_SET_RATE_PARENT,
  742. .ops = &clk_regmap_div_ro_ops,
  743. },
  744. };
  745. static struct clk_branch disp_cc_mdss_ahb1_clk = {
  746. .halt_reg = 0x8088,
  747. .halt_check = BRANCH_HALT,
  748. .clkr = {
  749. .enable_reg = 0x8088,
  750. .enable_mask = BIT(0),
  751. .hw.init = &(const struct clk_init_data){
  752. .name = "disp_cc_mdss_ahb1_clk",
  753. .parent_hws = (const struct clk_hw*[]){
  754. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  755. },
  756. .num_parents = 1,
  757. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  758. .ops = &clk_branch2_ops,
  759. },
  760. },
  761. };
  762. static struct clk_branch disp_cc_mdss_ahb_clk = {
  763. .halt_reg = 0x8084,
  764. .halt_check = BRANCH_HALT,
  765. .clkr = {
  766. .enable_reg = 0x8084,
  767. .enable_mask = BIT(0),
  768. .hw.init = &(const struct clk_init_data){
  769. .name = "disp_cc_mdss_ahb_clk",
  770. .parent_hws = (const struct clk_hw*[]){
  771. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  772. },
  773. .num_parents = 1,
  774. .flags = CLK_DONT_HOLD_STATE | CLK_SET_RATE_PARENT,
  775. .ops = &clk_branch2_ops,
  776. },
  777. },
  778. };
  779. static struct clk_branch disp_cc_mdss_byte0_clk = {
  780. .halt_reg = 0x8034,
  781. .halt_check = BRANCH_HALT,
  782. .clkr = {
  783. .enable_reg = 0x8034,
  784. .enable_mask = BIT(0),
  785. .hw.init = &(const struct clk_init_data){
  786. .name = "disp_cc_mdss_byte0_clk",
  787. .parent_hws = (const struct clk_hw*[]){
  788. &disp_cc_mdss_byte0_clk_src.clkr.hw,
  789. },
  790. .num_parents = 1,
  791. .flags = CLK_SET_RATE_PARENT,
  792. .ops = &clk_branch2_ops,
  793. },
  794. },
  795. };
  796. static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
  797. .halt_reg = 0x8038,
  798. .halt_check = BRANCH_HALT,
  799. .clkr = {
  800. .enable_reg = 0x8038,
  801. .enable_mask = BIT(0),
  802. .hw.init = &(const struct clk_init_data){
  803. .name = "disp_cc_mdss_byte0_intf_clk",
  804. .parent_hws = (const struct clk_hw*[]){
  805. &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
  806. },
  807. .num_parents = 1,
  808. .flags = CLK_SET_RATE_PARENT,
  809. .ops = &clk_branch2_ops,
  810. },
  811. },
  812. };
  813. static struct clk_branch disp_cc_mdss_byte1_clk = {
  814. .halt_reg = 0x803c,
  815. .halt_check = BRANCH_HALT,
  816. .clkr = {
  817. .enable_reg = 0x803c,
  818. .enable_mask = BIT(0),
  819. .hw.init = &(const struct clk_init_data){
  820. .name = "disp_cc_mdss_byte1_clk",
  821. .parent_hws = (const struct clk_hw*[]){
  822. &disp_cc_mdss_byte1_clk_src.clkr.hw,
  823. },
  824. .num_parents = 1,
  825. .flags = CLK_SET_RATE_PARENT,
  826. .ops = &clk_branch2_ops,
  827. },
  828. },
  829. };
  830. static struct clk_branch disp_cc_mdss_byte1_intf_clk = {
  831. .halt_reg = 0x8040,
  832. .halt_check = BRANCH_HALT,
  833. .clkr = {
  834. .enable_reg = 0x8040,
  835. .enable_mask = BIT(0),
  836. .hw.init = &(const struct clk_init_data){
  837. .name = "disp_cc_mdss_byte1_intf_clk",
  838. .parent_hws = (const struct clk_hw*[]){
  839. &disp_cc_mdss_byte1_div_clk_src.clkr.hw,
  840. },
  841. .num_parents = 1,
  842. .flags = CLK_SET_RATE_PARENT,
  843. .ops = &clk_branch2_ops,
  844. },
  845. },
  846. };
  847. static struct clk_branch disp_cc_mdss_dptx0_aux_clk = {
  848. .halt_reg = 0x805c,
  849. .halt_check = BRANCH_HALT,
  850. .clkr = {
  851. .enable_reg = 0x805c,
  852. .enable_mask = BIT(0),
  853. .hw.init = &(const struct clk_init_data){
  854. .name = "disp_cc_mdss_dptx0_aux_clk",
  855. .parent_hws = (const struct clk_hw*[]){
  856. &disp_cc_mdss_dptx0_aux_clk_src.clkr.hw,
  857. },
  858. .num_parents = 1,
  859. .flags = CLK_SET_RATE_PARENT,
  860. .ops = &clk_branch2_ops,
  861. },
  862. },
  863. };
  864. static struct clk_branch disp_cc_mdss_dptx0_crypto_clk = {
  865. .halt_reg = 0x8058,
  866. .halt_check = BRANCH_HALT,
  867. .clkr = {
  868. .enable_reg = 0x8058,
  869. .enable_mask = BIT(0),
  870. .hw.init = &(const struct clk_init_data){
  871. .name = "disp_cc_mdss_dptx0_crypto_clk",
  872. .parent_hws = (const struct clk_hw*[]){
  873. &disp_cc_mdss_dptx0_crypto_clk_src.clkr.hw,
  874. },
  875. .num_parents = 1,
  876. .flags = CLK_SET_RATE_PARENT,
  877. .ops = &clk_branch2_ops,
  878. },
  879. },
  880. };
  881. static struct clk_branch disp_cc_mdss_dptx0_link_clk = {
  882. .halt_reg = 0x804c,
  883. .halt_check = BRANCH_HALT,
  884. .clkr = {
  885. .enable_reg = 0x804c,
  886. .enable_mask = BIT(0),
  887. .hw.init = &(const struct clk_init_data){
  888. .name = "disp_cc_mdss_dptx0_link_clk",
  889. .parent_hws = (const struct clk_hw*[]){
  890. &disp_cc_mdss_dptx0_link_clk_src.clkr.hw,
  891. },
  892. .num_parents = 1,
  893. .flags = CLK_SET_RATE_PARENT,
  894. .ops = &clk_branch2_ops,
  895. },
  896. },
  897. };
  898. static struct clk_branch disp_cc_mdss_dptx0_link_intf_clk = {
  899. .halt_reg = 0x8050,
  900. .halt_check = BRANCH_HALT,
  901. .clkr = {
  902. .enable_reg = 0x8050,
  903. .enable_mask = BIT(0),
  904. .hw.init = &(const struct clk_init_data){
  905. .name = "disp_cc_mdss_dptx0_link_intf_clk",
  906. .parent_hws = (const struct clk_hw*[]){
  907. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  908. },
  909. .num_parents = 1,
  910. .flags = CLK_SET_RATE_PARENT,
  911. .ops = &clk_branch2_ops,
  912. },
  913. },
  914. };
  915. static struct clk_branch disp_cc_mdss_dptx0_pixel0_clk = {
  916. .halt_reg = 0x8060,
  917. .halt_check = BRANCH_HALT,
  918. .clkr = {
  919. .enable_reg = 0x8060,
  920. .enable_mask = BIT(0),
  921. .hw.init = &(const struct clk_init_data){
  922. .name = "disp_cc_mdss_dptx0_pixel0_clk",
  923. .parent_hws = (const struct clk_hw*[]){
  924. &disp_cc_mdss_dptx0_pixel0_clk_src.clkr.hw,
  925. },
  926. .num_parents = 1,
  927. .flags = CLK_SET_RATE_PARENT,
  928. .ops = &clk_branch2_ops,
  929. },
  930. },
  931. };
  932. static struct clk_branch disp_cc_mdss_dptx0_pixel1_clk = {
  933. .halt_reg = 0x8064,
  934. .halt_check = BRANCH_HALT,
  935. .clkr = {
  936. .enable_reg = 0x8064,
  937. .enable_mask = BIT(0),
  938. .hw.init = &(const struct clk_init_data){
  939. .name = "disp_cc_mdss_dptx0_pixel1_clk",
  940. .parent_hws = (const struct clk_hw*[]){
  941. &disp_cc_mdss_dptx0_pixel1_clk_src.clkr.hw,
  942. },
  943. .num_parents = 1,
  944. .flags = CLK_SET_RATE_PARENT,
  945. .ops = &clk_branch2_ops,
  946. },
  947. },
  948. };
  949. static struct clk_branch disp_cc_mdss_dptx0_pixel2_clk = {
  950. .halt_reg = 0x8264,
  951. .halt_check = BRANCH_HALT,
  952. .clkr = {
  953. .enable_reg = 0x8264,
  954. .enable_mask = BIT(0),
  955. .hw.init = &(const struct clk_init_data){
  956. .name = "disp_cc_mdss_dptx0_pixel2_clk",
  957. .parent_hws = (const struct clk_hw*[]){
  958. &disp_cc_mdss_dptx0_pixel2_clk_src.clkr.hw,
  959. },
  960. .num_parents = 1,
  961. .flags = CLK_SET_RATE_PARENT,
  962. .ops = &clk_branch2_ops,
  963. },
  964. },
  965. };
  966. static struct clk_branch disp_cc_mdss_dptx0_pixel3_clk = {
  967. .halt_reg = 0x8268,
  968. .halt_check = BRANCH_HALT,
  969. .clkr = {
  970. .enable_reg = 0x8268,
  971. .enable_mask = BIT(0),
  972. .hw.init = &(const struct clk_init_data){
  973. .name = "disp_cc_mdss_dptx0_pixel3_clk",
  974. .parent_hws = (const struct clk_hw*[]){
  975. &disp_cc_mdss_dptx0_pixel3_clk_src.clkr.hw,
  976. },
  977. .num_parents = 1,
  978. .flags = CLK_SET_RATE_PARENT,
  979. .ops = &clk_branch2_ops,
  980. },
  981. },
  982. };
  983. static struct clk_branch disp_cc_mdss_dptx0_usb_router_link_intf_clk = {
  984. .halt_reg = 0x8054,
  985. .halt_check = BRANCH_HALT,
  986. .clkr = {
  987. .enable_reg = 0x8054,
  988. .enable_mask = BIT(0),
  989. .hw.init = &(const struct clk_init_data){
  990. .name = "disp_cc_mdss_dptx0_usb_router_link_intf_clk",
  991. .parent_hws = (const struct clk_hw*[]){
  992. &disp_cc_mdss_dptx0_link_div_clk_src.clkr.hw,
  993. },
  994. .num_parents = 1,
  995. .flags = CLK_SET_RATE_PARENT,
  996. .ops = &clk_branch2_ops,
  997. },
  998. },
  999. };
  1000. static struct clk_branch disp_cc_mdss_dptx1_aux_clk = {
  1001. .halt_reg = 0x8080,
  1002. .halt_check = BRANCH_HALT,
  1003. .clkr = {
  1004. .enable_reg = 0x8080,
  1005. .enable_mask = BIT(0),
  1006. .hw.init = &(const struct clk_init_data){
  1007. .name = "disp_cc_mdss_dptx1_aux_clk",
  1008. .parent_hws = (const struct clk_hw*[]){
  1009. &disp_cc_mdss_dptx1_aux_clk_src.clkr.hw,
  1010. },
  1011. .num_parents = 1,
  1012. .flags = CLK_SET_RATE_PARENT,
  1013. .ops = &clk_branch2_ops,
  1014. },
  1015. },
  1016. };
  1017. static struct clk_branch disp_cc_mdss_dptx1_crypto_clk = {
  1018. .halt_reg = 0x807c,
  1019. .halt_check = BRANCH_HALT,
  1020. .clkr = {
  1021. .enable_reg = 0x807c,
  1022. .enable_mask = BIT(0),
  1023. .hw.init = &(const struct clk_init_data){
  1024. .name = "disp_cc_mdss_dptx1_crypto_clk",
  1025. .parent_hws = (const struct clk_hw*[]){
  1026. &disp_cc_mdss_dptx1_crypto_clk_src.clkr.hw,
  1027. },
  1028. .num_parents = 1,
  1029. .flags = CLK_SET_RATE_PARENT,
  1030. .ops = &clk_branch2_ops,
  1031. },
  1032. },
  1033. };
  1034. static struct clk_branch disp_cc_mdss_dptx1_link_clk = {
  1035. .halt_reg = 0x8070,
  1036. .halt_check = BRANCH_HALT,
  1037. .clkr = {
  1038. .enable_reg = 0x8070,
  1039. .enable_mask = BIT(0),
  1040. .hw.init = &(const struct clk_init_data){
  1041. .name = "disp_cc_mdss_dptx1_link_clk",
  1042. .parent_hws = (const struct clk_hw*[]){
  1043. &disp_cc_mdss_dptx1_link_clk_src.clkr.hw,
  1044. },
  1045. .num_parents = 1,
  1046. .flags = CLK_SET_RATE_PARENT,
  1047. .ops = &clk_branch2_ops,
  1048. },
  1049. },
  1050. };
  1051. static struct clk_branch disp_cc_mdss_dptx1_link_intf_clk = {
  1052. .halt_reg = 0x8074,
  1053. .halt_check = BRANCH_HALT,
  1054. .clkr = {
  1055. .enable_reg = 0x8074,
  1056. .enable_mask = BIT(0),
  1057. .hw.init = &(const struct clk_init_data){
  1058. .name = "disp_cc_mdss_dptx1_link_intf_clk",
  1059. .parent_hws = (const struct clk_hw*[]){
  1060. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1061. },
  1062. .num_parents = 1,
  1063. .flags = CLK_SET_RATE_PARENT,
  1064. .ops = &clk_branch2_ops,
  1065. },
  1066. },
  1067. };
  1068. static struct clk_branch disp_cc_mdss_dptx1_pixel0_clk = {
  1069. .halt_reg = 0x8068,
  1070. .halt_check = BRANCH_HALT,
  1071. .clkr = {
  1072. .enable_reg = 0x8068,
  1073. .enable_mask = BIT(0),
  1074. .hw.init = &(const struct clk_init_data){
  1075. .name = "disp_cc_mdss_dptx1_pixel0_clk",
  1076. .parent_hws = (const struct clk_hw*[]){
  1077. &disp_cc_mdss_dptx1_pixel0_clk_src.clkr.hw,
  1078. },
  1079. .num_parents = 1,
  1080. .flags = CLK_SET_RATE_PARENT,
  1081. .ops = &clk_branch2_ops,
  1082. },
  1083. },
  1084. };
  1085. static struct clk_branch disp_cc_mdss_dptx1_pixel1_clk = {
  1086. .halt_reg = 0x806c,
  1087. .halt_check = BRANCH_HALT,
  1088. .clkr = {
  1089. .enable_reg = 0x806c,
  1090. .enable_mask = BIT(0),
  1091. .hw.init = &(const struct clk_init_data){
  1092. .name = "disp_cc_mdss_dptx1_pixel1_clk",
  1093. .parent_hws = (const struct clk_hw*[]){
  1094. &disp_cc_mdss_dptx1_pixel1_clk_src.clkr.hw,
  1095. },
  1096. .num_parents = 1,
  1097. .flags = CLK_SET_RATE_PARENT,
  1098. .ops = &clk_branch2_ops,
  1099. },
  1100. },
  1101. };
  1102. static struct clk_branch disp_cc_mdss_dptx1_usb_router_link_intf_clk = {
  1103. .halt_reg = 0x8078,
  1104. .halt_check = BRANCH_HALT,
  1105. .clkr = {
  1106. .enable_reg = 0x8078,
  1107. .enable_mask = BIT(0),
  1108. .hw.init = &(const struct clk_init_data){
  1109. .name = "disp_cc_mdss_dptx1_usb_router_link_intf_clk",
  1110. .parent_hws = (const struct clk_hw*[]){
  1111. &disp_cc_mdss_dptx1_link_div_clk_src.clkr.hw,
  1112. },
  1113. .num_parents = 1,
  1114. .flags = CLK_SET_RATE_PARENT,
  1115. .ops = &clk_branch2_ops,
  1116. },
  1117. },
  1118. };
  1119. static struct clk_branch disp_cc_mdss_esc0_clk = {
  1120. .halt_reg = 0x8044,
  1121. .halt_check = BRANCH_HALT,
  1122. .clkr = {
  1123. .enable_reg = 0x8044,
  1124. .enable_mask = BIT(0),
  1125. .hw.init = &(const struct clk_init_data){
  1126. .name = "disp_cc_mdss_esc0_clk",
  1127. .parent_hws = (const struct clk_hw*[]){
  1128. &disp_cc_mdss_esc0_clk_src.clkr.hw,
  1129. },
  1130. .num_parents = 1,
  1131. .flags = CLK_SET_RATE_PARENT,
  1132. .ops = &clk_branch2_ops,
  1133. },
  1134. },
  1135. };
  1136. static struct clk_branch disp_cc_mdss_esc1_clk = {
  1137. .halt_reg = 0x8048,
  1138. .halt_check = BRANCH_HALT,
  1139. .clkr = {
  1140. .enable_reg = 0x8048,
  1141. .enable_mask = BIT(0),
  1142. .hw.init = &(const struct clk_init_data){
  1143. .name = "disp_cc_mdss_esc1_clk",
  1144. .parent_hws = (const struct clk_hw*[]){
  1145. &disp_cc_mdss_esc1_clk_src.clkr.hw,
  1146. },
  1147. .num_parents = 1,
  1148. .flags = CLK_SET_RATE_PARENT,
  1149. .ops = &clk_branch2_ops,
  1150. },
  1151. },
  1152. };
  1153. static struct clk_branch disp_cc_mdss_mdp1_clk = {
  1154. .halt_reg = 0x8014,
  1155. .halt_check = BRANCH_HALT,
  1156. .clkr = {
  1157. .enable_reg = 0x8014,
  1158. .enable_mask = BIT(0),
  1159. .hw.init = &(const struct clk_init_data){
  1160. .name = "disp_cc_mdss_mdp1_clk",
  1161. .parent_hws = (const struct clk_hw*[]){
  1162. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1163. },
  1164. .num_parents = 1,
  1165. .flags = CLK_SET_RATE_PARENT,
  1166. .ops = &clk_branch2_ops,
  1167. },
  1168. },
  1169. };
  1170. static struct clk_branch disp_cc_mdss_mdp_clk = {
  1171. .halt_reg = 0x800c,
  1172. .halt_check = BRANCH_HALT,
  1173. .clkr = {
  1174. .enable_reg = 0x800c,
  1175. .enable_mask = BIT(0),
  1176. .hw.init = &(const struct clk_init_data){
  1177. .name = "disp_cc_mdss_mdp_clk",
  1178. .parent_hws = (const struct clk_hw*[]){
  1179. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1180. },
  1181. .num_parents = 1,
  1182. .flags = CLK_SET_RATE_PARENT,
  1183. .ops = &clk_branch2_ops,
  1184. },
  1185. },
  1186. };
  1187. static struct clk_branch disp_cc_mdss_mdp_lut1_clk = {
  1188. .halt_reg = 0x8024,
  1189. .halt_check = BRANCH_HALT,
  1190. .clkr = {
  1191. .enable_reg = 0x8024,
  1192. .enable_mask = BIT(0),
  1193. .hw.init = &(const struct clk_init_data){
  1194. .name = "disp_cc_mdss_mdp_lut1_clk",
  1195. .parent_hws = (const struct clk_hw*[]){
  1196. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1197. },
  1198. .num_parents = 1,
  1199. .flags = CLK_SET_RATE_PARENT,
  1200. .ops = &clk_branch2_ops,
  1201. },
  1202. },
  1203. };
  1204. static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
  1205. .halt_reg = 0x801c,
  1206. .halt_check = BRANCH_HALT,
  1207. .clkr = {
  1208. .enable_reg = 0x801c,
  1209. .enable_mask = BIT(0),
  1210. .hw.init = &(const struct clk_init_data){
  1211. .name = "disp_cc_mdss_mdp_lut_clk",
  1212. .parent_hws = (const struct clk_hw*[]){
  1213. &disp_cc_mdss_mdp_clk_src.clkr.hw,
  1214. },
  1215. .num_parents = 1,
  1216. .flags = CLK_SET_RATE_PARENT,
  1217. .ops = &clk_branch2_ops,
  1218. },
  1219. },
  1220. };
  1221. static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
  1222. .halt_reg = 0xa004,
  1223. .halt_check = BRANCH_HALT_VOTED,
  1224. .clkr = {
  1225. .enable_reg = 0xa004,
  1226. .enable_mask = BIT(0),
  1227. .hw.init = &(const struct clk_init_data){
  1228. .name = "disp_cc_mdss_non_gdsc_ahb_clk",
  1229. .parent_hws = (const struct clk_hw*[]){
  1230. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1231. },
  1232. .num_parents = 1,
  1233. .flags = CLK_SET_RATE_PARENT,
  1234. .ops = &clk_branch2_ops,
  1235. },
  1236. },
  1237. };
  1238. static struct clk_branch disp_cc_mdss_pclk0_clk = {
  1239. .halt_reg = 0x8004,
  1240. .halt_check = BRANCH_HALT,
  1241. .clkr = {
  1242. .enable_reg = 0x8004,
  1243. .enable_mask = BIT(0),
  1244. .hw.init = &(const struct clk_init_data){
  1245. .name = "disp_cc_mdss_pclk0_clk",
  1246. .parent_hws = (const struct clk_hw*[]){
  1247. &disp_cc_mdss_pclk0_clk_src.clkr.hw,
  1248. },
  1249. .num_parents = 1,
  1250. .flags = CLK_SET_RATE_PARENT,
  1251. .ops = &clk_branch2_ops,
  1252. },
  1253. },
  1254. };
  1255. static struct clk_branch disp_cc_mdss_pclk1_clk = {
  1256. .halt_reg = 0x8008,
  1257. .halt_check = BRANCH_HALT,
  1258. .clkr = {
  1259. .enable_reg = 0x8008,
  1260. .enable_mask = BIT(0),
  1261. .hw.init = &(const struct clk_init_data){
  1262. .name = "disp_cc_mdss_pclk1_clk",
  1263. .parent_hws = (const struct clk_hw*[]){
  1264. &disp_cc_mdss_pclk1_clk_src.clkr.hw,
  1265. },
  1266. .num_parents = 1,
  1267. .flags = CLK_SET_RATE_PARENT,
  1268. .ops = &clk_branch2_ops,
  1269. },
  1270. },
  1271. };
  1272. static struct clk_branch disp_cc_mdss_pll_lock_monitor_clk = {
  1273. .halt_reg = 0xe000,
  1274. .halt_check = BRANCH_HALT,
  1275. .clkr = {
  1276. .enable_reg = 0xe000,
  1277. .enable_mask = BIT(0),
  1278. .hw.init = &(const struct clk_init_data){
  1279. .name = "disp_cc_mdss_pll_lock_monitor_clk",
  1280. .parent_hws = (const struct clk_hw*[]){
  1281. &disp_cc_xo_clk_src.clkr.hw,
  1282. },
  1283. .num_parents = 1,
  1284. .flags = CLK_SET_RATE_PARENT,
  1285. .ops = &clk_branch2_ops,
  1286. },
  1287. },
  1288. };
  1289. static struct clk_branch disp_cc_mdss_rscc_ahb_clk = {
  1290. .halt_reg = 0xa00c,
  1291. .halt_check = BRANCH_HALT,
  1292. .clkr = {
  1293. .enable_reg = 0xa00c,
  1294. .enable_mask = BIT(0),
  1295. .hw.init = &(const struct clk_init_data){
  1296. .name = "disp_cc_mdss_rscc_ahb_clk",
  1297. .parent_hws = (const struct clk_hw*[]){
  1298. &disp_cc_mdss_ahb_clk_src.clkr.hw,
  1299. },
  1300. .num_parents = 1,
  1301. .flags = CLK_SET_RATE_PARENT,
  1302. .ops = &clk_branch2_ops,
  1303. },
  1304. },
  1305. };
  1306. static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
  1307. .halt_reg = 0xa008,
  1308. .halt_check = BRANCH_HALT,
  1309. .clkr = {
  1310. .enable_reg = 0xa008,
  1311. .enable_mask = BIT(0),
  1312. .hw.init = &(const struct clk_init_data){
  1313. .name = "disp_cc_mdss_rscc_vsync_clk",
  1314. .parent_hws = (const struct clk_hw*[]){
  1315. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1316. },
  1317. .num_parents = 1,
  1318. .flags = CLK_SET_RATE_PARENT,
  1319. .ops = &clk_branch2_ops,
  1320. },
  1321. },
  1322. };
  1323. static struct clk_branch disp_cc_mdss_vsync1_clk = {
  1324. .halt_reg = 0x8030,
  1325. .halt_check = BRANCH_HALT,
  1326. .clkr = {
  1327. .enable_reg = 0x8030,
  1328. .enable_mask = BIT(0),
  1329. .hw.init = &(const struct clk_init_data){
  1330. .name = "disp_cc_mdss_vsync1_clk",
  1331. .parent_hws = (const struct clk_hw*[]){
  1332. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1333. },
  1334. .num_parents = 1,
  1335. .flags = CLK_SET_RATE_PARENT,
  1336. .ops = &clk_branch2_ops,
  1337. },
  1338. },
  1339. };
  1340. static struct clk_branch disp_cc_mdss_vsync_clk = {
  1341. .halt_reg = 0x802c,
  1342. .halt_check = BRANCH_HALT,
  1343. .clkr = {
  1344. .enable_reg = 0x802c,
  1345. .enable_mask = BIT(0),
  1346. .hw.init = &(const struct clk_init_data){
  1347. .name = "disp_cc_mdss_vsync_clk",
  1348. .parent_hws = (const struct clk_hw*[]){
  1349. &disp_cc_mdss_vsync_clk_src.clkr.hw,
  1350. },
  1351. .num_parents = 1,
  1352. .flags = CLK_SET_RATE_PARENT,
  1353. .ops = &clk_branch2_ops,
  1354. },
  1355. },
  1356. };
  1357. static struct clk_regmap *disp_cc_monaco_auto_clocks[] = {
  1358. [DISP_CC_MDSS_AHB1_CLK] = &disp_cc_mdss_ahb1_clk.clkr,
  1359. [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
  1360. [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
  1361. [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
  1362. [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
  1363. [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
  1364. [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
  1365. [DISP_CC_MDSS_BYTE1_CLK] = &disp_cc_mdss_byte1_clk.clkr,
  1366. [DISP_CC_MDSS_BYTE1_CLK_SRC] = &disp_cc_mdss_byte1_clk_src.clkr,
  1367. [DISP_CC_MDSS_BYTE1_DIV_CLK_SRC] = &disp_cc_mdss_byte1_div_clk_src.clkr,
  1368. [DISP_CC_MDSS_BYTE1_INTF_CLK] = &disp_cc_mdss_byte1_intf_clk.clkr,
  1369. [DISP_CC_MDSS_DPTX0_AUX_CLK] = &disp_cc_mdss_dptx0_aux_clk.clkr,
  1370. [DISP_CC_MDSS_DPTX0_AUX_CLK_SRC] = &disp_cc_mdss_dptx0_aux_clk_src.clkr,
  1371. [DISP_CC_MDSS_DPTX0_CRYPTO_CLK] = &disp_cc_mdss_dptx0_crypto_clk.clkr,
  1372. [DISP_CC_MDSS_DPTX0_CRYPTO_CLK_SRC] = &disp_cc_mdss_dptx0_crypto_clk_src.clkr,
  1373. [DISP_CC_MDSS_DPTX0_LINK_CLK] = &disp_cc_mdss_dptx0_link_clk.clkr,
  1374. [DISP_CC_MDSS_DPTX0_LINK_CLK_SRC] = &disp_cc_mdss_dptx0_link_clk_src.clkr,
  1375. [DISP_CC_MDSS_DPTX0_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx0_link_div_clk_src.clkr,
  1376. [DISP_CC_MDSS_DPTX0_LINK_INTF_CLK] = &disp_cc_mdss_dptx0_link_intf_clk.clkr,
  1377. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK] = &disp_cc_mdss_dptx0_pixel0_clk.clkr,
  1378. [DISP_CC_MDSS_DPTX0_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx0_pixel0_clk_src.clkr,
  1379. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK] = &disp_cc_mdss_dptx0_pixel1_clk.clkr,
  1380. [DISP_CC_MDSS_DPTX0_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx0_pixel1_clk_src.clkr,
  1381. [DISP_CC_MDSS_DPTX0_PIXEL2_CLK] = &disp_cc_mdss_dptx0_pixel2_clk.clkr,
  1382. [DISP_CC_MDSS_DPTX0_PIXEL2_CLK_SRC] = &disp_cc_mdss_dptx0_pixel2_clk_src.clkr,
  1383. [DISP_CC_MDSS_DPTX0_PIXEL3_CLK] = &disp_cc_mdss_dptx0_pixel3_clk.clkr,
  1384. [DISP_CC_MDSS_DPTX0_PIXEL3_CLK_SRC] = &disp_cc_mdss_dptx0_pixel3_clk_src.clkr,
  1385. [DISP_CC_MDSS_DPTX0_USB_ROUTER_LINK_INTF_CLK] =
  1386. &disp_cc_mdss_dptx0_usb_router_link_intf_clk.clkr,
  1387. [DISP_CC_MDSS_DPTX1_AUX_CLK] = &disp_cc_mdss_dptx1_aux_clk.clkr,
  1388. [DISP_CC_MDSS_DPTX1_AUX_CLK_SRC] = &disp_cc_mdss_dptx1_aux_clk_src.clkr,
  1389. [DISP_CC_MDSS_DPTX1_CRYPTO_CLK] = &disp_cc_mdss_dptx1_crypto_clk.clkr,
  1390. [DISP_CC_MDSS_DPTX1_CRYPTO_CLK_SRC] = &disp_cc_mdss_dptx1_crypto_clk_src.clkr,
  1391. [DISP_CC_MDSS_DPTX1_LINK_CLK] = &disp_cc_mdss_dptx1_link_clk.clkr,
  1392. [DISP_CC_MDSS_DPTX1_LINK_CLK_SRC] = &disp_cc_mdss_dptx1_link_clk_src.clkr,
  1393. [DISP_CC_MDSS_DPTX1_LINK_DIV_CLK_SRC] = &disp_cc_mdss_dptx1_link_div_clk_src.clkr,
  1394. [DISP_CC_MDSS_DPTX1_LINK_INTF_CLK] = &disp_cc_mdss_dptx1_link_intf_clk.clkr,
  1395. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK] = &disp_cc_mdss_dptx1_pixel0_clk.clkr,
  1396. [DISP_CC_MDSS_DPTX1_PIXEL0_CLK_SRC] = &disp_cc_mdss_dptx1_pixel0_clk_src.clkr,
  1397. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK] = &disp_cc_mdss_dptx1_pixel1_clk.clkr,
  1398. [DISP_CC_MDSS_DPTX1_PIXEL1_CLK_SRC] = &disp_cc_mdss_dptx1_pixel1_clk_src.clkr,
  1399. [DISP_CC_MDSS_DPTX1_USB_ROUTER_LINK_INTF_CLK] =
  1400. &disp_cc_mdss_dptx1_usb_router_link_intf_clk.clkr,
  1401. [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
  1402. [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
  1403. [DISP_CC_MDSS_ESC1_CLK] = &disp_cc_mdss_esc1_clk.clkr,
  1404. [DISP_CC_MDSS_ESC1_CLK_SRC] = &disp_cc_mdss_esc1_clk_src.clkr,
  1405. [DISP_CC_MDSS_MDP1_CLK] = &disp_cc_mdss_mdp1_clk.clkr,
  1406. [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
  1407. [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
  1408. [DISP_CC_MDSS_MDP_LUT1_CLK] = &disp_cc_mdss_mdp_lut1_clk.clkr,
  1409. [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
  1410. [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
  1411. [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
  1412. [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
  1413. [DISP_CC_MDSS_PCLK1_CLK] = &disp_cc_mdss_pclk1_clk.clkr,
  1414. [DISP_CC_MDSS_PCLK1_CLK_SRC] = &disp_cc_mdss_pclk1_clk_src.clkr,
  1415. [DISP_CC_MDSS_PLL_LOCK_MONITOR_CLK] = &disp_cc_mdss_pll_lock_monitor_clk.clkr,
  1416. [DISP_CC_MDSS_RSCC_AHB_CLK] = &disp_cc_mdss_rscc_ahb_clk.clkr,
  1417. [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
  1418. [DISP_CC_MDSS_VSYNC1_CLK] = &disp_cc_mdss_vsync1_clk.clkr,
  1419. [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
  1420. [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
  1421. [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
  1422. [DISP_CC_PLL1] = &disp_cc_pll1.clkr,
  1423. [DISP_CC_SLEEP_CLK_SRC] = &disp_cc_sleep_clk_src.clkr,
  1424. [DISP_CC_XO_CLK_SRC] = &disp_cc_xo_clk_src.clkr,
  1425. };
  1426. static const struct qcom_reset_map disp_cc_monaco_auto_resets[] = {
  1427. [DISP_CC_MDSS_CORE_BCR] = { 0x8000 },
  1428. [DISP_CC_MDSS_RSCC_BCR] = { 0xa000 },
  1429. };
  1430. static const struct regmap_config disp_cc_monaco_auto_regmap_config = {
  1431. .reg_bits = 32,
  1432. .reg_stride = 4,
  1433. .val_bits = 32,
  1434. .max_register = 0x12414,
  1435. .fast_io = true,
  1436. };
  1437. static struct qcom_cc_desc disp_cc_monaco_auto_desc = {
  1438. .config = &disp_cc_monaco_auto_regmap_config,
  1439. .clks = disp_cc_monaco_auto_clocks,
  1440. .num_clks = ARRAY_SIZE(disp_cc_monaco_auto_clocks),
  1441. .resets = disp_cc_monaco_auto_resets,
  1442. .num_resets = ARRAY_SIZE(disp_cc_monaco_auto_resets),
  1443. .clk_regulators = disp_cc_monaco_auto_regulators,
  1444. .num_clk_regulators = ARRAY_SIZE(disp_cc_monaco_auto_regulators),
  1445. };
  1446. static const struct of_device_id disp_cc_monaco_auto_match_table[] = {
  1447. { .compatible = "qcom,monaco_auto-dispcc" },
  1448. { }
  1449. };
  1450. MODULE_DEVICE_TABLE(of, disp_cc_monaco_auto_match_table);
  1451. static int disp_cc_monaco_auto_probe(struct platform_device *pdev)
  1452. {
  1453. struct regmap *regmap;
  1454. int ret;
  1455. regmap = qcom_cc_map(pdev, &disp_cc_monaco_auto_desc);
  1456. if (IS_ERR(regmap))
  1457. return PTR_ERR(regmap);
  1458. ret = qcom_cc_runtime_init(pdev, &disp_cc_monaco_auto_desc);
  1459. if (ret)
  1460. return ret;
  1461. ret = pm_runtime_get_sync(&pdev->dev);
  1462. if (ret)
  1463. return ret;
  1464. clk_lucid_evo_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
  1465. clk_lucid_evo_pll_configure(&disp_cc_pll1, regmap, &disp_cc_pll1_config);
  1466. /*
  1467. * Keep clocks always enabled:
  1468. * disp_cc_sleep_clk
  1469. * disp_cc_xo_clk
  1470. */
  1471. regmap_update_bits(regmap, 0xc070, BIT(0), BIT(0));
  1472. regmap_update_bits(regmap, 0xc054, BIT(0), BIT(0));
  1473. ret = qcom_cc_really_probe(pdev, &disp_cc_monaco_auto_desc, regmap);
  1474. if (ret) {
  1475. dev_err(&pdev->dev, "Failed to register DISP CC clocks\n");
  1476. return ret;
  1477. }
  1478. pm_runtime_put_sync(&pdev->dev);
  1479. dev_info(&pdev->dev, "Registered DISP CC clocks\n");
  1480. return ret;
  1481. }
  1482. static void disp_cc_monaco_auto_sync_state(struct device *dev)
  1483. {
  1484. qcom_cc_sync_state(dev, &disp_cc_monaco_auto_desc);
  1485. }
  1486. static const struct dev_pm_ops disp_cc_monaco_auto_pm_ops = {
  1487. SET_RUNTIME_PM_OPS(qcom_cc_runtime_suspend, qcom_cc_runtime_resume, NULL)
  1488. SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
  1489. pm_runtime_force_resume)
  1490. };
  1491. static struct platform_driver disp_cc_monaco_auto_driver = {
  1492. .probe = disp_cc_monaco_auto_probe,
  1493. .driver = {
  1494. .name = "disp_cc-monaco_auto",
  1495. .of_match_table = disp_cc_monaco_auto_match_table,
  1496. .sync_state = disp_cc_monaco_auto_sync_state,
  1497. .pm = &disp_cc_monaco_auto_pm_ops,
  1498. },
  1499. };
  1500. static int __init disp_cc_monaco_auto_init(void)
  1501. {
  1502. return platform_driver_register(&disp_cc_monaco_auto_driver);
  1503. }
  1504. subsys_initcall(disp_cc_monaco_auto_init);
  1505. static void __exit disp_cc_monaco_auto_exit(void)
  1506. {
  1507. platform_driver_unregister(&disp_cc_monaco_auto_driver);
  1508. }
  1509. module_exit(disp_cc_monaco_auto_exit);
  1510. MODULE_DESCRIPTION("QTI DISP_CC MONACO_AUTO Driver");
  1511. MODULE_LICENSE("GPL");