This source file includes following definitions.
- img_ir_jvc_scancode
- img_ir_jvc_filter
1
2
3
4
5
6
7
8 #include "img-ir-hw.h"
9
10
11 static int img_ir_jvc_scancode(int len, u64 raw, u64 enabled_protocols,
12 struct img_ir_scancode_req *request)
13 {
14 unsigned int cust, data;
15
16 if (len != 16)
17 return -EINVAL;
18
19 cust = (raw >> 0) & 0xff;
20 data = (raw >> 8) & 0xff;
21
22 request->protocol = RC_PROTO_JVC;
23 request->scancode = cust << 8 | data;
24 return IMG_IR_SCANCODE;
25 }
26
27
28 static int img_ir_jvc_filter(const struct rc_scancode_filter *in,
29 struct img_ir_filter *out, u64 protocols)
30 {
31 unsigned int cust, data;
32 unsigned int cust_m, data_m;
33
34 cust = (in->data >> 8) & 0xff;
35 cust_m = (in->mask >> 8) & 0xff;
36 data = (in->data >> 0) & 0xff;
37 data_m = (in->mask >> 0) & 0xff;
38
39 out->data = cust | data << 8;
40 out->mask = cust_m | data_m << 8;
41
42 return 0;
43 }
44
45
46
47
48
49
50 struct img_ir_decoder img_ir_jvc = {
51 .type = RC_PROTO_BIT_JVC,
52 .control = {
53 .decoden = 1,
54 .code_type = IMG_IR_CODETYPE_PULSEDIST,
55 },
56
57 .unit = 527500,
58 .timings = {
59
60 .ldr = {
61 .pulse = { 16 },
62 .space = { 8 },
63 },
64
65 .s00 = {
66 .pulse = { 1 },
67 .space = { 1 },
68 },
69
70 .s01 = {
71 .pulse = { 1 },
72 .space = { 3 },
73 },
74
75 .ft = {
76 .minlen = 16,
77 .maxlen = 16,
78 .ft_min = 10,
79 },
80 },
81
82 .scancode = img_ir_jvc_scancode,
83 .filter = img_ir_jvc_filter,
84 };