Lines Matching refs:ast
13 struct ast_device *ast = data; in ast_release_firmware() local
15 release_firmware(ast->dp501_fw); in ast_release_firmware()
16 ast->dp501_fw = NULL; in ast_release_firmware()
21 struct ast_device *ast = to_ast_device(dev); in ast_load_dp501_microcode() local
24 ret = request_firmware(&ast->dp501_fw, "ast_dp501_fw.bin", dev->dev); in ast_load_dp501_microcode()
28 return devm_add_action_or_reset(dev->dev, ast_release_firmware, ast); in ast_load_dp501_microcode()
31 static void send_ack(struct ast_device *ast) in send_ack() argument
34 sendack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0xff); in send_ack()
36 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0x00, sendack); in send_ack()
39 static void send_nack(struct ast_device *ast) in send_nack() argument
42 sendack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0xff); in send_nack()
44 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0x00, sendack); in send_nack()
47 static bool wait_ack(struct ast_device *ast) in wait_ack() argument
52 waitack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff); in wait_ack()
63 static bool wait_nack(struct ast_device *ast) in wait_nack() argument
68 waitack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff); in wait_nack()
79 static void set_cmd_trigger(struct ast_device *ast) in set_cmd_trigger() argument
81 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, ~0x40, 0x40); in set_cmd_trigger()
84 static void clear_cmd_trigger(struct ast_device *ast) in clear_cmd_trigger() argument
86 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, ~0x40, 0x00); in clear_cmd_trigger()
90 static bool wait_fw_ready(struct ast_device *ast)
95 waitready = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff);
109 struct ast_device *ast = to_ast_device(dev); in ast_write_cmd() local
111 if (wait_nack(ast)) { in ast_write_cmd()
112 send_nack(ast); in ast_write_cmd()
113 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, data); in ast_write_cmd()
114 send_ack(ast); in ast_write_cmd()
115 set_cmd_trigger(ast); in ast_write_cmd()
117 if (wait_ack(ast)) { in ast_write_cmd()
118 clear_cmd_trigger(ast); in ast_write_cmd()
119 send_nack(ast); in ast_write_cmd()
124 clear_cmd_trigger(ast); in ast_write_cmd()
125 send_nack(ast); in ast_write_cmd()
131 struct ast_device *ast = to_ast_device(dev); in ast_write_data() local
133 if (wait_nack(ast)) { in ast_write_data()
134 send_nack(ast); in ast_write_data()
135 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, data); in ast_write_data()
136 send_ack(ast); in ast_write_data()
137 if (wait_ack(ast)) { in ast_write_data()
138 send_nack(ast); in ast_write_data()
142 send_nack(ast); in ast_write_data()
149 struct ast_device *ast = to_ast_device(dev);
154 if (wait_ack(ast) == false)
156 tmp = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd3, 0xff);
158 if (wait_nack(ast) == false) {
159 send_nack(ast);
162 send_nack(ast);
166 static void clear_cmd(struct ast_device *ast)
168 send_nack(ast);
169 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, 0x00);
181 static u32 get_fw_base(struct ast_device *ast) in get_fw_base() argument
183 return ast_mindwm(ast, 0x1e6e2104) & 0x7fffffff; in get_fw_base()
188 struct ast_device *ast = to_ast_device(dev); in ast_backup_fw() local
192 if (ast->config_mode != ast_use_p2a) in ast_backup_fw()
195 data = ast_mindwm(ast, 0x1e6e2100) & 0x01; in ast_backup_fw()
197 boot_address = get_fw_base(ast); in ast_backup_fw()
199 *(u32 *)(addr + i) = ast_mindwm(ast, boot_address + i); in ast_backup_fw()
207 struct ast_device *ast = to_ast_device(dev); in ast_launch_m68k() local
213 if (ast->config_mode != ast_use_p2a) in ast_launch_m68k()
216 data = ast_mindwm(ast, 0x1e6e2100) & 0x01; in ast_launch_m68k()
219 if (ast->dp501_fw_addr) { in ast_launch_m68k()
220 fw_addr = ast->dp501_fw_addr; in ast_launch_m68k()
223 if (!ast->dp501_fw && in ast_launch_m68k()
227 fw_addr = (u8 *)ast->dp501_fw->data; in ast_launch_m68k()
228 len = ast->dp501_fw->size; in ast_launch_m68k()
231 ast_moutdwm(ast, 0x1e6e2000, 0x1688a8a8); in ast_launch_m68k()
232 data = ast_mindwm(ast, 0x1e6e0004); in ast_launch_m68k()
253 ast_moutdwm(ast, boot_address + i, data); in ast_launch_m68k()
257 ast_moutdwm(ast, 0x1e6e2000, 0x1688a8a8); in ast_launch_m68k()
260 ast_moutdwm(ast, 0x1e6e2104, 0x80000000 + boot_address); in ast_launch_m68k()
261 ast_moutdwm(ast, 0x1e6e2100, 1); in ast_launch_m68k()
264 data = ast_mindwm(ast, 0x1e6e2040) & 0xfffff1ff; /* D[11:9] = 100b: UEFI handling */ in ast_launch_m68k()
266 ast_moutdwm(ast, 0x1e6e2040, data); in ast_launch_m68k()
268 …jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x99, 0xfc); /* D[1:0]: Reserved Video Buffer… in ast_launch_m68k()
270 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x99, jreg); in ast_launch_m68k()
275 bool ast_dp501_is_connected(struct ast_device *ast) in ast_dp501_is_connected() argument
279 if (ast->config_mode == ast_use_p2a) { in ast_dp501_is_connected()
280 boot_address = get_fw_base(ast); in ast_dp501_is_connected()
284 data = ast_mindwm(ast, boot_address + offset); in ast_dp501_is_connected()
290 data = ast_mindwm(ast, boot_address + offset); in ast_dp501_is_connected()
294 if (!ast->dp501_fw_buf) in ast_dp501_is_connected()
299 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_is_connected()
303 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_is_connected()
309 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_is_connected()
318 struct ast_device *ast = to_ast_device(dev); in ast_dp501_read_edid() local
322 if (!ast_dp501_is_connected(ast)) in ast_dp501_read_edid()
325 if (ast->config_mode == ast_use_p2a) { in ast_dp501_read_edid()
326 boot_address = get_fw_base(ast); in ast_dp501_read_edid()
331 data = ast_mindwm(ast, boot_address + offset + i); in ast_dp501_read_edid()
339 data = readl(ast->dp501_fw_buf + offset + i); in ast_dp501_read_edid()
350 struct ast_device *ast = to_ast_device(dev); in ast_init_dvo() local
353 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_init_dvo()
354 ast_write32(ast, 0xf000, 0x1); in ast_init_dvo()
355 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_dvo()
357 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); in ast_init_dvo()
360 data = ast_read32(ast, 0x12008); in ast_init_dvo()
364 ast_write32(ast, 0x12008, data); in ast_init_dvo()
366 if (IS_AST_GEN4(ast)) { in ast_init_dvo()
367 data = ast_read32(ast, 0x12084); in ast_init_dvo()
370 ast_write32(ast, 0x12084, data); in ast_init_dvo()
372 data = ast_read32(ast, 0x12088); in ast_init_dvo()
375 ast_write32(ast, 0x12088, data); in ast_init_dvo()
377 data = ast_read32(ast, 0x12090); in ast_init_dvo()
381 ast_write32(ast, 0x12090, data); in ast_init_dvo()
383 data = ast_read32(ast, 0x12088); in ast_init_dvo()
386 ast_write32(ast, 0x12088, data); in ast_init_dvo()
388 data = ast_read32(ast, 0x1208c); in ast_init_dvo()
391 ast_write32(ast, 0x1208c, data); in ast_init_dvo()
393 data = ast_read32(ast, 0x120a4); in ast_init_dvo()
396 ast_write32(ast, 0x120a4, data); in ast_init_dvo()
398 data = ast_read32(ast, 0x120a8); in ast_init_dvo()
401 ast_write32(ast, 0x120a8, data); in ast_init_dvo()
403 data = ast_read32(ast, 0x12094); in ast_init_dvo()
406 ast_write32(ast, 0x12094, data); in ast_init_dvo()
411 data = ast_read32(ast, 0x1202c); in ast_init_dvo()
413 ast_write32(ast, 0x1202c, data); in ast_init_dvo()
416 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x80); in ast_init_dvo()
423 struct ast_device *ast = to_ast_device(dev); in ast_init_analog() local
431 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_init_analog()
432 ast_write32(ast, 0xf000, 0x1); in ast_init_analog()
435 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
436 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
437 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
440 data = ast_read32(ast, 0x1202c); in ast_init_analog()
442 ast_write32(ast, 0, data); in ast_init_analog()
445 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x00); in ast_init_analog()
450 struct ast_device *ast = to_ast_device(dev); in ast_init_3rdtx() local
453 if (IS_AST_GEN4(ast) || IS_AST_GEN5(ast)) { in ast_init_3rdtx()
454 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); in ast_init_3rdtx()
466 if (ast->tx_chip_types & BIT(AST_TX_SIL164)) in ast_init_3rdtx()