mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-01 14:52:32 +00:00
[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>
This commit is contained in:
parent
293d31ed32
commit
e5eda7faea
@ -207,7 +207,6 @@ struct wbcir_data {
|
|||||||
/* RX state */
|
/* RX state */
|
||||||
enum wbcir_rxstate rxstate;
|
enum wbcir_rxstate rxstate;
|
||||||
struct led_trigger *rxtrigger;
|
struct led_trigger *rxtrigger;
|
||||||
struct ir_raw_event rxev;
|
|
||||||
|
|
||||||
/* TX state */
|
/* TX state */
|
||||||
enum wbcir_txstate txstate;
|
enum wbcir_txstate txstate;
|
||||||
@ -339,9 +338,12 @@ wbcir_idle_rx(struct rc_dev *dev, bool idle)
|
|||||||
led_trigger_event(data->rxtrigger, LED_FULL);
|
led_trigger_event(data->rxtrigger, LED_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idle && data->rxstate != WBCIR_RXSTATE_INACTIVE)
|
if (idle && data->rxstate != WBCIR_RXSTATE_INACTIVE) {
|
||||||
|
data->rxstate = WBCIR_RXSTATE_INACTIVE;
|
||||||
|
led_trigger_event(data->rxtrigger, LED_OFF);
|
||||||
/* Tell hardware to go idle by setting RXINACTIVE */
|
/* Tell hardware to go idle by setting RXINACTIVE */
|
||||||
outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR);
|
outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -360,12 +362,6 @@ wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
|
|||||||
ir_raw_event_store_with_filter(data->dev, &rawir);
|
ir_raw_event_store_with_filter(data->dev, &rawir);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we should go idle */
|
|
||||||
if (data->dev->idle) {
|
|
||||||
led_trigger_event(data->rxtrigger, LED_OFF);
|
|
||||||
data->rxstate = WBCIR_RXSTATE_INACTIVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ir_raw_event_handle(data->dev);
|
ir_raw_event_handle(data->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -915,9 +911,8 @@ wbcir_init_hw(struct wbcir_data *data)
|
|||||||
|
|
||||||
/* Clear RX state */
|
/* Clear RX state */
|
||||||
data->rxstate = WBCIR_RXSTATE_INACTIVE;
|
data->rxstate = WBCIR_RXSTATE_INACTIVE;
|
||||||
data->rxev.duration = 0;
|
|
||||||
ir_raw_event_reset(data->dev);
|
ir_raw_event_reset(data->dev);
|
||||||
ir_raw_event_handle(data->dev);
|
ir_raw_event_set_idle(data->dev, true);
|
||||||
|
|
||||||
/* Clear TX state */
|
/* Clear TX state */
|
||||||
if (data->txstate == WBCIR_TXSTATE_ACTIVE) {
|
if (data->txstate == WBCIR_TXSTATE_ACTIVE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user