Skip to content

Commit aec3ead

Browse files
seanyoungmchehab
authored andcommitted
media: mceusb: MCE_CMD_SETIRTIMEOUT cause strange behaviour on device
If the IR timeout is set on vid 1784 pid 0011, the device starts behaving strangely. Reported-by: Matthias Reichl <hias@horus.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent 09c2cc9 commit aec3ead

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

‎drivers/media/rc/mceusb.c‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ enum mceusb_model_type {
181181
MCE_GEN2 = 0, /* Most boards */
182182
MCE_GEN1,
183183
MCE_GEN3,
184+
MCE_GEN3_BROKEN_IRTIMEOUT,
184185
MCE_GEN2_TX_INV,
185186
MCE_GEN2_TX_INV_RX_GOOD,
186187
POLARIS_EVK,
@@ -199,6 +200,7 @@ struct mceusb_model {
199200
u32 mce_gen3:1;
200201
u32 tx_mask_normal:1;
201202
u32 no_tx:1;
203+
u32 broken_irtimeout:1;
202204
/*
203205
* 2nd IR receiver (short-range, wideband) for learning mode:
204206
* 0, absent 2nd receiver (rx2)
@@ -242,6 +244,12 @@ static const struct mceusb_model mceusb_model[] = {
242244
.tx_mask_normal = 1,
243245
.rx2 = 2,
244246
},
247+
[MCE_GEN3_BROKEN_IRTIMEOUT] = {
248+
.mce_gen3 = 1,
249+
.tx_mask_normal = 1,
250+
.rx2 = 2,
251+
.broken_irtimeout = 1
252+
},
245253
[POLARIS_EVK] = {
246254
/*
247255
* In fact, the EVK is shipped without
@@ -352,7 +360,7 @@ static const struct usb_device_id mceusb_dev_table[] = {
352360
.driver_info = MCE_GEN2_TX_INV },
353361
/* Topseed eHome Infrared Transceiver */
354362
{ USB_DEVICE(VENDOR_TOPSEED, 0x0011),
355-
.driver_info = MCE_GEN3 },
363+
.driver_info = MCE_GEN3_BROKEN_IRTIMEOUT },
356364
/* Ricavision internal Infrared Transceiver */
357365
{ USB_DEVICE(VENDOR_RICAVISION, 0x0010) },
358366
/* Itron ione Libra Q-11 */
@@ -1441,8 +1449,16 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
14411449
rc->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
14421450
rc->min_timeout = US_TO_NS(MCE_TIME_UNIT);
14431451
rc->timeout = MS_TO_NS(100);
1444-
rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
1445-
rc->s_timeout = mceusb_set_timeout;
1452+
if (!mceusb_model[ir->model].broken_irtimeout) {
1453+
rc->s_timeout = mceusb_set_timeout;
1454+
rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT;
1455+
} else {
1456+
/*
1457+
* If we can't set the timeout using CMD_SETIRTIMEOUT, we can
1458+
* rely on software timeouts for timeouts < 100ms.
1459+
*/
1460+
rc->max_timeout = rc->timeout;
1461+
}
14461462
if (!ir->flags.no_tx) {
14471463
rc->s_tx_mask = mceusb_set_tx_mask;
14481464
rc->s_tx_carrier = mceusb_set_tx_carrier;

0 commit comments

Comments
 (0)