UPSTREAM: media: rc: default to idle on at startup or after reset

Any spaces events received after a reset or startup should be discarded,
so ensure the rc device is in idle mode.

This also makes it much easier to detect incorrect raw events, as we will
do in a following commit.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit e0d51e6cef)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Sean Young
2018-05-10 16:41:15 -04:00
committed by Tao Huang
parent a9055a4c42
commit ff7e976e81
2 changed files with 2 additions and 0 deletions

View File

@@ -620,6 +620,7 @@ int ir_raw_event_prepare(struct rc_dev *dev)
dev->raw->dev = dev;
dev->change_protocol = change_protocol;
dev->idle = true;
spin_lock_init(&dev->raw->edge_spinlock);
timer_setup(&dev->raw->edge_handle, ir_raw_edge_handle, 0);
INIT_KFIFO(dev->raw->kfifo);

View File

@@ -361,6 +361,7 @@ static inline void ir_raw_event_reset(struct rc_dev *dev)
struct ir_raw_event ev = { .reset = true };
ir_raw_event_store(dev, &ev);
dev->idle = true;
ir_raw_event_handle(dev);
}