Lines Matching refs:msg

14 static inline void cec_msg_active_source(struct cec_msg *msg, __u16 phys_addr)  in cec_msg_active_source()  argument
16 msg->len = 4; in cec_msg_active_source()
17 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_active_source()
18 msg->msg[1] = CEC_MSG_ACTIVE_SOURCE; in cec_msg_active_source()
19 msg->msg[2] = phys_addr >> 8; in cec_msg_active_source()
20 msg->msg[3] = phys_addr & 0xff; in cec_msg_active_source()
23 static inline void cec_ops_active_source(const struct cec_msg *msg, in cec_ops_active_source() argument
26 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_active_source()
29 static inline void cec_msg_image_view_on(struct cec_msg *msg) in cec_msg_image_view_on() argument
31 msg->len = 2; in cec_msg_image_view_on()
32 msg->msg[1] = CEC_MSG_IMAGE_VIEW_ON; in cec_msg_image_view_on()
35 static inline void cec_msg_text_view_on(struct cec_msg *msg) in cec_msg_text_view_on() argument
37 msg->len = 2; in cec_msg_text_view_on()
38 msg->msg[1] = CEC_MSG_TEXT_VIEW_ON; in cec_msg_text_view_on()
43 static inline void cec_msg_inactive_source(struct cec_msg *msg, in cec_msg_inactive_source() argument
46 msg->len = 4; in cec_msg_inactive_source()
47 msg->msg[1] = CEC_MSG_INACTIVE_SOURCE; in cec_msg_inactive_source()
48 msg->msg[2] = phys_addr >> 8; in cec_msg_inactive_source()
49 msg->msg[3] = phys_addr & 0xff; in cec_msg_inactive_source()
52 static inline void cec_ops_inactive_source(const struct cec_msg *msg, in cec_ops_inactive_source() argument
55 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_inactive_source()
58 static inline void cec_msg_request_active_source(struct cec_msg *msg, in cec_msg_request_active_source() argument
61 msg->len = 2; in cec_msg_request_active_source()
62 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_request_active_source()
63 msg->msg[1] = CEC_MSG_REQUEST_ACTIVE_SOURCE; in cec_msg_request_active_source()
64 msg->reply = reply ? CEC_MSG_ACTIVE_SOURCE : 0; in cec_msg_request_active_source()
67 static inline void cec_msg_routing_information(struct cec_msg *msg, in cec_msg_routing_information() argument
70 msg->len = 4; in cec_msg_routing_information()
71 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_routing_information()
72 msg->msg[1] = CEC_MSG_ROUTING_INFORMATION; in cec_msg_routing_information()
73 msg->msg[2] = phys_addr >> 8; in cec_msg_routing_information()
74 msg->msg[3] = phys_addr & 0xff; in cec_msg_routing_information()
77 static inline void cec_ops_routing_information(const struct cec_msg *msg, in cec_ops_routing_information() argument
80 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_information()
83 static inline void cec_msg_routing_change(struct cec_msg *msg, in cec_msg_routing_change() argument
88 msg->len = 6; in cec_msg_routing_change()
89 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_routing_change()
90 msg->msg[1] = CEC_MSG_ROUTING_CHANGE; in cec_msg_routing_change()
91 msg->msg[2] = orig_phys_addr >> 8; in cec_msg_routing_change()
92 msg->msg[3] = orig_phys_addr & 0xff; in cec_msg_routing_change()
93 msg->msg[4] = new_phys_addr >> 8; in cec_msg_routing_change()
94 msg->msg[5] = new_phys_addr & 0xff; in cec_msg_routing_change()
95 msg->reply = reply ? CEC_MSG_ROUTING_INFORMATION : 0; in cec_msg_routing_change()
98 static inline void cec_ops_routing_change(const struct cec_msg *msg, in cec_ops_routing_change() argument
102 *orig_phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_change()
103 *new_phys_addr = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_routing_change()
106 static inline void cec_msg_set_stream_path(struct cec_msg *msg, __u16 phys_addr) in cec_msg_set_stream_path() argument
108 msg->len = 4; in cec_msg_set_stream_path()
109 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_set_stream_path()
110 msg->msg[1] = CEC_MSG_SET_STREAM_PATH; in cec_msg_set_stream_path()
111 msg->msg[2] = phys_addr >> 8; in cec_msg_set_stream_path()
112 msg->msg[3] = phys_addr & 0xff; in cec_msg_set_stream_path()
115 static inline void cec_ops_set_stream_path(const struct cec_msg *msg, in cec_ops_set_stream_path() argument
118 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_set_stream_path()
123 static inline void cec_msg_standby(struct cec_msg *msg) in cec_msg_standby() argument
125 msg->len = 2; in cec_msg_standby()
126 msg->msg[1] = CEC_MSG_STANDBY; in cec_msg_standby()
131 static inline void cec_msg_record_off(struct cec_msg *msg, int reply) in cec_msg_record_off() argument
133 msg->len = 2; in cec_msg_record_off()
134 msg->msg[1] = CEC_MSG_RECORD_OFF; in cec_msg_record_off()
135 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_off()
190 static inline void cec_set_digital_service_id(__u8 *msg, in cec_set_digital_service_id() argument
193 *msg++ = (digital->service_id_method << 7) | digital->dig_bcast_system; in cec_set_digital_service_id()
195 *msg++ = (digital->channel.channel_number_fmt << 2) | in cec_set_digital_service_id()
197 *msg++ = digital->channel.major & 0xff; in cec_set_digital_service_id()
198 *msg++ = digital->channel.minor >> 8; in cec_set_digital_service_id()
199 *msg++ = digital->channel.minor & 0xff; in cec_set_digital_service_id()
200 *msg++ = 0; in cec_set_digital_service_id()
201 *msg++ = 0; in cec_set_digital_service_id()
209 *msg++ = digital->atsc.transport_id >> 8; in cec_set_digital_service_id()
210 *msg++ = digital->atsc.transport_id & 0xff; in cec_set_digital_service_id()
211 *msg++ = digital->atsc.program_number >> 8; in cec_set_digital_service_id()
212 *msg++ = digital->atsc.program_number & 0xff; in cec_set_digital_service_id()
213 *msg++ = 0; in cec_set_digital_service_id()
214 *msg++ = 0; in cec_set_digital_service_id()
217 *msg++ = digital->dvb.transport_id >> 8; in cec_set_digital_service_id()
218 *msg++ = digital->dvb.transport_id & 0xff; in cec_set_digital_service_id()
219 *msg++ = digital->dvb.service_id >> 8; in cec_set_digital_service_id()
220 *msg++ = digital->dvb.service_id & 0xff; in cec_set_digital_service_id()
221 *msg++ = digital->dvb.orig_network_id >> 8; in cec_set_digital_service_id()
222 *msg++ = digital->dvb.orig_network_id & 0xff; in cec_set_digital_service_id()
227 static inline void cec_get_digital_service_id(const __u8 *msg, in cec_get_digital_service_id() argument
230 digital->service_id_method = msg[0] >> 7; in cec_get_digital_service_id()
231 digital->dig_bcast_system = msg[0] & 0x7f; in cec_get_digital_service_id()
233 digital->channel.channel_number_fmt = msg[1] >> 2; in cec_get_digital_service_id()
234 digital->channel.major = ((msg[1] & 3) << 6) | msg[2]; in cec_get_digital_service_id()
235 digital->channel.minor = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
238 digital->dvb.transport_id = (msg[1] << 8) | msg[2]; in cec_get_digital_service_id()
239 digital->dvb.service_id = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
240 digital->dvb.orig_network_id = (msg[5] << 8) | msg[6]; in cec_get_digital_service_id()
243 static inline void cec_msg_record_on_own(struct cec_msg *msg) in cec_msg_record_on_own() argument
245 msg->len = 3; in cec_msg_record_on_own()
246 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_own()
247 msg->msg[2] = CEC_OP_RECORD_SRC_OWN; in cec_msg_record_on_own()
250 static inline void cec_msg_record_on_digital(struct cec_msg *msg, in cec_msg_record_on_digital() argument
253 msg->len = 10; in cec_msg_record_on_digital()
254 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_digital()
255 msg->msg[2] = CEC_OP_RECORD_SRC_DIGITAL; in cec_msg_record_on_digital()
256 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_record_on_digital()
259 static inline void cec_msg_record_on_analog(struct cec_msg *msg, in cec_msg_record_on_analog() argument
264 msg->len = 7; in cec_msg_record_on_analog()
265 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_analog()
266 msg->msg[2] = CEC_OP_RECORD_SRC_ANALOG; in cec_msg_record_on_analog()
267 msg->msg[3] = ana_bcast_type; in cec_msg_record_on_analog()
268 msg->msg[4] = ana_freq >> 8; in cec_msg_record_on_analog()
269 msg->msg[5] = ana_freq & 0xff; in cec_msg_record_on_analog()
270 msg->msg[6] = bcast_system; in cec_msg_record_on_analog()
273 static inline void cec_msg_record_on_plug(struct cec_msg *msg, in cec_msg_record_on_plug() argument
276 msg->len = 4; in cec_msg_record_on_plug()
277 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_plug()
278 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PLUG; in cec_msg_record_on_plug()
279 msg->msg[3] = plug; in cec_msg_record_on_plug()
282 static inline void cec_msg_record_on_phys_addr(struct cec_msg *msg, in cec_msg_record_on_phys_addr() argument
285 msg->len = 5; in cec_msg_record_on_phys_addr()
286 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_phys_addr()
287 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PHYS_ADDR; in cec_msg_record_on_phys_addr()
288 msg->msg[3] = phys_addr >> 8; in cec_msg_record_on_phys_addr()
289 msg->msg[4] = phys_addr & 0xff; in cec_msg_record_on_phys_addr()
292 static inline void cec_msg_record_on(struct cec_msg *msg, in cec_msg_record_on() argument
298 cec_msg_record_on_own(msg); in cec_msg_record_on()
301 cec_msg_record_on_digital(msg, &rec_src->digital); in cec_msg_record_on()
304 cec_msg_record_on_analog(msg, in cec_msg_record_on()
310 cec_msg_record_on_plug(msg, rec_src->ext_plug.plug); in cec_msg_record_on()
313 cec_msg_record_on_phys_addr(msg, in cec_msg_record_on()
317 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_on()
320 static inline void cec_ops_record_on(const struct cec_msg *msg, in cec_ops_record_on() argument
323 rec_src->type = msg->msg[2]; in cec_ops_record_on()
328 cec_get_digital_service_id(msg->msg + 3, &rec_src->digital); in cec_ops_record_on()
331 rec_src->analog.ana_bcast_type = msg->msg[3]; in cec_ops_record_on()
333 (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_record_on()
334 rec_src->analog.bcast_system = msg->msg[6]; in cec_ops_record_on()
337 rec_src->ext_plug.plug = msg->msg[3]; in cec_ops_record_on()
341 (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_record_on()
346 static inline void cec_msg_record_status(struct cec_msg *msg, __u8 rec_status) in cec_msg_record_status() argument
348 msg->len = 3; in cec_msg_record_status()
349 msg->msg[1] = CEC_MSG_RECORD_STATUS; in cec_msg_record_status()
350 msg->msg[2] = rec_status; in cec_msg_record_status()
353 static inline void cec_ops_record_status(const struct cec_msg *msg, in cec_ops_record_status() argument
356 *rec_status = msg->msg[2]; in cec_ops_record_status()
359 static inline void cec_msg_record_tv_screen(struct cec_msg *msg, in cec_msg_record_tv_screen() argument
362 msg->len = 2; in cec_msg_record_tv_screen()
363 msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN; in cec_msg_record_tv_screen()
364 msg->reply = reply ? CEC_MSG_RECORD_ON : 0; in cec_msg_record_tv_screen()
369 static inline void cec_msg_timer_status(struct cec_msg *msg, in cec_msg_timer_status() argument
377 msg->len = 3; in cec_msg_timer_status()
378 msg->msg[1] = CEC_MSG_TIMER_STATUS; in cec_msg_timer_status()
379 msg->msg[2] = (timer_overlap_warning << 7) | in cec_msg_timer_status()
386 msg->len += 2; in cec_msg_timer_status()
387 msg->msg[3] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_timer_status()
388 msg->msg[4] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_timer_status()
392 static inline void cec_ops_timer_status(const struct cec_msg *msg, in cec_ops_timer_status() argument
400 *timer_overlap_warning = msg->msg[2] >> 7; in cec_ops_timer_status()
401 *media_info = (msg->msg[2] >> 5) & 3; in cec_ops_timer_status()
402 if (msg->msg[2] & 0x10) { in cec_ops_timer_status()
403 *prog_info = msg->msg[2] & 0xf; in cec_ops_timer_status()
407 *prog_error = msg->msg[2] & 0xf; in cec_ops_timer_status()
412 *duration_hr = (msg->msg[3] >> 4) * 10 + (msg->msg[3] & 0xf); in cec_ops_timer_status()
413 *duration_min = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_timer_status()
419 static inline void cec_msg_timer_cleared_status(struct cec_msg *msg, in cec_msg_timer_cleared_status() argument
422 msg->len = 3; in cec_msg_timer_cleared_status()
423 msg->msg[1] = CEC_MSG_TIMER_CLEARED_STATUS; in cec_msg_timer_cleared_status()
424 msg->msg[2] = timer_cleared_status; in cec_msg_timer_cleared_status()
427 static inline void cec_ops_timer_cleared_status(const struct cec_msg *msg, in cec_ops_timer_cleared_status() argument
430 *timer_cleared_status = msg->msg[2]; in cec_ops_timer_cleared_status()
433 static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, in cec_msg_clear_analogue_timer() argument
446 msg->len = 13; in cec_msg_clear_analogue_timer()
447 msg->msg[1] = CEC_MSG_CLEAR_ANALOGUE_TIMER; in cec_msg_clear_analogue_timer()
448 msg->msg[2] = day; in cec_msg_clear_analogue_timer()
449 msg->msg[3] = month; in cec_msg_clear_analogue_timer()
451 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_analogue_timer()
452 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_analogue_timer()
453 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_analogue_timer()
454 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_analogue_timer()
455 msg->msg[8] = recording_seq; in cec_msg_clear_analogue_timer()
456 msg->msg[9] = ana_bcast_type; in cec_msg_clear_analogue_timer()
457 msg->msg[10] = ana_freq >> 8; in cec_msg_clear_analogue_timer()
458 msg->msg[11] = ana_freq & 0xff; in cec_msg_clear_analogue_timer()
459 msg->msg[12] = bcast_system; in cec_msg_clear_analogue_timer()
460 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_analogue_timer()
463 static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, in cec_ops_clear_analogue_timer() argument
475 *day = msg->msg[2]; in cec_ops_clear_analogue_timer()
476 *month = msg->msg[3]; in cec_ops_clear_analogue_timer()
478 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_analogue_timer()
479 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_analogue_timer()
480 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_analogue_timer()
481 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_analogue_timer()
482 *recording_seq = msg->msg[8]; in cec_ops_clear_analogue_timer()
483 *ana_bcast_type = msg->msg[9]; in cec_ops_clear_analogue_timer()
484 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_clear_analogue_timer()
485 *bcast_system = msg->msg[12]; in cec_ops_clear_analogue_timer()
488 static inline void cec_msg_clear_digital_timer(struct cec_msg *msg, in cec_msg_clear_digital_timer() argument
499 msg->len = 16; in cec_msg_clear_digital_timer()
500 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_digital_timer()
501 msg->msg[1] = CEC_MSG_CLEAR_DIGITAL_TIMER; in cec_msg_clear_digital_timer()
502 msg->msg[2] = day; in cec_msg_clear_digital_timer()
503 msg->msg[3] = month; in cec_msg_clear_digital_timer()
505 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_digital_timer()
506 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_digital_timer()
507 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_digital_timer()
508 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_digital_timer()
509 msg->msg[8] = recording_seq; in cec_msg_clear_digital_timer()
510 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_clear_digital_timer()
513 static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg, in cec_ops_clear_digital_timer() argument
523 *day = msg->msg[2]; in cec_ops_clear_digital_timer()
524 *month = msg->msg[3]; in cec_ops_clear_digital_timer()
526 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_digital_timer()
527 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_digital_timer()
528 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_digital_timer()
529 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_digital_timer()
530 *recording_seq = msg->msg[8]; in cec_ops_clear_digital_timer()
531 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_clear_digital_timer()
534 static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, in cec_msg_clear_ext_timer() argument
547 msg->len = 13; in cec_msg_clear_ext_timer()
548 msg->msg[1] = CEC_MSG_CLEAR_EXT_TIMER; in cec_msg_clear_ext_timer()
549 msg->msg[2] = day; in cec_msg_clear_ext_timer()
550 msg->msg[3] = month; in cec_msg_clear_ext_timer()
552 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_ext_timer()
553 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_ext_timer()
554 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_ext_timer()
555 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_ext_timer()
556 msg->msg[8] = recording_seq; in cec_msg_clear_ext_timer()
557 msg->msg[9] = ext_src_spec; in cec_msg_clear_ext_timer()
558 msg->msg[10] = plug; in cec_msg_clear_ext_timer()
559 msg->msg[11] = phys_addr >> 8; in cec_msg_clear_ext_timer()
560 msg->msg[12] = phys_addr & 0xff; in cec_msg_clear_ext_timer()
561 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_ext_timer()
564 static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, in cec_ops_clear_ext_timer() argument
576 *day = msg->msg[2]; in cec_ops_clear_ext_timer()
577 *month = msg->msg[3]; in cec_ops_clear_ext_timer()
579 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_ext_timer()
580 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_ext_timer()
581 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_ext_timer()
582 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_ext_timer()
583 *recording_seq = msg->msg[8]; in cec_ops_clear_ext_timer()
584 *ext_src_spec = msg->msg[9]; in cec_ops_clear_ext_timer()
585 *plug = msg->msg[10]; in cec_ops_clear_ext_timer()
586 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_clear_ext_timer()
589 static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, in cec_msg_set_analogue_timer() argument
602 msg->len = 13; in cec_msg_set_analogue_timer()
603 msg->msg[1] = CEC_MSG_SET_ANALOGUE_TIMER; in cec_msg_set_analogue_timer()
604 msg->msg[2] = day; in cec_msg_set_analogue_timer()
605 msg->msg[3] = month; in cec_msg_set_analogue_timer()
607 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_analogue_timer()
608 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_analogue_timer()
609 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_analogue_timer()
610 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_analogue_timer()
611 msg->msg[8] = recording_seq; in cec_msg_set_analogue_timer()
612 msg->msg[9] = ana_bcast_type; in cec_msg_set_analogue_timer()
613 msg->msg[10] = ana_freq >> 8; in cec_msg_set_analogue_timer()
614 msg->msg[11] = ana_freq & 0xff; in cec_msg_set_analogue_timer()
615 msg->msg[12] = bcast_system; in cec_msg_set_analogue_timer()
616 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_analogue_timer()
619 static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, in cec_ops_set_analogue_timer() argument
631 *day = msg->msg[2]; in cec_ops_set_analogue_timer()
632 *month = msg->msg[3]; in cec_ops_set_analogue_timer()
634 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_analogue_timer()
635 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_analogue_timer()
636 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_analogue_timer()
637 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_analogue_timer()
638 *recording_seq = msg->msg[8]; in cec_ops_set_analogue_timer()
639 *ana_bcast_type = msg->msg[9]; in cec_ops_set_analogue_timer()
640 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_set_analogue_timer()
641 *bcast_system = msg->msg[12]; in cec_ops_set_analogue_timer()
644 static inline void cec_msg_set_digital_timer(struct cec_msg *msg, in cec_msg_set_digital_timer() argument
655 msg->len = 16; in cec_msg_set_digital_timer()
656 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_digital_timer()
657 msg->msg[1] = CEC_MSG_SET_DIGITAL_TIMER; in cec_msg_set_digital_timer()
658 msg->msg[2] = day; in cec_msg_set_digital_timer()
659 msg->msg[3] = month; in cec_msg_set_digital_timer()
661 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_digital_timer()
662 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_digital_timer()
663 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_digital_timer()
664 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_digital_timer()
665 msg->msg[8] = recording_seq; in cec_msg_set_digital_timer()
666 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_set_digital_timer()
669 static inline void cec_ops_set_digital_timer(const struct cec_msg *msg, in cec_ops_set_digital_timer() argument
679 *day = msg->msg[2]; in cec_ops_set_digital_timer()
680 *month = msg->msg[3]; in cec_ops_set_digital_timer()
682 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_digital_timer()
683 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_digital_timer()
684 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_digital_timer()
685 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_digital_timer()
686 *recording_seq = msg->msg[8]; in cec_ops_set_digital_timer()
687 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_set_digital_timer()
690 static inline void cec_msg_set_ext_timer(struct cec_msg *msg, in cec_msg_set_ext_timer() argument
703 msg->len = 13; in cec_msg_set_ext_timer()
704 msg->msg[1] = CEC_MSG_SET_EXT_TIMER; in cec_msg_set_ext_timer()
705 msg->msg[2] = day; in cec_msg_set_ext_timer()
706 msg->msg[3] = month; in cec_msg_set_ext_timer()
708 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_ext_timer()
709 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_ext_timer()
710 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_ext_timer()
711 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_ext_timer()
712 msg->msg[8] = recording_seq; in cec_msg_set_ext_timer()
713 msg->msg[9] = ext_src_spec; in cec_msg_set_ext_timer()
714 msg->msg[10] = plug; in cec_msg_set_ext_timer()
715 msg->msg[11] = phys_addr >> 8; in cec_msg_set_ext_timer()
716 msg->msg[12] = phys_addr & 0xff; in cec_msg_set_ext_timer()
717 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_ext_timer()
720 static inline void cec_ops_set_ext_timer(const struct cec_msg *msg, in cec_ops_set_ext_timer() argument
732 *day = msg->msg[2]; in cec_ops_set_ext_timer()
733 *month = msg->msg[3]; in cec_ops_set_ext_timer()
735 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_ext_timer()
736 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_ext_timer()
737 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_ext_timer()
738 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_ext_timer()
739 *recording_seq = msg->msg[8]; in cec_ops_set_ext_timer()
740 *ext_src_spec = msg->msg[9]; in cec_ops_set_ext_timer()
741 *plug = msg->msg[10]; in cec_ops_set_ext_timer()
742 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_set_ext_timer()
745 static inline void cec_msg_set_timer_program_title(struct cec_msg *msg, in cec_msg_set_timer_program_title() argument
752 msg->len = 2 + len; in cec_msg_set_timer_program_title()
753 msg->msg[1] = CEC_MSG_SET_TIMER_PROGRAM_TITLE; in cec_msg_set_timer_program_title()
754 memcpy(msg->msg + 2, prog_title, len); in cec_msg_set_timer_program_title()
757 static inline void cec_ops_set_timer_program_title(const struct cec_msg *msg, in cec_ops_set_timer_program_title() argument
760 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_timer_program_title()
764 memcpy(prog_title, msg->msg + 2, len); in cec_ops_set_timer_program_title()
769 static inline void cec_msg_cec_version(struct cec_msg *msg, __u8 cec_version) in cec_msg_cec_version() argument
771 msg->len = 3; in cec_msg_cec_version()
772 msg->msg[1] = CEC_MSG_CEC_VERSION; in cec_msg_cec_version()
773 msg->msg[2] = cec_version; in cec_msg_cec_version()
776 static inline void cec_ops_cec_version(const struct cec_msg *msg, in cec_ops_cec_version() argument
779 *cec_version = msg->msg[2]; in cec_ops_cec_version()
782 static inline void cec_msg_get_cec_version(struct cec_msg *msg, in cec_msg_get_cec_version() argument
785 msg->len = 2; in cec_msg_get_cec_version()
786 msg->msg[1] = CEC_MSG_GET_CEC_VERSION; in cec_msg_get_cec_version()
787 msg->reply = reply ? CEC_MSG_CEC_VERSION : 0; in cec_msg_get_cec_version()
790 static inline void cec_msg_report_physical_addr(struct cec_msg *msg, in cec_msg_report_physical_addr() argument
793 msg->len = 5; in cec_msg_report_physical_addr()
794 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_physical_addr()
795 msg->msg[1] = CEC_MSG_REPORT_PHYSICAL_ADDR; in cec_msg_report_physical_addr()
796 msg->msg[2] = phys_addr >> 8; in cec_msg_report_physical_addr()
797 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_physical_addr()
798 msg->msg[4] = prim_devtype; in cec_msg_report_physical_addr()
801 static inline void cec_ops_report_physical_addr(const struct cec_msg *msg, in cec_ops_report_physical_addr() argument
804 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_physical_addr()
805 *prim_devtype = msg->msg[4]; in cec_ops_report_physical_addr()
808 static inline void cec_msg_give_physical_addr(struct cec_msg *msg, in cec_msg_give_physical_addr() argument
811 msg->len = 2; in cec_msg_give_physical_addr()
812 msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR; in cec_msg_give_physical_addr()
813 msg->reply = reply ? CEC_MSG_REPORT_PHYSICAL_ADDR : 0; in cec_msg_give_physical_addr()
816 static inline void cec_msg_set_menu_language(struct cec_msg *msg, in cec_msg_set_menu_language() argument
819 msg->len = 5; in cec_msg_set_menu_language()
820 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_set_menu_language()
821 msg->msg[1] = CEC_MSG_SET_MENU_LANGUAGE; in cec_msg_set_menu_language()
822 memcpy(msg->msg + 2, language, 3); in cec_msg_set_menu_language()
825 static inline void cec_ops_set_menu_language(const struct cec_msg *msg, in cec_ops_set_menu_language() argument
828 memcpy(language, msg->msg + 2, 3); in cec_ops_set_menu_language()
832 static inline void cec_msg_get_menu_language(struct cec_msg *msg, in cec_msg_get_menu_language() argument
835 msg->len = 2; in cec_msg_get_menu_language()
836 msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE; in cec_msg_get_menu_language()
837 msg->reply = reply ? CEC_MSG_SET_MENU_LANGUAGE : 0; in cec_msg_get_menu_language()
848 static inline void cec_msg_report_features(struct cec_msg *msg, in cec_msg_report_features() argument
852 msg->len = 6; in cec_msg_report_features()
853 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_features()
854 msg->msg[1] = CEC_MSG_REPORT_FEATURES; in cec_msg_report_features()
855 msg->msg[2] = cec_version; in cec_msg_report_features()
856 msg->msg[3] = all_device_types; in cec_msg_report_features()
857 msg->msg[4] = rc_profile; in cec_msg_report_features()
858 msg->msg[5] = dev_features; in cec_msg_report_features()
861 static inline void cec_ops_report_features(const struct cec_msg *msg, in cec_ops_report_features() argument
865 const __u8 *p = &msg->msg[4]; in cec_ops_report_features()
867 *cec_version = msg->msg[2]; in cec_ops_report_features()
868 *all_device_types = msg->msg[3]; in cec_ops_report_features()
871 while (p < &msg->msg[14] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
875 while (p < &msg->msg[15] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
882 static inline void cec_msg_give_features(struct cec_msg *msg, in cec_msg_give_features() argument
885 msg->len = 2; in cec_msg_give_features()
886 msg->msg[1] = CEC_MSG_GIVE_FEATURES; in cec_msg_give_features()
887 msg->reply = reply ? CEC_MSG_REPORT_FEATURES : 0; in cec_msg_give_features()
891 static inline void cec_msg_deck_control(struct cec_msg *msg, in cec_msg_deck_control() argument
894 msg->len = 3; in cec_msg_deck_control()
895 msg->msg[1] = CEC_MSG_DECK_CONTROL; in cec_msg_deck_control()
896 msg->msg[2] = deck_control_mode; in cec_msg_deck_control()
899 static inline void cec_ops_deck_control(const struct cec_msg *msg, in cec_ops_deck_control() argument
902 *deck_control_mode = msg->msg[2]; in cec_ops_deck_control()
905 static inline void cec_msg_deck_status(struct cec_msg *msg, in cec_msg_deck_status() argument
908 msg->len = 3; in cec_msg_deck_status()
909 msg->msg[1] = CEC_MSG_DECK_STATUS; in cec_msg_deck_status()
910 msg->msg[2] = deck_info; in cec_msg_deck_status()
913 static inline void cec_ops_deck_status(const struct cec_msg *msg, in cec_ops_deck_status() argument
916 *deck_info = msg->msg[2]; in cec_ops_deck_status()
919 static inline void cec_msg_give_deck_status(struct cec_msg *msg, in cec_msg_give_deck_status() argument
923 msg->len = 3; in cec_msg_give_deck_status()
924 msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS; in cec_msg_give_deck_status()
925 msg->msg[2] = status_req; in cec_msg_give_deck_status()
926 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? in cec_msg_give_deck_status()
930 static inline void cec_ops_give_deck_status(const struct cec_msg *msg, in cec_ops_give_deck_status() argument
933 *status_req = msg->msg[2]; in cec_ops_give_deck_status()
936 static inline void cec_msg_play(struct cec_msg *msg, in cec_msg_play() argument
939 msg->len = 3; in cec_msg_play()
940 msg->msg[1] = CEC_MSG_PLAY; in cec_msg_play()
941 msg->msg[2] = play_mode; in cec_msg_play()
944 static inline void cec_ops_play(const struct cec_msg *msg, in cec_ops_play() argument
947 *play_mode = msg->msg[2]; in cec_ops_play()
966 static inline void cec_msg_tuner_device_status_analog(struct cec_msg *msg, in cec_msg_tuner_device_status_analog() argument
973 msg->len = 7; in cec_msg_tuner_device_status_analog()
974 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_analog()
975 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_analog()
976 msg->msg[3] = ana_bcast_type; in cec_msg_tuner_device_status_analog()
977 msg->msg[4] = ana_freq >> 8; in cec_msg_tuner_device_status_analog()
978 msg->msg[5] = ana_freq & 0xff; in cec_msg_tuner_device_status_analog()
979 msg->msg[6] = bcast_system; in cec_msg_tuner_device_status_analog()
982 static inline void cec_msg_tuner_device_status_digital(struct cec_msg *msg, in cec_msg_tuner_device_status_digital() argument
986 msg->len = 10; in cec_msg_tuner_device_status_digital()
987 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_digital()
988 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_digital()
989 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_tuner_device_status_digital()
992 static inline void cec_msg_tuner_device_status(struct cec_msg *msg, in cec_msg_tuner_device_status() argument
996 cec_msg_tuner_device_status_analog(msg, in cec_msg_tuner_device_status()
1003 cec_msg_tuner_device_status_digital(msg, in cec_msg_tuner_device_status()
1009 static inline void cec_ops_tuner_device_status(const struct cec_msg *msg, in cec_ops_tuner_device_status() argument
1012 tuner_dev_info->is_analog = msg->len < 10; in cec_ops_tuner_device_status()
1013 tuner_dev_info->rec_flag = msg->msg[2] >> 7; in cec_ops_tuner_device_status()
1014 tuner_dev_info->tuner_display_info = msg->msg[2] & 0x7f; in cec_ops_tuner_device_status()
1016 tuner_dev_info->analog.ana_bcast_type = msg->msg[3]; in cec_ops_tuner_device_status()
1017 tuner_dev_info->analog.ana_freq = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_tuner_device_status()
1018 tuner_dev_info->analog.bcast_system = msg->msg[6]; in cec_ops_tuner_device_status()
1021 cec_get_digital_service_id(msg->msg + 3, &tuner_dev_info->digital); in cec_ops_tuner_device_status()
1024 static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, in cec_msg_give_tuner_device_status() argument
1028 msg->len = 3; in cec_msg_give_tuner_device_status()
1029 msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS; in cec_msg_give_tuner_device_status()
1030 msg->msg[2] = status_req; in cec_msg_give_tuner_device_status()
1031 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? in cec_msg_give_tuner_device_status()
1035 static inline void cec_ops_give_tuner_device_status(const struct cec_msg *msg, in cec_ops_give_tuner_device_status() argument
1038 *status_req = msg->msg[2]; in cec_ops_give_tuner_device_status()
1041 static inline void cec_msg_select_analogue_service(struct cec_msg *msg, in cec_msg_select_analogue_service() argument
1046 msg->len = 6; in cec_msg_select_analogue_service()
1047 msg->msg[1] = CEC_MSG_SELECT_ANALOGUE_SERVICE; in cec_msg_select_analogue_service()
1048 msg->msg[2] = ana_bcast_type; in cec_msg_select_analogue_service()
1049 msg->msg[3] = ana_freq >> 8; in cec_msg_select_analogue_service()
1050 msg->msg[4] = ana_freq & 0xff; in cec_msg_select_analogue_service()
1051 msg->msg[5] = bcast_system; in cec_msg_select_analogue_service()
1054 static inline void cec_ops_select_analogue_service(const struct cec_msg *msg, in cec_ops_select_analogue_service() argument
1059 *ana_bcast_type = msg->msg[2]; in cec_ops_select_analogue_service()
1060 *ana_freq = (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_select_analogue_service()
1061 *bcast_system = msg->msg[5]; in cec_ops_select_analogue_service()
1064 static inline void cec_msg_select_digital_service(struct cec_msg *msg, in cec_msg_select_digital_service() argument
1067 msg->len = 9; in cec_msg_select_digital_service()
1068 msg->msg[1] = CEC_MSG_SELECT_DIGITAL_SERVICE; in cec_msg_select_digital_service()
1069 cec_set_digital_service_id(msg->msg + 2, digital); in cec_msg_select_digital_service()
1072 static inline void cec_ops_select_digital_service(const struct cec_msg *msg, in cec_ops_select_digital_service() argument
1075 cec_get_digital_service_id(msg->msg + 2, digital); in cec_ops_select_digital_service()
1078 static inline void cec_msg_tuner_step_decrement(struct cec_msg *msg) in cec_msg_tuner_step_decrement() argument
1080 msg->len = 2; in cec_msg_tuner_step_decrement()
1081 msg->msg[1] = CEC_MSG_TUNER_STEP_DECREMENT; in cec_msg_tuner_step_decrement()
1084 static inline void cec_msg_tuner_step_increment(struct cec_msg *msg) in cec_msg_tuner_step_increment() argument
1086 msg->len = 2; in cec_msg_tuner_step_increment()
1087 msg->msg[1] = CEC_MSG_TUNER_STEP_INCREMENT; in cec_msg_tuner_step_increment()
1092 static inline void cec_msg_device_vendor_id(struct cec_msg *msg, __u32 vendor_id) in cec_msg_device_vendor_id() argument
1094 msg->len = 5; in cec_msg_device_vendor_id()
1095 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_device_vendor_id()
1096 msg->msg[1] = CEC_MSG_DEVICE_VENDOR_ID; in cec_msg_device_vendor_id()
1097 msg->msg[2] = vendor_id >> 16; in cec_msg_device_vendor_id()
1098 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_device_vendor_id()
1099 msg->msg[4] = vendor_id & 0xff; in cec_msg_device_vendor_id()
1102 static inline void cec_ops_device_vendor_id(const struct cec_msg *msg, in cec_ops_device_vendor_id() argument
1105 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_device_vendor_id()
1108 static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg, in cec_msg_give_device_vendor_id() argument
1111 msg->len = 2; in cec_msg_give_device_vendor_id()
1112 msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID; in cec_msg_give_device_vendor_id()
1113 msg->reply = reply ? CEC_MSG_DEVICE_VENDOR_ID : 0; in cec_msg_give_device_vendor_id()
1116 static inline void cec_msg_vendor_command(struct cec_msg *msg, in cec_msg_vendor_command() argument
1121 msg->len = 2 + size; in cec_msg_vendor_command()
1122 msg->msg[1] = CEC_MSG_VENDOR_COMMAND; in cec_msg_vendor_command()
1123 memcpy(msg->msg + 2, vendor_cmd, size); in cec_msg_vendor_command()
1126 static inline void cec_ops_vendor_command(const struct cec_msg *msg, in cec_ops_vendor_command() argument
1130 *size = msg->len - 2; in cec_ops_vendor_command()
1134 *vendor_cmd = msg->msg + 2; in cec_ops_vendor_command()
1137 static inline void cec_msg_vendor_command_with_id(struct cec_msg *msg, in cec_msg_vendor_command_with_id() argument
1143 msg->len = 5 + size; in cec_msg_vendor_command_with_id()
1144 msg->msg[1] = CEC_MSG_VENDOR_COMMAND_WITH_ID; in cec_msg_vendor_command_with_id()
1145 msg->msg[2] = vendor_id >> 16; in cec_msg_vendor_command_with_id()
1146 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_vendor_command_with_id()
1147 msg->msg[4] = vendor_id & 0xff; in cec_msg_vendor_command_with_id()
1148 memcpy(msg->msg + 5, vendor_cmd, size); in cec_msg_vendor_command_with_id()
1151 static inline void cec_ops_vendor_command_with_id(const struct cec_msg *msg, in cec_ops_vendor_command_with_id() argument
1155 *size = msg->len - 5; in cec_ops_vendor_command_with_id()
1159 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_vendor_command_with_id()
1160 *vendor_cmd = msg->msg + 5; in cec_ops_vendor_command_with_id()
1163 static inline void cec_msg_vendor_remote_button_down(struct cec_msg *msg, in cec_msg_vendor_remote_button_down() argument
1169 msg->len = 2 + size; in cec_msg_vendor_remote_button_down()
1170 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN; in cec_msg_vendor_remote_button_down()
1171 memcpy(msg->msg + 2, rc_code, size); in cec_msg_vendor_remote_button_down()
1174 static inline void cec_ops_vendor_remote_button_down(const struct cec_msg *msg, in cec_ops_vendor_remote_button_down() argument
1178 *size = msg->len - 2; in cec_ops_vendor_remote_button_down()
1182 *rc_code = msg->msg + 2; in cec_ops_vendor_remote_button_down()
1185 static inline void cec_msg_vendor_remote_button_up(struct cec_msg *msg) in cec_msg_vendor_remote_button_up() argument
1187 msg->len = 2; in cec_msg_vendor_remote_button_up()
1188 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_UP; in cec_msg_vendor_remote_button_up()
1193 static inline void cec_msg_set_osd_string(struct cec_msg *msg, in cec_msg_set_osd_string() argument
1201 msg->len = 3 + len; in cec_msg_set_osd_string()
1202 msg->msg[1] = CEC_MSG_SET_OSD_STRING; in cec_msg_set_osd_string()
1203 msg->msg[2] = disp_ctl; in cec_msg_set_osd_string()
1204 memcpy(msg->msg + 3, osd, len); in cec_msg_set_osd_string()
1207 static inline void cec_ops_set_osd_string(const struct cec_msg *msg, in cec_ops_set_osd_string() argument
1211 unsigned int len = msg->len > 3 ? msg->len - 3 : 0; in cec_ops_set_osd_string()
1213 *disp_ctl = msg->msg[2]; in cec_ops_set_osd_string()
1216 memcpy(osd, msg->msg + 3, len); in cec_ops_set_osd_string()
1222 static inline void cec_msg_set_osd_name(struct cec_msg *msg, const char *name) in cec_msg_set_osd_name() argument
1228 msg->len = 2 + len; in cec_msg_set_osd_name()
1229 msg->msg[1] = CEC_MSG_SET_OSD_NAME; in cec_msg_set_osd_name()
1230 memcpy(msg->msg + 2, name, len); in cec_msg_set_osd_name()
1233 static inline void cec_ops_set_osd_name(const struct cec_msg *msg, in cec_ops_set_osd_name() argument
1236 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_osd_name()
1240 memcpy(name, msg->msg + 2, len); in cec_ops_set_osd_name()
1244 static inline void cec_msg_give_osd_name(struct cec_msg *msg, in cec_msg_give_osd_name() argument
1247 msg->len = 2; in cec_msg_give_osd_name()
1248 msg->msg[1] = CEC_MSG_GIVE_OSD_NAME; in cec_msg_give_osd_name()
1249 msg->reply = reply ? CEC_MSG_SET_OSD_NAME : 0; in cec_msg_give_osd_name()
1254 static inline void cec_msg_menu_status(struct cec_msg *msg, in cec_msg_menu_status() argument
1257 msg->len = 3; in cec_msg_menu_status()
1258 msg->msg[1] = CEC_MSG_MENU_STATUS; in cec_msg_menu_status()
1259 msg->msg[2] = menu_state; in cec_msg_menu_status()
1262 static inline void cec_ops_menu_status(const struct cec_msg *msg, in cec_ops_menu_status() argument
1265 *menu_state = msg->msg[2]; in cec_ops_menu_status()
1268 static inline void cec_msg_menu_request(struct cec_msg *msg, in cec_msg_menu_request() argument
1272 msg->len = 3; in cec_msg_menu_request()
1273 msg->msg[1] = CEC_MSG_MENU_REQUEST; in cec_msg_menu_request()
1274 msg->msg[2] = menu_req; in cec_msg_menu_request()
1275 msg->reply = reply ? CEC_MSG_MENU_STATUS : 0; in cec_msg_menu_request()
1278 static inline void cec_ops_menu_request(const struct cec_msg *msg, in cec_ops_menu_request() argument
1281 *menu_req = msg->msg[2]; in cec_ops_menu_request()
1298 static inline void cec_msg_user_control_pressed(struct cec_msg *msg, in cec_msg_user_control_pressed() argument
1301 msg->len = 3; in cec_msg_user_control_pressed()
1302 msg->msg[1] = CEC_MSG_USER_CONTROL_PRESSED; in cec_msg_user_control_pressed()
1303 msg->msg[2] = ui_cmd->ui_cmd; in cec_msg_user_control_pressed()
1314 msg->len++; in cec_msg_user_control_pressed()
1315 msg->msg[3] = ui_cmd->play_mode; in cec_msg_user_control_pressed()
1318 msg->len += 4; in cec_msg_user_control_pressed()
1319 msg->msg[3] = (ui_cmd->channel_identifier.channel_number_fmt << 2) | in cec_msg_user_control_pressed()
1321 msg->msg[4] = ui_cmd->channel_identifier.major & 0xff; in cec_msg_user_control_pressed()
1322 msg->msg[5] = ui_cmd->channel_identifier.minor >> 8; in cec_msg_user_control_pressed()
1323 msg->msg[6] = ui_cmd->channel_identifier.minor & 0xff; in cec_msg_user_control_pressed()
1328 static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, in cec_ops_user_control_pressed() argument
1331 ui_cmd->ui_cmd = msg->msg[2]; in cec_ops_user_control_pressed()
1333 if (msg->len == 3) in cec_ops_user_control_pressed()
1343 ui_cmd->play_mode = msg->msg[3]; in cec_ops_user_control_pressed()
1347 if (msg->len < 7) in cec_ops_user_control_pressed()
1350 ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2; in cec_ops_user_control_pressed()
1351 ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4]; in cec_ops_user_control_pressed()
1352 ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_user_control_pressed()
1357 static inline void cec_msg_user_control_released(struct cec_msg *msg) in cec_msg_user_control_released() argument
1359 msg->len = 2; in cec_msg_user_control_released()
1360 msg->msg[1] = CEC_MSG_USER_CONTROL_RELEASED; in cec_msg_user_control_released()
1366 static inline void cec_msg_report_power_status(struct cec_msg *msg, in cec_msg_report_power_status() argument
1369 msg->len = 3; in cec_msg_report_power_status()
1370 msg->msg[1] = CEC_MSG_REPORT_POWER_STATUS; in cec_msg_report_power_status()
1371 msg->msg[2] = pwr_state; in cec_msg_report_power_status()
1374 static inline void cec_ops_report_power_status(const struct cec_msg *msg, in cec_ops_report_power_status() argument
1377 *pwr_state = msg->msg[2]; in cec_ops_report_power_status()
1380 static inline void cec_msg_give_device_power_status(struct cec_msg *msg, in cec_msg_give_device_power_status() argument
1383 msg->len = 2; in cec_msg_give_device_power_status()
1384 msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS; in cec_msg_give_device_power_status()
1385 msg->reply = reply ? CEC_MSG_REPORT_POWER_STATUS : 0; in cec_msg_give_device_power_status()
1389 static inline void cec_msg_feature_abort(struct cec_msg *msg, in cec_msg_feature_abort() argument
1392 msg->len = 4; in cec_msg_feature_abort()
1393 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_feature_abort()
1394 msg->msg[2] = abort_msg; in cec_msg_feature_abort()
1395 msg->msg[3] = reason; in cec_msg_feature_abort()
1398 static inline void cec_ops_feature_abort(const struct cec_msg *msg, in cec_ops_feature_abort() argument
1401 *abort_msg = msg->msg[2]; in cec_ops_feature_abort()
1402 *reason = msg->msg[3]; in cec_ops_feature_abort()
1406 static inline void cec_msg_reply_feature_abort(struct cec_msg *msg, __u8 reason) in cec_msg_reply_feature_abort() argument
1408 cec_msg_set_reply_to(msg, msg); in cec_msg_reply_feature_abort()
1409 msg->len = 4; in cec_msg_reply_feature_abort()
1410 msg->msg[2] = msg->msg[1]; in cec_msg_reply_feature_abort()
1411 msg->msg[3] = reason; in cec_msg_reply_feature_abort()
1412 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_reply_feature_abort()
1415 static inline void cec_msg_abort(struct cec_msg *msg) in cec_msg_abort() argument
1417 msg->len = 2; in cec_msg_abort()
1418 msg->msg[1] = CEC_MSG_ABORT; in cec_msg_abort()
1423 static inline void cec_msg_report_audio_status(struct cec_msg *msg, in cec_msg_report_audio_status() argument
1427 msg->len = 3; in cec_msg_report_audio_status()
1428 msg->msg[1] = CEC_MSG_REPORT_AUDIO_STATUS; in cec_msg_report_audio_status()
1429 msg->msg[2] = (aud_mute_status << 7) | (aud_vol_status & 0x7f); in cec_msg_report_audio_status()
1432 static inline void cec_ops_report_audio_status(const struct cec_msg *msg, in cec_ops_report_audio_status() argument
1436 *aud_mute_status = msg->msg[2] >> 7; in cec_ops_report_audio_status()
1437 *aud_vol_status = msg->msg[2] & 0x7f; in cec_ops_report_audio_status()
1440 static inline void cec_msg_give_audio_status(struct cec_msg *msg, in cec_msg_give_audio_status() argument
1443 msg->len = 2; in cec_msg_give_audio_status()
1444 msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS; in cec_msg_give_audio_status()
1445 msg->reply = reply ? CEC_MSG_REPORT_AUDIO_STATUS : 0; in cec_msg_give_audio_status()
1448 static inline void cec_msg_set_system_audio_mode(struct cec_msg *msg, in cec_msg_set_system_audio_mode() argument
1451 msg->len = 3; in cec_msg_set_system_audio_mode()
1452 msg->msg[1] = CEC_MSG_SET_SYSTEM_AUDIO_MODE; in cec_msg_set_system_audio_mode()
1453 msg->msg[2] = sys_aud_status; in cec_msg_set_system_audio_mode()
1456 static inline void cec_ops_set_system_audio_mode(const struct cec_msg *msg, in cec_ops_set_system_audio_mode() argument
1459 *sys_aud_status = msg->msg[2]; in cec_ops_set_system_audio_mode()
1462 static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg, in cec_msg_system_audio_mode_request() argument
1466 msg->len = phys_addr == 0xffff ? 2 : 4; in cec_msg_system_audio_mode_request()
1467 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST; in cec_msg_system_audio_mode_request()
1468 msg->msg[2] = phys_addr >> 8; in cec_msg_system_audio_mode_request()
1469 msg->msg[3] = phys_addr & 0xff; in cec_msg_system_audio_mode_request()
1470 msg->reply = reply ? CEC_MSG_SET_SYSTEM_AUDIO_MODE : 0; in cec_msg_system_audio_mode_request()
1474 static inline void cec_ops_system_audio_mode_request(const struct cec_msg *msg, in cec_ops_system_audio_mode_request() argument
1477 if (msg->len < 4) in cec_ops_system_audio_mode_request()
1480 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_system_audio_mode_request()
1483 static inline void cec_msg_system_audio_mode_status(struct cec_msg *msg, in cec_msg_system_audio_mode_status() argument
1486 msg->len = 3; in cec_msg_system_audio_mode_status()
1487 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_system_audio_mode_status()
1488 msg->msg[2] = sys_aud_status; in cec_msg_system_audio_mode_status()
1491 static inline void cec_ops_system_audio_mode_status(const struct cec_msg *msg, in cec_ops_system_audio_mode_status() argument
1494 *sys_aud_status = msg->msg[2]; in cec_ops_system_audio_mode_status()
1497 static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg, in cec_msg_give_system_audio_mode_status() argument
1500 msg->len = 2; in cec_msg_give_system_audio_mode_status()
1501 msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_give_system_audio_mode_status()
1502 msg->reply = reply ? CEC_MSG_SYSTEM_AUDIO_MODE_STATUS : 0; in cec_msg_give_system_audio_mode_status()
1505 static inline void cec_msg_report_short_audio_descriptor(struct cec_msg *msg, in cec_msg_report_short_audio_descriptor() argument
1513 msg->len = 2 + num_descriptors * 3; in cec_msg_report_short_audio_descriptor()
1514 msg->msg[1] = CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR; in cec_msg_report_short_audio_descriptor()
1516 msg->msg[2 + i * 3] = (descriptors[i] >> 16) & 0xff; in cec_msg_report_short_audio_descriptor()
1517 msg->msg[3 + i * 3] = (descriptors[i] >> 8) & 0xff; in cec_msg_report_short_audio_descriptor()
1518 msg->msg[4 + i * 3] = descriptors[i] & 0xff; in cec_msg_report_short_audio_descriptor()
1522 static inline void cec_ops_report_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_report_short_audio_descriptor() argument
1528 *num_descriptors = (msg->len - 2) / 3; in cec_ops_report_short_audio_descriptor()
1532 descriptors[i] = (msg->msg[2 + i * 3] << 16) | in cec_ops_report_short_audio_descriptor()
1533 (msg->msg[3 + i * 3] << 8) | in cec_ops_report_short_audio_descriptor()
1534 msg->msg[4 + i * 3]; in cec_ops_report_short_audio_descriptor()
1537 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, in cec_msg_request_short_audio_descriptor() argument
1547 msg->len = 2 + num_descriptors; in cec_msg_request_short_audio_descriptor()
1548 msg->msg[1] = CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR; in cec_msg_request_short_audio_descriptor()
1549 msg->reply = reply ? CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR : 0; in cec_msg_request_short_audio_descriptor()
1551 msg->msg[2 + i] = (audio_format_id[i] << 6) | in cec_msg_request_short_audio_descriptor()
1555 static inline void cec_ops_request_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_request_short_audio_descriptor() argument
1562 *num_descriptors = msg->len - 2; in cec_ops_request_short_audio_descriptor()
1566 audio_format_id[i] = msg->msg[2 + i] >> 6; in cec_ops_request_short_audio_descriptor()
1567 audio_format_code[i] = msg->msg[2 + i] & 0x3f; in cec_ops_request_short_audio_descriptor()
1571 static inline void cec_msg_set_audio_volume_level(struct cec_msg *msg, in cec_msg_set_audio_volume_level() argument
1574 msg->len = 3; in cec_msg_set_audio_volume_level()
1575 msg->msg[1] = CEC_MSG_SET_AUDIO_VOLUME_LEVEL; in cec_msg_set_audio_volume_level()
1576 msg->msg[2] = audio_volume_level; in cec_msg_set_audio_volume_level()
1579 static inline void cec_ops_set_audio_volume_level(const struct cec_msg *msg, in cec_ops_set_audio_volume_level() argument
1582 *audio_volume_level = msg->msg[2]; in cec_ops_set_audio_volume_level()
1587 static inline void cec_msg_set_audio_rate(struct cec_msg *msg, in cec_msg_set_audio_rate() argument
1590 msg->len = 3; in cec_msg_set_audio_rate()
1591 msg->msg[1] = CEC_MSG_SET_AUDIO_RATE; in cec_msg_set_audio_rate()
1592 msg->msg[2] = audio_rate; in cec_msg_set_audio_rate()
1595 static inline void cec_ops_set_audio_rate(const struct cec_msg *msg, in cec_ops_set_audio_rate() argument
1598 *audio_rate = msg->msg[2]; in cec_ops_set_audio_rate()
1603 static inline void cec_msg_report_arc_initiated(struct cec_msg *msg) in cec_msg_report_arc_initiated() argument
1605 msg->len = 2; in cec_msg_report_arc_initiated()
1606 msg->msg[1] = CEC_MSG_REPORT_ARC_INITIATED; in cec_msg_report_arc_initiated()
1609 static inline void cec_msg_initiate_arc(struct cec_msg *msg, in cec_msg_initiate_arc() argument
1612 msg->len = 2; in cec_msg_initiate_arc()
1613 msg->msg[1] = CEC_MSG_INITIATE_ARC; in cec_msg_initiate_arc()
1614 msg->reply = reply ? CEC_MSG_REPORT_ARC_INITIATED : 0; in cec_msg_initiate_arc()
1617 static inline void cec_msg_request_arc_initiation(struct cec_msg *msg, in cec_msg_request_arc_initiation() argument
1620 msg->len = 2; in cec_msg_request_arc_initiation()
1621 msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION; in cec_msg_request_arc_initiation()
1622 msg->reply = reply ? CEC_MSG_INITIATE_ARC : 0; in cec_msg_request_arc_initiation()
1625 static inline void cec_msg_report_arc_terminated(struct cec_msg *msg) in cec_msg_report_arc_terminated() argument
1627 msg->len = 2; in cec_msg_report_arc_terminated()
1628 msg->msg[1] = CEC_MSG_REPORT_ARC_TERMINATED; in cec_msg_report_arc_terminated()
1631 static inline void cec_msg_terminate_arc(struct cec_msg *msg, in cec_msg_terminate_arc() argument
1634 msg->len = 2; in cec_msg_terminate_arc()
1635 msg->msg[1] = CEC_MSG_TERMINATE_ARC; in cec_msg_terminate_arc()
1636 msg->reply = reply ? CEC_MSG_REPORT_ARC_TERMINATED : 0; in cec_msg_terminate_arc()
1639 static inline void cec_msg_request_arc_termination(struct cec_msg *msg, in cec_msg_request_arc_termination() argument
1642 msg->len = 2; in cec_msg_request_arc_termination()
1643 msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION; in cec_msg_request_arc_termination()
1644 msg->reply = reply ? CEC_MSG_TERMINATE_ARC : 0; in cec_msg_request_arc_termination()
1650 static inline void cec_msg_report_current_latency(struct cec_msg *msg, in cec_msg_report_current_latency() argument
1657 msg->len = 6; in cec_msg_report_current_latency()
1658 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_report_current_latency()
1659 msg->msg[1] = CEC_MSG_REPORT_CURRENT_LATENCY; in cec_msg_report_current_latency()
1660 msg->msg[2] = phys_addr >> 8; in cec_msg_report_current_latency()
1661 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_current_latency()
1662 msg->msg[4] = video_latency; in cec_msg_report_current_latency()
1663 msg->msg[5] = (low_latency_mode << 2) | audio_out_compensated; in cec_msg_report_current_latency()
1665 msg->msg[msg->len++] = audio_out_delay; in cec_msg_report_current_latency()
1668 static inline void cec_ops_report_current_latency(const struct cec_msg *msg, in cec_ops_report_current_latency() argument
1675 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_current_latency()
1676 *video_latency = msg->msg[4]; in cec_ops_report_current_latency()
1677 *low_latency_mode = (msg->msg[5] >> 2) & 1; in cec_ops_report_current_latency()
1678 *audio_out_compensated = msg->msg[5] & 3; in cec_ops_report_current_latency()
1679 if (*audio_out_compensated == 3 && msg->len >= 7) in cec_ops_report_current_latency()
1680 *audio_out_delay = msg->msg[6]; in cec_ops_report_current_latency()
1685 static inline void cec_msg_request_current_latency(struct cec_msg *msg, in cec_msg_request_current_latency() argument
1689 msg->len = 4; in cec_msg_request_current_latency()
1690 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_request_current_latency()
1691 msg->msg[1] = CEC_MSG_REQUEST_CURRENT_LATENCY; in cec_msg_request_current_latency()
1692 msg->msg[2] = phys_addr >> 8; in cec_msg_request_current_latency()
1693 msg->msg[3] = phys_addr & 0xff; in cec_msg_request_current_latency()
1694 msg->reply = reply ? CEC_MSG_REPORT_CURRENT_LATENCY : 0; in cec_msg_request_current_latency()
1697 static inline void cec_ops_request_current_latency(const struct cec_msg *msg, in cec_ops_request_current_latency() argument
1700 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_request_current_latency()
1705 static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, in cec_msg_cdc_hec_inquire_state() argument
1709 msg->len = 9; in cec_msg_cdc_hec_inquire_state()
1710 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_inquire_state()
1711 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_inquire_state()
1713 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_inquire_state()
1714 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_inquire_state()
1715 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_inquire_state()
1716 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_inquire_state()
1717 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_inquire_state()
1720 static inline void cec_ops_cdc_hec_inquire_state(const struct cec_msg *msg, in cec_ops_cdc_hec_inquire_state() argument
1725 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_inquire_state()
1726 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_inquire_state()
1727 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_inquire_state()
1730 static inline void cec_msg_cdc_hec_report_state(struct cec_msg *msg, in cec_msg_cdc_hec_report_state() argument
1739 msg->len = has_field ? 10 : 8; in cec_msg_cdc_hec_report_state()
1740 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_report_state()
1741 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_report_state()
1743 msg->msg[4] = CEC_MSG_CDC_HEC_REPORT_STATE; in cec_msg_cdc_hec_report_state()
1744 msg->msg[5] = target_phys_addr >> 8; in cec_msg_cdc_hec_report_state()
1745 msg->msg[6] = target_phys_addr & 0xff; in cec_msg_cdc_hec_report_state()
1746 msg->msg[7] = (hec_func_state << 6) | in cec_msg_cdc_hec_report_state()
1751 msg->msg[8] = hec_field >> 8; in cec_msg_cdc_hec_report_state()
1752 msg->msg[9] = hec_field & 0xff; in cec_msg_cdc_hec_report_state()
1756 static inline void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, in cec_ops_cdc_hec_report_state() argument
1766 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_report_state()
1767 *target_phys_addr = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_report_state()
1768 *hec_func_state = msg->msg[7] >> 6; in cec_ops_cdc_hec_report_state()
1769 *host_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1770 *enc_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1771 *cdc_errcode = msg->msg[7] & 3; in cec_ops_cdc_hec_report_state()
1772 *has_field = msg->len >= 10; in cec_ops_cdc_hec_report_state()
1773 *hec_field = *has_field ? ((msg->msg[8] << 8) | msg->msg[9]) : 0; in cec_ops_cdc_hec_report_state()
1776 static inline void cec_msg_cdc_hec_set_state(struct cec_msg *msg, in cec_msg_cdc_hec_set_state() argument
1784 msg->len = 10; in cec_msg_cdc_hec_set_state()
1785 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_set_state()
1786 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state()
1788 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_set_state()
1789 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state()
1790 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state()
1791 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_set_state()
1792 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_set_state()
1793 msg->msg[9] = hec_set_state; in cec_msg_cdc_hec_set_state()
1795 msg->msg[msg->len++] = phys_addr3 >> 8; in cec_msg_cdc_hec_set_state()
1796 msg->msg[msg->len++] = phys_addr3 & 0xff; in cec_msg_cdc_hec_set_state()
1798 msg->msg[msg->len++] = phys_addr4 >> 8; in cec_msg_cdc_hec_set_state()
1799 msg->msg[msg->len++] = phys_addr4 & 0xff; in cec_msg_cdc_hec_set_state()
1801 msg->msg[msg->len++] = phys_addr5 >> 8; in cec_msg_cdc_hec_set_state()
1802 msg->msg[msg->len++] = phys_addr5 & 0xff; in cec_msg_cdc_hec_set_state()
1808 static inline void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state() argument
1817 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state()
1818 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state()
1819 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_set_state()
1820 *hec_set_state = msg->msg[9]; in cec_ops_cdc_hec_set_state()
1822 if (msg->len >= 12) in cec_ops_cdc_hec_set_state()
1823 *phys_addr3 = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_cdc_hec_set_state()
1824 if (msg->len >= 14) in cec_ops_cdc_hec_set_state()
1825 *phys_addr4 = (msg->msg[12] << 8) | msg->msg[13]; in cec_ops_cdc_hec_set_state()
1826 if (msg->len >= 16) in cec_ops_cdc_hec_set_state()
1827 *phys_addr5 = (msg->msg[14] << 8) | msg->msg[15]; in cec_ops_cdc_hec_set_state()
1830 static inline void cec_msg_cdc_hec_set_state_adjacent(struct cec_msg *msg, in cec_msg_cdc_hec_set_state_adjacent() argument
1834 msg->len = 8; in cec_msg_cdc_hec_set_state_adjacent()
1835 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_set_state_adjacent()
1836 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state_adjacent()
1838 msg->msg[4] = CEC_MSG_CDC_HEC_SET_STATE_ADJACENT; in cec_msg_cdc_hec_set_state_adjacent()
1839 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state_adjacent()
1840 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state_adjacent()
1841 msg->msg[7] = hec_set_state; in cec_msg_cdc_hec_set_state_adjacent()
1844 static inline void cec_ops_cdc_hec_set_state_adjacent(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state_adjacent() argument
1849 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state_adjacent()
1850 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state_adjacent()
1851 *hec_set_state = msg->msg[7]; in cec_ops_cdc_hec_set_state_adjacent()
1854 static inline void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg, in cec_msg_cdc_hec_request_deactivation() argument
1859 msg->len = 11; in cec_msg_cdc_hec_request_deactivation()
1860 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_request_deactivation()
1861 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_request_deactivation()
1863 msg->msg[4] = CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION; in cec_msg_cdc_hec_request_deactivation()
1864 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_request_deactivation()
1865 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1866 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_request_deactivation()
1867 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1868 msg->msg[9] = phys_addr3 >> 8; in cec_msg_cdc_hec_request_deactivation()
1869 msg->msg[10] = phys_addr3 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1872 static inline void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *msg, in cec_ops_cdc_hec_request_deactivation() argument
1878 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_request_deactivation()
1879 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_request_deactivation()
1880 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_request_deactivation()
1881 *phys_addr3 = (msg->msg[9] << 8) | msg->msg[10]; in cec_ops_cdc_hec_request_deactivation()
1884 static inline void cec_msg_cdc_hec_notify_alive(struct cec_msg *msg) in cec_msg_cdc_hec_notify_alive() argument
1886 msg->len = 5; in cec_msg_cdc_hec_notify_alive()
1887 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_notify_alive()
1888 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_notify_alive()
1890 msg->msg[4] = CEC_MSG_CDC_HEC_NOTIFY_ALIVE; in cec_msg_cdc_hec_notify_alive()
1893 static inline void cec_ops_cdc_hec_notify_alive(const struct cec_msg *msg, in cec_ops_cdc_hec_notify_alive() argument
1896 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_notify_alive()
1899 static inline void cec_msg_cdc_hec_discover(struct cec_msg *msg) in cec_msg_cdc_hec_discover() argument
1901 msg->len = 5; in cec_msg_cdc_hec_discover()
1902 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hec_discover()
1903 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_discover()
1905 msg->msg[4] = CEC_MSG_CDC_HEC_DISCOVER; in cec_msg_cdc_hec_discover()
1908 static inline void cec_ops_cdc_hec_discover(const struct cec_msg *msg, in cec_ops_cdc_hec_discover() argument
1911 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_discover()
1914 static inline void cec_msg_cdc_hpd_set_state(struct cec_msg *msg, in cec_msg_cdc_hpd_set_state() argument
1918 msg->len = 6; in cec_msg_cdc_hpd_set_state()
1919 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hpd_set_state()
1920 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_set_state()
1922 msg->msg[4] = CEC_MSG_CDC_HPD_SET_STATE; in cec_msg_cdc_hpd_set_state()
1923 msg->msg[5] = (input_port << 4) | hpd_state; in cec_msg_cdc_hpd_set_state()
1926 static inline void cec_ops_cdc_hpd_set_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_set_state() argument
1931 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_set_state()
1932 *input_port = msg->msg[5] >> 4; in cec_ops_cdc_hpd_set_state()
1933 *hpd_state = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_set_state()
1936 static inline void cec_msg_cdc_hpd_report_state(struct cec_msg *msg, in cec_msg_cdc_hpd_report_state() argument
1940 msg->len = 6; in cec_msg_cdc_hpd_report_state()
1941 msg->msg[0] |= 0xf; /* broadcast */ in cec_msg_cdc_hpd_report_state()
1942 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_report_state()
1944 msg->msg[4] = CEC_MSG_CDC_HPD_REPORT_STATE; in cec_msg_cdc_hpd_report_state()
1945 msg->msg[5] = (hpd_state << 4) | hpd_error; in cec_msg_cdc_hpd_report_state()
1948 static inline void cec_ops_cdc_hpd_report_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_report_state() argument
1953 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_report_state()
1954 *hpd_state = msg->msg[5] >> 4; in cec_ops_cdc_hpd_report_state()
1955 *hpd_error = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_report_state()