1
2
3
4
5
6
7
8
9
10
11
12#include "img-ir-hw.h"
13
14
15static int img_ir_rc6_scancode(int len, u64 raw, u64 enabled_protocols,
16 struct img_ir_scancode_req *request)
17{
18 unsigned int addr, cmd, mode, trl1, trl2;
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 raw >>= 27;
38
39 trl1 = (raw >> 17) & 0x01;
40 trl2 = (raw >> 16) & 0x01;
41
42 mode = (raw >> 18) & 0x07;
43 addr = (raw >> 8) & 0xff;
44 cmd = raw & 0xff;
45
46
47
48
49
50 if (trl1 == trl2)
51 return -EINVAL;
52
53
54 if (mode)
55 return -EINVAL;
56
57 request->protocol = RC_TYPE_RC6_0;
58 request->scancode = addr << 8 | cmd;
59 request->toggle = trl2;
60 return IMG_IR_SCANCODE;
61}
62
63
64static int img_ir_rc6_filter(const struct rc_scancode_filter *in,
65 struct img_ir_filter *out, u64 protocols)
66{
67
68 return -EINVAL;
69}
70
71
72
73
74
75struct img_ir_decoder img_ir_rc6 = {
76 .type = RC_BIT_RC6_0,
77 .control = {
78 .bitorien = 1,
79 .code_type = IMG_IR_CODETYPE_BIPHASE,
80 .decoden = 1,
81 .decodinpol = 1,
82 },
83
84 .tolerance = 20,
85
86
87
88
89
90 .timings = {
91
92 .ldr = {
93 .pulse = { 650 },
94 .space = { 660 },
95 },
96
97 .s00 = {
98 .pulse = { 370 },
99 .space = { 370 },
100 },
101
102 .s01 = {
103 .pulse = { 370 },
104 .space = { 370 },
105 },
106
107 .ft = {
108 .minlen = 21,
109 .maxlen = 21,
110 .ft_min = 2666,
111 },
112 },
113
114
115 .scancode = img_ir_rc6_scancode,
116 .filter = img_ir_rc6_filter,
117};
118