diff options
Diffstat (limited to 'drivers/media/rc/winbond-cir.c')
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 630e376d3688..aed23ca0fa6c 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c @@ -354,7 +354,6 @@ wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device) { u8 irdata; struct ir_raw_event rawir = {}; - unsigned duration; /* Since RXHDLEV is set, at least 8 bytes are in the FIFO */ while (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_AVAIL) { @@ -362,13 +361,12 @@ wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device) if (data->rxstate == WBCIR_RXSTATE_ERROR) continue; - duration = ((irdata & 0x7F) + 1) * + rawir.duration = ((irdata & 0x7F) + 1) * (data->carrier_report_enabled ? 2 : 10); rawir.pulse = irdata & 0x80 ? false : true; - rawir.duration = US_TO_NS(duration); if (rawir.pulse) - data->pulse_duration += duration; + data->pulse_duration += rawir.duration; ir_raw_event_store_with_filter(data->dev, &rawir); } @@ -519,7 +517,7 @@ wbcir_set_carrier_report(struct rc_dev *dev, int enable) /* Set a higher sampling resolution if carrier reports are enabled */ wbcir_select_bank(data, WBCIR_BANK_2); - data->dev->rx_resolution = US_TO_NS(enable ? 2 : 10); + data->dev->rx_resolution = enable ? 2 : 10; outb(enable ? 0x03 : 0x0f, data->sbase + WBCIR_REG_SP3_BGDL); outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH); @@ -1076,7 +1074,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) data->dev->min_timeout = 1; data->dev->timeout = IR_DEFAULT_TIMEOUT; data->dev->max_timeout = 10 * IR_DEFAULT_TIMEOUT; - data->dev->rx_resolution = US_TO_NS(2); + data->dev->rx_resolution = 2; data->dev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER; data->dev->allowed_wakeup_protocols = RC_PROTO_BIT_NEC | RC_PROTO_BIT_NECX | RC_PROTO_BIT_NEC32 | RC_PROTO_BIT_RC5 | |