1dd3d0662STaniya Das // SPDX-License-Identifier: GPL-2.0-only
2dd3d0662STaniya Das /*
36e6fec3fSTaniya Das * Copyright (c) 2019, 2022, The Linux Foundation. All rights reserved.
4dd3d0662STaniya Das */
5dd3d0662STaniya Das
6dd3d0662STaniya Das #include <linux/clk-provider.h>
7dd3d0662STaniya Das #include <linux/module.h>
8dd3d0662STaniya Das #include <linux/platform_device.h>
9dd3d0662STaniya Das #include <linux/regmap.h>
10dd3d0662STaniya Das
11dd3d0662STaniya Das #include <dt-bindings/clock/qcom,dispcc-sc7180.h>
12dd3d0662STaniya Das
13dd3d0662STaniya Das #include "clk-alpha-pll.h"
14dd3d0662STaniya Das #include "clk-branch.h"
15dd3d0662STaniya Das #include "clk-rcg.h"
16dd3d0662STaniya Das #include "clk-regmap-divider.h"
17dd3d0662STaniya Das #include "common.h"
18dd3d0662STaniya Das #include "gdsc.h"
19dd3d0662STaniya Das
20dd3d0662STaniya Das enum {
21dd3d0662STaniya Das P_BI_TCXO,
22dd3d0662STaniya Das P_DISP_CC_PLL0_OUT_EVEN,
23dd3d0662STaniya Das P_DISP_CC_PLL0_OUT_MAIN,
24dd3d0662STaniya Das P_DP_PHY_PLL_LINK_CLK,
25dd3d0662STaniya Das P_DP_PHY_PLL_VCO_DIV_CLK,
26dd3d0662STaniya Das P_DSI0_PHY_PLL_OUT_BYTECLK,
27dd3d0662STaniya Das P_DSI0_PHY_PLL_OUT_DSICLK,
28dd3d0662STaniya Das P_GPLL0_OUT_MAIN,
29dd3d0662STaniya Das };
30dd3d0662STaniya Das
31dd3d0662STaniya Das static const struct pll_vco fabia_vco[] = {
32dd3d0662STaniya Das { 249600000, 2000000000, 0 },
33dd3d0662STaniya Das };
34dd3d0662STaniya Das
35dd3d0662STaniya Das static struct clk_alpha_pll disp_cc_pll0 = {
36dd3d0662STaniya Das .offset = 0x0,
37dd3d0662STaniya Das .vco_table = fabia_vco,
38dd3d0662STaniya Das .num_vco = ARRAY_SIZE(fabia_vco),
39dd3d0662STaniya Das .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
40dd3d0662STaniya Das .clkr = {
41dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
42dd3d0662STaniya Das .name = "disp_cc_pll0",
43dd3d0662STaniya Das .parent_data = &(const struct clk_parent_data){
44dd3d0662STaniya Das .fw_name = "bi_tcxo",
45dd3d0662STaniya Das },
46dd3d0662STaniya Das .num_parents = 1,
47dd3d0662STaniya Das .ops = &clk_alpha_pll_fabia_ops,
48dd3d0662STaniya Das },
49dd3d0662STaniya Das },
50dd3d0662STaniya Das };
51dd3d0662STaniya Das
52dd3d0662STaniya Das static const struct clk_div_table post_div_table_disp_cc_pll0_out_even[] = {
53dd3d0662STaniya Das { 0x0, 1 },
54dd3d0662STaniya Das { }
55dd3d0662STaniya Das };
56dd3d0662STaniya Das
57dd3d0662STaniya Das static struct clk_alpha_pll_postdiv disp_cc_pll0_out_even = {
58dd3d0662STaniya Das .offset = 0x0,
59dd3d0662STaniya Das .post_div_shift = 8,
60dd3d0662STaniya Das .post_div_table = post_div_table_disp_cc_pll0_out_even,
61dd3d0662STaniya Das .num_post_div = ARRAY_SIZE(post_div_table_disp_cc_pll0_out_even),
62dd3d0662STaniya Das .width = 4,
63dd3d0662STaniya Das .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
64dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
65dd3d0662STaniya Das .name = "disp_cc_pll0_out_even",
66f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
67f8fae78cSDmitry Baryshkov &disp_cc_pll0.clkr.hw,
68dd3d0662STaniya Das },
69dd3d0662STaniya Das .num_parents = 1,
70dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
71dd3d0662STaniya Das .ops = &clk_alpha_pll_postdiv_fabia_ops,
72dd3d0662STaniya Das },
73dd3d0662STaniya Das };
74dd3d0662STaniya Das
75dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_0[] = {
76dd3d0662STaniya Das { P_BI_TCXO, 0 },
77dd3d0662STaniya Das };
78dd3d0662STaniya Das
79dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_0[] = {
80dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
81dd3d0662STaniya Das };
82dd3d0662STaniya Das
83dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_1[] = {
84dd3d0662STaniya Das { P_BI_TCXO, 0 },
85dd3d0662STaniya Das { P_DP_PHY_PLL_LINK_CLK, 1 },
86dd3d0662STaniya Das { P_DP_PHY_PLL_VCO_DIV_CLK, 2 },
87dd3d0662STaniya Das };
88dd3d0662STaniya Das
89dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_1[] = {
90dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
910a97e8a5SDouglas Anderson { .fw_name = "dp_phy_pll_link_clk" },
920a97e8a5SDouglas Anderson { .fw_name = "dp_phy_pll_vco_div_clk" },
93dd3d0662STaniya Das };
94dd3d0662STaniya Das
95dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_2[] = {
96dd3d0662STaniya Das { P_BI_TCXO, 0 },
97dd3d0662STaniya Das { P_DSI0_PHY_PLL_OUT_BYTECLK, 1 },
98dd3d0662STaniya Das };
99dd3d0662STaniya Das
100dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_2[] = {
101dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
1020a97e8a5SDouglas Anderson { .fw_name = "dsi0_phy_pll_out_byteclk" },
103dd3d0662STaniya Das };
104dd3d0662STaniya Das
105dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_3[] = {
106dd3d0662STaniya Das { P_BI_TCXO, 0 },
107dd3d0662STaniya Das { P_DISP_CC_PLL0_OUT_MAIN, 1 },
108dd3d0662STaniya Das { P_GPLL0_OUT_MAIN, 4 },
109dd3d0662STaniya Das { P_DISP_CC_PLL0_OUT_EVEN, 5 },
110dd3d0662STaniya Das };
111dd3d0662STaniya Das
112dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_3[] = {
113dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
114dd3d0662STaniya Das { .hw = &disp_cc_pll0.clkr.hw },
115dd3d0662STaniya Das { .fw_name = "gcc_disp_gpll0_clk_src" },
116dd3d0662STaniya Das { .hw = &disp_cc_pll0_out_even.clkr.hw },
117dd3d0662STaniya Das };
118dd3d0662STaniya Das
119dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_4[] = {
120dd3d0662STaniya Das { P_BI_TCXO, 0 },
121dd3d0662STaniya Das { P_GPLL0_OUT_MAIN, 4 },
122dd3d0662STaniya Das };
123dd3d0662STaniya Das
124dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_4[] = {
125dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
126dd3d0662STaniya Das { .fw_name = "gcc_disp_gpll0_clk_src" },
127dd3d0662STaniya Das };
128dd3d0662STaniya Das
129dd3d0662STaniya Das static const struct parent_map disp_cc_parent_map_5[] = {
130dd3d0662STaniya Das { P_BI_TCXO, 0 },
131dd3d0662STaniya Das { P_DSI0_PHY_PLL_OUT_DSICLK, 1 },
132dd3d0662STaniya Das };
133dd3d0662STaniya Das
134dd3d0662STaniya Das static const struct clk_parent_data disp_cc_parent_data_5[] = {
135dd3d0662STaniya Das { .fw_name = "bi_tcxo" },
1360a97e8a5SDouglas Anderson { .fw_name = "dsi0_phy_pll_out_dsiclk" },
137dd3d0662STaniya Das };
138dd3d0662STaniya Das
139dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_ahb_clk_src[] = {
140dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0),
141dd3d0662STaniya Das F(37500000, P_GPLL0_OUT_MAIN, 16, 0, 0),
142dd3d0662STaniya Das F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
143dd3d0662STaniya Das { }
144dd3d0662STaniya Das };
145dd3d0662STaniya Das
146dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_ahb_clk_src = {
147dd3d0662STaniya Das .cmd_rcgr = 0x22bc,
148dd3d0662STaniya Das .mnd_width = 0,
149dd3d0662STaniya Das .hid_width = 5,
150dd3d0662STaniya Das .parent_map = disp_cc_parent_map_4,
151dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_ahb_clk_src,
152dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
153dd3d0662STaniya Das .name = "disp_cc_mdss_ahb_clk_src",
154dd3d0662STaniya Das .parent_data = disp_cc_parent_data_4,
1553696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_4),
156dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
157dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops,
158dd3d0662STaniya Das },
159dd3d0662STaniya Das };
160dd3d0662STaniya Das
161dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_byte0_clk_src = {
162dd3d0662STaniya Das .cmd_rcgr = 0x2110,
163dd3d0662STaniya Das .mnd_width = 0,
164dd3d0662STaniya Das .hid_width = 5,
165dd3d0662STaniya Das .parent_map = disp_cc_parent_map_2,
166dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
167dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_clk_src",
168dd3d0662STaniya Das .parent_data = disp_cc_parent_data_2,
1693696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
170dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
171dd3d0662STaniya Das .ops = &clk_byte2_ops,
172dd3d0662STaniya Das },
173dd3d0662STaniya Das };
174dd3d0662STaniya Das
175dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_dp_aux_clk_src[] = {
176dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0),
177dd3d0662STaniya Das { }
178dd3d0662STaniya Das };
179dd3d0662STaniya Das
180dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_aux_clk_src = {
181dd3d0662STaniya Das .cmd_rcgr = 0x21dc,
182dd3d0662STaniya Das .mnd_width = 0,
183dd3d0662STaniya Das .hid_width = 5,
184dd3d0662STaniya Das .parent_map = disp_cc_parent_map_0,
185dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src,
186dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
187dd3d0662STaniya Das .name = "disp_cc_mdss_dp_aux_clk_src",
188dd3d0662STaniya Das .parent_data = disp_cc_parent_data_0,
1893696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
190dd3d0662STaniya Das .ops = &clk_rcg2_ops,
191dd3d0662STaniya Das },
192dd3d0662STaniya Das };
193dd3d0662STaniya Das
194dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = {
195dd3d0662STaniya Das .cmd_rcgr = 0x2194,
196dd3d0662STaniya Das .mnd_width = 0,
197dd3d0662STaniya Das .hid_width = 5,
198dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1,
199dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
200dd3d0662STaniya Das .name = "disp_cc_mdss_dp_crypto_clk_src",
201dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1,
2023696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
203dd3d0662STaniya Das .ops = &clk_byte2_ops,
204dd3d0662STaniya Das },
205dd3d0662STaniya Das };
206dd3d0662STaniya Das
207dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = {
208dd3d0662STaniya Das .cmd_rcgr = 0x2178,
209dd3d0662STaniya Das .mnd_width = 0,
210dd3d0662STaniya Das .hid_width = 5,
211dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1,
212dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
213dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_clk_src",
214dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1,
2153696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
216dd3d0662STaniya Das .ops = &clk_byte2_ops,
217dd3d0662STaniya Das },
218dd3d0662STaniya Das };
219dd3d0662STaniya Das
220dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_dp_pixel_clk_src = {
221dd3d0662STaniya Das .cmd_rcgr = 0x21ac,
222dd3d0662STaniya Das .mnd_width = 16,
223dd3d0662STaniya Das .hid_width = 5,
224dd3d0662STaniya Das .parent_map = disp_cc_parent_map_1,
225dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
226dd3d0662STaniya Das .name = "disp_cc_mdss_dp_pixel_clk_src",
227dd3d0662STaniya Das .parent_data = disp_cc_parent_data_1,
2283696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_1),
229dd3d0662STaniya Das .ops = &clk_dp_ops,
230dd3d0662STaniya Das },
231dd3d0662STaniya Das };
232dd3d0662STaniya Das
233dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = {
234dd3d0662STaniya Das .cmd_rcgr = 0x2148,
235dd3d0662STaniya Das .mnd_width = 0,
236dd3d0662STaniya Das .hid_width = 5,
237dd3d0662STaniya Das .parent_map = disp_cc_parent_map_2,
238dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src,
239dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
240dd3d0662STaniya Das .name = "disp_cc_mdss_esc0_clk_src",
241dd3d0662STaniya Das .parent_data = disp_cc_parent_data_2,
2423696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_2),
243dd3d0662STaniya Das .ops = &clk_rcg2_ops,
244dd3d0662STaniya Das },
245dd3d0662STaniya Das };
246dd3d0662STaniya Das
247dd3d0662STaniya Das static const struct freq_tbl ftbl_disp_cc_mdss_mdp_clk_src[] = {
248dd3d0662STaniya Das F(19200000, P_BI_TCXO, 1, 0, 0),
249dd3d0662STaniya Das F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
250dd3d0662STaniya Das F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
251dd3d0662STaniya Das F(345000000, P_DISP_CC_PLL0_OUT_MAIN, 4, 0, 0),
252dd3d0662STaniya Das F(460000000, P_DISP_CC_PLL0_OUT_MAIN, 3, 0, 0),
253dd3d0662STaniya Das { }
254dd3d0662STaniya Das };
255dd3d0662STaniya Das
256dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
257dd3d0662STaniya Das .cmd_rcgr = 0x20c8,
258dd3d0662STaniya Das .mnd_width = 0,
259dd3d0662STaniya Das .hid_width = 5,
260dd3d0662STaniya Das .parent_map = disp_cc_parent_map_3,
261dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
262dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
263dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_clk_src",
264dd3d0662STaniya Das .parent_data = disp_cc_parent_data_3,
2653696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
266dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops,
267dd3d0662STaniya Das },
268dd3d0662STaniya Das };
269dd3d0662STaniya Das
270dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
271dd3d0662STaniya Das .cmd_rcgr = 0x2098,
272dd3d0662STaniya Das .mnd_width = 8,
273dd3d0662STaniya Das .hid_width = 5,
274dd3d0662STaniya Das .parent_map = disp_cc_parent_map_5,
275dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
276dd3d0662STaniya Das .name = "disp_cc_mdss_pclk0_clk_src",
277dd3d0662STaniya Das .parent_data = disp_cc_parent_data_5,
2783696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
279dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
280dd3d0662STaniya Das .ops = &clk_pixel_ops,
281dd3d0662STaniya Das },
282dd3d0662STaniya Das };
283dd3d0662STaniya Das
284dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_rot_clk_src = {
285dd3d0662STaniya Das .cmd_rcgr = 0x20e0,
286dd3d0662STaniya Das .mnd_width = 0,
287dd3d0662STaniya Das .hid_width = 5,
288dd3d0662STaniya Das .parent_map = disp_cc_parent_map_3,
289dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_mdp_clk_src,
290dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
291dd3d0662STaniya Das .name = "disp_cc_mdss_rot_clk_src",
292dd3d0662STaniya Das .parent_data = disp_cc_parent_data_3,
2933696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_3),
294dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops,
295dd3d0662STaniya Das },
296dd3d0662STaniya Das };
297dd3d0662STaniya Das
298dd3d0662STaniya Das static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = {
299dd3d0662STaniya Das .cmd_rcgr = 0x20f8,
300dd3d0662STaniya Das .mnd_width = 0,
301dd3d0662STaniya Das .hid_width = 5,
302dd3d0662STaniya Das .parent_map = disp_cc_parent_map_0,
303dd3d0662STaniya Das .freq_tbl = ftbl_disp_cc_mdss_dp_aux_clk_src,
304dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data){
305dd3d0662STaniya Das .name = "disp_cc_mdss_vsync_clk_src",
306dd3d0662STaniya Das .parent_data = disp_cc_parent_data_0,
3073696ebe4SDouglas Anderson .num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
308dd3d0662STaniya Das .ops = &clk_rcg2_shared_ops,
309dd3d0662STaniya Das },
310dd3d0662STaniya Das };
311dd3d0662STaniya Das
312dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_ahb_clk = {
313dd3d0662STaniya Das .halt_reg = 0x2080,
314dd3d0662STaniya Das .halt_check = BRANCH_HALT,
315dd3d0662STaniya Das .clkr = {
316dd3d0662STaniya Das .enable_reg = 0x2080,
317dd3d0662STaniya Das .enable_mask = BIT(0),
318dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
319dd3d0662STaniya Das .name = "disp_cc_mdss_ahb_clk",
320f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
321f8fae78cSDmitry Baryshkov &disp_cc_mdss_ahb_clk_src.clkr.hw,
322dd3d0662STaniya Das },
323dd3d0662STaniya Das .num_parents = 1,
324dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
325dd3d0662STaniya Das .ops = &clk_branch2_ops,
326dd3d0662STaniya Das },
327dd3d0662STaniya Das },
328dd3d0662STaniya Das };
329dd3d0662STaniya Das
330dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_byte0_clk = {
331dd3d0662STaniya Das .halt_reg = 0x2028,
332dd3d0662STaniya Das .halt_check = BRANCH_HALT,
333dd3d0662STaniya Das .clkr = {
334dd3d0662STaniya Das .enable_reg = 0x2028,
335dd3d0662STaniya Das .enable_mask = BIT(0),
336dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
337dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_clk",
338f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
339f8fae78cSDmitry Baryshkov &disp_cc_mdss_byte0_clk_src.clkr.hw,
340dd3d0662STaniya Das },
341dd3d0662STaniya Das .num_parents = 1,
342dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
343dd3d0662STaniya Das .ops = &clk_branch2_ops,
344dd3d0662STaniya Das },
345dd3d0662STaniya Das },
346dd3d0662STaniya Das };
347dd3d0662STaniya Das
348dd3d0662STaniya Das static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = {
349dd3d0662STaniya Das .reg = 0x2128,
350dd3d0662STaniya Das .shift = 0,
351dd3d0662STaniya Das .width = 2,
352dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data) {
353dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_div_clk_src",
354*a9e46af1SDmitry Baryshkov .parent_hws = (const struct clk_hw*[]) {
355*a9e46af1SDmitry Baryshkov &disp_cc_mdss_byte0_clk_src.clkr.hw,
356dd3d0662STaniya Das },
357dd3d0662STaniya Das .num_parents = 1,
358dd3d0662STaniya Das .ops = &clk_regmap_div_ops,
359dd3d0662STaniya Das },
360dd3d0662STaniya Das };
361dd3d0662STaniya Das
362dd3d0662STaniya Das static struct clk_regmap_div disp_cc_mdss_dp_link_div_clk_src = {
363dd3d0662STaniya Das .reg = 0x2190,
364dd3d0662STaniya Das .shift = 0,
365dd3d0662STaniya Das .width = 2,
366dd3d0662STaniya Das .clkr.hw.init = &(struct clk_init_data) {
367dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_div_clk_src",
368*a9e46af1SDmitry Baryshkov .parent_hws = (const struct clk_hw*[]) {
369*a9e46af1SDmitry Baryshkov &disp_cc_mdss_dp_link_clk_src.clkr.hw,
370dd3d0662STaniya Das },
371dd3d0662STaniya Das .num_parents = 1,
372dd3d0662STaniya Das .ops = &clk_regmap_div_ops,
373dd3d0662STaniya Das },
374dd3d0662STaniya Das };
375dd3d0662STaniya Das
376dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_byte0_intf_clk = {
377dd3d0662STaniya Das .halt_reg = 0x202c,
378dd3d0662STaniya Das .halt_check = BRANCH_HALT,
379dd3d0662STaniya Das .clkr = {
380dd3d0662STaniya Das .enable_reg = 0x202c,
381dd3d0662STaniya Das .enable_mask = BIT(0),
382dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
383dd3d0662STaniya Das .name = "disp_cc_mdss_byte0_intf_clk",
384f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
385f8fae78cSDmitry Baryshkov &disp_cc_mdss_byte0_div_clk_src.clkr.hw,
386dd3d0662STaniya Das },
387dd3d0662STaniya Das .num_parents = 1,
388dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
389dd3d0662STaniya Das .ops = &clk_branch2_ops,
390dd3d0662STaniya Das },
391dd3d0662STaniya Das },
392dd3d0662STaniya Das };
393dd3d0662STaniya Das
394dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_aux_clk = {
395dd3d0662STaniya Das .halt_reg = 0x2054,
396dd3d0662STaniya Das .halt_check = BRANCH_HALT,
397dd3d0662STaniya Das .clkr = {
398dd3d0662STaniya Das .enable_reg = 0x2054,
399dd3d0662STaniya Das .enable_mask = BIT(0),
400dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
401dd3d0662STaniya Das .name = "disp_cc_mdss_dp_aux_clk",
402f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
403f8fae78cSDmitry Baryshkov &disp_cc_mdss_dp_aux_clk_src.clkr.hw,
404dd3d0662STaniya Das },
405dd3d0662STaniya Das .num_parents = 1,
406dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
407dd3d0662STaniya Das .ops = &clk_branch2_ops,
408dd3d0662STaniya Das },
409dd3d0662STaniya Das },
410dd3d0662STaniya Das };
411dd3d0662STaniya Das
412dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_crypto_clk = {
413dd3d0662STaniya Das .halt_reg = 0x2048,
414dd3d0662STaniya Das .halt_check = BRANCH_HALT,
415dd3d0662STaniya Das .clkr = {
416dd3d0662STaniya Das .enable_reg = 0x2048,
417dd3d0662STaniya Das .enable_mask = BIT(0),
418dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
419dd3d0662STaniya Das .name = "disp_cc_mdss_dp_crypto_clk",
420f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
421f8fae78cSDmitry Baryshkov &disp_cc_mdss_dp_crypto_clk_src.clkr.hw,
422dd3d0662STaniya Das },
423dd3d0662STaniya Das .num_parents = 1,
424dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
425dd3d0662STaniya Das .ops = &clk_branch2_ops,
426dd3d0662STaniya Das },
427dd3d0662STaniya Das },
428dd3d0662STaniya Das };
429dd3d0662STaniya Das
430dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_link_clk = {
431dd3d0662STaniya Das .halt_reg = 0x2040,
432dd3d0662STaniya Das .halt_check = BRANCH_HALT,
433dd3d0662STaniya Das .clkr = {
434dd3d0662STaniya Das .enable_reg = 0x2040,
435dd3d0662STaniya Das .enable_mask = BIT(0),
436dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
437dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_clk",
438f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
439f8fae78cSDmitry Baryshkov &disp_cc_mdss_dp_link_clk_src.clkr.hw,
440dd3d0662STaniya Das },
441dd3d0662STaniya Das .num_parents = 1,
442dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
443dd3d0662STaniya Das .ops = &clk_branch2_ops,
444dd3d0662STaniya Das },
445dd3d0662STaniya Das },
446dd3d0662STaniya Das };
447dd3d0662STaniya Das
448dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_link_intf_clk = {
449dd3d0662STaniya Das .halt_reg = 0x2044,
450dd3d0662STaniya Das .halt_check = BRANCH_HALT,
451dd3d0662STaniya Das .clkr = {
452dd3d0662STaniya Das .enable_reg = 0x2044,
453dd3d0662STaniya Das .enable_mask = BIT(0),
454dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
455dd3d0662STaniya Das .name = "disp_cc_mdss_dp_link_intf_clk",
456f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
457f8fae78cSDmitry Baryshkov &disp_cc_mdss_dp_link_div_clk_src.clkr.hw,
458dd3d0662STaniya Das },
459dd3d0662STaniya Das .num_parents = 1,
460dd3d0662STaniya Das .ops = &clk_branch2_ops,
461dd3d0662STaniya Das },
462dd3d0662STaniya Das },
463dd3d0662STaniya Das };
464dd3d0662STaniya Das
465dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_dp_pixel_clk = {
466dd3d0662STaniya Das .halt_reg = 0x204c,
467dd3d0662STaniya Das .halt_check = BRANCH_HALT,
468dd3d0662STaniya Das .clkr = {
469dd3d0662STaniya Das .enable_reg = 0x204c,
470dd3d0662STaniya Das .enable_mask = BIT(0),
471dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
472dd3d0662STaniya Das .name = "disp_cc_mdss_dp_pixel_clk",
473f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
474f8fae78cSDmitry Baryshkov &disp_cc_mdss_dp_pixel_clk_src.clkr.hw,
475dd3d0662STaniya Das },
476dd3d0662STaniya Das .num_parents = 1,
477dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
478dd3d0662STaniya Das .ops = &clk_branch2_ops,
479dd3d0662STaniya Das },
480dd3d0662STaniya Das },
481dd3d0662STaniya Das };
482dd3d0662STaniya Das
483dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_esc0_clk = {
484dd3d0662STaniya Das .halt_reg = 0x2038,
485dd3d0662STaniya Das .halt_check = BRANCH_HALT,
486dd3d0662STaniya Das .clkr = {
487dd3d0662STaniya Das .enable_reg = 0x2038,
488dd3d0662STaniya Das .enable_mask = BIT(0),
489dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
490dd3d0662STaniya Das .name = "disp_cc_mdss_esc0_clk",
491f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
492f8fae78cSDmitry Baryshkov &disp_cc_mdss_esc0_clk_src.clkr.hw,
493dd3d0662STaniya Das },
494dd3d0662STaniya Das .num_parents = 1,
495dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
496dd3d0662STaniya Das .ops = &clk_branch2_ops,
497dd3d0662STaniya Das },
498dd3d0662STaniya Das },
499dd3d0662STaniya Das };
500dd3d0662STaniya Das
501dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_mdp_clk = {
502dd3d0662STaniya Das .halt_reg = 0x200c,
503dd3d0662STaniya Das .halt_check = BRANCH_HALT,
504dd3d0662STaniya Das .clkr = {
505dd3d0662STaniya Das .enable_reg = 0x200c,
506dd3d0662STaniya Das .enable_mask = BIT(0),
507dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
508dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_clk",
509f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
510f8fae78cSDmitry Baryshkov &disp_cc_mdss_mdp_clk_src.clkr.hw,
511dd3d0662STaniya Das },
512dd3d0662STaniya Das .num_parents = 1,
513dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
514dd3d0662STaniya Das .ops = &clk_branch2_ops,
515dd3d0662STaniya Das },
516dd3d0662STaniya Das },
517dd3d0662STaniya Das };
518dd3d0662STaniya Das
519dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
520dd3d0662STaniya Das .halt_reg = 0x201c,
521dd3d0662STaniya Das .halt_check = BRANCH_VOTED,
522dd3d0662STaniya Das .clkr = {
523dd3d0662STaniya Das .enable_reg = 0x201c,
524dd3d0662STaniya Das .enable_mask = BIT(0),
525dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
526dd3d0662STaniya Das .name = "disp_cc_mdss_mdp_lut_clk",
527f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
528f8fae78cSDmitry Baryshkov &disp_cc_mdss_mdp_clk_src.clkr.hw,
529dd3d0662STaniya Das },
530dd3d0662STaniya Das .num_parents = 1,
531dd3d0662STaniya Das .ops = &clk_branch2_ops,
532dd3d0662STaniya Das },
533dd3d0662STaniya Das },
534dd3d0662STaniya Das };
535dd3d0662STaniya Das
536dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_non_gdsc_ahb_clk = {
537dd3d0662STaniya Das .halt_reg = 0x4004,
538dd3d0662STaniya Das .halt_check = BRANCH_VOTED,
539dd3d0662STaniya Das .clkr = {
540dd3d0662STaniya Das .enable_reg = 0x4004,
541dd3d0662STaniya Das .enable_mask = BIT(0),
542dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
543dd3d0662STaniya Das .name = "disp_cc_mdss_non_gdsc_ahb_clk",
544f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
545f8fae78cSDmitry Baryshkov &disp_cc_mdss_ahb_clk_src.clkr.hw,
546dd3d0662STaniya Das },
547dd3d0662STaniya Das .num_parents = 1,
548dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
549dd3d0662STaniya Das .ops = &clk_branch2_ops,
550dd3d0662STaniya Das },
551dd3d0662STaniya Das },
552dd3d0662STaniya Das };
553dd3d0662STaniya Das
554dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_pclk0_clk = {
555dd3d0662STaniya Das .halt_reg = 0x2004,
556dd3d0662STaniya Das .halt_check = BRANCH_HALT,
557dd3d0662STaniya Das .clkr = {
558dd3d0662STaniya Das .enable_reg = 0x2004,
559dd3d0662STaniya Das .enable_mask = BIT(0),
560dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
561dd3d0662STaniya Das .name = "disp_cc_mdss_pclk0_clk",
562f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
563f8fae78cSDmitry Baryshkov &disp_cc_mdss_pclk0_clk_src.clkr.hw,
564dd3d0662STaniya Das },
565dd3d0662STaniya Das .num_parents = 1,
566dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
567dd3d0662STaniya Das .ops = &clk_branch2_ops,
568dd3d0662STaniya Das },
569dd3d0662STaniya Das },
570dd3d0662STaniya Das };
571dd3d0662STaniya Das
572dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_rot_clk = {
573dd3d0662STaniya Das .halt_reg = 0x2014,
574dd3d0662STaniya Das .halt_check = BRANCH_HALT,
575dd3d0662STaniya Das .clkr = {
576dd3d0662STaniya Das .enable_reg = 0x2014,
577dd3d0662STaniya Das .enable_mask = BIT(0),
578dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
579dd3d0662STaniya Das .name = "disp_cc_mdss_rot_clk",
580f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
581f8fae78cSDmitry Baryshkov &disp_cc_mdss_rot_clk_src.clkr.hw,
582dd3d0662STaniya Das },
583dd3d0662STaniya Das .num_parents = 1,
584dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
585dd3d0662STaniya Das .ops = &clk_branch2_ops,
586dd3d0662STaniya Das },
587dd3d0662STaniya Das },
588dd3d0662STaniya Das };
589dd3d0662STaniya Das
590dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_rscc_vsync_clk = {
591dd3d0662STaniya Das .halt_reg = 0x4008,
592dd3d0662STaniya Das .halt_check = BRANCH_HALT,
593dd3d0662STaniya Das .clkr = {
594dd3d0662STaniya Das .enable_reg = 0x4008,
595dd3d0662STaniya Das .enable_mask = BIT(0),
596dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
597dd3d0662STaniya Das .name = "disp_cc_mdss_rscc_vsync_clk",
598f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
599f8fae78cSDmitry Baryshkov &disp_cc_mdss_vsync_clk_src.clkr.hw,
600dd3d0662STaniya Das },
601dd3d0662STaniya Das .num_parents = 1,
602dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
603dd3d0662STaniya Das .ops = &clk_branch2_ops,
604dd3d0662STaniya Das },
605dd3d0662STaniya Das },
606dd3d0662STaniya Das };
607dd3d0662STaniya Das
608dd3d0662STaniya Das static struct clk_branch disp_cc_mdss_vsync_clk = {
609dd3d0662STaniya Das .halt_reg = 0x2024,
610dd3d0662STaniya Das .halt_check = BRANCH_HALT,
611dd3d0662STaniya Das .clkr = {
612dd3d0662STaniya Das .enable_reg = 0x2024,
613dd3d0662STaniya Das .enable_mask = BIT(0),
614dd3d0662STaniya Das .hw.init = &(struct clk_init_data){
615dd3d0662STaniya Das .name = "disp_cc_mdss_vsync_clk",
616f8fae78cSDmitry Baryshkov .parent_hws = (const struct clk_hw*[]){
617f8fae78cSDmitry Baryshkov &disp_cc_mdss_vsync_clk_src.clkr.hw,
618dd3d0662STaniya Das },
619dd3d0662STaniya Das .num_parents = 1,
620dd3d0662STaniya Das .flags = CLK_SET_RATE_PARENT,
621dd3d0662STaniya Das .ops = &clk_branch2_ops,
622dd3d0662STaniya Das },
623dd3d0662STaniya Das },
624dd3d0662STaniya Das };
625dd3d0662STaniya Das
626dd3d0662STaniya Das static struct gdsc mdss_gdsc = {
627dd3d0662STaniya Das .gdscr = 0x3000,
6286e6fec3fSTaniya Das .en_rest_wait_val = 0x2,
6296e6fec3fSTaniya Das .en_few_wait_val = 0x2,
6306e6fec3fSTaniya Das .clk_dis_wait_val = 0xf,
631dd3d0662STaniya Das .pd = {
632dd3d0662STaniya Das .name = "mdss_gdsc",
633dd3d0662STaniya Das },
634dd3d0662STaniya Das .pwrsts = PWRSTS_OFF_ON,
635dd3d0662STaniya Das .flags = HW_CTRL,
636dd3d0662STaniya Das };
637dd3d0662STaniya Das
638dd3d0662STaniya Das static struct gdsc *disp_cc_sc7180_gdscs[] = {
639dd3d0662STaniya Das [MDSS_GDSC] = &mdss_gdsc,
640dd3d0662STaniya Das };
641dd3d0662STaniya Das
642dd3d0662STaniya Das static struct clk_regmap *disp_cc_sc7180_clocks[] = {
643dd3d0662STaniya Das [DISP_CC_MDSS_AHB_CLK] = &disp_cc_mdss_ahb_clk.clkr,
644dd3d0662STaniya Das [DISP_CC_MDSS_AHB_CLK_SRC] = &disp_cc_mdss_ahb_clk_src.clkr,
645dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_CLK] = &disp_cc_mdss_byte0_clk.clkr,
646dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_CLK_SRC] = &disp_cc_mdss_byte0_clk_src.clkr,
647dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_DIV_CLK_SRC] = &disp_cc_mdss_byte0_div_clk_src.clkr,
648dd3d0662STaniya Das [DISP_CC_MDSS_BYTE0_INTF_CLK] = &disp_cc_mdss_byte0_intf_clk.clkr,
649dd3d0662STaniya Das [DISP_CC_MDSS_DP_AUX_CLK] = &disp_cc_mdss_dp_aux_clk.clkr,
650dd3d0662STaniya Das [DISP_CC_MDSS_DP_AUX_CLK_SRC] = &disp_cc_mdss_dp_aux_clk_src.clkr,
651dd3d0662STaniya Das [DISP_CC_MDSS_DP_CRYPTO_CLK] = &disp_cc_mdss_dp_crypto_clk.clkr,
652dd3d0662STaniya Das [DISP_CC_MDSS_DP_CRYPTO_CLK_SRC] = &disp_cc_mdss_dp_crypto_clk_src.clkr,
653dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_CLK] = &disp_cc_mdss_dp_link_clk.clkr,
654dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_CLK_SRC] = &disp_cc_mdss_dp_link_clk_src.clkr,
655dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_DIV_CLK_SRC] =
656dd3d0662STaniya Das &disp_cc_mdss_dp_link_div_clk_src.clkr,
657dd3d0662STaniya Das [DISP_CC_MDSS_DP_LINK_INTF_CLK] = &disp_cc_mdss_dp_link_intf_clk.clkr,
658dd3d0662STaniya Das [DISP_CC_MDSS_DP_PIXEL_CLK] = &disp_cc_mdss_dp_pixel_clk.clkr,
659dd3d0662STaniya Das [DISP_CC_MDSS_DP_PIXEL_CLK_SRC] = &disp_cc_mdss_dp_pixel_clk_src.clkr,
660dd3d0662STaniya Das [DISP_CC_MDSS_ESC0_CLK] = &disp_cc_mdss_esc0_clk.clkr,
661dd3d0662STaniya Das [DISP_CC_MDSS_ESC0_CLK_SRC] = &disp_cc_mdss_esc0_clk_src.clkr,
662dd3d0662STaniya Das [DISP_CC_MDSS_MDP_CLK] = &disp_cc_mdss_mdp_clk.clkr,
663dd3d0662STaniya Das [DISP_CC_MDSS_MDP_CLK_SRC] = &disp_cc_mdss_mdp_clk_src.clkr,
664dd3d0662STaniya Das [DISP_CC_MDSS_MDP_LUT_CLK] = &disp_cc_mdss_mdp_lut_clk.clkr,
665dd3d0662STaniya Das [DISP_CC_MDSS_NON_GDSC_AHB_CLK] = &disp_cc_mdss_non_gdsc_ahb_clk.clkr,
666dd3d0662STaniya Das [DISP_CC_MDSS_PCLK0_CLK] = &disp_cc_mdss_pclk0_clk.clkr,
667dd3d0662STaniya Das [DISP_CC_MDSS_PCLK0_CLK_SRC] = &disp_cc_mdss_pclk0_clk_src.clkr,
668dd3d0662STaniya Das [DISP_CC_MDSS_ROT_CLK] = &disp_cc_mdss_rot_clk.clkr,
669dd3d0662STaniya Das [DISP_CC_MDSS_ROT_CLK_SRC] = &disp_cc_mdss_rot_clk_src.clkr,
670dd3d0662STaniya Das [DISP_CC_MDSS_RSCC_VSYNC_CLK] = &disp_cc_mdss_rscc_vsync_clk.clkr,
671dd3d0662STaniya Das [DISP_CC_MDSS_VSYNC_CLK] = &disp_cc_mdss_vsync_clk.clkr,
672dd3d0662STaniya Das [DISP_CC_MDSS_VSYNC_CLK_SRC] = &disp_cc_mdss_vsync_clk_src.clkr,
673dd3d0662STaniya Das [DISP_CC_PLL0] = &disp_cc_pll0.clkr,
674dd3d0662STaniya Das [DISP_CC_PLL0_OUT_EVEN] = &disp_cc_pll0_out_even.clkr,
675dd3d0662STaniya Das };
676dd3d0662STaniya Das
677dd3d0662STaniya Das static const struct regmap_config disp_cc_sc7180_regmap_config = {
678dd3d0662STaniya Das .reg_bits = 32,
679dd3d0662STaniya Das .reg_stride = 4,
680dd3d0662STaniya Das .val_bits = 32,
681dd3d0662STaniya Das .max_register = 0x10000,
682dd3d0662STaniya Das .fast_io = true,
683dd3d0662STaniya Das };
684dd3d0662STaniya Das
685dd3d0662STaniya Das static const struct qcom_cc_desc disp_cc_sc7180_desc = {
686dd3d0662STaniya Das .config = &disp_cc_sc7180_regmap_config,
687dd3d0662STaniya Das .clks = disp_cc_sc7180_clocks,
688dd3d0662STaniya Das .num_clks = ARRAY_SIZE(disp_cc_sc7180_clocks),
689dd3d0662STaniya Das .gdscs = disp_cc_sc7180_gdscs,
690dd3d0662STaniya Das .num_gdscs = ARRAY_SIZE(disp_cc_sc7180_gdscs),
691dd3d0662STaniya Das };
692dd3d0662STaniya Das
693dd3d0662STaniya Das static const struct of_device_id disp_cc_sc7180_match_table[] = {
694dd3d0662STaniya Das { .compatible = "qcom,sc7180-dispcc" },
695dd3d0662STaniya Das { }
696dd3d0662STaniya Das };
697dd3d0662STaniya Das MODULE_DEVICE_TABLE(of, disp_cc_sc7180_match_table);
698dd3d0662STaniya Das
disp_cc_sc7180_probe(struct platform_device * pdev)699dd3d0662STaniya Das static int disp_cc_sc7180_probe(struct platform_device *pdev)
700dd3d0662STaniya Das {
701dd3d0662STaniya Das struct regmap *regmap;
702dd3d0662STaniya Das struct alpha_pll_config disp_cc_pll_config = {};
703dd3d0662STaniya Das
704dd3d0662STaniya Das regmap = qcom_cc_map(pdev, &disp_cc_sc7180_desc);
705dd3d0662STaniya Das if (IS_ERR(regmap))
706dd3d0662STaniya Das return PTR_ERR(regmap);
707dd3d0662STaniya Das
708dd3d0662STaniya Das /* 1380MHz configuration */
709dd3d0662STaniya Das disp_cc_pll_config.l = 0x47;
710dd3d0662STaniya Das disp_cc_pll_config.alpha = 0xe000;
711dd3d0662STaniya Das disp_cc_pll_config.user_ctl_val = 0x00000001;
712dd3d0662STaniya Das disp_cc_pll_config.user_ctl_hi_val = 0x00004805;
713dd3d0662STaniya Das
714dd3d0662STaniya Das clk_fabia_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll_config);
715dd3d0662STaniya Das
716dd3d0662STaniya Das return qcom_cc_really_probe(pdev, &disp_cc_sc7180_desc, regmap);
717dd3d0662STaniya Das }
718dd3d0662STaniya Das
719dd3d0662STaniya Das static struct platform_driver disp_cc_sc7180_driver = {
720dd3d0662STaniya Das .probe = disp_cc_sc7180_probe,
721dd3d0662STaniya Das .driver = {
722dd3d0662STaniya Das .name = "sc7180-dispcc",
723dd3d0662STaniya Das .of_match_table = disp_cc_sc7180_match_table,
724dd3d0662STaniya Das },
725dd3d0662STaniya Das };
726dd3d0662STaniya Das
disp_cc_sc7180_init(void)727dd3d0662STaniya Das static int __init disp_cc_sc7180_init(void)
728dd3d0662STaniya Das {
729dd3d0662STaniya Das return platform_driver_register(&disp_cc_sc7180_driver);
730dd3d0662STaniya Das }
731dd3d0662STaniya Das subsys_initcall(disp_cc_sc7180_init);
732dd3d0662STaniya Das
disp_cc_sc7180_exit(void)733dd3d0662STaniya Das static void __exit disp_cc_sc7180_exit(void)
734dd3d0662STaniya Das {
735dd3d0662STaniya Das platform_driver_unregister(&disp_cc_sc7180_driver);
736dd3d0662STaniya Das }
737dd3d0662STaniya Das module_exit(disp_cc_sc7180_exit);
738dd3d0662STaniya Das
739dd3d0662STaniya Das MODULE_DESCRIPTION("QTI DISP_CC SC7180 Driver");
740dd3d0662STaniya Das MODULE_LICENSE("GPL v2");
741