1*b843c749SSergey Zigachev /*
2*b843c749SSergey Zigachev  * Copyright 2012-15 Advanced Micro Devices, Inc.
3*b843c749SSergey Zigachev  *
4*b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5*b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6*b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7*b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*b843c749SSergey Zigachev  * and/or sell copies of the Software, and to permit persons to whom the
9*b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10*b843c749SSergey Zigachev  *
11*b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12*b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13*b843c749SSergey Zigachev  *
14*b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21*b843c749SSergey Zigachev  *
22*b843c749SSergey Zigachev  * Authors: AMD
23*b843c749SSergey Zigachev  *
24*b843c749SSergey Zigachev  */
25*b843c749SSergey Zigachev 
26*b843c749SSergey Zigachev #include "dm_services.h"
27*b843c749SSergey Zigachev 
28*b843c749SSergey Zigachev #include "atom.h"
29*b843c749SSergey Zigachev 
30*b843c749SSergey Zigachev #include "include/bios_parser_types.h"
31*b843c749SSergey Zigachev 
32*b843c749SSergey Zigachev #include "../command_table_helper.h"
33*b843c749SSergey Zigachev 
phy_id_to_atom(enum transmitter t)34*b843c749SSergey Zigachev static uint8_t phy_id_to_atom(enum transmitter t)
35*b843c749SSergey Zigachev {
36*b843c749SSergey Zigachev 	uint8_t atom_phy_id;
37*b843c749SSergey Zigachev 
38*b843c749SSergey Zigachev 	switch (t) {
39*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_A:
40*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYA;
41*b843c749SSergey Zigachev 		break;
42*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_B:
43*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYB;
44*b843c749SSergey Zigachev 		break;
45*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_C:
46*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYC;
47*b843c749SSergey Zigachev 		break;
48*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_D:
49*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYD;
50*b843c749SSergey Zigachev 		break;
51*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_E:
52*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYE;
53*b843c749SSergey Zigachev 		break;
54*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_F:
55*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYF;
56*b843c749SSergey Zigachev 		break;
57*b843c749SSergey Zigachev 	case TRANSMITTER_UNIPHY_G:
58*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYG;
59*b843c749SSergey Zigachev 		break;
60*b843c749SSergey Zigachev 	default:
61*b843c749SSergey Zigachev 		atom_phy_id = ATOM_PHY_ID_UNIPHYA;
62*b843c749SSergey Zigachev 		break;
63*b843c749SSergey Zigachev 	}
64*b843c749SSergey Zigachev 	return atom_phy_id;
65*b843c749SSergey Zigachev }
66*b843c749SSergey Zigachev 
signal_type_to_atom_dig_mode(enum signal_type s)67*b843c749SSergey Zigachev static uint8_t signal_type_to_atom_dig_mode(enum signal_type s)
68*b843c749SSergey Zigachev {
69*b843c749SSergey Zigachev 	uint8_t atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP;
70*b843c749SSergey Zigachev 
71*b843c749SSergey Zigachev 	switch (s) {
72*b843c749SSergey Zigachev 	case SIGNAL_TYPE_DISPLAY_PORT:
73*b843c749SSergey Zigachev 	case SIGNAL_TYPE_EDP:
74*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP;
75*b843c749SSergey Zigachev 		break;
76*b843c749SSergey Zigachev 	case SIGNAL_TYPE_LVDS:
77*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_LVDS;
78*b843c749SSergey Zigachev 		break;
79*b843c749SSergey Zigachev 	case SIGNAL_TYPE_DVI_SINGLE_LINK:
80*b843c749SSergey Zigachev 	case SIGNAL_TYPE_DVI_DUAL_LINK:
81*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DVI;
82*b843c749SSergey Zigachev 		break;
83*b843c749SSergey Zigachev 	case SIGNAL_TYPE_HDMI_TYPE_A:
84*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_HDMI;
85*b843c749SSergey Zigachev 		break;
86*b843c749SSergey Zigachev 	case SIGNAL_TYPE_DISPLAY_PORT_MST:
87*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DP_MST;
88*b843c749SSergey Zigachev 		break;
89*b843c749SSergey Zigachev 	default:
90*b843c749SSergey Zigachev 		atom_dig_mode = ATOM_TRANSMITTER_DIGMODE_V5_DVI;
91*b843c749SSergey Zigachev 		break;
92*b843c749SSergey Zigachev 	}
93*b843c749SSergey Zigachev 
94*b843c749SSergey Zigachev 	return atom_dig_mode;
95*b843c749SSergey Zigachev }
96*b843c749SSergey Zigachev 
clock_source_id_to_atom_phy_clk_src_id(enum clock_source_id id)97*b843c749SSergey Zigachev static uint8_t clock_source_id_to_atom_phy_clk_src_id(
98*b843c749SSergey Zigachev 		enum clock_source_id id)
99*b843c749SSergey Zigachev {
100*b843c749SSergey Zigachev 	uint8_t atom_phy_clk_src_id = 0;
101*b843c749SSergey Zigachev 
102*b843c749SSergey Zigachev 	switch (id) {
103*b843c749SSergey Zigachev 	case CLOCK_SOURCE_ID_PLL0:
104*b843c749SSergey Zigachev 		atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P0PLL;
105*b843c749SSergey Zigachev 		break;
106*b843c749SSergey Zigachev 	case CLOCK_SOURCE_ID_PLL1:
107*b843c749SSergey Zigachev 		atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
108*b843c749SSergey Zigachev 		break;
109*b843c749SSergey Zigachev 	case CLOCK_SOURCE_ID_PLL2:
110*b843c749SSergey Zigachev 		atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P2PLL;
111*b843c749SSergey Zigachev 		break;
112*b843c749SSergey Zigachev 	case CLOCK_SOURCE_ID_EXTERNAL:
113*b843c749SSergey Zigachev 		atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_REFCLK_SRC_EXT;
114*b843c749SSergey Zigachev 		break;
115*b843c749SSergey Zigachev 	default:
116*b843c749SSergey Zigachev 		atom_phy_clk_src_id = ATOM_TRANSMITTER_CONFIG_V5_P1PLL;
117*b843c749SSergey Zigachev 		break;
118*b843c749SSergey Zigachev 	}
119*b843c749SSergey Zigachev 
120*b843c749SSergey Zigachev 	return atom_phy_clk_src_id >> 2;
121*b843c749SSergey Zigachev }
122*b843c749SSergey Zigachev 
hpd_sel_to_atom(enum hpd_source_id id)123*b843c749SSergey Zigachev static uint8_t hpd_sel_to_atom(enum hpd_source_id id)
124*b843c749SSergey Zigachev {
125*b843c749SSergey Zigachev 	uint8_t atom_hpd_sel = 0;
126*b843c749SSergey Zigachev 
127*b843c749SSergey Zigachev 	switch (id) {
128*b843c749SSergey Zigachev 	case HPD_SOURCEID1:
129*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD1_SEL;
130*b843c749SSergey Zigachev 		break;
131*b843c749SSergey Zigachev 	case HPD_SOURCEID2:
132*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD2_SEL;
133*b843c749SSergey Zigachev 		break;
134*b843c749SSergey Zigachev 	case HPD_SOURCEID3:
135*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD3_SEL;
136*b843c749SSergey Zigachev 		break;
137*b843c749SSergey Zigachev 	case HPD_SOURCEID4:
138*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD4_SEL;
139*b843c749SSergey Zigachev 		break;
140*b843c749SSergey Zigachev 	case HPD_SOURCEID5:
141*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD5_SEL;
142*b843c749SSergey Zigachev 		break;
143*b843c749SSergey Zigachev 	case HPD_SOURCEID6:
144*b843c749SSergey Zigachev 		atom_hpd_sel = ATOM_TRANSMITTER_CONFIG_V5_HPD6_SEL;
145*b843c749SSergey Zigachev 		break;
146*b843c749SSergey Zigachev 	case HPD_SOURCEID_UNKNOWN:
147*b843c749SSergey Zigachev 	default:
148*b843c749SSergey Zigachev 		atom_hpd_sel = 0;
149*b843c749SSergey Zigachev 		break;
150*b843c749SSergey Zigachev 	}
151*b843c749SSergey Zigachev 	return atom_hpd_sel >> 4;
152*b843c749SSergey Zigachev }
153*b843c749SSergey Zigachev 
dig_encoder_sel_to_atom(enum engine_id id)154*b843c749SSergey Zigachev static uint8_t dig_encoder_sel_to_atom(enum engine_id id)
155*b843c749SSergey Zigachev {
156*b843c749SSergey Zigachev 	uint8_t atom_dig_encoder_sel = 0;
157*b843c749SSergey Zigachev 
158*b843c749SSergey Zigachev 	switch (id) {
159*b843c749SSergey Zigachev 	case ENGINE_ID_DIGA:
160*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGA_SEL;
161*b843c749SSergey Zigachev 		break;
162*b843c749SSergey Zigachev 	case ENGINE_ID_DIGB:
163*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGB_SEL;
164*b843c749SSergey Zigachev 		break;
165*b843c749SSergey Zigachev 	case ENGINE_ID_DIGC:
166*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGC_SEL;
167*b843c749SSergey Zigachev 		break;
168*b843c749SSergey Zigachev 	case ENGINE_ID_DIGD:
169*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGD_SEL;
170*b843c749SSergey Zigachev 		break;
171*b843c749SSergey Zigachev 	case ENGINE_ID_DIGE:
172*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGE_SEL;
173*b843c749SSergey Zigachev 		break;
174*b843c749SSergey Zigachev 	case ENGINE_ID_DIGF:
175*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGF_SEL;
176*b843c749SSergey Zigachev 		break;
177*b843c749SSergey Zigachev 	case ENGINE_ID_DIGG:
178*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGG_SEL;
179*b843c749SSergey Zigachev 		break;
180*b843c749SSergey Zigachev 	case ENGINE_ID_UNKNOWN:
181*b843c749SSergey Zigachev 		 /* No DIG_FRONT is associated to DIG_BACKEND */
182*b843c749SSergey Zigachev 		atom_dig_encoder_sel = 0;
183*b843c749SSergey Zigachev 		break;
184*b843c749SSergey Zigachev 	default:
185*b843c749SSergey Zigachev 		atom_dig_encoder_sel = ATOM_TRANMSITTER_V5__DIGA_SEL;
186*b843c749SSergey Zigachev 		break;
187*b843c749SSergey Zigachev 	}
188*b843c749SSergey Zigachev 
189*b843c749SSergey Zigachev 	return 0;
190*b843c749SSergey Zigachev }
191*b843c749SSergey Zigachev 
clock_source_id_to_atom(enum clock_source_id id,uint32_t * atom_pll_id)192*b843c749SSergey Zigachev static bool clock_source_id_to_atom(
193*b843c749SSergey Zigachev 	enum clock_source_id id,
194*b843c749SSergey Zigachev 	uint32_t *atom_pll_id)
195*b843c749SSergey Zigachev {
196*b843c749SSergey Zigachev 	bool result = true;
197*b843c749SSergey Zigachev 
198*b843c749SSergey Zigachev 	if (atom_pll_id != NULL)
199*b843c749SSergey Zigachev 		switch (id) {
200*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_PLL0:
201*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL0;
202*b843c749SSergey Zigachev 			break;
203*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_PLL1:
204*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL1;
205*b843c749SSergey Zigachev 			break;
206*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_PLL2:
207*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL2;
208*b843c749SSergey Zigachev 			break;
209*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_EXTERNAL:
210*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL_INVALID;
211*b843c749SSergey Zigachev 			break;
212*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_DFS:
213*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_EXT_PLL1;
214*b843c749SSergey Zigachev 			break;
215*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_VCE:
216*b843c749SSergey Zigachev 			/* for VCE encoding,
217*b843c749SSergey Zigachev 			 * we need to pass in ATOM_PPLL_INVALID
218*b843c749SSergey Zigachev 			 */
219*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL_INVALID;
220*b843c749SSergey Zigachev 			break;
221*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_DP_DTO:
222*b843c749SSergey Zigachev 			/* When programming DP DTO PLL ID should be invalid */
223*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL_INVALID;
224*b843c749SSergey Zigachev 			break;
225*b843c749SSergey Zigachev 		case CLOCK_SOURCE_ID_UNDEFINED:
226*b843c749SSergey Zigachev 			/* Should not happen */
227*b843c749SSergey Zigachev 			*atom_pll_id = ATOM_PPLL_INVALID;
228*b843c749SSergey Zigachev 			result = false;
229*b843c749SSergey Zigachev 			break;
230*b843c749SSergey Zigachev 		default:
231*b843c749SSergey Zigachev 			result = false;
232*b843c749SSergey Zigachev 			break;
233*b843c749SSergey Zigachev 		}
234*b843c749SSergey Zigachev 
235*b843c749SSergey Zigachev 	return result;
236*b843c749SSergey Zigachev }
237*b843c749SSergey Zigachev 
engine_bp_to_atom(enum engine_id id,uint32_t * atom_engine_id)238*b843c749SSergey Zigachev static bool engine_bp_to_atom(enum engine_id id, uint32_t *atom_engine_id)
239*b843c749SSergey Zigachev {
240*b843c749SSergey Zigachev 	bool result = false;
241*b843c749SSergey Zigachev 
242*b843c749SSergey Zigachev 	if (atom_engine_id != NULL)
243*b843c749SSergey Zigachev 		switch (id) {
244*b843c749SSergey Zigachev 		case ENGINE_ID_DIGA:
245*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG1_ENCODER_ID;
246*b843c749SSergey Zigachev 			result = true;
247*b843c749SSergey Zigachev 			break;
248*b843c749SSergey Zigachev 		case ENGINE_ID_DIGB:
249*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG2_ENCODER_ID;
250*b843c749SSergey Zigachev 			result = true;
251*b843c749SSergey Zigachev 			break;
252*b843c749SSergey Zigachev 		case ENGINE_ID_DIGC:
253*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG3_ENCODER_ID;
254*b843c749SSergey Zigachev 			result = true;
255*b843c749SSergey Zigachev 			break;
256*b843c749SSergey Zigachev 		case ENGINE_ID_DIGD:
257*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG4_ENCODER_ID;
258*b843c749SSergey Zigachev 			result = true;
259*b843c749SSergey Zigachev 			break;
260*b843c749SSergey Zigachev 		case ENGINE_ID_DIGE:
261*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG5_ENCODER_ID;
262*b843c749SSergey Zigachev 			result = true;
263*b843c749SSergey Zigachev 			break;
264*b843c749SSergey Zigachev 		case ENGINE_ID_DIGF:
265*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG6_ENCODER_ID;
266*b843c749SSergey Zigachev 			result = true;
267*b843c749SSergey Zigachev 			break;
268*b843c749SSergey Zigachev 		case ENGINE_ID_DIGG:
269*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DIG7_ENCODER_ID;
270*b843c749SSergey Zigachev 			result = true;
271*b843c749SSergey Zigachev 			break;
272*b843c749SSergey Zigachev 		case ENGINE_ID_DACA:
273*b843c749SSergey Zigachev 			*atom_engine_id = ASIC_INT_DAC1_ENCODER_ID;
274*b843c749SSergey Zigachev 			result = true;
275*b843c749SSergey Zigachev 			break;
276*b843c749SSergey Zigachev 		default:
277*b843c749SSergey Zigachev 			break;
278*b843c749SSergey Zigachev 		}
279*b843c749SSergey Zigachev 
280*b843c749SSergey Zigachev 	return result;
281*b843c749SSergey Zigachev }
282*b843c749SSergey Zigachev 
encoder_action_to_atom(enum bp_encoder_control_action action)283*b843c749SSergey Zigachev static uint8_t encoder_action_to_atom(enum bp_encoder_control_action action)
284*b843c749SSergey Zigachev {
285*b843c749SSergey Zigachev 	uint8_t atom_action = 0;
286*b843c749SSergey Zigachev 
287*b843c749SSergey Zigachev 	switch (action) {
288*b843c749SSergey Zigachev 	case ENCODER_CONTROL_ENABLE:
289*b843c749SSergey Zigachev 		atom_action = ATOM_ENABLE;
290*b843c749SSergey Zigachev 		break;
291*b843c749SSergey Zigachev 	case ENCODER_CONTROL_DISABLE:
292*b843c749SSergey Zigachev 		atom_action = ATOM_DISABLE;
293*b843c749SSergey Zigachev 		break;
294*b843c749SSergey Zigachev 	case ENCODER_CONTROL_SETUP:
295*b843c749SSergey Zigachev 		atom_action = ATOM_ENCODER_CMD_SETUP;
296*b843c749SSergey Zigachev 		break;
297*b843c749SSergey Zigachev 	case ENCODER_CONTROL_INIT:
298*b843c749SSergey Zigachev 		atom_action = ATOM_ENCODER_INIT;
299*b843c749SSergey Zigachev 		break;
300*b843c749SSergey Zigachev 	default:
301*b843c749SSergey Zigachev 		BREAK_TO_DEBUGGER(); /* Unhandle action in driver.!! */
302*b843c749SSergey Zigachev 		break;
303*b843c749SSergey Zigachev 	}
304*b843c749SSergey Zigachev 
305*b843c749SSergey Zigachev 	return atom_action;
306*b843c749SSergey Zigachev }
307*b843c749SSergey Zigachev 
disp_power_gating_action_to_atom(enum bp_pipe_control_action action)308*b843c749SSergey Zigachev static uint8_t disp_power_gating_action_to_atom(
309*b843c749SSergey Zigachev 	enum bp_pipe_control_action action)
310*b843c749SSergey Zigachev {
311*b843c749SSergey Zigachev 	uint8_t atom_pipe_action = 0;
312*b843c749SSergey Zigachev 
313*b843c749SSergey Zigachev 	switch (action) {
314*b843c749SSergey Zigachev 	case ASIC_PIPE_DISABLE:
315*b843c749SSergey Zigachev 		atom_pipe_action = ATOM_DISABLE;
316*b843c749SSergey Zigachev 		break;
317*b843c749SSergey Zigachev 	case ASIC_PIPE_ENABLE:
318*b843c749SSergey Zigachev 		atom_pipe_action = ATOM_ENABLE;
319*b843c749SSergey Zigachev 		break;
320*b843c749SSergey Zigachev 	case ASIC_PIPE_INIT:
321*b843c749SSergey Zigachev 		atom_pipe_action = ATOM_INIT;
322*b843c749SSergey Zigachev 		break;
323*b843c749SSergey Zigachev 	default:
324*b843c749SSergey Zigachev 		ASSERT_CRITICAL(false); /* Unhandle action in driver! */
325*b843c749SSergey Zigachev 		break;
326*b843c749SSergey Zigachev 	}
327*b843c749SSergey Zigachev 
328*b843c749SSergey Zigachev 	return atom_pipe_action;
329*b843c749SSergey Zigachev }
330*b843c749SSergey Zigachev 
331*b843c749SSergey Zigachev /* function table */
332*b843c749SSergey Zigachev static const struct command_table_helper command_table_helper_funcs = {
333*b843c749SSergey Zigachev 	.controller_id_to_atom = dal_cmd_table_helper_controller_id_to_atom,
334*b843c749SSergey Zigachev 	.encoder_action_to_atom = encoder_action_to_atom,
335*b843c749SSergey Zigachev 	.engine_bp_to_atom = engine_bp_to_atom,
336*b843c749SSergey Zigachev 	.clock_source_id_to_atom = clock_source_id_to_atom,
337*b843c749SSergey Zigachev 	.clock_source_id_to_atom_phy_clk_src_id =
338*b843c749SSergey Zigachev 			clock_source_id_to_atom_phy_clk_src_id,
339*b843c749SSergey Zigachev 	.signal_type_to_atom_dig_mode = signal_type_to_atom_dig_mode,
340*b843c749SSergey Zigachev 	.hpd_sel_to_atom = hpd_sel_to_atom,
341*b843c749SSergey Zigachev 	.dig_encoder_sel_to_atom = dig_encoder_sel_to_atom,
342*b843c749SSergey Zigachev 	.phy_id_to_atom = phy_id_to_atom,
343*b843c749SSergey Zigachev 	.disp_power_gating_action_to_atom = disp_power_gating_action_to_atom,
344*b843c749SSergey Zigachev 	.assign_control_parameter = NULL,
345*b843c749SSergey Zigachev 	.clock_source_id_to_ref_clk_src = NULL,
346*b843c749SSergey Zigachev 	.transmitter_bp_to_atom = NULL,
347*b843c749SSergey Zigachev 	.encoder_id_to_atom = dal_cmd_table_helper_encoder_id_to_atom,
348*b843c749SSergey Zigachev 	.encoder_mode_bp_to_atom = dal_cmd_table_helper_encoder_mode_bp_to_atom,
349*b843c749SSergey Zigachev };
350*b843c749SSergey Zigachev 
351*b843c749SSergey Zigachev /*
352*b843c749SSergey Zigachev  * dal_cmd_tbl_helper_dce110_get_table
353*b843c749SSergey Zigachev  *
354*b843c749SSergey Zigachev  * @brief
355*b843c749SSergey Zigachev  * Initialize command table helper functions
356*b843c749SSergey Zigachev  *
357*b843c749SSergey Zigachev  * @param
358*b843c749SSergey Zigachev  * const struct command_table_helper **h - [out] struct of functions
359*b843c749SSergey Zigachev  *
360*b843c749SSergey Zigachev  */
dal_cmd_tbl_helper_dce110_get_table(void)361*b843c749SSergey Zigachev const struct command_table_helper *dal_cmd_tbl_helper_dce110_get_table(void)
362*b843c749SSergey Zigachev {
363*b843c749SSergey Zigachev 	return &command_table_helper_funcs;
364*b843c749SSergey Zigachev }
365