aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorDylan Rajaratnam <dylan.rajaratnam@imgtec.com>2014-11-17 07:17:45 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-04 12:28:53 -0500
commitea0de4ec5489da0fe738b274effac4f950e93d76 (patch)
tree39f6dbb45ab98a1b0141aa103810fcca504dcb2d /drivers/media/rc
parentd0a0a65e277c0cdfb498980e2ae998e0060c1ee4 (diff)
[media] img-ir/hw: Always read data to clear buffer
A problem was found on Polaris where if the unit it booted via the power button on the infrared remote then the next button press on the remote would return the key code used to power on the unit. The sequence is: - The polaris powered off but with the powerdown controller (PDC) block still powered. - Press power key on remote, IR block receives the key. - Kernel starts, IR code is in IMG_IR_DATA_x but neither IMG_IR_RXDVAL or IMG_IR_RXDVALD2 are set. - Wait any amount of time. - Press any key. - IMG_IR_RXDVAL or IMG_IR_RXDVALD2 is set but IMG_IR_DATA_x is unchanged since the powerup key data was never read. This is worked around by always reading the IMG_IR_DATA_x in img_ir_set_decoder(), rather than only when the IMG_IR_RXDVAL or IMG_IR_RXDVALD2 bit is set. Signed-off-by: Dylan Rajaratnam <dylan.rajaratnam@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: <stable@vger.kernel.org> # v3.15+ Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/img-ir/img-ir-hw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/rc/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c
index ec49f94425fc..9db065344b41 100644
--- a/drivers/media/rc/img-ir/img-ir-hw.c
+++ b/drivers/media/rc/img-ir/img-ir-hw.c
@@ -541,10 +541,12 @@ static void img_ir_set_decoder(struct img_ir_priv *priv,
541 if (ir_status & (IMG_IR_RXDVAL | IMG_IR_RXDVALD2)) { 541 if (ir_status & (IMG_IR_RXDVAL | IMG_IR_RXDVALD2)) {
542 ir_status &= ~(IMG_IR_RXDVAL | IMG_IR_RXDVALD2); 542 ir_status &= ~(IMG_IR_RXDVAL | IMG_IR_RXDVALD2);
543 img_ir_write(priv, IMG_IR_STATUS, ir_status); 543 img_ir_write(priv, IMG_IR_STATUS, ir_status);
544 img_ir_read(priv, IMG_IR_DATA_LW);
545 img_ir_read(priv, IMG_IR_DATA_UP);
546 } 544 }
547 545
546 /* always read data to clear buffer if IR wakes the device */
547 img_ir_read(priv, IMG_IR_DATA_LW);
548 img_ir_read(priv, IMG_IR_DATA_UP);
549
548 /* stop the end timer and switch back to normal mode */ 550 /* stop the end timer and switch back to normal mode */
549 del_timer_sync(&hw->end_timer); 551 del_timer_sync(&hw->end_timer);
550 hw->mode = IMG_IR_M_NORMAL; 552 hw->mode = IMG_IR_M_NORMAL;