Lines Matching +full:1 +full:p
24 if (msg->msg[1] == CEC_MSG_FEATURE_ABORT) in cec_feature_abort_reason()
30 cec_msg_feature_abort(&tx_msg, msg->msg[1], reason); in cec_feature_abort_reason()
35 static void cec_port_out_active_source(struct cec_splitter_port *p) in cec_port_out_active_source() argument
37 struct cec_adapter *adap = p->adap; in cec_port_out_active_source()
42 p->is_active_source = true; in cec_port_out_active_source()
58 static void cec_port_out_standby(struct cec_splitter_port *p) in cec_port_out_standby() argument
60 struct cec_adapter *adap = p->adap; in cec_port_out_standby()
80 static void cec_port_out_wakeup(struct cec_splitter_port *p, u8 opcode) in cec_port_out_wakeup() argument
82 struct cec_adapter *adap = p->adap; in cec_port_out_wakeup()
90 msg.msg[1] = opcode; in cec_port_out_wakeup()
108 void cec_splitter_unconfigured_output(struct cec_splitter_port *p) in cec_splitter_unconfigured_output() argument
110 p->video_latency = 1; in cec_splitter_unconfigured_output()
111 p->power_status = p->splitter->is_standby ? in cec_splitter_unconfigured_output()
115 p->out_give_device_power_status_seq = 0; in cec_splitter_unconfigured_output()
116 p->out_give_device_power_status_ts = ktime_set(0, 0); in cec_splitter_unconfigured_output()
117 p->out_request_current_latency_seq = 0; in cec_splitter_unconfigured_output()
118 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_splitter_unconfigured_output()
126 void cec_splitter_configured_output(struct cec_splitter_port *p) in cec_splitter_configured_output() argument
128 p->video_latency = 1; in cec_splitter_configured_output()
129 p->power_status = p->splitter->is_standby ? in cec_splitter_configured_output()
132 if (p->splitter->is_standby) { in cec_splitter_configured_output()
137 cec_port_out_active_source(p); in cec_splitter_configured_output()
138 cec_port_out_standby(p); in cec_splitter_configured_output()
140 cec_port_out_wakeup(p, CEC_MSG_IMAGE_VIEW_ON); in cec_splitter_configured_output()
151 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_passthrough() local
152 struct cec_adapter *adap = p->adap; in cec_out_passthrough()
159 memcpy(msg.msg + 1, in_msg->msg + 1, msg.len - 1); in cec_out_passthrough()
177 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_report_current_latency() local
178 struct cec_adapter *adap = p->adap; in cec_out_report_current_latency()
184 if (p->out_request_current_latency_seq) in cec_out_report_current_latency()
186 reply_lat += p->video_latency - 1; in cec_out_report_current_latency()
195 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_report_current_latency() local
197 p->out_request_current_latency_seq = 0; in cec_out_report_current_latency()
198 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_out_report_current_latency()
209 reply_lat = 1 + reply_lat / cnt; in cec_out_report_current_latency()
213 reply_lat, 1, 1, 1); in cec_out_report_current_latency()
225 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_request_current_latency() local
226 struct cec_adapter *adap = p->adap; in cec_out_request_current_latency()
230 p->out_request_current_latency_seq = 0; in cec_out_request_current_latency()
231 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_out_request_current_latency()
232 } else if (!p->out_request_current_latency_seq) { in cec_out_request_current_latency()
239 p->out_request_current_latency_ts = now; in cec_out_request_current_latency()
244 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_request_current_latency() local
245 struct cec_adapter *adap = p->adap; in cec_out_request_current_latency()
254 p->out_request_current_latency_seq = msg.sequence | (1U << 31); in cec_out_request_current_latency()
281 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_report_power_status() local
284 if (!p->found_sink) in cec_out_report_power_status()
288 if (p->out_give_device_power_status_seq) in cec_out_report_power_status()
290 if (p->power_status != splitter_pwr) in cec_out_report_power_status()
299 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_report_power_status() local
301 p->out_give_device_power_status_seq = 0; in cec_out_report_power_status()
302 p->out_give_device_power_status_ts = ktime_set(0, 0); in cec_out_report_power_status()
324 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_give_device_power_status() local
325 struct cec_adapter *adap = p->adap; in cec_out_give_device_power_status()
333 if (adap->is_configured && !p->out_give_device_power_status_seq) in cec_out_give_device_power_status()
334 p->out_give_device_power_status_ts = now; in cec_out_give_device_power_status()
338 struct cec_splitter_port *p = splitter->ports[i]; in cec_out_give_device_power_status() local
339 struct cec_adapter *adap = p->adap; in cec_out_give_device_power_status()
349 p->out_give_device_power_status_seq = msg.sequence | (1U << 31); in cec_out_give_device_power_status()
359 int cec_splitter_received_input(struct cec_splitter_port *p, struct cec_msg *msg) in cec_splitter_received_input() argument
367 switch (msg->msg[1]) { in cec_splitter_received_input()
377 p->splitter->is_standby = true; in cec_splitter_received_input()
378 cec_out_standby(p->splitter); in cec_splitter_received_input()
383 p->splitter->is_standby = false; in cec_splitter_received_input()
384 cec_out_wakeup(p->splitter, msg->msg[1]); in cec_splitter_received_input()
388 cec_out_active_source(p->splitter); in cec_splitter_received_input()
392 cec_out_passthrough(p->splitter, msg); in cec_splitter_received_input()
396 p->splitter->give_device_power_status_dest = in cec_splitter_received_input()
398 if (cec_out_give_device_power_status(p->splitter)) in cec_splitter_received_input()
399 cec_feature_abort_reason(p->adap, msg, in cec_splitter_received_input()
406 p->splitter->request_current_latency_dest = in cec_splitter_received_input()
409 if (pa == p->adap->phys_addr && in cec_splitter_received_input()
410 cec_out_request_current_latency(p->splitter)) in cec_splitter_received_input()
411 cec_feature_abort_reason(p->adap, msg, in cec_splitter_received_input()
422 void cec_splitter_nb_transmit_canceled_output(struct cec_splitter_port *p, in cec_splitter_nb_transmit_canceled_output() argument
426 struct cec_splitter *splitter = p->splitter; in cec_splitter_nb_transmit_canceled_output()
427 u32 seq = msg->sequence | (1U << 31); in cec_splitter_nb_transmit_canceled_output()
439 u8 tx_op = msg->msg[1]; in cec_splitter_nb_transmit_canceled_output()
448 if (p->out_give_device_power_status_seq != seq) in cec_splitter_nb_transmit_canceled_output()
450 p->out_give_device_power_status_seq = 0; in cec_splitter_nb_transmit_canceled_output()
451 p->out_give_device_power_status_ts = ktime_set(0, 0); in cec_splitter_nb_transmit_canceled_output()
452 p->power_status = splitter->is_standby ? in cec_splitter_nb_transmit_canceled_output()
458 if (p->out_request_current_latency_seq != seq) in cec_splitter_nb_transmit_canceled_output()
460 p->video_latency = 1; in cec_splitter_nb_transmit_canceled_output()
461 p->out_request_current_latency_seq = 0; in cec_splitter_nb_transmit_canceled_output()
462 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_splitter_nb_transmit_canceled_output()
470 if (p->out_request_current_latency_seq != seq) in cec_splitter_nb_transmit_canceled_output()
472 p->out_request_current_latency_ts = ns_to_ktime(msg->tx_ts); in cec_splitter_nb_transmit_canceled_output()
481 int cec_splitter_received_output(struct cec_splitter_port *p, struct cec_msg *msg, in cec_splitter_received_output() argument
484 struct cec_adapter *adap = p->adap; in cec_splitter_received_output()
485 struct cec_splitter *splitter = p->splitter; in cec_splitter_received_output()
486 u32 seq = msg->sequence | (1U << 31); in cec_splitter_received_output()
493 switch (msg->msg[1]) { in cec_splitter_received_output()
502 p->power_status = pwr; in cec_splitter_received_output()
503 if (p->out_give_device_power_status_seq == seq) { in cec_splitter_received_output()
504 p->out_give_device_power_status_seq = 0; in cec_splitter_received_output()
505 p->out_give_device_power_status_ts = ktime_set(0, 0); in cec_splitter_received_output()
521 video_lat = 1; in cec_splitter_received_output()
522 p->video_latency = video_lat; in cec_splitter_received_output()
523 if (p->out_request_current_latency_seq == seq) { in cec_splitter_received_output()
524 p->out_request_current_latency_seq = 0; in cec_splitter_received_output()
525 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_splitter_received_output()
539 p->is_active_source = false; in cec_splitter_received_output()
543 if (!p->is_active_source) in cec_splitter_received_output()
590 struct cec_splitter_port *p = splitter->ports[i]; in cec_splitter_poll() local
594 if (!p) in cec_splitter_poll()
597 pwr_delta = ktime_ms_delta(now, p->out_give_device_power_status_ts); in cec_splitter_poll()
598 pwr_timeout = p->out_give_device_power_status_seq && in cec_splitter_poll()
600 lat_delta = ktime_ms_delta(now, p->out_request_current_latency_ts); in cec_splitter_poll()
601 lat_timeout = p->out_request_current_latency_seq && in cec_splitter_poll()
608 if (p->found_sink && ktime_to_ns(p->lost_sink_ts) && in cec_splitter_poll()
609 ktime_ms_delta(now, p->lost_sink_ts) > 5000) { in cec_splitter_poll()
613 p->port); in cec_splitter_poll()
614 p->found_sink = false; in cec_splitter_poll()
615 p->lost_sink_ts = ktime_set(0, 0); in cec_splitter_poll()
625 mutex_lock(&p->adap->lock); in cec_splitter_poll()
629 p->port, in cec_splitter_poll()
630 p->out_give_device_power_status_seq & ~(1 << 31)); in cec_splitter_poll()
631 p->power_status = pwr; in cec_splitter_poll()
632 p->out_give_device_power_status_seq = 0; in cec_splitter_poll()
633 p->out_give_device_power_status_ts = ktime_set(0, 0); in cec_splitter_poll()
634 mutex_unlock(&p->adap->lock); in cec_splitter_poll()
640 * latency to 1. in cec_splitter_poll()
643 mutex_lock(&p->adap->lock); in cec_splitter_poll()
647 p->port, in cec_splitter_poll()
648 p->out_request_current_latency_seq & ~(1 << 31)); in cec_splitter_poll()
649 p->video_latency = 1; in cec_splitter_poll()
650 p->out_request_current_latency_seq = 0; in cec_splitter_poll()
651 p->out_request_current_latency_ts = ktime_set(0, 0); in cec_splitter_poll()
652 mutex_unlock(&p->adap->lock); in cec_splitter_poll()