diff options
Diffstat (limited to 'drivers/media/IR/ir-jvc-decoder.c')
-rw-r--r-- | drivers/media/IR/ir-jvc-decoder.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-jvc-decoder.c b/drivers/media/IR/ir-jvc-decoder.c index 8894d8b3604..77a89c4de01 100644 --- a/drivers/media/IR/ir-jvc-decoder.c +++ b/drivers/media/IR/ir-jvc-decoder.c | |||
@@ -32,6 +32,7 @@ enum jvc_state { | |||
32 | STATE_BIT_SPACE, | 32 | STATE_BIT_SPACE, |
33 | STATE_TRAILER_PULSE, | 33 | STATE_TRAILER_PULSE, |
34 | STATE_TRAILER_SPACE, | 34 | STATE_TRAILER_SPACE, |
35 | STATE_CHECK_REPEAT, | ||
35 | }; | 36 | }; |
36 | 37 | ||
37 | /** | 38 | /** |
@@ -60,6 +61,7 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) | |||
60 | IR_dprintk(2, "JVC decode started at state %d (%uus %s)\n", | 61 | IR_dprintk(2, "JVC decode started at state %d (%uus %s)\n", |
61 | data->state, TO_US(ev.duration), TO_STR(ev.pulse)); | 62 | data->state, TO_US(ev.duration), TO_STR(ev.pulse)); |
62 | 63 | ||
64 | again: | ||
63 | switch (data->state) { | 65 | switch (data->state) { |
64 | 66 | ||
65 | case STATE_INACTIVE: | 67 | case STATE_INACTIVE: |
@@ -149,8 +151,18 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) | |||
149 | } | 151 | } |
150 | 152 | ||
151 | data->count = 0; | 153 | data->count = 0; |
152 | data->state = STATE_BIT_PULSE; | 154 | data->state = STATE_CHECK_REPEAT; |
153 | return 0; | 155 | return 0; |
156 | |||
157 | case STATE_CHECK_REPEAT: | ||
158 | if (!ev.pulse) | ||
159 | break; | ||
160 | |||
161 | if (eq_margin(ev.duration, JVC_HEADER_PULSE, JVC_UNIT / 2)) | ||
162 | data->state = STATE_INACTIVE; | ||
163 | else | ||
164 | data->state = STATE_BIT_PULSE; | ||
165 | goto again; | ||
154 | } | 166 | } |
155 | 167 | ||
156 | out: | 168 | out: |