Lines Matching refs:port

193 static int extron_send_and_wait_len(struct extron *extron, struct extron_port *port,  in extron_send_and_wait_len()  argument
209 if (port) { in extron_send_and_wait_len()
210 init_completion(&port->cmd_done); in extron_send_and_wait_len()
211 port->cmd_error = 0; in extron_send_and_wait_len()
212 port->response = response; in extron_send_and_wait_len()
221 !wait_for_completion_timeout(port ? &port->cmd_done : &extron->cmd_done, timeout)) { in extron_send_and_wait_len()
227 if (!err && response && (port ? port->cmd_error : extron->cmd_error)) { in extron_send_and_wait_len()
229 cmd, port ? port->cmd_error : extron->cmd_error, response); in extron_send_and_wait_len()
230 if (port) in extron_send_and_wait_len()
231 port->cmd_error = 0; in extron_send_and_wait_len()
236 if (port) in extron_send_and_wait_len()
237 port->response = NULL; in extron_send_and_wait_len()
244 static int extron_send_and_wait(struct extron *extron, struct extron_port *port, in extron_send_and_wait() argument
247 return extron_send_and_wait_len(extron, port, cmd, NULL, 0, response); in extron_send_and_wait()
250 static void extron_parse_edid(struct extron_port *port) in extron_parse_edid() argument
252 const u8 *edid = port->edid; in extron_parse_edid()
256 port->has_4kp30 = false; in extron_parse_edid()
257 port->has_4kp60 = false; in extron_parse_edid()
258 port->has_qy = false; in extron_parse_edid()
259 port->has_qs = false; in extron_parse_edid()
261 port->est_i = edid[0x23]; in extron_parse_edid()
262 port->est_ii = edid[0x24]; in extron_parse_edid()
284 port->has_4kp30 = true; in extron_parse_edid()
286 port->has_4kp60 = true; in extron_parse_edid()
289 if (port->edid_blocks == 1) in extron_parse_edid()
319 port->has_4kp60 = true; in extron_parse_edid()
322 port->has_4kp30 = true; in extron_parse_edid()
329 port->has_qy = true; in extron_parse_edid()
331 port->has_qs = true; in extron_parse_edid()
406 static void extron_update_edid(struct extron_port *port, unsigned int blocks) in extron_update_edid() argument
416 port->edid_tmp[8] = c1; in extron_update_edid()
417 port->edid_tmp[9] = c2; in extron_update_edid()
420 port->edid_tmp[0x23] = port->est_i | 0x20; in extron_update_edid()
421 port->edid_tmp[0x24] = port->est_ii; in extron_update_edid()
424 extron_set_edid_string(port->edid_tmp + 0x5f, port->extron->unit_name); in extron_update_edid()
426 extron_set_edid_string(port->edid_tmp + 0x71, port->adap->name); in extron_update_edid()
428 extron_edid_crc(port->edid_tmp); in extron_update_edid()
431 offset = get_edid_tag_location(port->edid_tmp, blocks * 128, 7, 0); in extron_update_edid()
433 port->edid_tmp[offset + 2] &= ~0xc0; in extron_update_edid()
434 if (port->has_qy) in extron_update_edid()
435 port->edid_tmp[offset + 2] |= 0x80; in extron_update_edid()
436 if (port->has_qs) in extron_update_edid()
437 port->edid_tmp[offset + 2] |= 0x40; in extron_update_edid()
440 extron_edid_crc(port->edid_tmp + 128); in extron_update_edid()
443 static int extron_write_edid(struct extron_port *port, in extron_write_edid() argument
446 struct extron *extron = port->extron; in extron_write_edid()
456 memcpy(port->edid_tmp, edid, blocks * 128); in extron_write_edid()
459 extron_update_edid(port, blocks); in extron_write_edid()
461 ret = extron_send_and_wait_len(port->extron, port, "W+UF256,in.bin", in extron_write_edid()
462 port->edid_tmp, sizeof(port->edid_tmp), in extron_write_edid()
466 ret = extron_send_and_wait(port->extron, port, "WI1,in.binEDID", in extron_write_edid()
471 port->edid_blocks = blocks; in extron_write_edid()
472 memcpy(port->edid, port->edid_tmp, blocks * 128); in extron_write_edid()
473 port->read_edid = true; in extron_write_edid()
476 cec_s_phys_addr(port->adap, phys_addr, false); in extron_write_edid()
541 static void extron_read_edid(struct extron_port *port) in extron_read_edid() argument
543 struct extron *extron = port->extron; in extron_read_edid()
547 idx = port->port.port + (port->is_input ? 0 : extron->num_in_ports); in extron_read_edid()
552 if (port->read_edid) in extron_read_edid()
555 extron->edid_port = port; in extron_read_edid()
556 port->edid_blocks = 0; in extron_read_edid()
557 if (!port->has_edid) in extron_read_edid()
562 if (!extron_send_and_wait(extron, port, cmd, reply)) in extron_read_edid()
565 if (port->edid_blocks) { in extron_read_edid()
566 extron_parse_edid(port); in extron_read_edid()
567 port->read_edid = true; in extron_read_edid()
568 if (!port->is_input) in extron_read_edid()
569 v4l2_ctrl_s_ctrl(port->ctrl_tx_edid_present, 1); in extron_read_edid()
583 struct extron_port *port = in extron_irq_work_handler() local
585 struct extron *extron = port->extron; in extron_irq_work_handler()
595 spin_lock_irqsave(&port->msg_lock, flags); in extron_irq_work_handler()
596 while (port->rx_msg_num) { in extron_irq_work_handler()
597 spin_unlock_irqrestore(&port->msg_lock, flags); in extron_irq_work_handler()
598 cec_received_msg(port->adap, in extron_irq_work_handler()
599 &port->rx_msg[port->rx_msg_cur_idx]); in extron_irq_work_handler()
600 spin_lock_irqsave(&port->msg_lock, flags); in extron_irq_work_handler()
601 if (port->rx_msg_num) in extron_irq_work_handler()
602 port->rx_msg_num--; in extron_irq_work_handler()
603 port->rx_msg_cur_idx = in extron_irq_work_handler()
604 (port->rx_msg_cur_idx + 1) % NUM_MSGS; in extron_irq_work_handler()
606 update_pa = port->update_phys_addr; in extron_irq_work_handler()
607 pa = port->phys_addr; in extron_irq_work_handler()
608 port->update_phys_addr = false; in extron_irq_work_handler()
609 update_has_signal = port->update_has_signal; in extron_irq_work_handler()
610 has_signal = port->has_signal; in extron_irq_work_handler()
611 port->update_has_signal = false; in extron_irq_work_handler()
612 update_has_edid = port->update_has_edid; in extron_irq_work_handler()
613 has_edid = port->has_edid; in extron_irq_work_handler()
614 port->update_has_edid = false; in extron_irq_work_handler()
615 status = port->tx_done_status; in extron_irq_work_handler()
616 port->tx_done_status = 0; in extron_irq_work_handler()
617 spin_unlock_irqrestore(&port->msg_lock, flags); in extron_irq_work_handler()
620 cec_transmit_done(port->adap, status, 0, 0, 0, 0); in extron_irq_work_handler()
622 if (update_has_signal && port->is_input) in extron_irq_work_handler()
623 v4l2_ctrl_s_ctrl(port->ctrl_rx_power_present, has_signal); in extron_irq_work_handler()
625 if (update_has_edid && !port->is_input) { in extron_irq_work_handler()
626 v4l2_ctrl_s_ctrl(port->ctrl_tx_hotplug, in extron_irq_work_handler()
627 port->has_edid); in extron_irq_work_handler()
628 if (port->has_edid) { in extron_irq_work_handler()
629 port->port.found_sink = true; in extron_irq_work_handler()
630 port->port.lost_sink_ts = ktime_set(0, 0); in extron_irq_work_handler()
632 port->port.lost_sink_ts = ktime_get(); in extron_irq_work_handler()
635 port->edid_blocks = 0; in extron_irq_work_handler()
636 port->read_edid = false; in extron_irq_work_handler()
638 extron->edid_port == port) in extron_irq_work_handler()
640 v4l2_ctrl_s_ctrl(port->ctrl_tx_edid_present, 0); in extron_irq_work_handler()
641 } else if (!extron->edid_reading || extron->edid_port != port) { in extron_irq_work_handler()
642 extron_read_edid(port); in extron_irq_work_handler()
646 cec_s_phys_addr(port->adap, pa, false); in extron_irq_work_handler()
649 static void extron_process_received(struct extron_port *port, const char *data) in extron_process_received() argument
656 if (!port || port->disconnected) in extron_process_received()
671 spin_lock_irqsave(&port->msg_lock, irq_flags); in extron_process_received()
672 idx = (port->rx_msg_cur_idx + port->rx_msg_num) % in extron_process_received()
674 if (port->rx_msg_num == NUM_MSGS) { in extron_process_received()
675 dev_warn(port->dev, in extron_process_received()
678 spin_unlock_irqrestore(&port->msg_lock, in extron_process_received()
682 port->rx_msg_num++; in extron_process_received()
683 port->rx_msg[idx] = msg; in extron_process_received()
684 spin_unlock_irqrestore(&port->msg_lock, irq_flags); in extron_process_received()
685 if (!port->disconnected) in extron_process_received()
686 schedule_work(&port->irq_work); in extron_process_received()
690 dev_info(port->extron->dev, "malformed msg received: '%s'\n", data); in extron_process_received()
693 static void extron_port_signal_change(struct extron_port *port, bool has_sig) in extron_port_signal_change() argument
698 if (!port) in extron_port_signal_change()
701 spin_lock_irqsave(&port->msg_lock, irq_flags); in extron_port_signal_change()
702 if (!port->update_has_signal && port->has_signal != has_sig) { in extron_port_signal_change()
703 port->update_has_signal = true; in extron_port_signal_change()
706 port->has_signal = has_sig; in extron_port_signal_change()
707 spin_unlock_irqrestore(&port->msg_lock, irq_flags); in extron_port_signal_change()
708 if (update && !port->disconnected) in extron_port_signal_change()
709 schedule_work(&port->irq_work); in extron_port_signal_change()
723 static void extron_port_edid_change(struct extron_port *port, bool has_edid) in extron_port_edid_change() argument
728 if (!port) in extron_port_edid_change()
731 spin_lock_irqsave(&port->msg_lock, irq_flags); in extron_port_edid_change()
732 if (!port->update_has_edid && port->has_edid != has_edid) { in extron_port_edid_change()
733 port->update_has_edid = true; in extron_port_edid_change()
736 port->has_edid = has_edid; in extron_port_edid_change()
737 spin_unlock_irqrestore(&port->msg_lock, irq_flags); in extron_port_edid_change()
738 if (update && !port->disconnected) in extron_port_edid_change()
739 schedule_work(&port->irq_work); in extron_port_edid_change()
758 static void extron_phys_addr_change(struct extron_port *port, u16 pa) in extron_phys_addr_change() argument
763 if (!port) in extron_phys_addr_change()
766 spin_lock_irqsave(&port->msg_lock, irq_flags); in extron_phys_addr_change()
767 if (!port->update_phys_addr && port->phys_addr != pa) { in extron_phys_addr_change()
769 port->update_phys_addr = true; in extron_phys_addr_change()
771 port->phys_addr = pa; in extron_phys_addr_change()
772 spin_unlock_irqrestore(&port->msg_lock, irq_flags); in extron_phys_addr_change()
773 if (update && !port->disconnected) in extron_phys_addr_change()
774 schedule_work(&port->irq_work); in extron_phys_addr_change()
777 static void extron_process_tx_done(struct extron_port *port, char status) in extron_process_tx_done() argument
782 if (!port) in extron_process_tx_done()
796 spin_lock_irqsave(&port->msg_lock, irq_flags); in extron_process_tx_done()
797 port->tx_done_status = tx_status; in extron_process_tx_done()
798 spin_unlock_irqrestore(&port->msg_lock, irq_flags); in extron_process_tx_done()
799 if (!port->disconnected) in extron_process_tx_done()
800 schedule_work(&port->irq_work); in extron_process_tx_done()
803 static void extron_add_edid(struct extron_port *port, const char *hex) in extron_add_edid() argument
805 struct extron *extron = port ? port->extron : NULL; in extron_add_edid()
807 if (!port || port != extron->edid_port) in extron_add_edid()
809 while (extron->edid_bytes_read < sizeof(port->edid) && *hex) { in extron_add_edid()
810 int err = hex2bin(&port->edid[extron->edid_bytes_read], hex, 1); in extron_add_edid()
821 port->edid[126] == 0) { in extron_add_edid()
823 port->edid_blocks = 1; in extron_add_edid()
827 if (extron->edid_bytes_read < sizeof(port->edid)) in extron_add_edid()
830 port->edid_blocks = 2; in extron_add_edid()
839 struct extron_port *port = NULL; in extron_interrupt() local
934 port = extron->ports[p]; in extron_interrupt()
935 if (port && port->response && in extron_interrupt()
936 !strncmp(port->response, extron->data, in extron_interrupt()
937 strlen(port->response))) in extron_interrupt()
957 if (!port) { in extron_interrupt()
961 port->response = NULL; in extron_interrupt()
962 complete(&port->cmd_done); in extron_interrupt()
978 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_adap_enable() local
980 return (port->disconnected && enable) ? -ENODEV : 0; in extron_cec_adap_enable()
985 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_adap_log_addr() local
991 if (port->disconnected) in extron_cec_adap_log_addr()
994 port->direction, port->port.port, la); in extron_cec_adap_log_addr()
996 port->direction, port->port.port, la); in extron_cec_adap_log_addr()
997 err = extron_send_and_wait(port->extron, port, cmd, resp); in extron_cec_adap_log_addr()
1004 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_adap_transmit() local
1009 if (port->disconnected) in extron_cec_adap_transmit()
1015 port->direction, port->port.port, in extron_cec_adap_transmit()
1017 return extron_send_and_wait(port->extron, port, cmd, NULL); in extron_cec_adap_transmit()
1022 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_adap_unconfigured() local
1024 if (port->disconnected) in extron_cec_adap_unconfigured()
1027 dev_info(port->extron->dev, "unconfigured port %d (%s)\n", in extron_cec_adap_unconfigured()
1028 port->port.port, in extron_cec_adap_unconfigured()
1029 port->extron->splitter.is_standby ? "Off" : "On"); in extron_cec_adap_unconfigured()
1030 if (!port->is_input) in extron_cec_adap_unconfigured()
1031 cec_splitter_unconfigured_output(&port->port); in extron_cec_adap_unconfigured()
1036 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_configured() local
1038 if (port->disconnected) in extron_cec_configured()
1041 dev_info(port->extron->dev, "configured port %d (%s)\n", in extron_cec_configured()
1042 port->port.port, in extron_cec_configured()
1043 port->extron->splitter.is_standby ? "Off" : "On"); in extron_cec_configured()
1044 if (!port->is_input) in extron_cec_configured()
1045 cec_splitter_configured_output(&port->port); in extron_cec_configured()
1051 struct extron_port *port = cec_get_drvdata(adap); in extron_cec_adap_nb_transmit_canceled() local
1056 if (port->disconnected || port->is_input) in extron_cec_adap_nb_transmit_canceled()
1058 input_adap = port->extron->ports[port->extron->num_out_ports]->adap; in extron_cec_adap_nb_transmit_canceled()
1059 cec_splitter_nb_transmit_canceled_output(&port->port, msg, input_adap); in extron_cec_adap_nb_transmit_canceled()
1064 struct extron_port *port = cec_get_drvdata(adap); in extron_received() local
1068 if (port->disconnected) in extron_received()
1070 if (port->is_input) in extron_received()
1071 return cec_splitter_received_input(&port->port, msg); in extron_received()
1072 return cec_splitter_received_output(&port->port, msg, in extron_received()
1073 port->extron->ports[port->extron->num_out_ports]->adap); in extron_received()
1091 static void extron_adap_status_port(struct extron_port *port, struct seq_file *file) in extron_adap_status_port() argument
1093 struct cec_adapter *adap = port->adap; in extron_adap_status_port()
1095 if (port->disconnected) { in extron_adap_status_port()
1097 "\tport %u: disconnected\n", port->port.port); in extron_adap_status_port()
1100 if (port->is_input) in extron_adap_status_port()
1103 port->port.port, in extron_adap_status_port()
1104 port->has_signal ? "has" : "no", in extron_adap_status_port()
1105 port->has_edid ? "has" : "no", in extron_adap_status_port()
1106 port->has_4kp30 ? "has" : "no", in extron_adap_status_port()
1107 port->has_4kp60 ? "has" : "no", in extron_adap_status_port()
1108 port->has_qs ? "" : "no ", in extron_adap_status_port()
1109 port->has_qy ? "" : "no ", in extron_adap_status_port()
1110 !port->port.adap->is_configured ? "not configured" : in extron_adap_status_port()
1111 pwr_state[port->extron->splitter.is_standby]); in extron_adap_status_port()
1115 port->port.port, in extron_adap_status_port()
1116 port->port.found_sink ? "found" : "no", in extron_adap_status_port()
1117 port->has_signal ? "has" : "no", in extron_adap_status_port()
1118 port->has_edid ? "has" : "no", in extron_adap_status_port()
1119 port->has_4kp30 ? "has" : "no", in extron_adap_status_port()
1120 port->has_4kp60 ? "has" : "no", in extron_adap_status_port()
1121 port->has_qs ? "" : "no ", in extron_adap_status_port()
1122 port->has_qy ? "" : "no ", in extron_adap_status_port()
1123 port->port.is_active_source ? "" : "not ", in extron_adap_status_port()
1124 !port->port.adap->is_configured ? "not configured" : in extron_adap_status_port()
1125 pwr_state[port->port.power_status & 3]); in extron_adap_status_port()
1126 if (port->port.out_give_device_power_status_seq) in extron_adap_status_port()
1129 port->port.port, in extron_adap_status_port()
1130 port->port.out_give_device_power_status_seq & ~(1 << 31), in extron_adap_status_port()
1132 port->port.out_give_device_power_status_ts)); in extron_adap_status_port()
1133 if (port->port.out_request_current_latency_seq) in extron_adap_status_port()
1136 port->port.port, in extron_adap_status_port()
1137 port->port.out_request_current_latency_seq & ~(1 << 31), in extron_adap_status_port()
1139 port->port.out_request_current_latency_ts)); in extron_adap_status_port()
1144 struct extron_port *port = cec_get_drvdata(adap); in extron_adap_status() local
1145 struct extron *extron = port->extron; in extron_adap_status()
1168 port->is_input ? "input" : "output", in extron_adap_status()
1169 port->port.port, port->name); in extron_adap_status()
1177 if (!port->has_edid || !port->read_edid) in extron_adap_status()
1180 for (i = 0; i < port->edid_blocks * 128; i += 16) { in extron_adap_status()
1183 log_printf(adap, file, "EDID: %*ph\n", 16, port->edid + i); in extron_adap_status()
1201 struct extron_port *port = video_drvdata(file); in extron_querycap() local
1205 snprintf(cap->bus_info, sizeof(cap->bus_info), "serio:%s", port->name); in extron_querycap()
1211 struct extron_port *port = video_drvdata(file); in extron_enum_input() local
1216 snprintf(inp->name, sizeof(inp->name), "HDMI IN %u", port->port.port); in extron_enum_input()
1217 inp->status = v4l2_ctrl_g_ctrl(port->ctrl_rx_power_present) ? in extron_enum_input()
1235 struct extron_port *port = video_drvdata(file); in extron_enum_output() local
1240 snprintf(out->name, sizeof(out->name), "HDMI OUT %u", port->port.port); in extron_enum_output()
1258 struct extron_port *port = video_drvdata(file); in extron_g_edid() local
1261 if (port->disconnected) in extron_g_edid()
1265 if (!port->has_edid) in extron_g_edid()
1267 if (!port->read_edid) in extron_g_edid()
1268 extron_read_edid(port); in extron_g_edid()
1269 if (!port->read_edid) in extron_g_edid()
1272 edid->blocks = port->edid_blocks; in extron_g_edid()
1275 if (edid->start_block >= port->edid_blocks) in extron_g_edid()
1277 if (edid->blocks > port->edid_blocks - edid->start_block) in extron_g_edid()
1278 edid->blocks = port->edid_blocks - edid->start_block; in extron_g_edid()
1279 memcpy(edid->edid, port->edid + edid->start_block * 128, edid->blocks * 128); in extron_g_edid()
1285 struct extron_port *port = video_drvdata(file); in extron_s_edid() local
1288 if (port->disconnected) in extron_s_edid()
1304 extron_parse_edid(port); in extron_s_edid()
1305 return extron_write_edid(port, edid->edid, edid->blocks); in extron_s_edid()
1310 struct extron_port *port = video_drvdata(file); in extron_log_status() local
1312 extron_adap_status(port->adap, NULL); in extron_log_status()
1356 struct extron_port *port = extron->ports[p]; in extron_disconnect() local
1358 if (!port) in extron_disconnect()
1360 port->disconnected = true; in extron_disconnect()
1361 cancel_work_sync(&port->irq_work); in extron_disconnect()
1365 struct extron_port *port = extron->ports[p]; in extron_disconnect() local
1367 if (!port) in extron_disconnect()
1370 if (port->cec_was_registered) { in extron_disconnect()
1371 if (cec_is_registered(port->adap)) in extron_disconnect()
1372 cec_unregister_adapter(port->adap); in extron_disconnect()
1379 cec_put_device(port->adap); in extron_disconnect()
1381 cec_delete_adapter(port->adap); in extron_disconnect()
1383 video_unregister_device(&port->vdev); in extron_disconnect()
1389 struct extron_port *port = extron->ports[p]; in extron_disconnect() local
1391 if (!port) in extron_disconnect()
1393 v4l2_ctrl_handler_free(&port->hdl); in extron_disconnect()
1394 mutex_destroy(&port->video_lock); in extron_disconnect()
1395 kfree(port); in extron_disconnect()
1407 struct extron_port *port; in extron_setup() local
1496 port = kzalloc(sizeof(*port), GFP_KERNEL); in extron_setup()
1497 if (!port) in extron_setup()
1500 INIT_WORK(&port->irq_work, extron_irq_work_handler); in extron_setup()
1501 spin_lock_init(&port->msg_lock); in extron_setup()
1502 mutex_init(&port->video_lock); in extron_setup()
1503 port->extron = extron; in extron_setup()
1504 port->is_input = p >= extron->num_out_ports; in extron_setup()
1505 port->direction = port->is_input ? 'I' : 'O'; in extron_setup()
1506 port->port.port = 1 + (port->is_input ? p - extron->num_out_ports : p); in extron_setup()
1507 port->port.splitter = &extron->splitter; in extron_setup()
1508 port->phys_addr = CEC_PHYS_ADDR_INVALID; in extron_setup()
1509 snprintf(port->name, sizeof(port->name), "%s-%s-%u", in extron_setup()
1510 dev_name(&serio->dev), port->is_input ? "in" : "out", in extron_setup()
1511 port->port.port); in extron_setup()
1513 port->dev = extron->dev; in extron_setup()
1514 port->adap = cec_allocate_adapter(&extron_cec_adap_ops, port, in extron_setup()
1515 port->name, caps, 1); in extron_setup()
1516 err = PTR_ERR_OR_ZERO(port->adap); in extron_setup()
1518 kfree(port); in extron_setup()
1522 port->adap->xfer_timeout_ms = EXTRON_TIMEOUT_SECS * 1000; in extron_setup()
1523 port->port.adap = port->adap; in extron_setup()
1524 port->vdev = extron_videodev; in extron_setup()
1525 port->vdev.lock = &port->video_lock; in extron_setup()
1526 port->vdev.v4l2_dev = &extron->v4l2_dev; in extron_setup()
1527 port->vdev.ctrl_handler = &port->hdl; in extron_setup()
1528 port->vdev.device_caps = V4L2_CAP_EDID; in extron_setup()
1529 video_set_drvdata(&port->vdev, port); in extron_setup()
1531 v4l2_ctrl_handler_init(&port->hdl, 2); in extron_setup()
1533 if (port->is_input) { in extron_setup()
1534 port->vdev.vfl_dir = VFL_DIR_RX; in extron_setup()
1535 port->ctrl_rx_power_present = in extron_setup()
1536 v4l2_ctrl_new_std(&port->hdl, NULL, in extron_setup()
1539 port->has_edid = true; in extron_setup()
1541 port->vdev.vfl_dir = VFL_DIR_TX; in extron_setup()
1542 port->ctrl_tx_hotplug = in extron_setup()
1543 v4l2_ctrl_new_std(&port->hdl, NULL, in extron_setup()
1546 port->ctrl_tx_edid_present = in extron_setup()
1547 v4l2_ctrl_new_std(&port->hdl, NULL, in extron_setup()
1552 err = port->hdl.error; in extron_setup()
1554 cec_delete_adapter(port->adap); in extron_setup()
1555 kfree(port); in extron_setup()
1558 extron->ports[p] = port; in extron_setup()
1559 extron->splitter_ports[p] = &port->port; in extron_setup()
1560 if (port->is_input && manufacturer_name[0]) in extron_setup()
1561 extron_write_edid(port, hdmi_edid, 2); in extron_setup()
1606 struct extron_port *port; in extron_setup_thread() local
1642 port = extron->ports[p]; in extron_setup_thread()
1643 if (port->is_input && manufacturer_name[0]) in extron_setup_thread()
1644 v4l2_disable_ioctl(&port->vdev, VIDIOC_S_EDID); in extron_setup_thread()
1645 err = video_register_device(&port->vdev, VFL_TYPE_VIDEO, -1); in extron_setup_thread()
1651 err = cec_register_adapter(port->adap, extron->dev); in extron_setup_thread()
1654 port->dev = &port->adap->devnode.dev; in extron_setup_thread()
1655 port->cec_was_registered = true; in extron_setup_thread()
1673 cec_get_device(port->adap); in extron_setup_thread()
1687 if (port->is_input) { in extron_setup_thread()
1695 "Splitter Out%u", port->port.port); in extron_setup_thread()
1700 err = cec_s_log_addrs(port->adap, &log_addrs, false); in extron_setup_thread()
1706 port = extron->ports[extron->num_out_ports]; in extron_setup_thread()
1724 cec_splitter_poll(&extron->splitter, port->adap, debug) && in extron_setup_thread()
1740 struct extron_port *port = extron->ports[p]; in extron_setup_thread() local
1742 if (!port) in extron_setup_thread()
1744 port->disconnected = true; in extron_setup_thread()
1745 cancel_work_sync(&port->irq_work); in extron_setup_thread()
1746 video_unregister_device(&port->vdev); in extron_setup_thread()
1747 if (port->cec_was_registered) in extron_setup_thread()
1748 cec_unregister_adapter(port->adap); in extron_setup_thread()