2 * ImgTec IR Decoder setup for JVC protocol.
4 * Copyright 2012-2014 Imagination Technologies Ltd.
9 /* Convert JVC data to a scancode */
10 static int img_ir_jvc_scancode(int len
, u64 raw
, int *scancode
, u64 protocols
)
12 unsigned int cust
, data
;
17 cust
= (raw
>> 0) & 0xff;
18 data
= (raw
>> 8) & 0xff;
20 *scancode
= cust
<< 8 | data
;
21 return IMG_IR_SCANCODE
;
24 /* Convert JVC scancode to JVC data filter */
25 static int img_ir_jvc_filter(const struct rc_scancode_filter
*in
,
26 struct img_ir_filter
*out
, u64 protocols
)
28 unsigned int cust
, data
;
29 unsigned int cust_m
, data_m
;
31 cust
= (in
->data
>> 8) & 0xff;
32 cust_m
= (in
->mask
>> 8) & 0xff;
33 data
= (in
->data
>> 0) & 0xff;
34 data_m
= (in
->mask
>> 0) & 0xff;
36 out
->data
= cust
| data
<< 8;
37 out
->mask
= cust_m
| data_m
<< 8;
44 * See also http://www.sbprojects.com/knowledge/ir/jvc.php
45 * http://support.jvc.com/consumer/support/documents/RemoteCodes.pdf
47 struct img_ir_decoder img_ir_jvc
= {
51 .code_type
= IMG_IR_CODETYPE_PULSEDIST
,
54 .unit
= 527500, /* 527.5 us */
58 .pulse
= { 16 /* 8.44 ms */ },
59 .space
= { 8 /* 4.22 ms */ },
63 .pulse
= { 1 /* 527.5 us +-60 us */ },
64 .space
= { 1 /* 527.5 us */ },
68 .pulse
= { 1 /* 527.5 us +-60 us */ },
69 .space
= { 3 /* 1.5825 ms +-40 us */ },
75 .ft_min
= 10, /* 5.275 ms */
79 .scancode
= img_ir_jvc_scancode
,
80 .filter
= img_ir_jvc_filter
,