diff options
Diffstat (limited to 'drivers/media/rc/ir-rc5-decoder.c')
-rw-r--r-- | drivers/media/rc/ir-rc5-decoder.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c index 9ab663a507a4..5b4d1ddeac4e 100644 --- a/drivers/media/rc/ir-rc5-decoder.c +++ b/drivers/media/rc/ir-rc5-decoder.c | |||
@@ -52,8 +52,8 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
52 | u8 toggle; | 52 | u8 toggle; |
53 | u32 scancode; | 53 | u32 scancode; |
54 | 54 | ||
55 | if (!(dev->raw->enabled_protocols & RC_TYPE_RC5)) | 55 | if (!(dev->raw->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X))) |
56 | return 0; | 56 | return 0; |
57 | 57 | ||
58 | if (!is_timing_event(ev)) { | 58 | if (!is_timing_event(ev)) { |
59 | if (ev.reset) | 59 | if (ev.reset) |
@@ -128,6 +128,10 @@ again: | |||
128 | if (data->wanted_bits == RC5X_NBITS) { | 128 | if (data->wanted_bits == RC5X_NBITS) { |
129 | /* RC5X */ | 129 | /* RC5X */ |
130 | u8 xdata, command, system; | 130 | u8 xdata, command, system; |
131 | if (!(dev->raw->enabled_protocols & RC_BIT_RC5X)) { | ||
132 | data->state = STATE_INACTIVE; | ||
133 | return 0; | ||
134 | } | ||
131 | xdata = (data->bits & 0x0003F) >> 0; | 135 | xdata = (data->bits & 0x0003F) >> 0; |
132 | command = (data->bits & 0x00FC0) >> 6; | 136 | command = (data->bits & 0x00FC0) >> 6; |
133 | system = (data->bits & 0x1F000) >> 12; | 137 | system = (data->bits & 0x1F000) >> 12; |
@@ -141,6 +145,10 @@ again: | |||
141 | } else { | 145 | } else { |
142 | /* RC5 */ | 146 | /* RC5 */ |
143 | u8 command, system; | 147 | u8 command, system; |
148 | if (!(dev->raw->enabled_protocols & RC_BIT_RC5)) { | ||
149 | data->state = STATE_INACTIVE; | ||
150 | return 0; | ||
151 | } | ||
144 | command = (data->bits & 0x0003F) >> 0; | 152 | command = (data->bits & 0x0003F) >> 0; |
145 | system = (data->bits & 0x007C0) >> 6; | 153 | system = (data->bits & 0x007C0) >> 6; |
146 | toggle = (data->bits & 0x00800) ? 1 : 0; | 154 | toggle = (data->bits & 0x00800) ? 1 : 0; |
@@ -164,7 +172,7 @@ out: | |||
164 | } | 172 | } |
165 | 173 | ||
166 | static struct ir_raw_handler rc5_handler = { | 174 | static struct ir_raw_handler rc5_handler = { |
167 | .protocols = RC_TYPE_RC5, | 175 | .protocols = RC_BIT_RC5 | RC_BIT_RC5X, |
168 | .decode = ir_rc5_decode, | 176 | .decode = ir_rc5_decode, |
169 | }; | 177 | }; |
170 | 178 | ||