upstream: [media] rc-main: automatically refresh filter on protocol change
authorJames Hogan <james.hogan@imgtec.com>
Fri, 28 Feb 2014 23:17:06 +0000 (20:17 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:58:50 +0000 (11:58 +0900)
commit02c4792496b89bd40d729fe1aa79e1da3eaed031
tree1c84139470830a63a5f714270dce8ba34fdd1e69
parent96f664de9e9d18fa323fc3029bec80fcd20bce7d
upstream: [media] rc-main: automatically refresh filter on protocol change

When either of the normal or wakeup filter protocols are changed,
refresh the corresponding scancode filter, i.e. try and set the same
scancode filter with the new protocol. If that fails clear the filter
instead.

If no protocol was selected the filter is just cleared, and if no
s_filter callback exists the filter is left unmodified.

Similarly clear the filter mask when the filter is set if no protocol is
currently selected.

This simplifies driver code which no longer has to explicitly worry
about modifying the filter on a protocol change. This also allows the
change_wakeup_protocol callback to be omitted entirely if there is only
a single available wakeup protocol at a time, since selecting no
protocol will automatically clear the wakeup filter, disabling wakeup.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/rc/rc-main.c