UPSTREAM: [media] lirc: fix transmit-only read features

An RC device which is transmit-only shouldn't have the
LIRC_CAN_REC_MODE2 feature.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit c9bbd5661f)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Sean Young
2017-01-19 19:27:17 -02:00
committed by Tao Huang
parent 8fb68ad2bb
commit a0601d9bb8

View File

@@ -350,7 +350,7 @@ static int ir_lirc_register(struct rc_dev *dev)
struct lirc_driver *drv;
struct lirc_buffer *rbuf;
int rc = -ENOMEM;
unsigned long features;
unsigned long features = 0;
drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
if (!drv)
@@ -364,7 +364,8 @@ static int ir_lirc_register(struct rc_dev *dev)
if (rc)
goto rbuf_init_failed;
features = LIRC_CAN_REC_MODE2;
if (dev->driver_type != RC_DRIVER_IR_RAW_TX)
features |= LIRC_CAN_REC_MODE2;
if (dev->tx_ir) {
features |= LIRC_CAN_SEND_PULSE;
if (dev->s_tx_mask)