diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-11-01 07:59:34 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-16 15:32:07 -0200 |
commit | f4062625ede8f0280d8246437f4070c8eb7fe9f3 (patch) | |
tree | 38d7647eccf2816cd437dca90ad330e111989d2b /drivers/staging/media/cec/cec-adap.c | |
parent | 77edf603f22425dedd5963e9b86db7ebb15c6caf (diff) | |
download | linux-f4062625ede8f0280d8246437f4070c8eb7fe9f3.tar.bz2 |
[media] cec: add flag to cec_log_addrs to enable RC passthrough
By default the CEC_MSG_USER_CONTROL_PRESSED/RELEASED messages
are passed on to the follower(s) only. If the new
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU flag is set in the
flags field of struct cec_log_addrs then these messages are also
passed on to the remote control input subsystem and they will appear
as keystrokes.
This used to be the default behavior, but now you have to explicitly
enable it. This is done to force the caller to think about possible
security issues (e.g. if these messages are used to enter passwords).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/media/cec/cec-adap.c')
-rw-r--r-- | drivers/staging/media/cec/cec-adap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/media/cec/cec-adap.c b/drivers/staging/media/cec/cec-adap.c index 611e07b78bfe..589e4576fbe9 100644 --- a/drivers/staging/media/cec/cec-adap.c +++ b/drivers/staging/media/cec/cec-adap.c @@ -1478,7 +1478,8 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, } case CEC_MSG_USER_CONTROL_PRESSED: - if (!(adap->capabilities & CEC_CAP_RC)) + if (!(adap->capabilities & CEC_CAP_RC) || + !(adap->log_addrs.flags & CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU)) break; #if IS_REACHABLE(CONFIG_RC_CORE) @@ -1515,7 +1516,8 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, break; case CEC_MSG_USER_CONTROL_RELEASED: - if (!(adap->capabilities & CEC_CAP_RC)) + if (!(adap->capabilities & CEC_CAP_RC) || + !(adap->log_addrs.flags & CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU)) break; #if IS_REACHABLE(CONFIG_RC_CORE) rc_keyup(adap->rc); |