2 * ImgTec IR Decoder setup for JVC protocol.
4 * Copyright 2012-2014 Imagination Technologies Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include "img-ir-hw.h"
14 /* Convert JVC data to a scancode */
15 static int img_ir_jvc_scancode(int len
, u64 raw
, u64 enabled_protocols
,
16 struct img_ir_scancode_req
*request
)
18 unsigned int cust
, data
;
23 cust
= (raw
>> 0) & 0xff;
24 data
= (raw
>> 8) & 0xff;
26 request
->protocol
= RC_TYPE_JVC
;
27 request
->scancode
= cust
<< 8 | data
;
28 return IMG_IR_SCANCODE
;
31 /* Convert JVC scancode to JVC data filter */
32 static int img_ir_jvc_filter(const struct rc_scancode_filter
*in
,
33 struct img_ir_filter
*out
, u64 protocols
)
35 unsigned int cust
, data
;
36 unsigned int cust_m
, data_m
;
38 cust
= (in
->data
>> 8) & 0xff;
39 cust_m
= (in
->mask
>> 8) & 0xff;
40 data
= (in
->data
>> 0) & 0xff;
41 data_m
= (in
->mask
>> 0) & 0xff;
43 out
->data
= cust
| data
<< 8;
44 out
->mask
= cust_m
| data_m
<< 8;
51 * See also http://www.sbprojects.com/knowledge/ir/jvc.php
52 * http://support.jvc.com/consumer/support/documents/RemoteCodes.pdf
54 struct img_ir_decoder img_ir_jvc
= {
58 .code_type
= IMG_IR_CODETYPE_PULSEDIST
,
61 .unit
= 527500, /* 527.5 us */
65 .pulse
= { 16 /* 8.44 ms */ },
66 .space
= { 8 /* 4.22 ms */ },
70 .pulse
= { 1 /* 527.5 us +-60 us */ },
71 .space
= { 1 /* 527.5 us */ },
75 .pulse
= { 1 /* 527.5 us +-60 us */ },
76 .space
= { 3 /* 1.5825 ms +-40 us */ },
82 .ft_min
= 10, /* 5.275 ms */
86 .scancode
= img_ir_jvc_scancode
,
87 .filter
= img_ir_jvc_filter
,