diff options
author | James Hogan <james.hogan@imgtec.com> | 2014-12-08 11:17:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-23 13:21:45 -0500 |
commit | 983c5bd26b86ba1c0d79b770e596bb8b77e42f32 (patch) | |
tree | eafac29e07884f42b80f12f7ab0fb07062fbb5de | |
parent | 40b8a5a65aa3ba51a80f7bd667df8403d54d6e7a (diff) |
[media] rc-main: Re-apply filter for no-op protocol change
Since commit da6e162d6a46 ("[media] rc-core: simplify sysfs code"), when
the IR protocol is set using the sysfs interface to the same set of
protocols that are already set, store_protocols() does not refresh the
scancode filter with the new protocol, even if it has already called the
change_protocol() callback successfully. This results in the filter
being disabled in the hardware and not re-enabled until the filter is
set again using sysfs.
Fix in store_protocols() by still re-applying the filter whenever the
change_protocol() driver callback succeeded.
The problem can be reproduced with the img-ir driver by setting a
filter, and then setting the protocol to the same protocol that is
already set:
$ echo nec > protocols
$ echo 0xffff > filter_mask
$ echo nec > protocols
After this, messages which don't match the filter were still being
received.
Fixes: da6e162d6a46 ("[media] rc-core: simplify sysfs code")
Reported-by: Sifan Naeem <sifan.naeem@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: David Härdeman <david@hardeman.nu>
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/rc/rc-main.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 86ffcd54339e..f8c5e47a30aa 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -1021,16 +1021,16 @@ static ssize_t store_protocols(struct device *device, | |||
1021 | goto out; | 1021 | goto out; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | if (new_protocols == old_protocols) { | 1024 | if (new_protocols != old_protocols) { |
1025 | rc = len; | 1025 | *current_protocols = new_protocols; |
1026 | goto out; | 1026 | IR_dprintk(1, "Protocols changed to 0x%llx\n", |
1027 | (long long)new_protocols); | ||
1027 | } | 1028 | } |
1028 | 1029 | ||
1029 | *current_protocols = new_protocols; | ||
1030 | IR_dprintk(1, "Protocols changed to 0x%llx\n", (long long)new_protocols); | ||
1031 | |||
1032 | /* | 1030 | /* |
1033 | * If the protocol is changed the filter needs updating. | 1031 | * If a protocol change was attempted the filter may need updating, even |
1032 | * if the actual protocol mask hasn't changed (since the driver may have | ||
1033 | * cleared the filter). | ||
1034 | * Try setting the same filter with the new protocol (if any). | 1034 | * Try setting the same filter with the new protocol (if any). |
1035 | * Fall back to clearing the filter. | 1035 | * Fall back to clearing the filter. |
1036 | */ | 1036 | */ |