This source file includes following definitions.
- img_ir_rc5_scancode
- img_ir_rc5_filter
1
2
3
4
5
6
7
8 #include "img-ir-hw.h"
9
10
11 static int img_ir_rc5_scancode(int len, u64 raw, u64 enabled_protocols,
12 struct img_ir_scancode_req *request)
13 {
14 unsigned int addr, cmd, tgl, start;
15
16
17 raw >>= 2;
18
19 start = (raw >> 13) & 0x01;
20 tgl = (raw >> 11) & 0x01;
21 addr = (raw >> 6) & 0x1f;
22 cmd = raw & 0x3f;
23
24
25
26
27 cmd += ((raw >> 12) & 0x01) ? 0 : 0x40;
28
29 if (!start)
30 return -EINVAL;
31
32 request->protocol = RC_PROTO_RC5;
33 request->scancode = addr << 8 | cmd;
34 request->toggle = tgl;
35 return IMG_IR_SCANCODE;
36 }
37
38
39 static int img_ir_rc5_filter(const struct rc_scancode_filter *in,
40 struct img_ir_filter *out, u64 protocols)
41 {
42
43 return -EINVAL;
44 }
45
46
47
48
49
50 struct img_ir_decoder img_ir_rc5 = {
51 .type = RC_PROTO_BIT_RC5,
52 .control = {
53 .bitoriend2 = 1,
54 .code_type = IMG_IR_CODETYPE_BIPHASE,
55 .decodend2 = 1,
56 },
57
58 .tolerance = 16,
59 .unit = 888888,
60 .timings = {
61
62 .s10 = {
63 .pulse = { 1 },
64 .space = { 1 },
65 },
66
67
68 .s11 = {
69 .pulse = { 1 },
70 .space = { 1 },
71 },
72
73
74 .ft = {
75 .minlen = 14,
76 .maxlen = 14,
77 .ft_min = 5,
78 },
79 },
80
81
82 .scancode = img_ir_rc5_scancode,
83 .filter = img_ir_rc5_filter,
84 };