[media] rc-core: fix toggle handling in the rc6 decoder
authorDavid Härdeman <david@hardeman.nu>
Thu, 20 Nov 2014 21:09:54 +0000 (18:09 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 21 Nov 2014 17:57:47 +0000 (15:57 -0200)
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)
Cc: stable@vger.kernel.org # For v3.17
Tested-by: Stephan Raue <mailinglists@openelec.tv>
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/rc/ir-rc6-decoder.c

index f1f098e22f7ea9f19b458223f226d5e73077bb2d..d16bc67af732251998fb280b86d887835cf39e1b 100644 (file)
@@ -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;