videocc-anorak.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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-provider.h>
  6. #include <linux/kernel.h>
  7. #include <linux/module.h>
  8. #include <linux/of_device.h>
  9. #include <linux/of.h>
  10. #include <linux/regmap.h>
  11. #include <linux/pm_runtime.h>
  12. #include <dt-bindings/clock/qcom,videocc-anorak.h>
  13. #include "clk-alpha-pll.h"
  14. #include "clk-branch.h"
  15. #include "clk-rcg.h"
  16. #include "clk-regmap-divider.h"
  17. #include "common.h"
  18. #include "reset.h"
  19. #include "vdd-level.h"
  20. static DEFINE_VDD_REGULATORS(vdd_mm, VDD_HIGH + 1, 1, vdd_corner);
  21. static DEFINE_VDD_REGULATORS(vdd_mxc, VDD_HIGH + 1, 1, vdd_corner);
  22. static struct clk_vdd_class *video_cc_anorak_regulators[] = {
  23. &vdd_mm,
  24. &vdd_mxc,
  25. };
  26. enum {
  27. P_BI_TCXO,
  28. P_SLEEP_CLK,
  29. P_VIDEO_CC_PLL0_OUT_MAIN,
  30. P_VIDEO_CC_PLL1_OUT_MAIN,
  31. };
  32. static const struct pll_vco lucid_evo_vco[] = {
  33. { 249600000, 2000000000, 0 },
  34. };
  35. /* 720MHz Configuration */
  36. static const struct alpha_pll_config video_cc_pll0_config = {
  37. .l = 0x25,
  38. .cal_l = 0x44,
  39. .alpha = 0x8000,
  40. .config_ctl_val = 0x20485699,
  41. .config_ctl_hi_val = 0x00182261,
  42. .config_ctl_hi1_val = 0x32AA299C,
  43. .user_ctl_val = 0x00000001,
  44. .user_ctl_hi_val = 0x00000805,
  45. };
  46. static struct clk_alpha_pll video_cc_pll0 = {
  47. .offset = 0x0,
  48. .vco_table = lucid_evo_vco,
  49. .num_vco = ARRAY_SIZE(lucid_evo_vco),
  50. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
  51. .clkr = {
  52. .hw.init = &(const struct clk_init_data){
  53. .name = "video_cc_pll0",
  54. .parent_data = &(const struct clk_parent_data){
  55. .fw_name = "bi_tcxo",
  56. },
  57. .num_parents = 1,
  58. .ops = &clk_alpha_pll_lucid_evo_ops,
  59. },
  60. .vdd_data = {
  61. .vdd_class = &vdd_mxc,
  62. .num_rate_max = VDD_NUM,
  63. .rate_max = (unsigned long[VDD_NUM]) {
  64. [VDD_LOWER_D1] = 500000000,
  65. [VDD_LOWER] = 615000000,
  66. [VDD_LOW] = 1066000000,
  67. [VDD_LOW_L1] = 1500000000,
  68. [VDD_NOMINAL] = 1800000000,
  69. [VDD_HIGH] = 2000000000},
  70. },
  71. },
  72. };
  73. /* 1050MHz Configuration */
  74. static const struct alpha_pll_config video_cc_pll1_config = {
  75. .l = 0x36,
  76. .cal_l = 0x44,
  77. .alpha = 0xb000,
  78. .config_ctl_val = 0x20485699,
  79. .config_ctl_hi_val = 0x00182261,
  80. .config_ctl_hi1_val = 0x32AA299C,
  81. .user_ctl_val = 0x00000001,
  82. .user_ctl_hi_val = 0x00000805,
  83. };
  84. static struct clk_alpha_pll video_cc_pll1 = {
  85. .offset = 0x1000,
  86. .vco_table = lucid_evo_vco,
  87. .num_vco = ARRAY_SIZE(lucid_evo_vco),
  88. .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID_EVO],
  89. .clkr = {
  90. .hw.init = &(const struct clk_init_data){
  91. .name = "video_cc_pll1",
  92. .parent_data = &(const struct clk_parent_data){
  93. .fw_name = "bi_tcxo",
  94. },
  95. .num_parents = 1,
  96. .ops = &clk_alpha_pll_lucid_evo_ops,
  97. },
  98. .vdd_data = {
  99. .vdd_class = &vdd_mxc,
  100. .num_rate_max = VDD_NUM,
  101. .rate_max = (unsigned long[VDD_NUM]) {
  102. [VDD_LOWER_D1] = 500000000,
  103. [VDD_LOWER] = 615000000,
  104. [VDD_LOW] = 1066000000,
  105. [VDD_LOW_L1] = 1500000000,
  106. [VDD_NOMINAL] = 1800000000,
  107. [VDD_HIGH] = 2000000000},
  108. },
  109. },
  110. };
  111. static const struct parent_map video_cc_parent_map_0[] = {
  112. { P_BI_TCXO, 0 },
  113. };
  114. static const struct clk_parent_data video_cc_parent_data_0[] = {
  115. { .fw_name = "bi_tcxo" },
  116. };
  117. static const struct parent_map video_cc_parent_map_1[] = {
  118. { P_BI_TCXO, 0 },
  119. { P_VIDEO_CC_PLL0_OUT_MAIN, 1 },
  120. };
  121. static const struct clk_parent_data video_cc_parent_data_1[] = {
  122. { .fw_name = "bi_tcxo" },
  123. { .hw = &video_cc_pll0.clkr.hw },
  124. };
  125. static const struct parent_map video_cc_parent_map_2[] = {
  126. { P_BI_TCXO, 0 },
  127. { P_VIDEO_CC_PLL1_OUT_MAIN, 1 },
  128. };
  129. static const struct clk_parent_data video_cc_parent_data_2[] = {
  130. { .fw_name = "bi_tcxo" },
  131. { .hw = &video_cc_pll1.clkr.hw },
  132. };
  133. static const struct parent_map video_cc_parent_map_3[] = {
  134. { P_SLEEP_CLK, 0 },
  135. };
  136. static const struct clk_parent_data video_cc_parent_data_3[] = {
  137. { .fw_name = "sleep_clk" },
  138. };
  139. static const struct freq_tbl ftbl_video_cc_ahb_clk_src[] = {
  140. F(19200000, P_BI_TCXO, 1, 0, 0),
  141. { }
  142. };
  143. static struct clk_rcg2 video_cc_ahb_clk_src = {
  144. .cmd_rcgr = 0x8030,
  145. .mnd_width = 0,
  146. .hid_width = 5,
  147. .parent_map = video_cc_parent_map_0,
  148. .freq_tbl = ftbl_video_cc_ahb_clk_src,
  149. .enable_safe_config = true,
  150. .clkr.hw.init = &(const struct clk_init_data){
  151. .name = "video_cc_ahb_clk_src",
  152. .parent_data = video_cc_parent_data_0,
  153. .num_parents = ARRAY_SIZE(video_cc_parent_data_0),
  154. .ops = &clk_rcg2_ops,
  155. },
  156. };
  157. static const struct freq_tbl ftbl_video_cc_mvs0_clk_src[] = {
  158. F(720000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0),
  159. F(1014000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0),
  160. F(1098000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0),
  161. F(1332000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0),
  162. F(1600000000, P_VIDEO_CC_PLL0_OUT_MAIN, 1, 0, 0),
  163. { }
  164. };
  165. static struct clk_rcg2 video_cc_mvs0_clk_src = {
  166. .cmd_rcgr = 0x8000,
  167. .mnd_width = 0,
  168. .hid_width = 5,
  169. .parent_map = video_cc_parent_map_1,
  170. .freq_tbl = ftbl_video_cc_mvs0_clk_src,
  171. .enable_safe_config = true,
  172. .clkr.hw.init = &(const struct clk_init_data){
  173. .name = "video_cc_mvs0_clk_src",
  174. .parent_data = video_cc_parent_data_1,
  175. .num_parents = ARRAY_SIZE(video_cc_parent_data_1),
  176. .flags = CLK_SET_RATE_PARENT,
  177. .ops = &clk_rcg2_ops,
  178. },
  179. .clkr.vdd_data = {
  180. .vdd_classes = video_cc_anorak_regulators,
  181. .num_vdd_classes = ARRAY_SIZE(video_cc_anorak_regulators),
  182. .num_rate_max = VDD_NUM,
  183. .rate_max = (unsigned long[VDD_NUM]) {
  184. [VDD_LOWER] = 720000000,
  185. [VDD_LOW] = 1014000000,
  186. [VDD_LOW_L1] = 1098000000,
  187. [VDD_NOMINAL] = 1332000000,
  188. [VDD_HIGH] = 1600000000},
  189. },
  190. };
  191. static const struct freq_tbl ftbl_video_cc_mvs1_clk_src[] = {
  192. F(1050000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0),
  193. F(1350000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0),
  194. F(1500000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0),
  195. F(1800000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0),
  196. F(1876000000, P_VIDEO_CC_PLL1_OUT_MAIN, 1, 0, 0),
  197. { }
  198. };
  199. static struct clk_rcg2 video_cc_mvs1_clk_src = {
  200. .cmd_rcgr = 0x8018,
  201. .mnd_width = 0,
  202. .hid_width = 5,
  203. .parent_map = video_cc_parent_map_2,
  204. .freq_tbl = ftbl_video_cc_mvs1_clk_src,
  205. .enable_safe_config = true,
  206. .clkr.hw.init = &(const struct clk_init_data){
  207. .name = "video_cc_mvs1_clk_src",
  208. .parent_data = video_cc_parent_data_2,
  209. .num_parents = ARRAY_SIZE(video_cc_parent_data_2),
  210. .flags = CLK_SET_RATE_PARENT,
  211. .ops = &clk_rcg2_ops,
  212. },
  213. .clkr.vdd_data = {
  214. .vdd_classes = video_cc_anorak_regulators,
  215. .num_vdd_classes = ARRAY_SIZE(video_cc_anorak_regulators),
  216. .num_rate_max = VDD_NUM,
  217. .rate_max = (unsigned long[VDD_NUM]) {
  218. [VDD_LOWER] = 1050000000,
  219. [VDD_LOW] = 1350000000,
  220. [VDD_LOW_L1] = 1500000000,
  221. [VDD_NOMINAL] = 1800000000,
  222. [VDD_HIGH] = 1876000000},
  223. },
  224. };
  225. static const struct freq_tbl ftbl_video_cc_sleep_clk_src[] = {
  226. F(32000, P_SLEEP_CLK, 1, 0, 0),
  227. { }
  228. };
  229. static struct clk_rcg2 video_cc_sleep_clk_src = {
  230. .cmd_rcgr = 0x8118,
  231. .mnd_width = 0,
  232. .hid_width = 5,
  233. .parent_map = video_cc_parent_map_3,
  234. .freq_tbl = ftbl_video_cc_sleep_clk_src,
  235. .clkr.hw.init = &(const struct clk_init_data){
  236. .name = "video_cc_sleep_clk_src",
  237. .parent_data = video_cc_parent_data_3,
  238. .num_parents = ARRAY_SIZE(video_cc_parent_data_3),
  239. .ops = &clk_rcg2_ops,
  240. },
  241. .clkr.vdd_data = {
  242. .vdd_class = &vdd_mm,
  243. .num_rate_max = VDD_NUM,
  244. .rate_max = (unsigned long[VDD_NUM]) {
  245. [VDD_LOWER] = 32000},
  246. },
  247. };
  248. static struct clk_rcg2 video_cc_xo_clk_src = {
  249. .cmd_rcgr = 0x80fc,
  250. .mnd_width = 0,
  251. .hid_width = 5,
  252. .parent_map = video_cc_parent_map_0,
  253. .freq_tbl = ftbl_video_cc_ahb_clk_src,
  254. .clkr.hw.init = &(const struct clk_init_data){
  255. .name = "video_cc_xo_clk_src",
  256. .parent_data = video_cc_parent_data_0,
  257. .num_parents = ARRAY_SIZE(video_cc_parent_data_0),
  258. .ops = &clk_rcg2_ops,
  259. },
  260. };
  261. static struct clk_regmap_div video_cc_mvs0_div_clk_src = {
  262. .reg = 0x80b8,
  263. .shift = 0,
  264. .width = 4,
  265. .clkr.hw.init = &(const struct clk_init_data) {
  266. .name = "video_cc_mvs0_div_clk_src",
  267. .parent_hws = (const struct clk_hw*[]){
  268. &video_cc_mvs0_clk_src.clkr.hw,
  269. },
  270. .num_parents = 1,
  271. .flags = CLK_SET_RATE_PARENT,
  272. .ops = &clk_regmap_div_ro_ops,
  273. },
  274. };
  275. static struct clk_regmap_div video_cc_mvs0c_div2_div_clk_src = {
  276. .reg = 0x806c,
  277. .shift = 0,
  278. .width = 4,
  279. .clkr.hw.init = &(const struct clk_init_data) {
  280. .name = "video_cc_mvs0c_div2_div_clk_src",
  281. .parent_hws = (const struct clk_hw*[]){
  282. &video_cc_mvs0_clk_src.clkr.hw,
  283. },
  284. .num_parents = 1,
  285. .flags = CLK_SET_RATE_PARENT,
  286. .ops = &clk_regmap_div_ro_ops,
  287. },
  288. };
  289. static struct clk_regmap_div video_cc_mvs1_div_clk_src = {
  290. .reg = 0x80dc,
  291. .shift = 0,
  292. .width = 4,
  293. .clkr.hw.init = &(const struct clk_init_data) {
  294. .name = "video_cc_mvs1_div_clk_src",
  295. .parent_hws = (const struct clk_hw*[]){
  296. &video_cc_mvs1_clk_src.clkr.hw,
  297. },
  298. .num_parents = 1,
  299. .flags = CLK_SET_RATE_PARENT,
  300. .ops = &clk_regmap_div_ro_ops,
  301. },
  302. };
  303. static struct clk_regmap_div video_cc_mvs1c_div2_div_clk_src = {
  304. .reg = 0x8094,
  305. .shift = 0,
  306. .width = 4,
  307. .clkr.hw.init = &(const struct clk_init_data) {
  308. .name = "video_cc_mvs1c_div2_div_clk_src",
  309. .parent_hws = (const struct clk_hw*[]){
  310. &video_cc_mvs1_clk_src.clkr.hw,
  311. },
  312. .num_parents = 1,
  313. .flags = CLK_SET_RATE_PARENT,
  314. .ops = &clk_regmap_div_ro_ops,
  315. },
  316. };
  317. static struct clk_branch video_cc_mvs0_clk = {
  318. .halt_reg = 0x80b0,
  319. .halt_check = BRANCH_HALT_VOTED,
  320. .hwcg_reg = 0x80b0,
  321. .hwcg_bit = 1,
  322. .clkr = {
  323. .enable_reg = 0x80b0,
  324. .enable_mask = BIT(0),
  325. .hw.init = &(const struct clk_init_data){
  326. .name = "video_cc_mvs0_clk",
  327. .parent_hws = (const struct clk_hw*[]){
  328. &video_cc_mvs0_div_clk_src.clkr.hw,
  329. },
  330. .num_parents = 1,
  331. .flags = CLK_SET_RATE_PARENT,
  332. .ops = &clk_branch2_ops,
  333. },
  334. },
  335. };
  336. static struct clk_branch video_cc_mvs0c_clk = {
  337. .halt_reg = 0x8064,
  338. .halt_check = BRANCH_HALT,
  339. .clkr = {
  340. .enable_reg = 0x8064,
  341. .enable_mask = BIT(0),
  342. .hw.init = &(const struct clk_init_data){
  343. .name = "video_cc_mvs0c_clk",
  344. .parent_hws = (const struct clk_hw*[]){
  345. &video_cc_mvs0c_div2_div_clk_src.clkr.hw,
  346. },
  347. .num_parents = 1,
  348. .flags = CLK_SET_RATE_PARENT,
  349. .ops = &clk_branch2_ops,
  350. },
  351. },
  352. };
  353. static struct clk_branch video_cc_mvs1_clk = {
  354. .halt_reg = 0x80d4,
  355. .halt_check = BRANCH_HALT_VOTED,
  356. .hwcg_reg = 0x80d4,
  357. .hwcg_bit = 1,
  358. .clkr = {
  359. .enable_reg = 0x80d4,
  360. .enable_mask = BIT(0),
  361. .hw.init = &(const struct clk_init_data){
  362. .name = "video_cc_mvs1_clk",
  363. .parent_hws = (const struct clk_hw*[]){
  364. &video_cc_mvs1_div_clk_src.clkr.hw,
  365. },
  366. .num_parents = 1,
  367. .flags = CLK_SET_RATE_PARENT,
  368. .ops = &clk_branch2_ops,
  369. },
  370. },
  371. };
  372. static struct clk_branch video_cc_mvs1c_clk = {
  373. .halt_reg = 0x808c,
  374. .halt_check = BRANCH_HALT,
  375. .clkr = {
  376. .enable_reg = 0x808c,
  377. .enable_mask = BIT(0),
  378. .hw.init = &(const struct clk_init_data){
  379. .name = "video_cc_mvs1c_clk",
  380. .parent_hws = (const struct clk_hw*[]){
  381. &video_cc_mvs1c_div2_div_clk_src.clkr.hw,
  382. },
  383. .num_parents = 1,
  384. .flags = CLK_SET_RATE_PARENT,
  385. .ops = &clk_branch2_ops,
  386. },
  387. },
  388. };
  389. static struct clk_branch video_cc_sleep_clk = {
  390. .halt_reg = 0x8130,
  391. .halt_check = BRANCH_HALT,
  392. .clkr = {
  393. .enable_reg = 0x8130,
  394. .enable_mask = BIT(0),
  395. .hw.init = &(const struct clk_init_data){
  396. .name = "video_cc_sleep_clk",
  397. .parent_hws = (const struct clk_hw*[]){
  398. &video_cc_sleep_clk_src.clkr.hw,
  399. },
  400. .num_parents = 1,
  401. .flags = CLK_SET_RATE_PARENT,
  402. .ops = &clk_branch2_ops,
  403. },
  404. },
  405. };
  406. static struct clk_regmap *video_cc_anorak_clocks[] = {
  407. [VIDEO_CC_AHB_CLK_SRC] = &video_cc_ahb_clk_src.clkr,
  408. [VIDEO_CC_MVS0_CLK] = &video_cc_mvs0_clk.clkr,
  409. [VIDEO_CC_MVS0_CLK_SRC] = &video_cc_mvs0_clk_src.clkr,
  410. [VIDEO_CC_MVS0_DIV_CLK_SRC] = &video_cc_mvs0_div_clk_src.clkr,
  411. [VIDEO_CC_MVS0C_CLK] = &video_cc_mvs0c_clk.clkr,
  412. [VIDEO_CC_MVS0C_DIV2_DIV_CLK_SRC] = &video_cc_mvs0c_div2_div_clk_src.clkr,
  413. [VIDEO_CC_MVS1_CLK] = &video_cc_mvs1_clk.clkr,
  414. [VIDEO_CC_MVS1_CLK_SRC] = &video_cc_mvs1_clk_src.clkr,
  415. [VIDEO_CC_MVS1_DIV_CLK_SRC] = &video_cc_mvs1_div_clk_src.clkr,
  416. [VIDEO_CC_MVS1C_CLK] = &video_cc_mvs1c_clk.clkr,
  417. [VIDEO_CC_MVS1C_DIV2_DIV_CLK_SRC] = &video_cc_mvs1c_div2_div_clk_src.clkr,
  418. [VIDEO_CC_PLL0] = &video_cc_pll0.clkr,
  419. [VIDEO_CC_PLL1] = &video_cc_pll1.clkr,
  420. [VIDEO_CC_SLEEP_CLK] = &video_cc_sleep_clk.clkr,
  421. [VIDEO_CC_SLEEP_CLK_SRC] = &video_cc_sleep_clk_src.clkr,
  422. [VIDEO_CC_XO_CLK_SRC] = &video_cc_xo_clk_src.clkr,
  423. };
  424. static const struct qcom_reset_map video_cc_anorak_resets[] = {
  425. [CVP_VIDEO_CC_INTERFACE_BCR] = { 0x80e0 },
  426. [CVP_VIDEO_CC_MVS0_BCR] = { 0x8098 },
  427. [VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 },
  428. [CVP_VIDEO_CC_MVS0C_BCR] = { 0x8048 },
  429. [CVP_VIDEO_CC_MVS1_BCR] = { 0x80bc },
  430. [VIDEO_CC_MVS1C_CLK_ARES] = { 0x808c, 2 },
  431. [CVP_VIDEO_CC_MVS1C_BCR] = { 0x8070 },
  432. };
  433. static const struct regmap_config video_cc_anorak_regmap_config = {
  434. .reg_bits = 32,
  435. .reg_stride = 4,
  436. .val_bits = 32,
  437. .max_register = 0x9f4c,
  438. .fast_io = true,
  439. };
  440. static struct qcom_cc_desc video_cc_anorak_desc = {
  441. .config = &video_cc_anorak_regmap_config,
  442. .clks = video_cc_anorak_clocks,
  443. .num_clks = ARRAY_SIZE(video_cc_anorak_clocks),
  444. .resets = video_cc_anorak_resets,
  445. .num_resets = ARRAY_SIZE(video_cc_anorak_resets),
  446. .clk_regulators = video_cc_anorak_regulators,
  447. .num_clk_regulators = ARRAY_SIZE(video_cc_anorak_regulators),
  448. };
  449. static const struct of_device_id video_cc_anorak_match_table[] = {
  450. { .compatible = "qcom,anorak-videocc" },
  451. { }
  452. };
  453. MODULE_DEVICE_TABLE(of, video_cc_anorak_match_table);
  454. static int video_cc_anorak_probe(struct platform_device *pdev)
  455. {
  456. struct regmap *regmap;
  457. int ret;
  458. regmap = qcom_cc_map(pdev, &video_cc_anorak_desc);
  459. if (IS_ERR(regmap))
  460. return PTR_ERR(regmap);
  461. ret = qcom_cc_runtime_init(pdev, &video_cc_anorak_desc);
  462. if (ret)
  463. return ret;
  464. ret = pm_runtime_get_sync(&pdev->dev);
  465. if (ret)
  466. return ret;
  467. clk_lucid_evo_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config);
  468. clk_lucid_evo_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config);
  469. /*
  470. * Keep clocks always enabled:
  471. * video_cc_ahb_clk
  472. * video_cc_xo_clk
  473. */
  474. regmap_update_bits(regmap, 0x80e4, BIT(0), BIT(0));
  475. regmap_update_bits(regmap, 0x8114, BIT(0), BIT(0));
  476. ret = qcom_cc_really_probe(pdev, &video_cc_anorak_desc, regmap);
  477. if (ret) {
  478. dev_err(&pdev->dev, "Failed to register VIDEO CC clocks\n");
  479. return ret;
  480. }
  481. pm_runtime_put_sync(&pdev->dev);
  482. dev_info(&pdev->dev, "Registered VIDEO CC clocks\n");
  483. return ret;
  484. }
  485. static void video_cc_anorak_sync_state(struct device *dev)
  486. {
  487. qcom_cc_sync_state(dev, &video_cc_anorak_desc);
  488. }
  489. static const struct dev_pm_ops video_cc_anorak_pm_ops = {
  490. SET_RUNTIME_PM_OPS(qcom_cc_runtime_suspend, qcom_cc_runtime_resume, NULL)
  491. SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
  492. pm_runtime_force_resume)
  493. };
  494. static struct platform_driver video_cc_anorak_driver = {
  495. .probe = video_cc_anorak_probe,
  496. .driver = {
  497. .name = "video_cc-anorak",
  498. .of_match_table = video_cc_anorak_match_table,
  499. .sync_state = video_cc_anorak_sync_state,
  500. .pm = &video_cc_anorak_pm_ops,
  501. },
  502. };
  503. static int __init video_cc_anorak_init(void)
  504. {
  505. return platform_driver_register(&video_cc_anorak_driver);
  506. }
  507. subsys_initcall(video_cc_anorak_init);
  508. static void __exit video_cc_anorak_exit(void)
  509. {
  510. platform_driver_unregister(&video_cc_anorak_driver);
  511. }
  512. module_exit(video_cc_anorak_exit);
  513. MODULE_DESCRIPTION("QTI VIDEO_CC ANORAK Driver");
  514. MODULE_LICENSE("GPL");