Skip to contentSkip to conversation

rc-core: fix toggle handling in the rc6 decoder

PATCH New David Härdeman 1 participant 1 message Nov 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rc-core: fix toggle handling in the rc6 decoder

The toggle bit shouldn't be cleared before the toggle value is calculated.

This should probably go into 3.17.x as well.

Fixes 120703f9eb32 ([media] rc-core: document the protocol type)
---
 drivers/media/rc/ir-rc6-decoder.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/ir-rc6-decoder.c +1 -1
index f1f098e..d16bc67 100644
@@ -259,8 +259,8 @@ again:
 			case 32:
 				if ((scancode & RC6_6A_LCC_MASK) == RC6_6A_MCE_CC) {
 					protocol = RC_TYPE_RC6_MCE;
-					scancode &= ~RC6_6A_MCE_TOGGLE_MASK;
 					toggle = !!(scancode & RC6_6A_MCE_TOGGLE_MASK);
+					scancode &= ~RC6_6A_MCE_TOGGLE_MASK;
 				} else {
 					protocol = RC_BIT_RC6_6A_32;
 					toggle = 0;