Commit 81bab3fa authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: increase rc-mm tolerance and add debug message

Decoding often fails on e.g. redrat3 devices. The dev_dbg() helps
with debugging when decoding does fail.

Cc: Patrick Lerda <patrick9876@free.fr>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent ce819649
...@@ -79,7 +79,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -79,7 +79,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!ev.pulse) if (!ev.pulse)
break; break;
if (!eq_margin(ev.duration, RCMM_PREFIX_PULSE, RCMM_UNIT / 2)) if (!eq_margin(ev.duration, RCMM_PREFIX_PULSE, RCMM_UNIT))
break; break;
data->state = STATE_LOW; data->state = STATE_LOW;
...@@ -91,7 +91,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -91,7 +91,7 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (ev.pulse) if (ev.pulse)
break; break;
if (!eq_margin(ev.duration, RCMM_PULSE_0, RCMM_UNIT / 2)) if (!eq_margin(ev.duration, RCMM_PULSE_0, RCMM_UNIT))
break; break;
data->state = STATE_BUMP; data->state = STATE_BUMP;
...@@ -164,6 +164,8 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -164,6 +164,8 @@ static int ir_rcmm_decode(struct rc_dev *dev, struct ir_raw_event ev)
break; break;
} }
dev_dbg(&dev->dev, "RC-MM decode failed at count %d state %d (%uus %s)\n",
data->count, data->state, TO_US(ev.duration), TO_STR(ev.pulse));
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment