Lines Matching refs:msg

42 static inline void cec_msg_active_source(struct cec_msg *msg, __u16 phys_addr)  in cec_msg_active_source()  argument
44 msg->len = 4; in cec_msg_active_source()
45 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_active_source()
46 msg->msg[1] = CEC_MSG_ACTIVE_SOURCE; in cec_msg_active_source()
47 msg->msg[2] = phys_addr >> 8; in cec_msg_active_source()
48 msg->msg[3] = phys_addr & 0xff; in cec_msg_active_source()
51 static inline void cec_ops_active_source(const struct cec_msg *msg, in cec_ops_active_source() argument
54 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_active_source()
57 static inline void cec_msg_image_view_on(struct cec_msg *msg) in cec_msg_image_view_on() argument
59 msg->len = 2; in cec_msg_image_view_on()
60 msg->msg[1] = CEC_MSG_IMAGE_VIEW_ON; in cec_msg_image_view_on()
63 static inline void cec_msg_text_view_on(struct cec_msg *msg) in cec_msg_text_view_on() argument
65 msg->len = 2; in cec_msg_text_view_on()
66 msg->msg[1] = CEC_MSG_TEXT_VIEW_ON; in cec_msg_text_view_on()
71 static inline void cec_msg_inactive_source(struct cec_msg *msg, in cec_msg_inactive_source() argument
74 msg->len = 4; in cec_msg_inactive_source()
75 msg->msg[1] = CEC_MSG_INACTIVE_SOURCE; in cec_msg_inactive_source()
76 msg->msg[2] = phys_addr >> 8; in cec_msg_inactive_source()
77 msg->msg[3] = phys_addr & 0xff; in cec_msg_inactive_source()
80 static inline void cec_ops_inactive_source(const struct cec_msg *msg, in cec_ops_inactive_source() argument
83 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_inactive_source()
86 static inline void cec_msg_request_active_source(struct cec_msg *msg, in cec_msg_request_active_source() argument
89 msg->len = 2; in cec_msg_request_active_source()
90 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_request_active_source()
91 msg->msg[1] = CEC_MSG_REQUEST_ACTIVE_SOURCE; in cec_msg_request_active_source()
92 msg->reply = reply ? CEC_MSG_ACTIVE_SOURCE : 0; in cec_msg_request_active_source()
95 static inline void cec_msg_routing_information(struct cec_msg *msg, in cec_msg_routing_information() argument
98 msg->len = 4; in cec_msg_routing_information()
99 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_routing_information()
100 msg->msg[1] = CEC_MSG_ROUTING_INFORMATION; in cec_msg_routing_information()
101 msg->msg[2] = phys_addr >> 8; in cec_msg_routing_information()
102 msg->msg[3] = phys_addr & 0xff; in cec_msg_routing_information()
105 static inline void cec_ops_routing_information(const struct cec_msg *msg, in cec_ops_routing_information() argument
108 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_information()
111 static inline void cec_msg_routing_change(struct cec_msg *msg, in cec_msg_routing_change() argument
116 msg->len = 6; in cec_msg_routing_change()
117 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_routing_change()
118 msg->msg[1] = CEC_MSG_ROUTING_CHANGE; in cec_msg_routing_change()
119 msg->msg[2] = orig_phys_addr >> 8; in cec_msg_routing_change()
120 msg->msg[3] = orig_phys_addr & 0xff; in cec_msg_routing_change()
121 msg->msg[4] = new_phys_addr >> 8; in cec_msg_routing_change()
122 msg->msg[5] = new_phys_addr & 0xff; in cec_msg_routing_change()
123 msg->reply = reply ? CEC_MSG_ROUTING_INFORMATION : 0; in cec_msg_routing_change()
126 static inline void cec_ops_routing_change(const struct cec_msg *msg, in cec_ops_routing_change() argument
130 *orig_phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_change()
131 *new_phys_addr = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_routing_change()
134 static inline void cec_msg_set_stream_path(struct cec_msg *msg, __u16 phys_addr) in cec_msg_set_stream_path() argument
136 msg->len = 4; in cec_msg_set_stream_path()
137 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_set_stream_path()
138 msg->msg[1] = CEC_MSG_SET_STREAM_PATH; in cec_msg_set_stream_path()
139 msg->msg[2] = phys_addr >> 8; in cec_msg_set_stream_path()
140 msg->msg[3] = phys_addr & 0xff; in cec_msg_set_stream_path()
143 static inline void cec_ops_set_stream_path(const struct cec_msg *msg, in cec_ops_set_stream_path() argument
146 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_set_stream_path()
151 static inline void cec_msg_standby(struct cec_msg *msg) in cec_msg_standby() argument
153 msg->len = 2; in cec_msg_standby()
154 msg->msg[1] = CEC_MSG_STANDBY; in cec_msg_standby()
159 static inline void cec_msg_record_off(struct cec_msg *msg, int reply) in cec_msg_record_off() argument
161 msg->len = 2; in cec_msg_record_off()
162 msg->msg[1] = CEC_MSG_RECORD_OFF; in cec_msg_record_off()
163 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_off()
218 static inline void cec_set_digital_service_id(__u8 *msg, in cec_set_digital_service_id() argument
221 *msg++ = (digital->service_id_method << 7) | digital->dig_bcast_system; in cec_set_digital_service_id()
223 *msg++ = (digital->channel.channel_number_fmt << 2) | in cec_set_digital_service_id()
225 *msg++ = digital->channel.major & 0xff; in cec_set_digital_service_id()
226 *msg++ = digital->channel.minor >> 8; in cec_set_digital_service_id()
227 *msg++ = digital->channel.minor & 0xff; in cec_set_digital_service_id()
228 *msg++ = 0; in cec_set_digital_service_id()
229 *msg++ = 0; in cec_set_digital_service_id()
237 *msg++ = digital->atsc.transport_id >> 8; in cec_set_digital_service_id()
238 *msg++ = digital->atsc.transport_id & 0xff; in cec_set_digital_service_id()
239 *msg++ = digital->atsc.program_number >> 8; in cec_set_digital_service_id()
240 *msg++ = digital->atsc.program_number & 0xff; in cec_set_digital_service_id()
241 *msg++ = 0; in cec_set_digital_service_id()
242 *msg++ = 0; in cec_set_digital_service_id()
245 *msg++ = digital->dvb.transport_id >> 8; in cec_set_digital_service_id()
246 *msg++ = digital->dvb.transport_id & 0xff; in cec_set_digital_service_id()
247 *msg++ = digital->dvb.service_id >> 8; in cec_set_digital_service_id()
248 *msg++ = digital->dvb.service_id & 0xff; in cec_set_digital_service_id()
249 *msg++ = digital->dvb.orig_network_id >> 8; in cec_set_digital_service_id()
250 *msg++ = digital->dvb.orig_network_id & 0xff; in cec_set_digital_service_id()
255 static inline void cec_get_digital_service_id(const __u8 *msg, in cec_get_digital_service_id() argument
258 digital->service_id_method = msg[0] >> 7; in cec_get_digital_service_id()
259 digital->dig_bcast_system = msg[0] & 0x7f; in cec_get_digital_service_id()
261 digital->channel.channel_number_fmt = msg[1] >> 2; in cec_get_digital_service_id()
262 digital->channel.major = ((msg[1] & 3) << 6) | msg[2]; in cec_get_digital_service_id()
263 digital->channel.minor = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
266 digital->dvb.transport_id = (msg[1] << 8) | msg[2]; in cec_get_digital_service_id()
267 digital->dvb.service_id = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
268 digital->dvb.orig_network_id = (msg[5] << 8) | msg[6]; in cec_get_digital_service_id()
271 static inline void cec_msg_record_on_own(struct cec_msg *msg) in cec_msg_record_on_own() argument
273 msg->len = 3; in cec_msg_record_on_own()
274 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_own()
275 msg->msg[2] = CEC_OP_RECORD_SRC_OWN; in cec_msg_record_on_own()
278 static inline void cec_msg_record_on_digital(struct cec_msg *msg, in cec_msg_record_on_digital() argument
281 msg->len = 10; in cec_msg_record_on_digital()
282 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_digital()
283 msg->msg[2] = CEC_OP_RECORD_SRC_DIGITAL; in cec_msg_record_on_digital()
284 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_record_on_digital()
287 static inline void cec_msg_record_on_analog(struct cec_msg *msg, in cec_msg_record_on_analog() argument
292 msg->len = 7; in cec_msg_record_on_analog()
293 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_analog()
294 msg->msg[2] = CEC_OP_RECORD_SRC_ANALOG; in cec_msg_record_on_analog()
295 msg->msg[3] = ana_bcast_type; in cec_msg_record_on_analog()
296 msg->msg[4] = ana_freq >> 8; in cec_msg_record_on_analog()
297 msg->msg[5] = ana_freq & 0xff; in cec_msg_record_on_analog()
298 msg->msg[6] = bcast_system; in cec_msg_record_on_analog()
301 static inline void cec_msg_record_on_plug(struct cec_msg *msg, in cec_msg_record_on_plug() argument
304 msg->len = 4; in cec_msg_record_on_plug()
305 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_plug()
306 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PLUG; in cec_msg_record_on_plug()
307 msg->msg[3] = plug; in cec_msg_record_on_plug()
310 static inline void cec_msg_record_on_phys_addr(struct cec_msg *msg, in cec_msg_record_on_phys_addr() argument
313 msg->len = 5; in cec_msg_record_on_phys_addr()
314 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_phys_addr()
315 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PHYS_ADDR; in cec_msg_record_on_phys_addr()
316 msg->msg[3] = phys_addr >> 8; in cec_msg_record_on_phys_addr()
317 msg->msg[4] = phys_addr & 0xff; in cec_msg_record_on_phys_addr()
320 static inline void cec_msg_record_on(struct cec_msg *msg, in cec_msg_record_on() argument
326 cec_msg_record_on_own(msg); in cec_msg_record_on()
329 cec_msg_record_on_digital(msg, &rec_src->digital); in cec_msg_record_on()
332 cec_msg_record_on_analog(msg, in cec_msg_record_on()
338 cec_msg_record_on_plug(msg, rec_src->ext_plug.plug); in cec_msg_record_on()
341 cec_msg_record_on_phys_addr(msg, in cec_msg_record_on()
345 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_on()
348 static inline void cec_ops_record_on(const struct cec_msg *msg, in cec_ops_record_on() argument
351 rec_src->type = msg->msg[2]; in cec_ops_record_on()
356 cec_get_digital_service_id(msg->msg + 3, &rec_src->digital); in cec_ops_record_on()
359 rec_src->analog.ana_bcast_type = msg->msg[3]; in cec_ops_record_on()
361 (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_record_on()
362 rec_src->analog.bcast_system = msg->msg[6]; in cec_ops_record_on()
365 rec_src->ext_plug.plug = msg->msg[3]; in cec_ops_record_on()
369 (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_record_on()
374 static inline void cec_msg_record_status(struct cec_msg *msg, __u8 rec_status) in cec_msg_record_status() argument
376 msg->len = 3; in cec_msg_record_status()
377 msg->msg[1] = CEC_MSG_RECORD_STATUS; in cec_msg_record_status()
378 msg->msg[2] = rec_status; in cec_msg_record_status()
381 static inline void cec_ops_record_status(const struct cec_msg *msg, in cec_ops_record_status() argument
384 *rec_status = msg->msg[2]; in cec_ops_record_status()
387 static inline void cec_msg_record_tv_screen(struct cec_msg *msg, in cec_msg_record_tv_screen() argument
390 msg->len = 2; in cec_msg_record_tv_screen()
391 msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN; in cec_msg_record_tv_screen()
392 msg->reply = reply ? CEC_MSG_RECORD_ON : 0; in cec_msg_record_tv_screen()
397 static inline void cec_msg_timer_status(struct cec_msg *msg, in cec_msg_timer_status() argument
405 msg->len = 3; in cec_msg_timer_status()
406 msg->msg[1] = CEC_MSG_TIMER_STATUS; in cec_msg_timer_status()
407 msg->msg[2] = (timer_overlap_warning << 7) | in cec_msg_timer_status()
414 msg->len += 2; in cec_msg_timer_status()
415 msg->msg[3] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_timer_status()
416 msg->msg[4] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_timer_status()
420 static inline void cec_ops_timer_status(const struct cec_msg *msg, in cec_ops_timer_status() argument
428 *timer_overlap_warning = msg->msg[2] >> 7; in cec_ops_timer_status()
429 *media_info = (msg->msg[2] >> 5) & 3; in cec_ops_timer_status()
430 if (msg->msg[2] & 0x10) { in cec_ops_timer_status()
431 *prog_info = msg->msg[2] & 0xf; in cec_ops_timer_status()
435 *prog_error = msg->msg[2] & 0xf; in cec_ops_timer_status()
440 *duration_hr = (msg->msg[3] >> 4) * 10 + (msg->msg[3] & 0xf); in cec_ops_timer_status()
441 *duration_min = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_timer_status()
447 static inline void cec_msg_timer_cleared_status(struct cec_msg *msg, in cec_msg_timer_cleared_status() argument
450 msg->len = 3; in cec_msg_timer_cleared_status()
451 msg->msg[1] = CEC_MSG_TIMER_CLEARED_STATUS; in cec_msg_timer_cleared_status()
452 msg->msg[2] = timer_cleared_status; in cec_msg_timer_cleared_status()
455 static inline void cec_ops_timer_cleared_status(const struct cec_msg *msg, in cec_ops_timer_cleared_status() argument
458 *timer_cleared_status = msg->msg[2]; in cec_ops_timer_cleared_status()
461 static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, in cec_msg_clear_analogue_timer() argument
474 msg->len = 13; in cec_msg_clear_analogue_timer()
475 msg->msg[1] = CEC_MSG_CLEAR_ANALOGUE_TIMER; in cec_msg_clear_analogue_timer()
476 msg->msg[2] = day; in cec_msg_clear_analogue_timer()
477 msg->msg[3] = month; in cec_msg_clear_analogue_timer()
479 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_analogue_timer()
480 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_analogue_timer()
481 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_analogue_timer()
482 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_analogue_timer()
483 msg->msg[8] = recording_seq; in cec_msg_clear_analogue_timer()
484 msg->msg[9] = ana_bcast_type; in cec_msg_clear_analogue_timer()
485 msg->msg[10] = ana_freq >> 8; in cec_msg_clear_analogue_timer()
486 msg->msg[11] = ana_freq & 0xff; in cec_msg_clear_analogue_timer()
487 msg->msg[12] = bcast_system; in cec_msg_clear_analogue_timer()
488 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_analogue_timer()
491 static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, in cec_ops_clear_analogue_timer() argument
503 *day = msg->msg[2]; in cec_ops_clear_analogue_timer()
504 *month = msg->msg[3]; in cec_ops_clear_analogue_timer()
506 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_analogue_timer()
507 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_analogue_timer()
508 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_analogue_timer()
509 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_analogue_timer()
510 *recording_seq = msg->msg[8]; in cec_ops_clear_analogue_timer()
511 *ana_bcast_type = msg->msg[9]; in cec_ops_clear_analogue_timer()
512 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_clear_analogue_timer()
513 *bcast_system = msg->msg[12]; in cec_ops_clear_analogue_timer()
516 static inline void cec_msg_clear_digital_timer(struct cec_msg *msg, in cec_msg_clear_digital_timer() argument
527 msg->len = 16; in cec_msg_clear_digital_timer()
528 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_digital_timer()
529 msg->msg[1] = CEC_MSG_CLEAR_DIGITAL_TIMER; in cec_msg_clear_digital_timer()
530 msg->msg[2] = day; in cec_msg_clear_digital_timer()
531 msg->msg[3] = month; in cec_msg_clear_digital_timer()
533 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_digital_timer()
534 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_digital_timer()
535 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_digital_timer()
536 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_digital_timer()
537 msg->msg[8] = recording_seq; in cec_msg_clear_digital_timer()
538 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_clear_digital_timer()
541 static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg, in cec_ops_clear_digital_timer() argument
551 *day = msg->msg[2]; in cec_ops_clear_digital_timer()
552 *month = msg->msg[3]; in cec_ops_clear_digital_timer()
554 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_digital_timer()
555 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_digital_timer()
556 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_digital_timer()
557 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_digital_timer()
558 *recording_seq = msg->msg[8]; in cec_ops_clear_digital_timer()
559 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_clear_digital_timer()
562 static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, in cec_msg_clear_ext_timer() argument
575 msg->len = 13; in cec_msg_clear_ext_timer()
576 msg->msg[1] = CEC_MSG_CLEAR_EXT_TIMER; in cec_msg_clear_ext_timer()
577 msg->msg[2] = day; in cec_msg_clear_ext_timer()
578 msg->msg[3] = month; in cec_msg_clear_ext_timer()
580 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_ext_timer()
581 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_ext_timer()
582 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_ext_timer()
583 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_ext_timer()
584 msg->msg[8] = recording_seq; in cec_msg_clear_ext_timer()
585 msg->msg[9] = ext_src_spec; in cec_msg_clear_ext_timer()
586 msg->msg[10] = plug; in cec_msg_clear_ext_timer()
587 msg->msg[11] = phys_addr >> 8; in cec_msg_clear_ext_timer()
588 msg->msg[12] = phys_addr & 0xff; in cec_msg_clear_ext_timer()
589 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_ext_timer()
592 static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, in cec_ops_clear_ext_timer() argument
604 *day = msg->msg[2]; in cec_ops_clear_ext_timer()
605 *month = msg->msg[3]; in cec_ops_clear_ext_timer()
607 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_ext_timer()
608 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_ext_timer()
609 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_ext_timer()
610 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_ext_timer()
611 *recording_seq = msg->msg[8]; in cec_ops_clear_ext_timer()
612 *ext_src_spec = msg->msg[9]; in cec_ops_clear_ext_timer()
613 *plug = msg->msg[10]; in cec_ops_clear_ext_timer()
614 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_clear_ext_timer()
617 static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, in cec_msg_set_analogue_timer() argument
630 msg->len = 13; in cec_msg_set_analogue_timer()
631 msg->msg[1] = CEC_MSG_SET_ANALOGUE_TIMER; in cec_msg_set_analogue_timer()
632 msg->msg[2] = day; in cec_msg_set_analogue_timer()
633 msg->msg[3] = month; in cec_msg_set_analogue_timer()
635 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_analogue_timer()
636 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_analogue_timer()
637 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_analogue_timer()
638 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_analogue_timer()
639 msg->msg[8] = recording_seq; in cec_msg_set_analogue_timer()
640 msg->msg[9] = ana_bcast_type; in cec_msg_set_analogue_timer()
641 msg->msg[10] = ana_freq >> 8; in cec_msg_set_analogue_timer()
642 msg->msg[11] = ana_freq & 0xff; in cec_msg_set_analogue_timer()
643 msg->msg[12] = bcast_system; in cec_msg_set_analogue_timer()
644 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_analogue_timer()
647 static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, in cec_ops_set_analogue_timer() argument
659 *day = msg->msg[2]; in cec_ops_set_analogue_timer()
660 *month = msg->msg[3]; in cec_ops_set_analogue_timer()
662 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_analogue_timer()
663 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_analogue_timer()
664 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_analogue_timer()
665 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_analogue_timer()
666 *recording_seq = msg->msg[8]; in cec_ops_set_analogue_timer()
667 *ana_bcast_type = msg->msg[9]; in cec_ops_set_analogue_timer()
668 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_set_analogue_timer()
669 *bcast_system = msg->msg[12]; in cec_ops_set_analogue_timer()
672 static inline void cec_msg_set_digital_timer(struct cec_msg *msg, in cec_msg_set_digital_timer() argument
683 msg->len = 16; in cec_msg_set_digital_timer()
684 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_digital_timer()
685 msg->msg[1] = CEC_MSG_SET_DIGITAL_TIMER; in cec_msg_set_digital_timer()
686 msg->msg[2] = day; in cec_msg_set_digital_timer()
687 msg->msg[3] = month; in cec_msg_set_digital_timer()
689 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_digital_timer()
690 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_digital_timer()
691 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_digital_timer()
692 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_digital_timer()
693 msg->msg[8] = recording_seq; in cec_msg_set_digital_timer()
694 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_set_digital_timer()
697 static inline void cec_ops_set_digital_timer(const struct cec_msg *msg, in cec_ops_set_digital_timer() argument
707 *day = msg->msg[2]; in cec_ops_set_digital_timer()
708 *month = msg->msg[3]; in cec_ops_set_digital_timer()
710 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_digital_timer()
711 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_digital_timer()
712 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_digital_timer()
713 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_digital_timer()
714 *recording_seq = msg->msg[8]; in cec_ops_set_digital_timer()
715 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_set_digital_timer()
718 static inline void cec_msg_set_ext_timer(struct cec_msg *msg, in cec_msg_set_ext_timer() argument
731 msg->len = 13; in cec_msg_set_ext_timer()
732 msg->msg[1] = CEC_MSG_SET_EXT_TIMER; in cec_msg_set_ext_timer()
733 msg->msg[2] = day; in cec_msg_set_ext_timer()
734 msg->msg[3] = month; in cec_msg_set_ext_timer()
736 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_ext_timer()
737 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_ext_timer()
738 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_ext_timer()
739 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_ext_timer()
740 msg->msg[8] = recording_seq; in cec_msg_set_ext_timer()
741 msg->msg[9] = ext_src_spec; in cec_msg_set_ext_timer()
742 msg->msg[10] = plug; in cec_msg_set_ext_timer()
743 msg->msg[11] = phys_addr >> 8; in cec_msg_set_ext_timer()
744 msg->msg[12] = phys_addr & 0xff; in cec_msg_set_ext_timer()
745 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_ext_timer()
748 static inline void cec_ops_set_ext_timer(const struct cec_msg *msg, in cec_ops_set_ext_timer() argument
760 *day = msg->msg[2]; in cec_ops_set_ext_timer()
761 *month = msg->msg[3]; in cec_ops_set_ext_timer()
763 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_ext_timer()
764 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_ext_timer()
765 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_ext_timer()
766 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_ext_timer()
767 *recording_seq = msg->msg[8]; in cec_ops_set_ext_timer()
768 *ext_src_spec = msg->msg[9]; in cec_ops_set_ext_timer()
769 *plug = msg->msg[10]; in cec_ops_set_ext_timer()
770 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_set_ext_timer()
773 static inline void cec_msg_set_timer_program_title(struct cec_msg *msg, in cec_msg_set_timer_program_title() argument
780 msg->len = 2 + len; in cec_msg_set_timer_program_title()
781 msg->msg[1] = CEC_MSG_SET_TIMER_PROGRAM_TITLE; in cec_msg_set_timer_program_title()
782 memcpy(msg->msg + 2, prog_title, len); in cec_msg_set_timer_program_title()
785 static inline void cec_ops_set_timer_program_title(const struct cec_msg *msg, in cec_ops_set_timer_program_title() argument
788 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_timer_program_title()
792 memcpy(prog_title, msg->msg + 2, len); in cec_ops_set_timer_program_title()
797 static inline void cec_msg_cec_version(struct cec_msg *msg, __u8 cec_version) in cec_msg_cec_version() argument
799 msg->len = 3; in cec_msg_cec_version()
800 msg->msg[1] = CEC_MSG_CEC_VERSION; in cec_msg_cec_version()
801 msg->msg[2] = cec_version; in cec_msg_cec_version()
804 static inline void cec_ops_cec_version(const struct cec_msg *msg, in cec_ops_cec_version() argument
807 *cec_version = msg->msg[2]; in cec_ops_cec_version()
810 static inline void cec_msg_get_cec_version(struct cec_msg *msg, in cec_msg_get_cec_version() argument
813 msg->len = 2; in cec_msg_get_cec_version()
814 msg->msg[1] = CEC_MSG_GET_CEC_VERSION; in cec_msg_get_cec_version()
815 msg->reply = reply ? CEC_MSG_CEC_VERSION : 0; in cec_msg_get_cec_version()
818 static inline void cec_msg_report_physical_addr(struct cec_msg *msg, in cec_msg_report_physical_addr() argument
821 msg->len = 5; in cec_msg_report_physical_addr()
822 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_physical_addr()
823 msg->msg[1] = CEC_MSG_REPORT_PHYSICAL_ADDR; in cec_msg_report_physical_addr()
824 msg->msg[2] = phys_addr >> 8; in cec_msg_report_physical_addr()
825 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_physical_addr()
826 msg->msg[4] = prim_devtype; in cec_msg_report_physical_addr()
829 static inline void cec_ops_report_physical_addr(const struct cec_msg *msg, in cec_ops_report_physical_addr() argument
832 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_physical_addr()
833 *prim_devtype = msg->msg[4]; in cec_ops_report_physical_addr()
836 static inline void cec_msg_give_physical_addr(struct cec_msg *msg, in cec_msg_give_physical_addr() argument
839 msg->len = 2; in cec_msg_give_physical_addr()
840 msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR; in cec_msg_give_physical_addr()
841 msg->reply = reply ? CEC_MSG_REPORT_PHYSICAL_ADDR : 0; in cec_msg_give_physical_addr()
844 static inline void cec_msg_set_menu_language(struct cec_msg *msg, in cec_msg_set_menu_language() argument
847 msg->len = 5; in cec_msg_set_menu_language()
848 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_set_menu_language()
849 msg->msg[1] = CEC_MSG_SET_MENU_LANGUAGE; in cec_msg_set_menu_language()
850 memcpy(msg->msg + 2, language, 3); in cec_msg_set_menu_language()
853 static inline void cec_ops_set_menu_language(const struct cec_msg *msg, in cec_ops_set_menu_language() argument
856 memcpy(language, msg->msg + 2, 3); in cec_ops_set_menu_language()
860 static inline void cec_msg_get_menu_language(struct cec_msg *msg, in cec_msg_get_menu_language() argument
863 msg->len = 2; in cec_msg_get_menu_language()
864 msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE; in cec_msg_get_menu_language()
865 msg->reply = reply ? CEC_MSG_SET_MENU_LANGUAGE : 0; in cec_msg_get_menu_language()
876 static inline void cec_msg_report_features(struct cec_msg *msg, in cec_msg_report_features() argument
880 msg->len = 6; in cec_msg_report_features()
881 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_features()
882 msg->msg[1] = CEC_MSG_REPORT_FEATURES; in cec_msg_report_features()
883 msg->msg[2] = cec_version; in cec_msg_report_features()
884 msg->msg[3] = all_device_types; in cec_msg_report_features()
885 msg->msg[4] = rc_profile; in cec_msg_report_features()
886 msg->msg[5] = dev_features; in cec_msg_report_features()
889 static inline void cec_ops_report_features(const struct cec_msg *msg, in cec_ops_report_features() argument
893 const __u8 *p = &msg->msg[4]; in cec_ops_report_features()
895 *cec_version = msg->msg[2]; in cec_ops_report_features()
896 *all_device_types = msg->msg[3]; in cec_ops_report_features()
898 while (p < &msg->msg[14] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
902 while (p < &msg->msg[15] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
909 static inline void cec_msg_give_features(struct cec_msg *msg, in cec_msg_give_features() argument
912 msg->len = 2; in cec_msg_give_features()
913 msg->msg[1] = CEC_MSG_GIVE_FEATURES; in cec_msg_give_features()
914 msg->reply = reply ? CEC_MSG_REPORT_FEATURES : 0; in cec_msg_give_features()
918 static inline void cec_msg_deck_control(struct cec_msg *msg, in cec_msg_deck_control() argument
921 msg->len = 3; in cec_msg_deck_control()
922 msg->msg[1] = CEC_MSG_DECK_CONTROL; in cec_msg_deck_control()
923 msg->msg[2] = deck_control_mode; in cec_msg_deck_control()
926 static inline void cec_ops_deck_control(const struct cec_msg *msg, in cec_ops_deck_control() argument
929 *deck_control_mode = msg->msg[2]; in cec_ops_deck_control()
932 static inline void cec_msg_deck_status(struct cec_msg *msg, in cec_msg_deck_status() argument
935 msg->len = 3; in cec_msg_deck_status()
936 msg->msg[1] = CEC_MSG_DECK_STATUS; in cec_msg_deck_status()
937 msg->msg[2] = deck_info; in cec_msg_deck_status()
940 static inline void cec_ops_deck_status(const struct cec_msg *msg, in cec_ops_deck_status() argument
943 *deck_info = msg->msg[2]; in cec_ops_deck_status()
946 static inline void cec_msg_give_deck_status(struct cec_msg *msg, in cec_msg_give_deck_status() argument
950 msg->len = 3; in cec_msg_give_deck_status()
951 msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS; in cec_msg_give_deck_status()
952 msg->msg[2] = status_req; in cec_msg_give_deck_status()
953 msg->reply = reply ? CEC_MSG_DECK_STATUS : 0; in cec_msg_give_deck_status()
956 static inline void cec_ops_give_deck_status(const struct cec_msg *msg, in cec_ops_give_deck_status() argument
959 *status_req = msg->msg[2]; in cec_ops_give_deck_status()
962 static inline void cec_msg_play(struct cec_msg *msg, in cec_msg_play() argument
965 msg->len = 3; in cec_msg_play()
966 msg->msg[1] = CEC_MSG_PLAY; in cec_msg_play()
967 msg->msg[2] = play_mode; in cec_msg_play()
970 static inline void cec_ops_play(const struct cec_msg *msg, in cec_ops_play() argument
973 *play_mode = msg->msg[2]; in cec_ops_play()
992 static inline void cec_msg_tuner_device_status_analog(struct cec_msg *msg, in cec_msg_tuner_device_status_analog() argument
999 msg->len = 7; in cec_msg_tuner_device_status_analog()
1000 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_analog()
1001 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_analog()
1002 msg->msg[3] = ana_bcast_type; in cec_msg_tuner_device_status_analog()
1003 msg->msg[4] = ana_freq >> 8; in cec_msg_tuner_device_status_analog()
1004 msg->msg[5] = ana_freq & 0xff; in cec_msg_tuner_device_status_analog()
1005 msg->msg[6] = bcast_system; in cec_msg_tuner_device_status_analog()
1008 static inline void cec_msg_tuner_device_status_digital(struct cec_msg *msg, in cec_msg_tuner_device_status_digital() argument
1012 msg->len = 10; in cec_msg_tuner_device_status_digital()
1013 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_digital()
1014 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_digital()
1015 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_tuner_device_status_digital()
1018 static inline void cec_msg_tuner_device_status(struct cec_msg *msg, in cec_msg_tuner_device_status() argument
1022 cec_msg_tuner_device_status_analog(msg, in cec_msg_tuner_device_status()
1029 cec_msg_tuner_device_status_digital(msg, in cec_msg_tuner_device_status()
1035 static inline void cec_ops_tuner_device_status(const struct cec_msg *msg, in cec_ops_tuner_device_status() argument
1038 tuner_dev_info->is_analog = msg->len < 10; in cec_ops_tuner_device_status()
1039 tuner_dev_info->rec_flag = msg->msg[2] >> 7; in cec_ops_tuner_device_status()
1040 tuner_dev_info->tuner_display_info = msg->msg[2] & 0x7f; in cec_ops_tuner_device_status()
1042 tuner_dev_info->analog.ana_bcast_type = msg->msg[3]; in cec_ops_tuner_device_status()
1043 tuner_dev_info->analog.ana_freq = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_tuner_device_status()
1044 tuner_dev_info->analog.bcast_system = msg->msg[6]; in cec_ops_tuner_device_status()
1047 cec_get_digital_service_id(msg->msg + 3, &tuner_dev_info->digital); in cec_ops_tuner_device_status()
1050 static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, in cec_msg_give_tuner_device_status() argument
1054 msg->len = 3; in cec_msg_give_tuner_device_status()
1055 msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS; in cec_msg_give_tuner_device_status()
1056 msg->msg[2] = status_req; in cec_msg_give_tuner_device_status()
1057 msg->reply = reply ? CEC_MSG_TUNER_DEVICE_STATUS : 0; in cec_msg_give_tuner_device_status()
1060 static inline void cec_ops_give_tuner_device_status(const struct cec_msg *msg, in cec_ops_give_tuner_device_status() argument
1063 *status_req = msg->msg[2]; in cec_ops_give_tuner_device_status()
1066 static inline void cec_msg_select_analogue_service(struct cec_msg *msg, in cec_msg_select_analogue_service() argument
1071 msg->len = 6; in cec_msg_select_analogue_service()
1072 msg->msg[1] = CEC_MSG_SELECT_ANALOGUE_SERVICE; in cec_msg_select_analogue_service()
1073 msg->msg[2] = ana_bcast_type; in cec_msg_select_analogue_service()
1074 msg->msg[3] = ana_freq >> 8; in cec_msg_select_analogue_service()
1075 msg->msg[4] = ana_freq & 0xff; in cec_msg_select_analogue_service()
1076 msg->msg[5] = bcast_system; in cec_msg_select_analogue_service()
1079 static inline void cec_ops_select_analogue_service(const struct cec_msg *msg, in cec_ops_select_analogue_service() argument
1084 *ana_bcast_type = msg->msg[2]; in cec_ops_select_analogue_service()
1085 *ana_freq = (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_select_analogue_service()
1086 *bcast_system = msg->msg[5]; in cec_ops_select_analogue_service()
1089 static inline void cec_msg_select_digital_service(struct cec_msg *msg, in cec_msg_select_digital_service() argument
1092 msg->len = 9; in cec_msg_select_digital_service()
1093 msg->msg[1] = CEC_MSG_SELECT_DIGITAL_SERVICE; in cec_msg_select_digital_service()
1094 cec_set_digital_service_id(msg->msg + 2, digital); in cec_msg_select_digital_service()
1097 static inline void cec_ops_select_digital_service(const struct cec_msg *msg, in cec_ops_select_digital_service() argument
1100 cec_get_digital_service_id(msg->msg + 2, digital); in cec_ops_select_digital_service()
1103 static inline void cec_msg_tuner_step_decrement(struct cec_msg *msg) in cec_msg_tuner_step_decrement() argument
1105 msg->len = 2; in cec_msg_tuner_step_decrement()
1106 msg->msg[1] = CEC_MSG_TUNER_STEP_DECREMENT; in cec_msg_tuner_step_decrement()
1109 static inline void cec_msg_tuner_step_increment(struct cec_msg *msg) in cec_msg_tuner_step_increment() argument
1111 msg->len = 2; in cec_msg_tuner_step_increment()
1112 msg->msg[1] = CEC_MSG_TUNER_STEP_INCREMENT; in cec_msg_tuner_step_increment()
1117 static inline void cec_msg_device_vendor_id(struct cec_msg *msg, __u32 vendor_id) in cec_msg_device_vendor_id() argument
1119 msg->len = 5; in cec_msg_device_vendor_id()
1120 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_device_vendor_id()
1121 msg->msg[1] = CEC_MSG_DEVICE_VENDOR_ID; in cec_msg_device_vendor_id()
1122 msg->msg[2] = vendor_id >> 16; in cec_msg_device_vendor_id()
1123 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_device_vendor_id()
1124 msg->msg[4] = vendor_id & 0xff; in cec_msg_device_vendor_id()
1127 static inline void cec_ops_device_vendor_id(const struct cec_msg *msg, in cec_ops_device_vendor_id() argument
1130 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_device_vendor_id()
1133 static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg, in cec_msg_give_device_vendor_id() argument
1136 msg->len = 2; in cec_msg_give_device_vendor_id()
1137 msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID; in cec_msg_give_device_vendor_id()
1138 msg->reply = reply ? CEC_MSG_DEVICE_VENDOR_ID : 0; in cec_msg_give_device_vendor_id()
1141 static inline void cec_msg_vendor_command(struct cec_msg *msg, in cec_msg_vendor_command() argument
1146 msg->len = 2 + size; in cec_msg_vendor_command()
1147 msg->msg[1] = CEC_MSG_VENDOR_COMMAND; in cec_msg_vendor_command()
1148 memcpy(msg->msg + 2, vendor_cmd, size); in cec_msg_vendor_command()
1151 static inline void cec_ops_vendor_command(const struct cec_msg *msg, in cec_ops_vendor_command() argument
1155 *size = msg->len - 2; in cec_ops_vendor_command()
1159 *vendor_cmd = msg->msg + 2; in cec_ops_vendor_command()
1162 static inline void cec_msg_vendor_command_with_id(struct cec_msg *msg, in cec_msg_vendor_command_with_id() argument
1168 msg->len = 5 + size; in cec_msg_vendor_command_with_id()
1169 msg->msg[1] = CEC_MSG_VENDOR_COMMAND_WITH_ID; in cec_msg_vendor_command_with_id()
1170 msg->msg[2] = vendor_id >> 16; in cec_msg_vendor_command_with_id()
1171 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_vendor_command_with_id()
1172 msg->msg[4] = vendor_id & 0xff; in cec_msg_vendor_command_with_id()
1173 memcpy(msg->msg + 5, vendor_cmd, size); in cec_msg_vendor_command_with_id()
1176 static inline void cec_ops_vendor_command_with_id(const struct cec_msg *msg, in cec_ops_vendor_command_with_id() argument
1180 *size = msg->len - 5; in cec_ops_vendor_command_with_id()
1184 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_vendor_command_with_id()
1185 *vendor_cmd = msg->msg + 5; in cec_ops_vendor_command_with_id()
1188 static inline void cec_msg_vendor_remote_button_down(struct cec_msg *msg, in cec_msg_vendor_remote_button_down() argument
1194 msg->len = 2 + size; in cec_msg_vendor_remote_button_down()
1195 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN; in cec_msg_vendor_remote_button_down()
1196 memcpy(msg->msg + 2, rc_code, size); in cec_msg_vendor_remote_button_down()
1199 static inline void cec_ops_vendor_remote_button_down(const struct cec_msg *msg, in cec_ops_vendor_remote_button_down() argument
1203 *size = msg->len - 2; in cec_ops_vendor_remote_button_down()
1207 *rc_code = msg->msg + 2; in cec_ops_vendor_remote_button_down()
1210 static inline void cec_msg_vendor_remote_button_up(struct cec_msg *msg) in cec_msg_vendor_remote_button_up() argument
1212 msg->len = 2; in cec_msg_vendor_remote_button_up()
1213 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_UP; in cec_msg_vendor_remote_button_up()
1218 static inline void cec_msg_set_osd_string(struct cec_msg *msg, in cec_msg_set_osd_string() argument
1226 msg->len = 3 + len; in cec_msg_set_osd_string()
1227 msg->msg[1] = CEC_MSG_SET_OSD_STRING; in cec_msg_set_osd_string()
1228 msg->msg[2] = disp_ctl; in cec_msg_set_osd_string()
1229 memcpy(msg->msg + 3, osd, len); in cec_msg_set_osd_string()
1232 static inline void cec_ops_set_osd_string(const struct cec_msg *msg, in cec_ops_set_osd_string() argument
1236 unsigned int len = msg->len > 3 ? msg->len - 3 : 0; in cec_ops_set_osd_string()
1238 *disp_ctl = msg->msg[2]; in cec_ops_set_osd_string()
1241 memcpy(osd, msg->msg + 3, len); in cec_ops_set_osd_string()
1247 static inline void cec_msg_set_osd_name(struct cec_msg *msg, const char *name) in cec_msg_set_osd_name() argument
1253 msg->len = 2 + len; in cec_msg_set_osd_name()
1254 msg->msg[1] = CEC_MSG_SET_OSD_NAME; in cec_msg_set_osd_name()
1255 memcpy(msg->msg + 2, name, len); in cec_msg_set_osd_name()
1258 static inline void cec_ops_set_osd_name(const struct cec_msg *msg, in cec_ops_set_osd_name() argument
1261 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_osd_name()
1265 memcpy(name, msg->msg + 2, len); in cec_ops_set_osd_name()
1269 static inline void cec_msg_give_osd_name(struct cec_msg *msg, in cec_msg_give_osd_name() argument
1272 msg->len = 2; in cec_msg_give_osd_name()
1273 msg->msg[1] = CEC_MSG_GIVE_OSD_NAME; in cec_msg_give_osd_name()
1274 msg->reply = reply ? CEC_MSG_SET_OSD_NAME : 0; in cec_msg_give_osd_name()
1279 static inline void cec_msg_menu_status(struct cec_msg *msg, in cec_msg_menu_status() argument
1282 msg->len = 3; in cec_msg_menu_status()
1283 msg->msg[1] = CEC_MSG_MENU_STATUS; in cec_msg_menu_status()
1284 msg->msg[2] = menu_state; in cec_msg_menu_status()
1287 static inline void cec_ops_menu_status(const struct cec_msg *msg, in cec_ops_menu_status() argument
1290 *menu_state = msg->msg[2]; in cec_ops_menu_status()
1293 static inline void cec_msg_menu_request(struct cec_msg *msg, in cec_msg_menu_request() argument
1297 msg->len = 3; in cec_msg_menu_request()
1298 msg->msg[1] = CEC_MSG_MENU_REQUEST; in cec_msg_menu_request()
1299 msg->msg[2] = menu_req; in cec_msg_menu_request()
1300 msg->reply = reply ? CEC_MSG_MENU_STATUS : 0; in cec_msg_menu_request()
1303 static inline void cec_ops_menu_request(const struct cec_msg *msg, in cec_ops_menu_request() argument
1306 *menu_req = msg->msg[2]; in cec_ops_menu_request()
1323 static inline void cec_msg_user_control_pressed(struct cec_msg *msg, in cec_msg_user_control_pressed() argument
1326 msg->len = 3; in cec_msg_user_control_pressed()
1327 msg->msg[1] = CEC_MSG_USER_CONTROL_PRESSED; in cec_msg_user_control_pressed()
1328 msg->msg[2] = ui_cmd->ui_cmd; in cec_msg_user_control_pressed()
1339 msg->len++; in cec_msg_user_control_pressed()
1340 msg->msg[3] = ui_cmd->play_mode; in cec_msg_user_control_pressed()
1343 msg->len += 4; in cec_msg_user_control_pressed()
1344 msg->msg[3] = (ui_cmd->channel_identifier.channel_number_fmt << 2) | in cec_msg_user_control_pressed()
1346 msg->msg[4] = ui_cmd->channel_identifier.major & 0xff; in cec_msg_user_control_pressed()
1347 msg->msg[5] = ui_cmd->channel_identifier.minor >> 8; in cec_msg_user_control_pressed()
1348 msg->msg[6] = ui_cmd->channel_identifier.minor & 0xff; in cec_msg_user_control_pressed()
1353 static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, in cec_ops_user_control_pressed() argument
1356 ui_cmd->ui_cmd = msg->msg[2]; in cec_ops_user_control_pressed()
1358 if (msg->len == 3) in cec_ops_user_control_pressed()
1368 ui_cmd->play_mode = msg->msg[3]; in cec_ops_user_control_pressed()
1372 if (msg->len < 7) in cec_ops_user_control_pressed()
1375 ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2; in cec_ops_user_control_pressed()
1376 ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4]; in cec_ops_user_control_pressed()
1377 ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_user_control_pressed()
1382 static inline void cec_msg_user_control_released(struct cec_msg *msg) in cec_msg_user_control_released() argument
1384 msg->len = 2; in cec_msg_user_control_released()
1385 msg->msg[1] = CEC_MSG_USER_CONTROL_RELEASED; in cec_msg_user_control_released()
1391 static inline void cec_msg_report_power_status(struct cec_msg *msg, in cec_msg_report_power_status() argument
1394 msg->len = 3; in cec_msg_report_power_status()
1395 msg->msg[1] = CEC_MSG_REPORT_POWER_STATUS; in cec_msg_report_power_status()
1396 msg->msg[2] = pwr_state; in cec_msg_report_power_status()
1399 static inline void cec_ops_report_power_status(const struct cec_msg *msg, in cec_ops_report_power_status() argument
1402 *pwr_state = msg->msg[2]; in cec_ops_report_power_status()
1405 static inline void cec_msg_give_device_power_status(struct cec_msg *msg, in cec_msg_give_device_power_status() argument
1408 msg->len = 2; in cec_msg_give_device_power_status()
1409 msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS; in cec_msg_give_device_power_status()
1410 msg->reply = reply ? CEC_MSG_REPORT_POWER_STATUS : 0; in cec_msg_give_device_power_status()
1414 static inline void cec_msg_feature_abort(struct cec_msg *msg, in cec_msg_feature_abort() argument
1417 msg->len = 4; in cec_msg_feature_abort()
1418 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_feature_abort()
1419 msg->msg[2] = abort_msg; in cec_msg_feature_abort()
1420 msg->msg[3] = reason; in cec_msg_feature_abort()
1423 static inline void cec_ops_feature_abort(const struct cec_msg *msg, in cec_ops_feature_abort() argument
1426 *abort_msg = msg->msg[2]; in cec_ops_feature_abort()
1427 *reason = msg->msg[3]; in cec_ops_feature_abort()
1431 static inline void cec_msg_reply_feature_abort(struct cec_msg *msg, __u8 reason) in cec_msg_reply_feature_abort() argument
1433 cec_msg_set_reply_to(msg, msg); in cec_msg_reply_feature_abort()
1434 msg->len = 4; in cec_msg_reply_feature_abort()
1435 msg->msg[2] = msg->msg[1]; in cec_msg_reply_feature_abort()
1436 msg->msg[3] = reason; in cec_msg_reply_feature_abort()
1437 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_reply_feature_abort()
1440 static inline void cec_msg_abort(struct cec_msg *msg) in cec_msg_abort() argument
1442 msg->len = 2; in cec_msg_abort()
1443 msg->msg[1] = CEC_MSG_ABORT; in cec_msg_abort()
1448 static inline void cec_msg_report_audio_status(struct cec_msg *msg, in cec_msg_report_audio_status() argument
1452 msg->len = 3; in cec_msg_report_audio_status()
1453 msg->msg[1] = CEC_MSG_REPORT_AUDIO_STATUS; in cec_msg_report_audio_status()
1454 msg->msg[2] = (aud_mute_status << 7) | (aud_vol_status & 0x7f); in cec_msg_report_audio_status()
1457 static inline void cec_ops_report_audio_status(const struct cec_msg *msg, in cec_ops_report_audio_status() argument
1461 *aud_mute_status = msg->msg[2] >> 7; in cec_ops_report_audio_status()
1462 *aud_vol_status = msg->msg[2] & 0x7f; in cec_ops_report_audio_status()
1465 static inline void cec_msg_give_audio_status(struct cec_msg *msg, in cec_msg_give_audio_status() argument
1468 msg->len = 2; in cec_msg_give_audio_status()
1469 msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS; in cec_msg_give_audio_status()
1470 msg->reply = reply ? CEC_MSG_REPORT_AUDIO_STATUS : 0; in cec_msg_give_audio_status()
1473 static inline void cec_msg_set_system_audio_mode(struct cec_msg *msg, in cec_msg_set_system_audio_mode() argument
1476 msg->len = 3; in cec_msg_set_system_audio_mode()
1477 msg->msg[1] = CEC_MSG_SET_SYSTEM_AUDIO_MODE; in cec_msg_set_system_audio_mode()
1478 msg->msg[2] = sys_aud_status; in cec_msg_set_system_audio_mode()
1481 static inline void cec_ops_set_system_audio_mode(const struct cec_msg *msg, in cec_ops_set_system_audio_mode() argument
1484 *sys_aud_status = msg->msg[2]; in cec_ops_set_system_audio_mode()
1487 static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg, in cec_msg_system_audio_mode_request() argument
1491 msg->len = phys_addr == 0xffff ? 2 : 4; in cec_msg_system_audio_mode_request()
1492 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST; in cec_msg_system_audio_mode_request()
1493 msg->msg[2] = phys_addr >> 8; in cec_msg_system_audio_mode_request()
1494 msg->msg[3] = phys_addr & 0xff; in cec_msg_system_audio_mode_request()
1495 msg->reply = reply ? CEC_MSG_SET_SYSTEM_AUDIO_MODE : 0; in cec_msg_system_audio_mode_request()
1499 static inline void cec_ops_system_audio_mode_request(const struct cec_msg *msg, in cec_ops_system_audio_mode_request() argument
1502 if (msg->len < 4) in cec_ops_system_audio_mode_request()
1505 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_system_audio_mode_request()
1508 static inline void cec_msg_system_audio_mode_status(struct cec_msg *msg, in cec_msg_system_audio_mode_status() argument
1511 msg->len = 3; in cec_msg_system_audio_mode_status()
1512 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_system_audio_mode_status()
1513 msg->msg[2] = sys_aud_status; in cec_msg_system_audio_mode_status()
1516 static inline void cec_ops_system_audio_mode_status(const struct cec_msg *msg, in cec_ops_system_audio_mode_status() argument
1519 *sys_aud_status = msg->msg[2]; in cec_ops_system_audio_mode_status()
1522 static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg, in cec_msg_give_system_audio_mode_status() argument
1525 msg->len = 2; in cec_msg_give_system_audio_mode_status()
1526 msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_give_system_audio_mode_status()
1527 msg->reply = reply ? CEC_MSG_SYSTEM_AUDIO_MODE_STATUS : 0; in cec_msg_give_system_audio_mode_status()
1530 static inline void cec_msg_report_short_audio_descriptor(struct cec_msg *msg, in cec_msg_report_short_audio_descriptor() argument
1538 msg->len = 2 + num_descriptors * 3; in cec_msg_report_short_audio_descriptor()
1539 msg->msg[1] = CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR; in cec_msg_report_short_audio_descriptor()
1541 msg->msg[2 + i * 3] = (descriptors[i] >> 16) & 0xff; in cec_msg_report_short_audio_descriptor()
1542 msg->msg[3 + i * 3] = (descriptors[i] >> 8) & 0xff; in cec_msg_report_short_audio_descriptor()
1543 msg->msg[4 + i * 3] = descriptors[i] & 0xff; in cec_msg_report_short_audio_descriptor()
1547 static inline void cec_ops_report_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_report_short_audio_descriptor() argument
1553 *num_descriptors = (msg->len - 2) / 3; in cec_ops_report_short_audio_descriptor()
1557 descriptors[i] = (msg->msg[2 + i * 3] << 16) | in cec_ops_report_short_audio_descriptor()
1558 (msg->msg[3 + i * 3] << 8) | in cec_ops_report_short_audio_descriptor()
1559 msg->msg[4 + i * 3]; in cec_ops_report_short_audio_descriptor()
1562 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, in cec_msg_request_short_audio_descriptor() argument
1572 msg->len = 2 + num_descriptors; in cec_msg_request_short_audio_descriptor()
1573 msg->msg[1] = CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR; in cec_msg_request_short_audio_descriptor()
1574 msg->reply = reply ? CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR : 0; in cec_msg_request_short_audio_descriptor()
1576 msg->msg[2 + i] = (audio_format_id[i] << 6) | in cec_msg_request_short_audio_descriptor()
1580 static inline void cec_ops_request_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_request_short_audio_descriptor() argument
1587 *num_descriptors = msg->len - 2; in cec_ops_request_short_audio_descriptor()
1591 audio_format_id[i] = msg->msg[2 + i] >> 6; in cec_ops_request_short_audio_descriptor()
1592 audio_format_code[i] = msg->msg[2 + i] & 0x3f; in cec_ops_request_short_audio_descriptor()
1598 static inline void cec_msg_set_audio_rate(struct cec_msg *msg, in cec_msg_set_audio_rate() argument
1601 msg->len = 3; in cec_msg_set_audio_rate()
1602 msg->msg[1] = CEC_MSG_SET_AUDIO_RATE; in cec_msg_set_audio_rate()
1603 msg->msg[2] = audio_rate; in cec_msg_set_audio_rate()
1606 static inline void cec_ops_set_audio_rate(const struct cec_msg *msg, in cec_ops_set_audio_rate() argument
1609 *audio_rate = msg->msg[2]; in cec_ops_set_audio_rate()
1614 static inline void cec_msg_report_arc_initiated(struct cec_msg *msg) in cec_msg_report_arc_initiated() argument
1616 msg->len = 2; in cec_msg_report_arc_initiated()
1617 msg->msg[1] = CEC_MSG_REPORT_ARC_INITIATED; in cec_msg_report_arc_initiated()
1620 static inline void cec_msg_initiate_arc(struct cec_msg *msg, in cec_msg_initiate_arc() argument
1623 msg->len = 2; in cec_msg_initiate_arc()
1624 msg->msg[1] = CEC_MSG_INITIATE_ARC; in cec_msg_initiate_arc()
1625 msg->reply = reply ? CEC_MSG_REPORT_ARC_INITIATED : 0; in cec_msg_initiate_arc()
1628 static inline void cec_msg_request_arc_initiation(struct cec_msg *msg, in cec_msg_request_arc_initiation() argument
1631 msg->len = 2; in cec_msg_request_arc_initiation()
1632 msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION; in cec_msg_request_arc_initiation()
1633 msg->reply = reply ? CEC_MSG_INITIATE_ARC : 0; in cec_msg_request_arc_initiation()
1636 static inline void cec_msg_report_arc_terminated(struct cec_msg *msg) in cec_msg_report_arc_terminated() argument
1638 msg->len = 2; in cec_msg_report_arc_terminated()
1639 msg->msg[1] = CEC_MSG_REPORT_ARC_TERMINATED; in cec_msg_report_arc_terminated()
1642 static inline void cec_msg_terminate_arc(struct cec_msg *msg, in cec_msg_terminate_arc() argument
1645 msg->len = 2; in cec_msg_terminate_arc()
1646 msg->msg[1] = CEC_MSG_TERMINATE_ARC; in cec_msg_terminate_arc()
1647 msg->reply = reply ? CEC_MSG_REPORT_ARC_TERMINATED : 0; in cec_msg_terminate_arc()
1650 static inline void cec_msg_request_arc_termination(struct cec_msg *msg, in cec_msg_request_arc_termination() argument
1653 msg->len = 2; in cec_msg_request_arc_termination()
1654 msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION; in cec_msg_request_arc_termination()
1655 msg->reply = reply ? CEC_MSG_TERMINATE_ARC : 0; in cec_msg_request_arc_termination()
1661 static inline void cec_msg_report_current_latency(struct cec_msg *msg, in cec_msg_report_current_latency() argument
1668 msg->len = 6; in cec_msg_report_current_latency()
1669 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_current_latency()
1670 msg->msg[1] = CEC_MSG_REPORT_CURRENT_LATENCY; in cec_msg_report_current_latency()
1671 msg->msg[2] = phys_addr >> 8; in cec_msg_report_current_latency()
1672 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_current_latency()
1673 msg->msg[4] = video_latency; in cec_msg_report_current_latency()
1674 msg->msg[5] = (low_latency_mode << 2) | audio_out_compensated; in cec_msg_report_current_latency()
1676 msg->msg[msg->len++] = audio_out_delay; in cec_msg_report_current_latency()
1679 static inline void cec_ops_report_current_latency(const struct cec_msg *msg, in cec_ops_report_current_latency() argument
1686 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_current_latency()
1687 *video_latency = msg->msg[4]; in cec_ops_report_current_latency()
1688 *low_latency_mode = (msg->msg[5] >> 2) & 1; in cec_ops_report_current_latency()
1689 *audio_out_compensated = msg->msg[5] & 3; in cec_ops_report_current_latency()
1690 if (*audio_out_compensated == 3 && msg->len >= 7) in cec_ops_report_current_latency()
1691 *audio_out_delay = msg->msg[6]; in cec_ops_report_current_latency()
1696 static inline void cec_msg_request_current_latency(struct cec_msg *msg, in cec_msg_request_current_latency() argument
1700 msg->len = 4; in cec_msg_request_current_latency()
1701 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_request_current_latency()
1702 msg->msg[1] = CEC_MSG_REQUEST_CURRENT_LATENCY; in cec_msg_request_current_latency()
1703 msg->msg[2] = phys_addr >> 8; in cec_msg_request_current_latency()
1704 msg->msg[3] = phys_addr & 0xff; in cec_msg_request_current_latency()
1705 msg->reply = reply ? CEC_MSG_REPORT_CURRENT_LATENCY : 0; in cec_msg_request_current_latency()
1708 static inline void cec_ops_request_current_latency(const struct cec_msg *msg, in cec_ops_request_current_latency() argument
1711 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_request_current_latency()
1716 static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, in cec_msg_cdc_hec_inquire_state() argument
1720 msg->len = 9; in cec_msg_cdc_hec_inquire_state()
1721 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_inquire_state()
1722 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_inquire_state()
1724 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_inquire_state()
1725 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_inquire_state()
1726 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_inquire_state()
1727 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_inquire_state()
1728 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_inquire_state()
1731 static inline void cec_ops_cdc_hec_inquire_state(const struct cec_msg *msg, in cec_ops_cdc_hec_inquire_state() argument
1736 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_inquire_state()
1737 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_inquire_state()
1738 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_inquire_state()
1741 static inline void cec_msg_cdc_hec_report_state(struct cec_msg *msg, in cec_msg_cdc_hec_report_state() argument
1750 msg->len = has_field ? 10 : 8; in cec_msg_cdc_hec_report_state()
1751 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_report_state()
1752 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_report_state()
1754 msg->msg[4] = CEC_MSG_CDC_HEC_REPORT_STATE; in cec_msg_cdc_hec_report_state()
1755 msg->msg[5] = target_phys_addr >> 8; in cec_msg_cdc_hec_report_state()
1756 msg->msg[6] = target_phys_addr & 0xff; in cec_msg_cdc_hec_report_state()
1757 msg->msg[7] = (hec_func_state << 6) | in cec_msg_cdc_hec_report_state()
1762 msg->msg[8] = hec_field >> 8; in cec_msg_cdc_hec_report_state()
1763 msg->msg[9] = hec_field & 0xff; in cec_msg_cdc_hec_report_state()
1767 static inline void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, in cec_ops_cdc_hec_report_state() argument
1777 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_report_state()
1778 *target_phys_addr = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_report_state()
1779 *hec_func_state = msg->msg[7] >> 6; in cec_ops_cdc_hec_report_state()
1780 *host_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1781 *enc_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1782 *cdc_errcode = msg->msg[7] & 3; in cec_ops_cdc_hec_report_state()
1783 *has_field = msg->len >= 10; in cec_ops_cdc_hec_report_state()
1784 *hec_field = *has_field ? ((msg->msg[8] << 8) | msg->msg[9]) : 0; in cec_ops_cdc_hec_report_state()
1787 static inline void cec_msg_cdc_hec_set_state(struct cec_msg *msg, in cec_msg_cdc_hec_set_state() argument
1795 msg->len = 10; in cec_msg_cdc_hec_set_state()
1796 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_set_state()
1797 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state()
1799 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_set_state()
1800 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state()
1801 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state()
1802 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_set_state()
1803 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_set_state()
1804 msg->msg[9] = hec_set_state; in cec_msg_cdc_hec_set_state()
1806 msg->msg[msg->len++] = phys_addr3 >> 8; in cec_msg_cdc_hec_set_state()
1807 msg->msg[msg->len++] = phys_addr3 & 0xff; in cec_msg_cdc_hec_set_state()
1809 msg->msg[msg->len++] = phys_addr4 >> 8; in cec_msg_cdc_hec_set_state()
1810 msg->msg[msg->len++] = phys_addr4 & 0xff; in cec_msg_cdc_hec_set_state()
1812 msg->msg[msg->len++] = phys_addr5 >> 8; in cec_msg_cdc_hec_set_state()
1813 msg->msg[msg->len++] = phys_addr5 & 0xff; in cec_msg_cdc_hec_set_state()
1819 static inline void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state() argument
1828 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state()
1829 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state()
1830 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_set_state()
1831 *hec_set_state = msg->msg[9]; in cec_ops_cdc_hec_set_state()
1833 if (msg->len >= 12) in cec_ops_cdc_hec_set_state()
1834 *phys_addr3 = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_cdc_hec_set_state()
1835 if (msg->len >= 14) in cec_ops_cdc_hec_set_state()
1836 *phys_addr4 = (msg->msg[12] << 8) | msg->msg[13]; in cec_ops_cdc_hec_set_state()
1837 if (msg->len >= 16) in cec_ops_cdc_hec_set_state()
1838 *phys_addr5 = (msg->msg[14] << 8) | msg->msg[15]; in cec_ops_cdc_hec_set_state()
1841 static inline void cec_msg_cdc_hec_set_state_adjacent(struct cec_msg *msg, in cec_msg_cdc_hec_set_state_adjacent() argument
1845 msg->len = 8; in cec_msg_cdc_hec_set_state_adjacent()
1846 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_set_state_adjacent()
1847 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state_adjacent()
1849 msg->msg[4] = CEC_MSG_CDC_HEC_SET_STATE_ADJACENT; in cec_msg_cdc_hec_set_state_adjacent()
1850 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state_adjacent()
1851 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state_adjacent()
1852 msg->msg[7] = hec_set_state; in cec_msg_cdc_hec_set_state_adjacent()
1855 static inline void cec_ops_cdc_hec_set_state_adjacent(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state_adjacent() argument
1860 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state_adjacent()
1861 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state_adjacent()
1862 *hec_set_state = msg->msg[7]; in cec_ops_cdc_hec_set_state_adjacent()
1865 static inline void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg, in cec_msg_cdc_hec_request_deactivation() argument
1870 msg->len = 11; in cec_msg_cdc_hec_request_deactivation()
1871 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_request_deactivation()
1872 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_request_deactivation()
1874 msg->msg[4] = CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION; in cec_msg_cdc_hec_request_deactivation()
1875 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_request_deactivation()
1876 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1877 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_request_deactivation()
1878 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1879 msg->msg[9] = phys_addr3 >> 8; in cec_msg_cdc_hec_request_deactivation()
1880 msg->msg[10] = phys_addr3 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1883 static inline void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *msg, in cec_ops_cdc_hec_request_deactivation() argument
1889 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_request_deactivation()
1890 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_request_deactivation()
1891 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_request_deactivation()
1892 *phys_addr3 = (msg->msg[9] << 8) | msg->msg[10]; in cec_ops_cdc_hec_request_deactivation()
1895 static inline void cec_msg_cdc_hec_notify_alive(struct cec_msg *msg) in cec_msg_cdc_hec_notify_alive() argument
1897 msg->len = 5; in cec_msg_cdc_hec_notify_alive()
1898 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_notify_alive()
1899 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_notify_alive()
1901 msg->msg[4] = CEC_MSG_CDC_HEC_NOTIFY_ALIVE; in cec_msg_cdc_hec_notify_alive()
1904 static inline void cec_ops_cdc_hec_notify_alive(const struct cec_msg *msg, in cec_ops_cdc_hec_notify_alive() argument
1907 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_notify_alive()
1910 static inline void cec_msg_cdc_hec_discover(struct cec_msg *msg) in cec_msg_cdc_hec_discover() argument
1912 msg->len = 5; in cec_msg_cdc_hec_discover()
1913 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_discover()
1914 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_discover()
1916 msg->msg[4] = CEC_MSG_CDC_HEC_DISCOVER; in cec_msg_cdc_hec_discover()
1919 static inline void cec_ops_cdc_hec_discover(const struct cec_msg *msg, in cec_ops_cdc_hec_discover() argument
1922 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_discover()
1925 static inline void cec_msg_cdc_hpd_set_state(struct cec_msg *msg, in cec_msg_cdc_hpd_set_state() argument
1929 msg->len = 6; in cec_msg_cdc_hpd_set_state()
1930 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hpd_set_state()
1931 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_set_state()
1933 msg->msg[4] = CEC_MSG_CDC_HPD_SET_STATE; in cec_msg_cdc_hpd_set_state()
1934 msg->msg[5] = (input_port << 4) | hpd_state; in cec_msg_cdc_hpd_set_state()
1937 static inline void cec_ops_cdc_hpd_set_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_set_state() argument
1942 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_set_state()
1943 *input_port = msg->msg[5] >> 4; in cec_ops_cdc_hpd_set_state()
1944 *hpd_state = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_set_state()
1947 static inline void cec_msg_cdc_hpd_report_state(struct cec_msg *msg, in cec_msg_cdc_hpd_report_state() argument
1951 msg->len = 6; in cec_msg_cdc_hpd_report_state()
1952 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hpd_report_state()
1953 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_report_state()
1955 msg->msg[4] = CEC_MSG_CDC_HPD_REPORT_STATE; in cec_msg_cdc_hpd_report_state()
1956 msg->msg[5] = (hpd_state << 4) | hpd_error; in cec_msg_cdc_hpd_report_state()
1959 static inline void cec_ops_cdc_hpd_report_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_report_state() argument
1964 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_report_state()
1965 *hpd_state = msg->msg[5] >> 4; in cec_ops_cdc_hpd_report_state()
1966 *hpd_error = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_report_state()