Lines Matching refs:code_block
400 struct code_block { struct
411 struct code_block *code_block) in send_data_block() argument
416 p = &code_block->length; in send_data_block()
417 for (i = 0; p < code_block->csum; i++) in send_data_block()
418 code_block->csum[i & 1] ^= *p++; in send_data_block()
420 p = &code_block->length; in send_data_block()
422 for (i = 0; i < sizeof(*code_block);) { in send_data_block()
423 int tosend = sizeof(*code_block) - i; in send_data_block()
461 struct code_block code_block = { .length = sizeof(code_block) }; in zilog_init() local
465 put_unaligned_be16(0x1000, &code_block.pulse[3]); in zilog_init()
467 ret = send_data_block(ir, ZILOG_INIT_END, &code_block); in zilog_init()
534 unsigned int count, struct code_block *code_block) in zilog_ir_format() argument
541 code_block->carrier_pulse = DIV_ROUND_CLOSEST( in zilog_ir_format()
543 code_block->carrier_space = DIV_ROUND_CLOSEST( in zilog_ir_format()
562 s = find_slot(code_block->space, in zilog_ir_format()
563 ARRAY_SIZE(code_block->space), l); in zilog_ir_format()
572 p = find_slot(code_block->pulse, in zilog_ir_format()
573 ARRAY_SIZE(code_block->pulse), l); in zilog_ir_format()
583 for (i = 1; i < ARRAY_SIZE(code_block->space); i++) { in zilog_ir_format()
584 u16 d = get_unaligned_be16(&code_block->space[i]); in zilog_ir_format()
586 if (get_unaligned_be16(&code_block->space[s]) > d) in zilog_ir_format()
613 if (leading >= ARRAY_SIZE(code_block->codes) - 3 - rep) { in zilog_ir_format()
619 copy_codes(code_block->codes, codes, leading); in zilog_ir_format()
620 code_block->codes[leading] = 0x82; in zilog_ir_format()
621 copy_codes(code_block->codes + leading + 1, codes + leading, in zilog_ir_format()
624 code_block->codes[c++] = 0xc0; in zilog_ir_format()
626 if (c >= ARRAY_SIZE(code_block->codes) - 3) { in zilog_ir_format()
632 code_block->codes[0] = 0x82; in zilog_ir_format()
633 copy_codes(code_block->codes + 1, codes, c); in zilog_ir_format()
635 code_block->codes[c++] = 0xc4; in zilog_ir_format()
638 while (c < ARRAY_SIZE(code_block->codes)) in zilog_ir_format()
639 code_block->codes[c++] = 0x83; in zilog_ir_format()
648 struct code_block code_block = { .length = sizeof(code_block) }; in zilog_tx() local
652 ret = zilog_ir_format(rcdev, txbuf, count, &code_block); in zilog_tx()
660 ret = send_data_block(ir, ZILOG_UIR_END, &code_block); in zilog_tx()