• Home
  • Raw
  • Download

Lines Matching full:msg

9 static inline void cec_msg_active_source(struct cec_msg *msg, __u16 phys_addr)  in cec_msg_active_source()  argument
11 msg->len = 4; in cec_msg_active_source()
12 msg->msg[0] |= 0xf; in cec_msg_active_source()
13 msg->msg[1] = CEC_MSG_ACTIVE_SOURCE; in cec_msg_active_source()
14 msg->msg[2] = phys_addr >> 8; in cec_msg_active_source()
15 msg->msg[3] = phys_addr & 0xff; in cec_msg_active_source()
17 static inline void cec_ops_active_source(const struct cec_msg *msg, in cec_ops_active_source() argument
20 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_active_source()
22 static inline void cec_msg_image_view_on(struct cec_msg *msg) in cec_msg_image_view_on() argument
24 msg->len = 2; in cec_msg_image_view_on()
25 msg->msg[1] = CEC_MSG_IMAGE_VIEW_ON; in cec_msg_image_view_on()
27 static inline void cec_msg_text_view_on(struct cec_msg *msg) in cec_msg_text_view_on() argument
29 msg->len = 2; in cec_msg_text_view_on()
30 msg->msg[1] = CEC_MSG_TEXT_VIEW_ON; in cec_msg_text_view_on()
32 static inline void cec_msg_inactive_source(struct cec_msg *msg, in cec_msg_inactive_source() argument
35 msg->len = 4; in cec_msg_inactive_source()
36 msg->msg[1] = CEC_MSG_INACTIVE_SOURCE; in cec_msg_inactive_source()
37 msg->msg[2] = phys_addr >> 8; in cec_msg_inactive_source()
38 msg->msg[3] = phys_addr & 0xff; in cec_msg_inactive_source()
40 static inline void cec_ops_inactive_source(const struct cec_msg *msg, in cec_ops_inactive_source() argument
43 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_inactive_source()
45 static inline void cec_msg_request_active_source(struct cec_msg *msg, in cec_msg_request_active_source() argument
48 msg->len = 2; in cec_msg_request_active_source()
49 msg->msg[0] |= 0xf; in cec_msg_request_active_source()
50 msg->msg[1] = CEC_MSG_REQUEST_ACTIVE_SOURCE; in cec_msg_request_active_source()
51 msg->reply = reply ? CEC_MSG_ACTIVE_SOURCE : 0; in cec_msg_request_active_source()
53 static inline void cec_msg_routing_information(struct cec_msg *msg, in cec_msg_routing_information() argument
56 msg->len = 4; in cec_msg_routing_information()
57 msg->msg[0] |= 0xf; in cec_msg_routing_information()
58 msg->msg[1] = CEC_MSG_ROUTING_INFORMATION; in cec_msg_routing_information()
59 msg->msg[2] = phys_addr >> 8; in cec_msg_routing_information()
60 msg->msg[3] = phys_addr & 0xff; in cec_msg_routing_information()
62 static inline void cec_ops_routing_information(const struct cec_msg *msg, in cec_ops_routing_information() argument
65 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_information()
67 static inline void cec_msg_routing_change(struct cec_msg *msg, in cec_msg_routing_change() argument
72 msg->len = 6; in cec_msg_routing_change()
73 msg->msg[0] |= 0xf; in cec_msg_routing_change()
74 msg->msg[1] = CEC_MSG_ROUTING_CHANGE; in cec_msg_routing_change()
75 msg->msg[2] = orig_phys_addr >> 8; in cec_msg_routing_change()
76 msg->msg[3] = orig_phys_addr & 0xff; in cec_msg_routing_change()
77 msg->msg[4] = new_phys_addr >> 8; in cec_msg_routing_change()
78 msg->msg[5] = new_phys_addr & 0xff; in cec_msg_routing_change()
79 msg->reply = reply ? CEC_MSG_ROUTING_INFORMATION : 0; in cec_msg_routing_change()
81 static inline void cec_ops_routing_change(const struct cec_msg *msg, in cec_ops_routing_change() argument
85 *orig_phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_routing_change()
86 *new_phys_addr = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_routing_change()
88 static inline void cec_msg_set_stream_path(struct cec_msg *msg, __u16 phys_addr) in cec_msg_set_stream_path() argument
90 msg->len = 4; in cec_msg_set_stream_path()
91 msg->msg[0] |= 0xf; in cec_msg_set_stream_path()
92 msg->msg[1] = CEC_MSG_SET_STREAM_PATH; in cec_msg_set_stream_path()
93 msg->msg[2] = phys_addr >> 8; in cec_msg_set_stream_path()
94 msg->msg[3] = phys_addr & 0xff; in cec_msg_set_stream_path()
96 static inline void cec_ops_set_stream_path(const struct cec_msg *msg, in cec_ops_set_stream_path() argument
99 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_set_stream_path()
101 static inline void cec_msg_standby(struct cec_msg *msg) in cec_msg_standby() argument
103 msg->len = 2; in cec_msg_standby()
104 msg->msg[1] = CEC_MSG_STANDBY; in cec_msg_standby()
106 static inline void cec_msg_record_off(struct cec_msg *msg, int reply) in cec_msg_record_off() argument
108 msg->len = 2; in cec_msg_record_off()
109 msg->msg[1] = CEC_MSG_RECORD_OFF; in cec_msg_record_off()
110 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_off()
158 static inline void cec_set_digital_service_id(__u8 *msg, in cec_set_digital_service_id() argument
161 *msg++ = (digital->service_id_method << 7) | digital->dig_bcast_system; in cec_set_digital_service_id()
163 *msg++ = (digital->channel.channel_number_fmt << 2) | in cec_set_digital_service_id()
165 *msg++ = digital->channel.major & 0xff; in cec_set_digital_service_id()
166 *msg++ = digital->channel.minor >> 8; in cec_set_digital_service_id()
167 *msg++ = digital->channel.minor & 0xff; in cec_set_digital_service_id()
168 *msg++ = 0; in cec_set_digital_service_id()
169 *msg++ = 0; in cec_set_digital_service_id()
177 *msg++ = digital->atsc.transport_id >> 8; in cec_set_digital_service_id()
178 *msg++ = digital->atsc.transport_id & 0xff; in cec_set_digital_service_id()
179 *msg++ = digital->atsc.program_number >> 8; in cec_set_digital_service_id()
180 *msg++ = digital->atsc.program_number & 0xff; in cec_set_digital_service_id()
181 *msg++ = 0; in cec_set_digital_service_id()
182 *msg++ = 0; in cec_set_digital_service_id()
185 *msg++ = digital->dvb.transport_id >> 8; in cec_set_digital_service_id()
186 *msg++ = digital->dvb.transport_id & 0xff; in cec_set_digital_service_id()
187 *msg++ = digital->dvb.service_id >> 8; in cec_set_digital_service_id()
188 *msg++ = digital->dvb.service_id & 0xff; in cec_set_digital_service_id()
189 *msg++ = digital->dvb.orig_network_id >> 8; in cec_set_digital_service_id()
190 *msg++ = digital->dvb.orig_network_id & 0xff; in cec_set_digital_service_id()
194 static inline void cec_get_digital_service_id(const __u8 *msg, in cec_get_digital_service_id() argument
197 digital->service_id_method = msg[0] >> 7; in cec_get_digital_service_id()
198 digital->dig_bcast_system = msg[0] & 0x7f; in cec_get_digital_service_id()
200 digital->channel.channel_number_fmt = msg[1] >> 2; in cec_get_digital_service_id()
201 digital->channel.major = ((msg[1] & 3) << 6) | msg[2]; in cec_get_digital_service_id()
202 digital->channel.minor = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
205 digital->dvb.transport_id = (msg[1] << 8) | msg[2]; in cec_get_digital_service_id()
206 digital->dvb.service_id = (msg[3] << 8) | msg[4]; in cec_get_digital_service_id()
207 digital->dvb.orig_network_id = (msg[5] << 8) | msg[6]; in cec_get_digital_service_id()
209 static inline void cec_msg_record_on_own(struct cec_msg *msg) in cec_msg_record_on_own() argument
211 msg->len = 3; in cec_msg_record_on_own()
212 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_own()
213 msg->msg[2] = CEC_OP_RECORD_SRC_OWN; in cec_msg_record_on_own()
215 static inline void cec_msg_record_on_digital(struct cec_msg *msg, in cec_msg_record_on_digital() argument
218 msg->len = 10; in cec_msg_record_on_digital()
219 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_digital()
220 msg->msg[2] = CEC_OP_RECORD_SRC_DIGITAL; in cec_msg_record_on_digital()
221 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_record_on_digital()
223 static inline void cec_msg_record_on_analog(struct cec_msg *msg, in cec_msg_record_on_analog() argument
228 msg->len = 7; in cec_msg_record_on_analog()
229 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_analog()
230 msg->msg[2] = CEC_OP_RECORD_SRC_ANALOG; in cec_msg_record_on_analog()
231 msg->msg[3] = ana_bcast_type; in cec_msg_record_on_analog()
232 msg->msg[4] = ana_freq >> 8; in cec_msg_record_on_analog()
233 msg->msg[5] = ana_freq & 0xff; in cec_msg_record_on_analog()
234 msg->msg[6] = bcast_system; in cec_msg_record_on_analog()
236 static inline void cec_msg_record_on_plug(struct cec_msg *msg, in cec_msg_record_on_plug() argument
239 msg->len = 4; in cec_msg_record_on_plug()
240 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_plug()
241 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PLUG; in cec_msg_record_on_plug()
242 msg->msg[3] = plug; in cec_msg_record_on_plug()
244 static inline void cec_msg_record_on_phys_addr(struct cec_msg *msg, in cec_msg_record_on_phys_addr() argument
247 msg->len = 5; in cec_msg_record_on_phys_addr()
248 msg->msg[1] = CEC_MSG_RECORD_ON; in cec_msg_record_on_phys_addr()
249 msg->msg[2] = CEC_OP_RECORD_SRC_EXT_PHYS_ADDR; in cec_msg_record_on_phys_addr()
250 msg->msg[3] = phys_addr >> 8; in cec_msg_record_on_phys_addr()
251 msg->msg[4] = phys_addr & 0xff; in cec_msg_record_on_phys_addr()
253 static inline void cec_msg_record_on(struct cec_msg *msg, in cec_msg_record_on() argument
259 cec_msg_record_on_own(msg); in cec_msg_record_on()
262 cec_msg_record_on_digital(msg, &rec_src->digital); in cec_msg_record_on()
265 cec_msg_record_on_analog(msg, in cec_msg_record_on()
271 cec_msg_record_on_plug(msg, rec_src->ext_plug.plug); in cec_msg_record_on()
274 cec_msg_record_on_phys_addr(msg, in cec_msg_record_on()
278 msg->reply = reply ? CEC_MSG_RECORD_STATUS : 0; in cec_msg_record_on()
280 static inline void cec_ops_record_on(const struct cec_msg *msg, in cec_ops_record_on() argument
283 rec_src->type = msg->msg[2]; in cec_ops_record_on()
288 cec_get_digital_service_id(msg->msg + 3, &rec_src->digital); in cec_ops_record_on()
291 rec_src->analog.ana_bcast_type = msg->msg[3]; in cec_ops_record_on()
293 (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_record_on()
294 rec_src->analog.bcast_system = msg->msg[6]; in cec_ops_record_on()
297 rec_src->ext_plug.plug = msg->msg[3]; in cec_ops_record_on()
301 (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_record_on()
305 static inline void cec_msg_record_status(struct cec_msg *msg, __u8 rec_status) in cec_msg_record_status() argument
307 msg->len = 3; in cec_msg_record_status()
308 msg->msg[1] = CEC_MSG_RECORD_STATUS; in cec_msg_record_status()
309 msg->msg[2] = rec_status; in cec_msg_record_status()
311 static inline void cec_ops_record_status(const struct cec_msg *msg, in cec_ops_record_status() argument
314 *rec_status = msg->msg[2]; in cec_ops_record_status()
316 static inline void cec_msg_record_tv_screen(struct cec_msg *msg, in cec_msg_record_tv_screen() argument
319 msg->len = 2; in cec_msg_record_tv_screen()
320 msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN; in cec_msg_record_tv_screen()
321 msg->reply = reply ? CEC_MSG_RECORD_ON : 0; in cec_msg_record_tv_screen()
323 static inline void cec_msg_timer_status(struct cec_msg *msg, in cec_msg_timer_status() argument
331 msg->len = 3; in cec_msg_timer_status()
332 msg->msg[1] = CEC_MSG_TIMER_STATUS; in cec_msg_timer_status()
333 msg->msg[2] = (timer_overlap_warning << 7) | in cec_msg_timer_status()
340 msg->len += 2; in cec_msg_timer_status()
341 msg->msg[3] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_timer_status()
342 msg->msg[4] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_timer_status()
345 static inline void cec_ops_timer_status(const struct cec_msg *msg, in cec_ops_timer_status() argument
353 *timer_overlap_warning = msg->msg[2] >> 7; in cec_ops_timer_status()
354 *media_info = (msg->msg[2] >> 5) & 3; in cec_ops_timer_status()
355 if (msg->msg[2] & 0x10) { in cec_ops_timer_status()
356 *prog_info = msg->msg[2] & 0xf; in cec_ops_timer_status()
360 *prog_error = msg->msg[2] & 0xf; in cec_ops_timer_status()
365 *duration_hr = (msg->msg[3] >> 4) * 10 + (msg->msg[3] & 0xf); in cec_ops_timer_status()
366 *duration_min = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_timer_status()
371 static inline void cec_msg_timer_cleared_status(struct cec_msg *msg, in cec_msg_timer_cleared_status() argument
374 msg->len = 3; in cec_msg_timer_cleared_status()
375 msg->msg[1] = CEC_MSG_TIMER_CLEARED_STATUS; in cec_msg_timer_cleared_status()
376 msg->msg[2] = timer_cleared_status; in cec_msg_timer_cleared_status()
378 static inline void cec_ops_timer_cleared_status(const struct cec_msg *msg, in cec_ops_timer_cleared_status() argument
381 *timer_cleared_status = msg->msg[2]; in cec_ops_timer_cleared_status()
383 static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, in cec_msg_clear_analogue_timer() argument
396 msg->len = 13; in cec_msg_clear_analogue_timer()
397 msg->msg[1] = CEC_MSG_CLEAR_ANALOGUE_TIMER; in cec_msg_clear_analogue_timer()
398 msg->msg[2] = day; in cec_msg_clear_analogue_timer()
399 msg->msg[3] = month; in cec_msg_clear_analogue_timer()
401 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_analogue_timer()
402 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_analogue_timer()
403 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_analogue_timer()
404 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_analogue_timer()
405 msg->msg[8] = recording_seq; in cec_msg_clear_analogue_timer()
406 msg->msg[9] = ana_bcast_type; in cec_msg_clear_analogue_timer()
407 msg->msg[10] = ana_freq >> 8; in cec_msg_clear_analogue_timer()
408 msg->msg[11] = ana_freq & 0xff; in cec_msg_clear_analogue_timer()
409 msg->msg[12] = bcast_system; in cec_msg_clear_analogue_timer()
410 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_analogue_timer()
412 static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, in cec_ops_clear_analogue_timer() argument
424 *day = msg->msg[2]; in cec_ops_clear_analogue_timer()
425 *month = msg->msg[3]; in cec_ops_clear_analogue_timer()
427 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_analogue_timer()
428 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_analogue_timer()
429 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_analogue_timer()
430 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_analogue_timer()
431 *recording_seq = msg->msg[8]; in cec_ops_clear_analogue_timer()
432 *ana_bcast_type = msg->msg[9]; in cec_ops_clear_analogue_timer()
433 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_clear_analogue_timer()
434 *bcast_system = msg->msg[12]; in cec_ops_clear_analogue_timer()
436 static inline void cec_msg_clear_digital_timer(struct cec_msg *msg, in cec_msg_clear_digital_timer() argument
447 msg->len = 16; in cec_msg_clear_digital_timer()
448 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_digital_timer()
449 msg->msg[1] = CEC_MSG_CLEAR_DIGITAL_TIMER; in cec_msg_clear_digital_timer()
450 msg->msg[2] = day; in cec_msg_clear_digital_timer()
451 msg->msg[3] = month; in cec_msg_clear_digital_timer()
453 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_digital_timer()
454 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_digital_timer()
455 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_digital_timer()
456 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_digital_timer()
457 msg->msg[8] = recording_seq; in cec_msg_clear_digital_timer()
458 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_clear_digital_timer()
460 static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg, in cec_ops_clear_digital_timer() argument
470 *day = msg->msg[2]; in cec_ops_clear_digital_timer()
471 *month = msg->msg[3]; in cec_ops_clear_digital_timer()
473 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_digital_timer()
474 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_digital_timer()
475 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_digital_timer()
476 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_digital_timer()
477 *recording_seq = msg->msg[8]; in cec_ops_clear_digital_timer()
478 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_clear_digital_timer()
480 static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, in cec_msg_clear_ext_timer() argument
493 msg->len = 13; in cec_msg_clear_ext_timer()
494 msg->msg[1] = CEC_MSG_CLEAR_EXT_TIMER; in cec_msg_clear_ext_timer()
495 msg->msg[2] = day; in cec_msg_clear_ext_timer()
496 msg->msg[3] = month; in cec_msg_clear_ext_timer()
498 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_clear_ext_timer()
499 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_clear_ext_timer()
500 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_clear_ext_timer()
501 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_clear_ext_timer()
502 msg->msg[8] = recording_seq; in cec_msg_clear_ext_timer()
503 msg->msg[9] = ext_src_spec; in cec_msg_clear_ext_timer()
504 msg->msg[10] = plug; in cec_msg_clear_ext_timer()
505 msg->msg[11] = phys_addr >> 8; in cec_msg_clear_ext_timer()
506 msg->msg[12] = phys_addr & 0xff; in cec_msg_clear_ext_timer()
507 msg->reply = reply ? CEC_MSG_TIMER_CLEARED_STATUS : 0; in cec_msg_clear_ext_timer()
509 static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, in cec_ops_clear_ext_timer() argument
521 *day = msg->msg[2]; in cec_ops_clear_ext_timer()
522 *month = msg->msg[3]; in cec_ops_clear_ext_timer()
524 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_clear_ext_timer()
525 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_clear_ext_timer()
526 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_clear_ext_timer()
527 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_clear_ext_timer()
528 *recording_seq = msg->msg[8]; in cec_ops_clear_ext_timer()
529 *ext_src_spec = msg->msg[9]; in cec_ops_clear_ext_timer()
530 *plug = msg->msg[10]; in cec_ops_clear_ext_timer()
531 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_clear_ext_timer()
533 static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, in cec_msg_set_analogue_timer() argument
546 msg->len = 13; in cec_msg_set_analogue_timer()
547 msg->msg[1] = CEC_MSG_SET_ANALOGUE_TIMER; in cec_msg_set_analogue_timer()
548 msg->msg[2] = day; in cec_msg_set_analogue_timer()
549 msg->msg[3] = month; in cec_msg_set_analogue_timer()
551 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_analogue_timer()
552 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_analogue_timer()
553 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_analogue_timer()
554 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_analogue_timer()
555 msg->msg[8] = recording_seq; in cec_msg_set_analogue_timer()
556 msg->msg[9] = ana_bcast_type; in cec_msg_set_analogue_timer()
557 msg->msg[10] = ana_freq >> 8; in cec_msg_set_analogue_timer()
558 msg->msg[11] = ana_freq & 0xff; in cec_msg_set_analogue_timer()
559 msg->msg[12] = bcast_system; in cec_msg_set_analogue_timer()
560 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_analogue_timer()
562 static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, in cec_ops_set_analogue_timer() argument
574 *day = msg->msg[2]; in cec_ops_set_analogue_timer()
575 *month = msg->msg[3]; in cec_ops_set_analogue_timer()
577 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_analogue_timer()
578 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_analogue_timer()
579 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_analogue_timer()
580 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_analogue_timer()
581 *recording_seq = msg->msg[8]; in cec_ops_set_analogue_timer()
582 *ana_bcast_type = msg->msg[9]; in cec_ops_set_analogue_timer()
583 *ana_freq = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_set_analogue_timer()
584 *bcast_system = msg->msg[12]; in cec_ops_set_analogue_timer()
586 static inline void cec_msg_set_digital_timer(struct cec_msg *msg, in cec_msg_set_digital_timer() argument
597 msg->len = 16; in cec_msg_set_digital_timer()
598 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_digital_timer()
599 msg->msg[1] = CEC_MSG_SET_DIGITAL_TIMER; in cec_msg_set_digital_timer()
600 msg->msg[2] = day; in cec_msg_set_digital_timer()
601 msg->msg[3] = month; in cec_msg_set_digital_timer()
603 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_digital_timer()
604 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_digital_timer()
605 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_digital_timer()
606 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_digital_timer()
607 msg->msg[8] = recording_seq; in cec_msg_set_digital_timer()
608 cec_set_digital_service_id(msg->msg + 9, digital); in cec_msg_set_digital_timer()
610 static inline void cec_ops_set_digital_timer(const struct cec_msg *msg, in cec_ops_set_digital_timer() argument
620 *day = msg->msg[2]; in cec_ops_set_digital_timer()
621 *month = msg->msg[3]; in cec_ops_set_digital_timer()
623 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_digital_timer()
624 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_digital_timer()
625 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_digital_timer()
626 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_digital_timer()
627 *recording_seq = msg->msg[8]; in cec_ops_set_digital_timer()
628 cec_get_digital_service_id(msg->msg + 9, digital); in cec_ops_set_digital_timer()
630 static inline void cec_msg_set_ext_timer(struct cec_msg *msg, in cec_msg_set_ext_timer() argument
643 msg->len = 13; in cec_msg_set_ext_timer()
644 msg->msg[1] = CEC_MSG_SET_EXT_TIMER; in cec_msg_set_ext_timer()
645 msg->msg[2] = day; in cec_msg_set_ext_timer()
646 msg->msg[3] = month; in cec_msg_set_ext_timer()
648 msg->msg[4] = ((start_hr / 10) << 4) | (start_hr % 10); in cec_msg_set_ext_timer()
649 msg->msg[5] = ((start_min / 10) << 4) | (start_min % 10); in cec_msg_set_ext_timer()
650 msg->msg[6] = ((duration_hr / 10) << 4) | (duration_hr % 10); in cec_msg_set_ext_timer()
651 msg->msg[7] = ((duration_min / 10) << 4) | (duration_min % 10); in cec_msg_set_ext_timer()
652 msg->msg[8] = recording_seq; in cec_msg_set_ext_timer()
653 msg->msg[9] = ext_src_spec; in cec_msg_set_ext_timer()
654 msg->msg[10] = plug; in cec_msg_set_ext_timer()
655 msg->msg[11] = phys_addr >> 8; in cec_msg_set_ext_timer()
656 msg->msg[12] = phys_addr & 0xff; in cec_msg_set_ext_timer()
657 msg->reply = reply ? CEC_MSG_TIMER_STATUS : 0; in cec_msg_set_ext_timer()
659 static inline void cec_ops_set_ext_timer(const struct cec_msg *msg, in cec_ops_set_ext_timer() argument
671 *day = msg->msg[2]; in cec_ops_set_ext_timer()
672 *month = msg->msg[3]; in cec_ops_set_ext_timer()
674 *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf); in cec_ops_set_ext_timer()
675 *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf); in cec_ops_set_ext_timer()
676 *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf); in cec_ops_set_ext_timer()
677 *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf); in cec_ops_set_ext_timer()
678 *recording_seq = msg->msg[8]; in cec_ops_set_ext_timer()
679 *ext_src_spec = msg->msg[9]; in cec_ops_set_ext_timer()
680 *plug = msg->msg[10]; in cec_ops_set_ext_timer()
681 *phys_addr = (msg->msg[11] << 8) | msg->msg[12]; in cec_ops_set_ext_timer()
683 static inline void cec_msg_set_timer_program_title(struct cec_msg *msg, in cec_msg_set_timer_program_title() argument
689 msg->len = 2 + len; in cec_msg_set_timer_program_title()
690 msg->msg[1] = CEC_MSG_SET_TIMER_PROGRAM_TITLE; in cec_msg_set_timer_program_title()
691 memcpy(msg->msg + 2, prog_title, len); in cec_msg_set_timer_program_title()
693 static inline void cec_ops_set_timer_program_title(const struct cec_msg *msg, in cec_ops_set_timer_program_title() argument
696 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_timer_program_title()
699 memcpy(prog_title, msg->msg + 2, len); in cec_ops_set_timer_program_title()
702 static inline void cec_msg_cec_version(struct cec_msg *msg, __u8 cec_version) in cec_msg_cec_version() argument
704 msg->len = 3; in cec_msg_cec_version()
705 msg->msg[1] = CEC_MSG_CEC_VERSION; in cec_msg_cec_version()
706 msg->msg[2] = cec_version; in cec_msg_cec_version()
708 static inline void cec_ops_cec_version(const struct cec_msg *msg, in cec_ops_cec_version() argument
711 *cec_version = msg->msg[2]; in cec_ops_cec_version()
713 static inline void cec_msg_get_cec_version(struct cec_msg *msg, in cec_msg_get_cec_version() argument
716 msg->len = 2; in cec_msg_get_cec_version()
717 msg->msg[1] = CEC_MSG_GET_CEC_VERSION; in cec_msg_get_cec_version()
718 msg->reply = reply ? CEC_MSG_CEC_VERSION : 0; in cec_msg_get_cec_version()
720 static inline void cec_msg_report_physical_addr(struct cec_msg *msg, in cec_msg_report_physical_addr() argument
723 msg->len = 5; in cec_msg_report_physical_addr()
724 msg->msg[0] |= 0xf; in cec_msg_report_physical_addr()
725 msg->msg[1] = CEC_MSG_REPORT_PHYSICAL_ADDR; in cec_msg_report_physical_addr()
726 msg->msg[2] = phys_addr >> 8; in cec_msg_report_physical_addr()
727 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_physical_addr()
728 msg->msg[4] = prim_devtype; in cec_msg_report_physical_addr()
730 static inline void cec_ops_report_physical_addr(const struct cec_msg *msg, in cec_ops_report_physical_addr() argument
733 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_physical_addr()
734 *prim_devtype = msg->msg[4]; in cec_ops_report_physical_addr()
736 static inline void cec_msg_give_physical_addr(struct cec_msg *msg, in cec_msg_give_physical_addr() argument
739 msg->len = 2; in cec_msg_give_physical_addr()
740 msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR; in cec_msg_give_physical_addr()
741 msg->reply = reply ? CEC_MSG_REPORT_PHYSICAL_ADDR : 0; in cec_msg_give_physical_addr()
743 static inline void cec_msg_set_menu_language(struct cec_msg *msg, in cec_msg_set_menu_language() argument
746 msg->len = 5; in cec_msg_set_menu_language()
747 msg->msg[0] |= 0xf; in cec_msg_set_menu_language()
748 msg->msg[1] = CEC_MSG_SET_MENU_LANGUAGE; in cec_msg_set_menu_language()
749 memcpy(msg->msg + 2, language, 3); in cec_msg_set_menu_language()
751 static inline void cec_ops_set_menu_language(const struct cec_msg *msg, in cec_ops_set_menu_language() argument
754 memcpy(language, msg->msg + 2, 3); in cec_ops_set_menu_language()
757 static inline void cec_msg_get_menu_language(struct cec_msg *msg, in cec_msg_get_menu_language() argument
760 msg->len = 2; in cec_msg_get_menu_language()
761 msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE; in cec_msg_get_menu_language()
762 msg->reply = reply ? CEC_MSG_SET_MENU_LANGUAGE : 0; in cec_msg_get_menu_language()
764 static inline void cec_msg_report_features(struct cec_msg *msg, in cec_msg_report_features() argument
768 msg->len = 6; in cec_msg_report_features()
769 msg->msg[0] |= 0xf; in cec_msg_report_features()
770 msg->msg[1] = CEC_MSG_REPORT_FEATURES; in cec_msg_report_features()
771 msg->msg[2] = cec_version; in cec_msg_report_features()
772 msg->msg[3] = all_device_types; in cec_msg_report_features()
773 msg->msg[4] = rc_profile; in cec_msg_report_features()
774 msg->msg[5] = dev_features; in cec_msg_report_features()
776 static inline void cec_ops_report_features(const struct cec_msg *msg, in cec_ops_report_features() argument
780 const __u8 *p = &msg->msg[4]; in cec_ops_report_features()
781 *cec_version = msg->msg[2]; in cec_ops_report_features()
782 *all_device_types = msg->msg[3]; in cec_ops_report_features()
785 while (p < &msg->msg[14] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
789 while (p < &msg->msg[15] && (*p & CEC_OP_FEAT_EXT)) in cec_ops_report_features()
795 static inline void cec_msg_give_features(struct cec_msg *msg, in cec_msg_give_features() argument
798 msg->len = 2; in cec_msg_give_features()
799 msg->msg[1] = CEC_MSG_GIVE_FEATURES; in cec_msg_give_features()
800 msg->reply = reply ? CEC_MSG_REPORT_FEATURES : 0; in cec_msg_give_features()
802 static inline void cec_msg_deck_control(struct cec_msg *msg, in cec_msg_deck_control() argument
805 msg->len = 3; in cec_msg_deck_control()
806 msg->msg[1] = CEC_MSG_DECK_CONTROL; in cec_msg_deck_control()
807 msg->msg[2] = deck_control_mode; in cec_msg_deck_control()
809 static inline void cec_ops_deck_control(const struct cec_msg *msg, in cec_ops_deck_control() argument
812 *deck_control_mode = msg->msg[2]; in cec_ops_deck_control()
814 static inline void cec_msg_deck_status(struct cec_msg *msg, in cec_msg_deck_status() argument
817 msg->len = 3; in cec_msg_deck_status()
818 msg->msg[1] = CEC_MSG_DECK_STATUS; in cec_msg_deck_status()
819 msg->msg[2] = deck_info; in cec_msg_deck_status()
821 static inline void cec_ops_deck_status(const struct cec_msg *msg, in cec_ops_deck_status() argument
824 *deck_info = msg->msg[2]; in cec_ops_deck_status()
826 static inline void cec_msg_give_deck_status(struct cec_msg *msg, in cec_msg_give_deck_status() argument
830 msg->len = 3; in cec_msg_give_deck_status()
831 msg->msg[1] = CEC_MSG_GIVE_DECK_STATUS; in cec_msg_give_deck_status()
832 msg->msg[2] = status_req; in cec_msg_give_deck_status()
833 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? in cec_msg_give_deck_status()
836 static inline void cec_ops_give_deck_status(const struct cec_msg *msg, in cec_ops_give_deck_status() argument
839 *status_req = msg->msg[2]; in cec_ops_give_deck_status()
841 static inline void cec_msg_play(struct cec_msg *msg, in cec_msg_play() argument
844 msg->len = 3; in cec_msg_play()
845 msg->msg[1] = CEC_MSG_PLAY; in cec_msg_play()
846 msg->msg[2] = play_mode; in cec_msg_play()
848 static inline void cec_ops_play(const struct cec_msg *msg, in cec_ops_play() argument
851 *play_mode = msg->msg[2]; in cec_ops_play()
866 static inline void cec_msg_tuner_device_status_analog(struct cec_msg *msg, in cec_msg_tuner_device_status_analog() argument
873 msg->len = 7; in cec_msg_tuner_device_status_analog()
874 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_analog()
875 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_analog()
876 msg->msg[3] = ana_bcast_type; in cec_msg_tuner_device_status_analog()
877 msg->msg[4] = ana_freq >> 8; in cec_msg_tuner_device_status_analog()
878 msg->msg[5] = ana_freq & 0xff; in cec_msg_tuner_device_status_analog()
879 msg->msg[6] = bcast_system; in cec_msg_tuner_device_status_analog()
881 static inline void cec_msg_tuner_device_status_digital(struct cec_msg *msg, in cec_msg_tuner_device_status_digital() argument
885 msg->len = 10; in cec_msg_tuner_device_status_digital()
886 msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS; in cec_msg_tuner_device_status_digital()
887 msg->msg[2] = (rec_flag << 7) | tuner_display_info; in cec_msg_tuner_device_status_digital()
888 cec_set_digital_service_id(msg->msg + 3, digital); in cec_msg_tuner_device_status_digital()
890 static inline void cec_msg_tuner_device_status(struct cec_msg *msg, in cec_msg_tuner_device_status() argument
894 cec_msg_tuner_device_status_analog(msg, in cec_msg_tuner_device_status()
901 cec_msg_tuner_device_status_digital(msg, in cec_msg_tuner_device_status()
906 static inline void cec_ops_tuner_device_status(const struct cec_msg *msg, in cec_ops_tuner_device_status() argument
909 tuner_dev_info->is_analog = msg->len < 10; in cec_ops_tuner_device_status()
910 tuner_dev_info->rec_flag = msg->msg[2] >> 7; in cec_ops_tuner_device_status()
911 tuner_dev_info->tuner_display_info = msg->msg[2] & 0x7f; in cec_ops_tuner_device_status()
913 tuner_dev_info->analog.ana_bcast_type = msg->msg[3]; in cec_ops_tuner_device_status()
914 tuner_dev_info->analog.ana_freq = (msg->msg[4] << 8) | msg->msg[5]; in cec_ops_tuner_device_status()
915 tuner_dev_info->analog.bcast_system = msg->msg[6]; in cec_ops_tuner_device_status()
918 cec_get_digital_service_id(msg->msg + 3, &tuner_dev_info->digital); in cec_ops_tuner_device_status()
920 static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, in cec_msg_give_tuner_device_status() argument
924 msg->len = 3; in cec_msg_give_tuner_device_status()
925 msg->msg[1] = CEC_MSG_GIVE_TUNER_DEVICE_STATUS; in cec_msg_give_tuner_device_status()
926 msg->msg[2] = status_req; in cec_msg_give_tuner_device_status()
927 msg->reply = (reply && status_req != CEC_OP_STATUS_REQ_OFF) ? in cec_msg_give_tuner_device_status()
930 static inline void cec_ops_give_tuner_device_status(const struct cec_msg *msg, in cec_ops_give_tuner_device_status() argument
933 *status_req = msg->msg[2]; in cec_ops_give_tuner_device_status()
935 static inline void cec_msg_select_analogue_service(struct cec_msg *msg, in cec_msg_select_analogue_service() argument
940 msg->len = 6; in cec_msg_select_analogue_service()
941 msg->msg[1] = CEC_MSG_SELECT_ANALOGUE_SERVICE; in cec_msg_select_analogue_service()
942 msg->msg[2] = ana_bcast_type; in cec_msg_select_analogue_service()
943 msg->msg[3] = ana_freq >> 8; in cec_msg_select_analogue_service()
944 msg->msg[4] = ana_freq & 0xff; in cec_msg_select_analogue_service()
945 msg->msg[5] = bcast_system; in cec_msg_select_analogue_service()
947 static inline void cec_ops_select_analogue_service(const struct cec_msg *msg, in cec_ops_select_analogue_service() argument
952 *ana_bcast_type = msg->msg[2]; in cec_ops_select_analogue_service()
953 *ana_freq = (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_select_analogue_service()
954 *bcast_system = msg->msg[5]; in cec_ops_select_analogue_service()
956 static inline void cec_msg_select_digital_service(struct cec_msg *msg, in cec_msg_select_digital_service() argument
959 msg->len = 9; in cec_msg_select_digital_service()
960 msg->msg[1] = CEC_MSG_SELECT_DIGITAL_SERVICE; in cec_msg_select_digital_service()
961 cec_set_digital_service_id(msg->msg + 2, digital); in cec_msg_select_digital_service()
963 static inline void cec_ops_select_digital_service(const struct cec_msg *msg, in cec_ops_select_digital_service() argument
966 cec_get_digital_service_id(msg->msg + 2, digital); in cec_ops_select_digital_service()
968 static inline void cec_msg_tuner_step_decrement(struct cec_msg *msg) in cec_msg_tuner_step_decrement() argument
970 msg->len = 2; in cec_msg_tuner_step_decrement()
971 msg->msg[1] = CEC_MSG_TUNER_STEP_DECREMENT; in cec_msg_tuner_step_decrement()
973 static inline void cec_msg_tuner_step_increment(struct cec_msg *msg) in cec_msg_tuner_step_increment() argument
975 msg->len = 2; in cec_msg_tuner_step_increment()
976 msg->msg[1] = CEC_MSG_TUNER_STEP_INCREMENT; in cec_msg_tuner_step_increment()
978 static inline void cec_msg_device_vendor_id(struct cec_msg *msg, __u32 vendor_id) in cec_msg_device_vendor_id() argument
980 msg->len = 5; in cec_msg_device_vendor_id()
981 msg->msg[0] |= 0xf; in cec_msg_device_vendor_id()
982 msg->msg[1] = CEC_MSG_DEVICE_VENDOR_ID; in cec_msg_device_vendor_id()
983 msg->msg[2] = vendor_id >> 16; in cec_msg_device_vendor_id()
984 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_device_vendor_id()
985 msg->msg[4] = vendor_id & 0xff; in cec_msg_device_vendor_id()
987 static inline void cec_ops_device_vendor_id(const struct cec_msg *msg, in cec_ops_device_vendor_id() argument
990 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_device_vendor_id()
992 static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg, in cec_msg_give_device_vendor_id() argument
995 msg->len = 2; in cec_msg_give_device_vendor_id()
996 msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID; in cec_msg_give_device_vendor_id()
997 msg->reply = reply ? CEC_MSG_DEVICE_VENDOR_ID : 0; in cec_msg_give_device_vendor_id()
999 static inline void cec_msg_vendor_command(struct cec_msg *msg, in cec_msg_vendor_command() argument
1004 msg->len = 2 + size; in cec_msg_vendor_command()
1005 msg->msg[1] = CEC_MSG_VENDOR_COMMAND; in cec_msg_vendor_command()
1006 memcpy(msg->msg + 2, vendor_cmd, size); in cec_msg_vendor_command()
1008 static inline void cec_ops_vendor_command(const struct cec_msg *msg, in cec_ops_vendor_command() argument
1012 *size = msg->len - 2; in cec_ops_vendor_command()
1015 *vendor_cmd = msg->msg + 2; in cec_ops_vendor_command()
1017 static inline void cec_msg_vendor_command_with_id(struct cec_msg *msg, in cec_msg_vendor_command_with_id() argument
1023 msg->len = 5 + size; in cec_msg_vendor_command_with_id()
1024 msg->msg[1] = CEC_MSG_VENDOR_COMMAND_WITH_ID; in cec_msg_vendor_command_with_id()
1025 msg->msg[2] = vendor_id >> 16; in cec_msg_vendor_command_with_id()
1026 msg->msg[3] = (vendor_id >> 8) & 0xff; in cec_msg_vendor_command_with_id()
1027 msg->msg[4] = vendor_id & 0xff; in cec_msg_vendor_command_with_id()
1028 memcpy(msg->msg + 5, vendor_cmd, size); in cec_msg_vendor_command_with_id()
1030 static inline void cec_ops_vendor_command_with_id(const struct cec_msg *msg, in cec_ops_vendor_command_with_id() argument
1034 *size = msg->len - 5; in cec_ops_vendor_command_with_id()
1037 *vendor_id = (msg->msg[2] << 16) | (msg->msg[3] << 8) | msg->msg[4]; in cec_ops_vendor_command_with_id()
1038 *vendor_cmd = msg->msg + 5; in cec_ops_vendor_command_with_id()
1040 static inline void cec_msg_vendor_remote_button_down(struct cec_msg *msg, in cec_msg_vendor_remote_button_down() argument
1046 msg->len = 2 + size; in cec_msg_vendor_remote_button_down()
1047 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN; in cec_msg_vendor_remote_button_down()
1048 memcpy(msg->msg + 2, rc_code, size); in cec_msg_vendor_remote_button_down()
1050 static inline void cec_ops_vendor_remote_button_down(const struct cec_msg *msg, in cec_ops_vendor_remote_button_down() argument
1054 *size = msg->len - 2; in cec_ops_vendor_remote_button_down()
1057 *rc_code = msg->msg + 2; in cec_ops_vendor_remote_button_down()
1059 static inline void cec_msg_vendor_remote_button_up(struct cec_msg *msg) in cec_msg_vendor_remote_button_up() argument
1061 msg->len = 2; in cec_msg_vendor_remote_button_up()
1062 msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_UP; in cec_msg_vendor_remote_button_up()
1064 static inline void cec_msg_set_osd_string(struct cec_msg *msg, in cec_msg_set_osd_string() argument
1071 msg->len = 3 + len; in cec_msg_set_osd_string()
1072 msg->msg[1] = CEC_MSG_SET_OSD_STRING; in cec_msg_set_osd_string()
1073 msg->msg[2] = disp_ctl; in cec_msg_set_osd_string()
1074 memcpy(msg->msg + 3, osd, len); in cec_msg_set_osd_string()
1076 static inline void cec_ops_set_osd_string(const struct cec_msg *msg, in cec_ops_set_osd_string() argument
1080 unsigned int len = msg->len > 3 ? msg->len - 3 : 0; in cec_ops_set_osd_string()
1081 *disp_ctl = msg->msg[2]; in cec_ops_set_osd_string()
1084 memcpy(osd, msg->msg + 3, len); in cec_ops_set_osd_string()
1087 static inline void cec_msg_set_osd_name(struct cec_msg *msg, const char *name) in cec_msg_set_osd_name() argument
1092 msg->len = 2 + len; in cec_msg_set_osd_name()
1093 msg->msg[1] = CEC_MSG_SET_OSD_NAME; in cec_msg_set_osd_name()
1094 memcpy(msg->msg + 2, name, len); in cec_msg_set_osd_name()
1096 static inline void cec_ops_set_osd_name(const struct cec_msg *msg, in cec_ops_set_osd_name() argument
1099 unsigned int len = msg->len > 2 ? msg->len - 2 : 0; in cec_ops_set_osd_name()
1102 memcpy(name, msg->msg + 2, len); in cec_ops_set_osd_name()
1105 static inline void cec_msg_give_osd_name(struct cec_msg *msg, in cec_msg_give_osd_name() argument
1108 msg->len = 2; in cec_msg_give_osd_name()
1109 msg->msg[1] = CEC_MSG_GIVE_OSD_NAME; in cec_msg_give_osd_name()
1110 msg->reply = reply ? CEC_MSG_SET_OSD_NAME : 0; in cec_msg_give_osd_name()
1112 static inline void cec_msg_menu_status(struct cec_msg *msg, in cec_msg_menu_status() argument
1115 msg->len = 3; in cec_msg_menu_status()
1116 msg->msg[1] = CEC_MSG_MENU_STATUS; in cec_msg_menu_status()
1117 msg->msg[2] = menu_state; in cec_msg_menu_status()
1119 static inline void cec_ops_menu_status(const struct cec_msg *msg, in cec_ops_menu_status() argument
1122 *menu_state = msg->msg[2]; in cec_ops_menu_status()
1124 static inline void cec_msg_menu_request(struct cec_msg *msg, in cec_msg_menu_request() argument
1128 msg->len = 3; in cec_msg_menu_request()
1129 msg->msg[1] = CEC_MSG_MENU_REQUEST; in cec_msg_menu_request()
1130 msg->msg[2] = menu_req; in cec_msg_menu_request()
1131 msg->reply = reply ? CEC_MSG_MENU_STATUS : 0; in cec_msg_menu_request()
1133 static inline void cec_ops_menu_request(const struct cec_msg *msg, in cec_ops_menu_request() argument
1136 *menu_req = msg->msg[2]; in cec_ops_menu_request()
1151 static inline void cec_msg_user_control_pressed(struct cec_msg *msg, in cec_msg_user_control_pressed() argument
1154 msg->len = 3; in cec_msg_user_control_pressed()
1155 msg->msg[1] = CEC_MSG_USER_CONTROL_PRESSED; in cec_msg_user_control_pressed()
1156 msg->msg[2] = ui_cmd->ui_cmd; in cec_msg_user_control_pressed()
1167 msg->len++; in cec_msg_user_control_pressed()
1168 msg->msg[3] = ui_cmd->play_mode; in cec_msg_user_control_pressed()
1171 msg->len += 4; in cec_msg_user_control_pressed()
1172 msg->msg[3] = (ui_cmd->channel_identifier.channel_number_fmt << 2) | in cec_msg_user_control_pressed()
1174 msg->msg[4] = ui_cmd->channel_identifier.major & 0xff; in cec_msg_user_control_pressed()
1175 msg->msg[5] = ui_cmd->channel_identifier.minor >> 8; in cec_msg_user_control_pressed()
1176 msg->msg[6] = ui_cmd->channel_identifier.minor & 0xff; in cec_msg_user_control_pressed()
1180 static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, in cec_ops_user_control_pressed() argument
1183 ui_cmd->ui_cmd = msg->msg[2]; in cec_ops_user_control_pressed()
1185 if (msg->len == 3) in cec_ops_user_control_pressed()
1195 ui_cmd->play_mode = msg->msg[3]; in cec_ops_user_control_pressed()
1199 if (msg->len < 7) in cec_ops_user_control_pressed()
1202 ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2; in cec_ops_user_control_pressed()
1203 ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4]; in cec_ops_user_control_pressed()
1204 ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_user_control_pressed()
1208 static inline void cec_msg_user_control_released(struct cec_msg *msg) in cec_msg_user_control_released() argument
1210 msg->len = 2; in cec_msg_user_control_released()
1211 msg->msg[1] = CEC_MSG_USER_CONTROL_RELEASED; in cec_msg_user_control_released()
1213 static inline void cec_msg_report_power_status(struct cec_msg *msg, in cec_msg_report_power_status() argument
1216 msg->len = 3; in cec_msg_report_power_status()
1217 msg->msg[1] = CEC_MSG_REPORT_POWER_STATUS; in cec_msg_report_power_status()
1218 msg->msg[2] = pwr_state; in cec_msg_report_power_status()
1220 static inline void cec_ops_report_power_status(const struct cec_msg *msg, in cec_ops_report_power_status() argument
1223 *pwr_state = msg->msg[2]; in cec_ops_report_power_status()
1225 static inline void cec_msg_give_device_power_status(struct cec_msg *msg, in cec_msg_give_device_power_status() argument
1228 msg->len = 2; in cec_msg_give_device_power_status()
1229 msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS; in cec_msg_give_device_power_status()
1230 msg->reply = reply ? CEC_MSG_REPORT_POWER_STATUS : 0; in cec_msg_give_device_power_status()
1232 static inline void cec_msg_feature_abort(struct cec_msg *msg, in cec_msg_feature_abort() argument
1235 msg->len = 4; in cec_msg_feature_abort()
1236 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_feature_abort()
1237 msg->msg[2] = abort_msg; in cec_msg_feature_abort()
1238 msg->msg[3] = reason; in cec_msg_feature_abort()
1240 static inline void cec_ops_feature_abort(const struct cec_msg *msg, in cec_ops_feature_abort() argument
1243 *abort_msg = msg->msg[2]; in cec_ops_feature_abort()
1244 *reason = msg->msg[3]; in cec_ops_feature_abort()
1246 static inline void cec_msg_reply_feature_abort(struct cec_msg *msg, __u8 reason) in cec_msg_reply_feature_abort() argument
1248 cec_msg_set_reply_to(msg, msg); in cec_msg_reply_feature_abort()
1249 msg->len = 4; in cec_msg_reply_feature_abort()
1250 msg->msg[2] = msg->msg[1]; in cec_msg_reply_feature_abort()
1251 msg->msg[3] = reason; in cec_msg_reply_feature_abort()
1252 msg->msg[1] = CEC_MSG_FEATURE_ABORT; in cec_msg_reply_feature_abort()
1254 static inline void cec_msg_abort(struct cec_msg *msg) in cec_msg_abort() argument
1256 msg->len = 2; in cec_msg_abort()
1257 msg->msg[1] = CEC_MSG_ABORT; in cec_msg_abort()
1259 static inline void cec_msg_report_audio_status(struct cec_msg *msg, in cec_msg_report_audio_status() argument
1263 msg->len = 3; in cec_msg_report_audio_status()
1264 msg->msg[1] = CEC_MSG_REPORT_AUDIO_STATUS; in cec_msg_report_audio_status()
1265 msg->msg[2] = (aud_mute_status << 7) | (aud_vol_status & 0x7f); in cec_msg_report_audio_status()
1267 static inline void cec_ops_report_audio_status(const struct cec_msg *msg, in cec_ops_report_audio_status() argument
1271 *aud_mute_status = msg->msg[2] >> 7; in cec_ops_report_audio_status()
1272 *aud_vol_status = msg->msg[2] & 0x7f; in cec_ops_report_audio_status()
1274 static inline void cec_msg_give_audio_status(struct cec_msg *msg, in cec_msg_give_audio_status() argument
1277 msg->len = 2; in cec_msg_give_audio_status()
1278 msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS; in cec_msg_give_audio_status()
1279 msg->reply = reply ? CEC_MSG_REPORT_AUDIO_STATUS : 0; in cec_msg_give_audio_status()
1281 static inline void cec_msg_set_system_audio_mode(struct cec_msg *msg, in cec_msg_set_system_audio_mode() argument
1284 msg->len = 3; in cec_msg_set_system_audio_mode()
1285 msg->msg[1] = CEC_MSG_SET_SYSTEM_AUDIO_MODE; in cec_msg_set_system_audio_mode()
1286 msg->msg[2] = sys_aud_status; in cec_msg_set_system_audio_mode()
1288 static inline void cec_ops_set_system_audio_mode(const struct cec_msg *msg, in cec_ops_set_system_audio_mode() argument
1291 *sys_aud_status = msg->msg[2]; in cec_ops_set_system_audio_mode()
1293 static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg, in cec_msg_system_audio_mode_request() argument
1297 msg->len = phys_addr == 0xffff ? 2 : 4; in cec_msg_system_audio_mode_request()
1298 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST; in cec_msg_system_audio_mode_request()
1299 msg->msg[2] = phys_addr >> 8; in cec_msg_system_audio_mode_request()
1300 msg->msg[3] = phys_addr & 0xff; in cec_msg_system_audio_mode_request()
1301 msg->reply = reply ? CEC_MSG_SET_SYSTEM_AUDIO_MODE : 0; in cec_msg_system_audio_mode_request()
1303 static inline void cec_ops_system_audio_mode_request(const struct cec_msg *msg, in cec_ops_system_audio_mode_request() argument
1306 if (msg->len < 4) in cec_ops_system_audio_mode_request()
1309 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_system_audio_mode_request()
1311 static inline void cec_msg_system_audio_mode_status(struct cec_msg *msg, in cec_msg_system_audio_mode_status() argument
1314 msg->len = 3; in cec_msg_system_audio_mode_status()
1315 msg->msg[1] = CEC_MSG_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_system_audio_mode_status()
1316 msg->msg[2] = sys_aud_status; in cec_msg_system_audio_mode_status()
1318 static inline void cec_ops_system_audio_mode_status(const struct cec_msg *msg, in cec_ops_system_audio_mode_status() argument
1321 *sys_aud_status = msg->msg[2]; in cec_ops_system_audio_mode_status()
1323 static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg, in cec_msg_give_system_audio_mode_status() argument
1326 msg->len = 2; in cec_msg_give_system_audio_mode_status()
1327 msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS; in cec_msg_give_system_audio_mode_status()
1328 msg->reply = reply ? CEC_MSG_SYSTEM_AUDIO_MODE_STATUS : 0; in cec_msg_give_system_audio_mode_status()
1330 static inline void cec_msg_report_short_audio_descriptor(struct cec_msg *msg, in cec_msg_report_short_audio_descriptor() argument
1337 msg->len = 2 + num_descriptors * 3; in cec_msg_report_short_audio_descriptor()
1338 msg->msg[1] = CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR; in cec_msg_report_short_audio_descriptor()
1340 msg->msg[2 + i * 3] = (descriptors[i] >> 16) & 0xff; in cec_msg_report_short_audio_descriptor()
1341 msg->msg[3 + i * 3] = (descriptors[i] >> 8) & 0xff; in cec_msg_report_short_audio_descriptor()
1342 msg->msg[4 + i * 3] = descriptors[i] & 0xff; in cec_msg_report_short_audio_descriptor()
1345 static inline void cec_ops_report_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_report_short_audio_descriptor() argument
1350 *num_descriptors = (msg->len - 2) / 3; in cec_ops_report_short_audio_descriptor()
1354 descriptors[i] = (msg->msg[2 + i * 3] << 16) | in cec_ops_report_short_audio_descriptor()
1355 (msg->msg[3 + i * 3] << 8) | in cec_ops_report_short_audio_descriptor()
1356 msg->msg[4 + i * 3]; in cec_ops_report_short_audio_descriptor()
1358 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, in cec_msg_request_short_audio_descriptor() argument
1367 msg->len = 2 + num_descriptors; in cec_msg_request_short_audio_descriptor()
1368 msg->msg[1] = CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR; in cec_msg_request_short_audio_descriptor()
1369 msg->reply = reply ? CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR : 0; in cec_msg_request_short_audio_descriptor()
1371 msg->msg[2 + i] = (audio_format_id[i] << 6) | in cec_msg_request_short_audio_descriptor()
1374 static inline void cec_ops_request_short_audio_descriptor(const struct cec_msg *msg, in cec_ops_request_short_audio_descriptor() argument
1380 *num_descriptors = msg->len - 2; in cec_ops_request_short_audio_descriptor()
1384 audio_format_id[i] = msg->msg[2 + i] >> 6; in cec_ops_request_short_audio_descriptor()
1385 audio_format_code[i] = msg->msg[2 + i] & 0x3f; in cec_ops_request_short_audio_descriptor()
1388 static inline void cec_msg_set_audio_rate(struct cec_msg *msg, in cec_msg_set_audio_rate() argument
1391 msg->len = 3; in cec_msg_set_audio_rate()
1392 msg->msg[1] = CEC_MSG_SET_AUDIO_RATE; in cec_msg_set_audio_rate()
1393 msg->msg[2] = audio_rate; in cec_msg_set_audio_rate()
1395 static inline void cec_ops_set_audio_rate(const struct cec_msg *msg, in cec_ops_set_audio_rate() argument
1398 *audio_rate = msg->msg[2]; in cec_ops_set_audio_rate()
1400 static inline void cec_msg_report_arc_initiated(struct cec_msg *msg) in cec_msg_report_arc_initiated() argument
1402 msg->len = 2; in cec_msg_report_arc_initiated()
1403 msg->msg[1] = CEC_MSG_REPORT_ARC_INITIATED; in cec_msg_report_arc_initiated()
1405 static inline void cec_msg_initiate_arc(struct cec_msg *msg, in cec_msg_initiate_arc() argument
1408 msg->len = 2; in cec_msg_initiate_arc()
1409 msg->msg[1] = CEC_MSG_INITIATE_ARC; in cec_msg_initiate_arc()
1410 msg->reply = reply ? CEC_MSG_REPORT_ARC_INITIATED : 0; in cec_msg_initiate_arc()
1412 static inline void cec_msg_request_arc_initiation(struct cec_msg *msg, in cec_msg_request_arc_initiation() argument
1415 msg->len = 2; in cec_msg_request_arc_initiation()
1416 msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION; in cec_msg_request_arc_initiation()
1417 msg->reply = reply ? CEC_MSG_INITIATE_ARC : 0; in cec_msg_request_arc_initiation()
1419 static inline void cec_msg_report_arc_terminated(struct cec_msg *msg) in cec_msg_report_arc_terminated() argument
1421 msg->len = 2; in cec_msg_report_arc_terminated()
1422 msg->msg[1] = CEC_MSG_REPORT_ARC_TERMINATED; in cec_msg_report_arc_terminated()
1424 static inline void cec_msg_terminate_arc(struct cec_msg *msg, in cec_msg_terminate_arc() argument
1427 msg->len = 2; in cec_msg_terminate_arc()
1428 msg->msg[1] = CEC_MSG_TERMINATE_ARC; in cec_msg_terminate_arc()
1429 msg->reply = reply ? CEC_MSG_REPORT_ARC_TERMINATED : 0; in cec_msg_terminate_arc()
1431 static inline void cec_msg_request_arc_termination(struct cec_msg *msg, in cec_msg_request_arc_termination() argument
1434 msg->len = 2; in cec_msg_request_arc_termination()
1435 msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION; in cec_msg_request_arc_termination()
1436 msg->reply = reply ? CEC_MSG_TERMINATE_ARC : 0; in cec_msg_request_arc_termination()
1438 static inline void cec_msg_report_current_latency(struct cec_msg *msg, in cec_msg_report_current_latency() argument
1445 msg->len = 6; in cec_msg_report_current_latency()
1446 msg->msg[0] |= 0xf; in cec_msg_report_current_latency()
1447 msg->msg[1] = CEC_MSG_REPORT_CURRENT_LATENCY; in cec_msg_report_current_latency()
1448 msg->msg[2] = phys_addr >> 8; in cec_msg_report_current_latency()
1449 msg->msg[3] = phys_addr & 0xff; in cec_msg_report_current_latency()
1450 msg->msg[4] = video_latency; in cec_msg_report_current_latency()
1451 msg->msg[5] = (low_latency_mode << 2) | audio_out_compensated; in cec_msg_report_current_latency()
1453 msg->msg[msg->len++] = audio_out_delay; in cec_msg_report_current_latency()
1455 static inline void cec_ops_report_current_latency(const struct cec_msg *msg, in cec_ops_report_current_latency() argument
1462 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_report_current_latency()
1463 *video_latency = msg->msg[4]; in cec_ops_report_current_latency()
1464 *low_latency_mode = (msg->msg[5] >> 2) & 1; in cec_ops_report_current_latency()
1465 *audio_out_compensated = msg->msg[5] & 3; in cec_ops_report_current_latency()
1466 if (*audio_out_compensated == 3 && msg->len >= 7) in cec_ops_report_current_latency()
1467 *audio_out_delay = msg->msg[6]; in cec_ops_report_current_latency()
1471 static inline void cec_msg_request_current_latency(struct cec_msg *msg, in cec_msg_request_current_latency() argument
1475 msg->len = 4; in cec_msg_request_current_latency()
1476 msg->msg[0] |= 0xf; in cec_msg_request_current_latency()
1477 msg->msg[1] = CEC_MSG_REQUEST_CURRENT_LATENCY; in cec_msg_request_current_latency()
1478 msg->msg[2] = phys_addr >> 8; in cec_msg_request_current_latency()
1479 msg->msg[3] = phys_addr & 0xff; in cec_msg_request_current_latency()
1480 msg->reply = reply ? CEC_MSG_REPORT_CURRENT_LATENCY : 0; in cec_msg_request_current_latency()
1482 static inline void cec_ops_request_current_latency(const struct cec_msg *msg, in cec_ops_request_current_latency() argument
1485 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_request_current_latency()
1487 static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, in cec_msg_cdc_hec_inquire_state() argument
1491 msg->len = 9; in cec_msg_cdc_hec_inquire_state()
1492 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_inquire_state()
1493 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_inquire_state()
1495 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_inquire_state()
1496 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_inquire_state()
1497 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_inquire_state()
1498 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_inquire_state()
1499 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_inquire_state()
1501 static inline void cec_ops_cdc_hec_inquire_state(const struct cec_msg *msg, in cec_ops_cdc_hec_inquire_state() argument
1506 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_inquire_state()
1507 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_inquire_state()
1508 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_inquire_state()
1510 static inline void cec_msg_cdc_hec_report_state(struct cec_msg *msg, in cec_msg_cdc_hec_report_state() argument
1519 msg->len = has_field ? 10 : 8; in cec_msg_cdc_hec_report_state()
1520 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_report_state()
1521 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_report_state()
1523 msg->msg[4] = CEC_MSG_CDC_HEC_REPORT_STATE; in cec_msg_cdc_hec_report_state()
1524 msg->msg[5] = target_phys_addr >> 8; in cec_msg_cdc_hec_report_state()
1525 msg->msg[6] = target_phys_addr & 0xff; in cec_msg_cdc_hec_report_state()
1526 msg->msg[7] = (hec_func_state << 6) | in cec_msg_cdc_hec_report_state()
1531 msg->msg[8] = hec_field >> 8; in cec_msg_cdc_hec_report_state()
1532 msg->msg[9] = hec_field & 0xff; in cec_msg_cdc_hec_report_state()
1535 static inline void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, in cec_ops_cdc_hec_report_state() argument
1545 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_report_state()
1546 *target_phys_addr = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_report_state()
1547 *hec_func_state = msg->msg[7] >> 6; in cec_ops_cdc_hec_report_state()
1548 *host_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1549 *enc_func_state = (msg->msg[7] >> 4) & 3; in cec_ops_cdc_hec_report_state()
1550 *cdc_errcode = msg->msg[7] & 3; in cec_ops_cdc_hec_report_state()
1551 *has_field = msg->len >= 10; in cec_ops_cdc_hec_report_state()
1552 *hec_field = *has_field ? ((msg->msg[8] << 8) | msg->msg[9]) : 0; in cec_ops_cdc_hec_report_state()
1554 static inline void cec_msg_cdc_hec_set_state(struct cec_msg *msg, in cec_msg_cdc_hec_set_state() argument
1562 msg->len = 10; in cec_msg_cdc_hec_set_state()
1563 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_set_state()
1564 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state()
1566 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE; in cec_msg_cdc_hec_set_state()
1567 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state()
1568 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state()
1569 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_set_state()
1570 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_set_state()
1571 msg->msg[9] = hec_set_state; in cec_msg_cdc_hec_set_state()
1573 msg->msg[msg->len++] = phys_addr3 >> 8; in cec_msg_cdc_hec_set_state()
1574 msg->msg[msg->len++] = phys_addr3 & 0xff; in cec_msg_cdc_hec_set_state()
1576 msg->msg[msg->len++] = phys_addr4 >> 8; in cec_msg_cdc_hec_set_state()
1577 msg->msg[msg->len++] = phys_addr4 & 0xff; in cec_msg_cdc_hec_set_state()
1579 msg->msg[msg->len++] = phys_addr5 >> 8; in cec_msg_cdc_hec_set_state()
1580 msg->msg[msg->len++] = phys_addr5 & 0xff; in cec_msg_cdc_hec_set_state()
1585 static inline void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state() argument
1594 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state()
1595 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state()
1596 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_set_state()
1597 *hec_set_state = msg->msg[9]; in cec_ops_cdc_hec_set_state()
1599 if (msg->len >= 12) in cec_ops_cdc_hec_set_state()
1600 *phys_addr3 = (msg->msg[10] << 8) | msg->msg[11]; in cec_ops_cdc_hec_set_state()
1601 if (msg->len >= 14) in cec_ops_cdc_hec_set_state()
1602 *phys_addr4 = (msg->msg[12] << 8) | msg->msg[13]; in cec_ops_cdc_hec_set_state()
1603 if (msg->len >= 16) in cec_ops_cdc_hec_set_state()
1604 *phys_addr5 = (msg->msg[14] << 8) | msg->msg[15]; in cec_ops_cdc_hec_set_state()
1606 static inline void cec_msg_cdc_hec_set_state_adjacent(struct cec_msg *msg, in cec_msg_cdc_hec_set_state_adjacent() argument
1610 msg->len = 8; in cec_msg_cdc_hec_set_state_adjacent()
1611 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_set_state_adjacent()
1612 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_set_state_adjacent()
1614 msg->msg[4] = CEC_MSG_CDC_HEC_SET_STATE_ADJACENT; in cec_msg_cdc_hec_set_state_adjacent()
1615 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_set_state_adjacent()
1616 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_set_state_adjacent()
1617 msg->msg[7] = hec_set_state; in cec_msg_cdc_hec_set_state_adjacent()
1619 static inline void cec_ops_cdc_hec_set_state_adjacent(const struct cec_msg *msg, in cec_ops_cdc_hec_set_state_adjacent() argument
1624 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_set_state_adjacent()
1625 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_set_state_adjacent()
1626 *hec_set_state = msg->msg[7]; in cec_ops_cdc_hec_set_state_adjacent()
1628 static inline void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg, in cec_msg_cdc_hec_request_deactivation() argument
1633 msg->len = 11; in cec_msg_cdc_hec_request_deactivation()
1634 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_request_deactivation()
1635 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_request_deactivation()
1637 msg->msg[4] = CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION; in cec_msg_cdc_hec_request_deactivation()
1638 msg->msg[5] = phys_addr1 >> 8; in cec_msg_cdc_hec_request_deactivation()
1639 msg->msg[6] = phys_addr1 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1640 msg->msg[7] = phys_addr2 >> 8; in cec_msg_cdc_hec_request_deactivation()
1641 msg->msg[8] = phys_addr2 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1642 msg->msg[9] = phys_addr3 >> 8; in cec_msg_cdc_hec_request_deactivation()
1643 msg->msg[10] = phys_addr3 & 0xff; in cec_msg_cdc_hec_request_deactivation()
1645 static inline void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *msg, in cec_ops_cdc_hec_request_deactivation() argument
1651 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_request_deactivation()
1652 *phys_addr1 = (msg->msg[5] << 8) | msg->msg[6]; in cec_ops_cdc_hec_request_deactivation()
1653 *phys_addr2 = (msg->msg[7] << 8) | msg->msg[8]; in cec_ops_cdc_hec_request_deactivation()
1654 *phys_addr3 = (msg->msg[9] << 8) | msg->msg[10]; in cec_ops_cdc_hec_request_deactivation()
1656 static inline void cec_msg_cdc_hec_notify_alive(struct cec_msg *msg) in cec_msg_cdc_hec_notify_alive() argument
1658 msg->len = 5; in cec_msg_cdc_hec_notify_alive()
1659 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_notify_alive()
1660 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_notify_alive()
1662 msg->msg[4] = CEC_MSG_CDC_HEC_NOTIFY_ALIVE; in cec_msg_cdc_hec_notify_alive()
1664 static inline void cec_ops_cdc_hec_notify_alive(const struct cec_msg *msg, in cec_ops_cdc_hec_notify_alive() argument
1667 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_notify_alive()
1669 static inline void cec_msg_cdc_hec_discover(struct cec_msg *msg) in cec_msg_cdc_hec_discover() argument
1671 msg->len = 5; in cec_msg_cdc_hec_discover()
1672 msg->msg[0] |= 0xf; in cec_msg_cdc_hec_discover()
1673 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hec_discover()
1675 msg->msg[4] = CEC_MSG_CDC_HEC_DISCOVER; in cec_msg_cdc_hec_discover()
1677 static inline void cec_ops_cdc_hec_discover(const struct cec_msg *msg, in cec_ops_cdc_hec_discover() argument
1680 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hec_discover()
1682 static inline void cec_msg_cdc_hpd_set_state(struct cec_msg *msg, in cec_msg_cdc_hpd_set_state() argument
1686 msg->len = 6; in cec_msg_cdc_hpd_set_state()
1687 msg->msg[0] |= 0xf; in cec_msg_cdc_hpd_set_state()
1688 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_set_state()
1690 msg->msg[4] = CEC_MSG_CDC_HPD_SET_STATE; in cec_msg_cdc_hpd_set_state()
1691 msg->msg[5] = (input_port << 4) | hpd_state; in cec_msg_cdc_hpd_set_state()
1693 static inline void cec_ops_cdc_hpd_set_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_set_state() argument
1698 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_set_state()
1699 *input_port = msg->msg[5] >> 4; in cec_ops_cdc_hpd_set_state()
1700 *hpd_state = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_set_state()
1702 static inline void cec_msg_cdc_hpd_report_state(struct cec_msg *msg, in cec_msg_cdc_hpd_report_state() argument
1706 msg->len = 6; in cec_msg_cdc_hpd_report_state()
1707 msg->msg[0] |= 0xf; in cec_msg_cdc_hpd_report_state()
1708 msg->msg[1] = CEC_MSG_CDC_MESSAGE; in cec_msg_cdc_hpd_report_state()
1710 msg->msg[4] = CEC_MSG_CDC_HPD_REPORT_STATE; in cec_msg_cdc_hpd_report_state()
1711 msg->msg[5] = (hpd_state << 4) | hpd_error; in cec_msg_cdc_hpd_report_state()
1713 static inline void cec_ops_cdc_hpd_report_state(const struct cec_msg *msg, in cec_ops_cdc_hpd_report_state() argument
1718 *phys_addr = (msg->msg[2] << 8) | msg->msg[3]; in cec_ops_cdc_hpd_report_state()
1719 *hpd_state = msg->msg[5] >> 4; in cec_ops_cdc_hpd_report_state()
1720 *hpd_error = msg->msg[5] & 0xf; in cec_ops_cdc_hpd_report_state()