diff options
author | Johan Fjeldtvedt <jaffe1@gmail.com> | 2016-09-07 11:01:11 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 16:00:14 (GMT) |
commit | 58584b28a8e57f1262d3c90e8f454f3793f6e8e9 (patch) | |
tree | f2b4e8ad60c7d0bd7f2b76cc7c161b15ef607f55 /drivers | |
parent | 09d6e35fdf10f94465620a195da8eaf0b81966bd (diff) | |
download | linux-58584b28a8e57f1262d3c90e8f454f3793f6e8e9.tar.xz |
[media] pulse8-cec: store logical address mask
In addition to setting the ACK mask, also set the logical address mask
setting in the dongle. This (and not the ACK mask) is persisted for
use in autonomous mode.
The logical address mask to use is deduced from the primary device type
in adap->log_addrs.
Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/pulse8-cec/pulse8-cec.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/staging/media/pulse8-cec/pulse8-cec.c b/drivers/staging/media/pulse8-cec/pulse8-cec.c index 13e8f61..8292cab 100644 --- a/drivers/staging/media/pulse8-cec/pulse8-cec.c +++ b/drivers/staging/media/pulse8-cec/pulse8-cec.c @@ -498,6 +498,40 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr) if (err) goto unlock; + switch (adap->log_addrs.primary_device_type[0]) { + case CEC_OP_PRIM_DEVTYPE_TV: + mask = CEC_LOG_ADDR_MASK_TV; + break; + case CEC_OP_PRIM_DEVTYPE_RECORD: + mask = CEC_LOG_ADDR_MASK_RECORD; + break; + case CEC_OP_PRIM_DEVTYPE_TUNER: + mask = CEC_LOG_ADDR_MASK_TUNER; + break; + case CEC_OP_PRIM_DEVTYPE_PLAYBACK: + mask = CEC_LOG_ADDR_MASK_PLAYBACK; + break; + case CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM: + mask = CEC_LOG_ADDR_MASK_AUDIOSYSTEM; + break; + case CEC_OP_PRIM_DEVTYPE_SWITCH: + mask = CEC_LOG_ADDR_MASK_UNREGISTERED; + break; + case CEC_OP_PRIM_DEVTYPE_PROCESSOR: + mask = CEC_LOG_ADDR_MASK_SPECIFIC; + break; + default: + mask = 0; + break; + } + cmd[0] = MSGCODE_SET_LOGICAL_ADDRESS_MASK; + cmd[1] = mask >> 8; + cmd[2] = mask & 0xff; + err = pulse8_send_and_wait(pulse8, cmd, 3, + MSGCODE_COMMAND_ACCEPTED, 0); + if (err) + goto unlock; + cmd[0] = MSGCODE_SET_DEFAULT_LOGICAL_ADDRESS; cmd[1] = log_addr; err = pulse8_send_and_wait(pulse8, cmd, 2, |