aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/winbond-cir.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2012-10-24 16:22:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-21 14:03:30 -0500
commite5eda7faea23c28836f17487962c6539fd3b3e27 (patch)
treea4c71a7a82393f548ae6c51f524d5b1660dbd937 /drivers/media/rc/winbond-cir.c
parent293d31ed32e491fa8124f8faf3ab6c9bbc425234 (diff)
[media] winbond-cir: fix idle mode
The receiver is never disabled by idle mode since rxstate never gets set to RXSTATE_ACTIVE, so we keep on getting interrupts after the first IR activity ends. Note that ir_raw_event_reset() already calls ir_raw_event_handle(). Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/winbond-cir.c')
-rw-r--r--drivers/media/rc/winbond-cir.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 45d2fff764bc..16ba38e8183f 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -207,7 +207,6 @@ struct wbcir_data {
207 /* RX state */ 207 /* RX state */
208 enum wbcir_rxstate rxstate; 208 enum wbcir_rxstate rxstate;
209 struct led_trigger *rxtrigger; 209 struct led_trigger *rxtrigger;
210 struct ir_raw_event rxev;
211 210
212 /* TX state */ 211 /* TX state */
213 enum wbcir_txstate txstate; 212 enum wbcir_txstate txstate;
@@ -339,9 +338,12 @@ wbcir_idle_rx(struct rc_dev *dev, bool idle)
339 led_trigger_event(data->rxtrigger, LED_FULL); 338 led_trigger_event(data->rxtrigger, LED_FULL);
340 } 339 }
341 340
342 if (idle && data->rxstate != WBCIR_RXSTATE_INACTIVE) 341 if (idle && data->rxstate != WBCIR_RXSTATE_INACTIVE) {
342 data->rxstate = WBCIR_RXSTATE_INACTIVE;
343 led_trigger_event(data->rxtrigger, LED_OFF);
343 /* Tell hardware to go idle by setting RXINACTIVE */ 344 /* Tell hardware to go idle by setting RXINACTIVE */
344 outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR); 345 outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR);
346 }
345} 347}
346 348
347static void 349static void
@@ -360,12 +362,6 @@ wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
360 ir_raw_event_store_with_filter(data->dev, &rawir); 362 ir_raw_event_store_with_filter(data->dev, &rawir);
361 } 363 }
362 364
363 /* Check if we should go idle */
364 if (data->dev->idle) {
365 led_trigger_event(data->rxtrigger, LED_OFF);
366 data->rxstate = WBCIR_RXSTATE_INACTIVE;
367 }
368
369 ir_raw_event_handle(data->dev); 365 ir_raw_event_handle(data->dev);
370} 366}
371 367
@@ -915,9 +911,8 @@ wbcir_init_hw(struct wbcir_data *data)
915 911
916 /* Clear RX state */ 912 /* Clear RX state */
917 data->rxstate = WBCIR_RXSTATE_INACTIVE; 913 data->rxstate = WBCIR_RXSTATE_INACTIVE;
918 data->rxev.duration = 0;
919 ir_raw_event_reset(data->dev); 914 ir_raw_event_reset(data->dev);
920 ir_raw_event_handle(data->dev); 915 ir_raw_event_set_idle(data->dev, true);
921 916
922 /* Clear TX state */ 917 /* Clear TX state */
923 if (data->txstate == WBCIR_TXSTATE_ACTIVE) { 918 if (data->txstate == WBCIR_TXSTATE_ACTIVE) {