1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
8 static const char * const dsi_v2_bus_clk_names[] = {
9 "core_mmss", "iface", "bus",
12 static const struct regulator_bulk_data apq8064_dsi_regulators[] = {
13 { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
14 { .supply = "avdd", .init_load_uA = 10000 }, /* 3.0 V */
15 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
18 static const struct msm_dsi_config apq8064_dsi_cfg = {
20 .regulator_data = apq8064_dsi_regulators,
21 .num_regulators = ARRAY_SIZE(apq8064_dsi_regulators),
22 .bus_clk_names = dsi_v2_bus_clk_names,
23 .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names),
25 { 0x4700000, 0x5800000 },
29 static const char * const dsi_6g_bus_clk_names[] = {
30 "mdp_core", "iface", "bus", "core_mmss",
33 static const struct regulator_bulk_data msm8974_apq8084_regulators[] = {
34 { .supply = "vdd", .init_load_uA = 150000 }, /* 3.0 V */
35 { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
36 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
39 static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
40 .io_offset = DSI_6G_REG_SHIFT,
41 .regulator_data = msm8974_apq8084_regulators,
42 .num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators),
43 .bus_clk_names = dsi_6g_bus_clk_names,
44 .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
46 { 0xfd922800, 0xfd922b00 },
50 static const char * const dsi_v1_3_1_clk_names[] = {
51 "mdp_core", "iface", "bus",
54 static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = {
55 { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
56 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
59 static const struct msm_dsi_config msm8916_dsi_cfg = {
60 .io_offset = DSI_6G_REG_SHIFT,
61 .regulator_data = dsi_v1_3_1_regulators,
62 .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
63 .bus_clk_names = dsi_v1_3_1_clk_names,
64 .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
70 static const struct msm_dsi_config msm8976_dsi_cfg = {
71 .io_offset = DSI_6G_REG_SHIFT,
72 .regulator_data = dsi_v1_3_1_regulators,
73 .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
74 .bus_clk_names = dsi_v1_3_1_clk_names,
75 .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
77 { 0x1a94000, 0x1a96000 },
81 static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
82 { .supply = "vdda", .init_load_uA = 100000 }, /* 1.25 V */
83 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
84 { .supply = "vcca", .init_load_uA = 10000 }, /* 1.0 V */
85 { .supply = "vdd", .init_load_uA = 100000 }, /* 1.8 V */
86 { .supply = "lab_reg", .init_load_uA = -1 },
87 { .supply = "ibb_reg", .init_load_uA = -1 },
90 static const struct msm_dsi_config msm8994_dsi_cfg = {
91 .io_offset = DSI_6G_REG_SHIFT,
92 .regulator_data = msm8994_dsi_regulators,
93 .num_regulators = ARRAY_SIZE(msm8994_dsi_regulators),
94 .bus_clk_names = dsi_6g_bus_clk_names,
95 .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
97 { 0xfd998000, 0xfd9a0000 },
101 static const struct regulator_bulk_data msm8996_dsi_regulators[] = {
102 { .supply = "vdda", .init_load_uA = 18160 }, /* 1.25 V */
103 { .supply = "vcca", .init_load_uA = 17000 }, /* 0.925 V */
104 { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
107 static const struct msm_dsi_config msm8996_dsi_cfg = {
108 .io_offset = DSI_6G_REG_SHIFT,
109 .regulator_data = msm8996_dsi_regulators,
110 .num_regulators = ARRAY_SIZE(msm8996_dsi_regulators),
111 .bus_clk_names = dsi_6g_bus_clk_names,
112 .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
114 { 0x994000, 0x996000 },
118 static const char * const dsi_msm8998_bus_clk_names[] = {
119 "iface", "bus", "core",
122 static const struct regulator_bulk_data msm8998_dsi_regulators[] = {
123 { .supply = "vdd", .init_load_uA = 367000 }, /* 0.9 V */
124 { .supply = "vdda", .init_load_uA = 62800 }, /* 1.2 V */
127 static const struct msm_dsi_config msm8998_dsi_cfg = {
128 .io_offset = DSI_6G_REG_SHIFT,
129 .regulator_data = msm8998_dsi_regulators,
130 .num_regulators = ARRAY_SIZE(msm8998_dsi_regulators),
131 .bus_clk_names = dsi_msm8998_bus_clk_names,
132 .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names),
134 { 0xc994000, 0xc996000 },
138 static const char * const dsi_sdm660_bus_clk_names[] = {
139 "iface", "bus", "core", "core_mmss",
142 static const struct regulator_bulk_data sdm660_dsi_regulators[] = {
143 { .supply = "vdda", .init_load_uA = 12560 }, /* 1.2 V */
146 static const struct msm_dsi_config sdm660_dsi_cfg = {
147 .io_offset = DSI_6G_REG_SHIFT,
148 .regulator_data = sdm660_dsi_regulators,
149 .num_regulators = ARRAY_SIZE(sdm660_dsi_regulators),
150 .bus_clk_names = dsi_sdm660_bus_clk_names,
151 .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names),
153 { 0xc994000, 0xc996000 },
157 static const char * const dsi_v2_4_clk_names[] = {
161 static const struct regulator_bulk_data dsi_v2_4_regulators[] = {
162 { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
165 static const struct msm_dsi_config sdm845_dsi_cfg = {
166 .io_offset = DSI_6G_REG_SHIFT,
167 .regulator_data = dsi_v2_4_regulators,
168 .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
169 .bus_clk_names = dsi_v2_4_clk_names,
170 .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
172 { 0xae94000, 0xae96000 },
176 static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
177 { .supply = "vdda", .init_load_uA = 16800 }, /* 1.2 V */
180 static const struct msm_dsi_config sm8550_dsi_cfg = {
181 .io_offset = DSI_6G_REG_SHIFT,
182 .regulator_data = sm8550_dsi_regulators,
183 .num_regulators = ARRAY_SIZE(sm8550_dsi_regulators),
184 .bus_clk_names = dsi_v2_4_clk_names,
185 .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
187 { 0xae94000, 0xae96000 },
191 static const struct msm_dsi_config sc7180_dsi_cfg = {
192 .io_offset = DSI_6G_REG_SHIFT,
193 .regulator_data = dsi_v2_4_regulators,
194 .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
195 .bus_clk_names = dsi_v2_4_clk_names,
196 .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
202 static const struct regulator_bulk_data sc7280_dsi_regulators[] = {
203 { .supply = "vdda", .init_load_uA = 8350 }, /* 1.2 V */
206 static const struct msm_dsi_config sc7280_dsi_cfg = {
207 .io_offset = DSI_6G_REG_SHIFT,
208 .regulator_data = sc7280_dsi_regulators,
209 .num_regulators = ARRAY_SIZE(sc7280_dsi_regulators),
210 .bus_clk_names = dsi_v2_4_clk_names,
211 .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
213 { 0xae94000, 0xae96000 },
217 static const struct msm_dsi_config qcm2290_dsi_cfg = {
218 .io_offset = DSI_6G_REG_SHIFT,
219 .regulator_data = dsi_v2_4_regulators,
220 .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
221 .bus_clk_names = dsi_v2_4_clk_names,
222 .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
228 static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
229 .link_clk_set_rate = dsi_link_clk_set_rate_v2,
230 .link_clk_enable = dsi_link_clk_enable_v2,
231 .link_clk_disable = dsi_link_clk_disable_v2,
232 .clk_init_ver = dsi_clk_init_v2,
233 .tx_buf_alloc = dsi_tx_buf_alloc_v2,
234 .tx_buf_get = dsi_tx_buf_get_v2,
236 .dma_base_get = dsi_dma_base_get_v2,
237 .calc_clk_rate = dsi_calc_clk_rate_v2,
240 static const struct msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = {
241 .link_clk_set_rate = dsi_link_clk_set_rate_6g,
242 .link_clk_enable = dsi_link_clk_enable_6g,
243 .link_clk_disable = dsi_link_clk_disable_6g,
244 .clk_init_ver = NULL,
245 .tx_buf_alloc = dsi_tx_buf_alloc_6g,
246 .tx_buf_get = dsi_tx_buf_get_6g,
247 .tx_buf_put = dsi_tx_buf_put_6g,
248 .dma_base_get = dsi_dma_base_get_6g,
249 .calc_clk_rate = dsi_calc_clk_rate_6g,
252 static const struct msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = {
253 .link_clk_set_rate = dsi_link_clk_set_rate_6g,
254 .link_clk_enable = dsi_link_clk_enable_6g,
255 .link_clk_disable = dsi_link_clk_disable_6g,
256 .clk_init_ver = dsi_clk_init_6g_v2,
257 .tx_buf_alloc = dsi_tx_buf_alloc_6g,
258 .tx_buf_get = dsi_tx_buf_get_6g,
259 .tx_buf_put = dsi_tx_buf_put_6g,
260 .dma_base_get = dsi_dma_base_get_6g,
261 .calc_clk_rate = dsi_calc_clk_rate_6g,
264 static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
265 {MSM_DSI_VER_MAJOR_V2, MSM_DSI_V2_VER_MINOR_8064,
266 &apq8064_dsi_cfg, &msm_dsi_v2_host_ops},
267 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_0,
268 &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
269 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1,
270 &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
271 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_1_1,
272 &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
273 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_2,
274 &msm8974_apq8084_dsi_cfg, &msm_dsi_6g_host_ops},
275 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_3,
276 &msm8994_dsi_cfg, &msm_dsi_6g_host_ops},
277 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_3_1,
278 &msm8916_dsi_cfg, &msm_dsi_6g_host_ops},
279 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_4_1,
280 &msm8996_dsi_cfg, &msm_dsi_6g_host_ops},
281 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_4_2,
282 &msm8976_dsi_cfg, &msm_dsi_6g_host_ops},
283 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_1_0,
284 &sdm660_dsi_cfg, &msm_dsi_6g_v2_host_ops},
285 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_0,
286 &msm8998_dsi_cfg, &msm_dsi_6g_v2_host_ops},
287 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_1,
288 &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
289 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_3_0,
290 &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
291 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0,
292 &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
293 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
294 &sc7180_dsi_cfg, &msm_dsi_6g_v2_host_ops},
295 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0,
296 &sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops},
297 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0,
298 &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
299 {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_7_0,
300 &sm8550_dsi_cfg, &msm_dsi_6g_v2_host_ops},
303 const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
305 const struct msm_dsi_cfg_handler *cfg_hnd = NULL;
308 for (i = ARRAY_SIZE(dsi_cfg_handlers) - 1; i >= 0; i--) {
309 if ((dsi_cfg_handlers[i].major == major) &&
310 (dsi_cfg_handlers[i].minor == minor)) {
311 cfg_hnd = &dsi_cfg_handlers[i];
319 /* Non autodetect configs */
320 const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler = {
321 .cfg = &qcm2290_dsi_cfg,
322 .ops = &msm_dsi_6g_v2_host_ops,