diff options
author | Sean Young <sean@mess.org> | 2012-10-24 16:22:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-21 14:05:18 -0500 |
commit | c496e716e0a7e3c486b99edbab5a6db7649824b1 (patch) | |
tree | efa290979247880c6298013cff2d8ce30863de2e /drivers/media/rc | |
parent | e5eda7faea23c28836f17487962c6539fd3b3e27 (diff) |
[media] winbond-cir: increase IR receiver resolution
This is needed for carrier reporting.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 16ba38e8183f..f040bbfd2100 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -358,7 +358,7 @@ wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device) | |||
358 | if (data->rxstate == WBCIR_RXSTATE_ERROR) | 358 | if (data->rxstate == WBCIR_RXSTATE_ERROR) |
359 | continue; | 359 | continue; |
360 | rawir.pulse = irdata & 0x80 ? false : true; | 360 | rawir.pulse = irdata & 0x80 ? false : true; |
361 | rawir.duration = US_TO_NS(((irdata & 0x7F) + 1) * 10); | 361 | rawir.duration = US_TO_NS(((irdata & 0x7F) + 1) * 2); |
362 | ir_raw_event_store_with_filter(data->dev, &rawir); | 362 | ir_raw_event_store_with_filter(data->dev, &rawir); |
363 | } | 363 | } |
364 | 364 | ||
@@ -862,8 +862,8 @@ wbcir_init_hw(struct wbcir_data *data) | |||
862 | /* prescaler 1.0, tx/rx fifo lvl 16 */ | 862 | /* prescaler 1.0, tx/rx fifo lvl 16 */ |
863 | outb(0x30, data->sbase + WBCIR_REG_SP3_EXCR2); | 863 | outb(0x30, data->sbase + WBCIR_REG_SP3_EXCR2); |
864 | 864 | ||
865 | /* Set baud divisor to sample every 10 us */ | 865 | /* Set baud divisor to sample every 2 ns */ |
866 | outb(0x0F, data->sbase + WBCIR_REG_SP3_BGDL); | 866 | outb(0x03, data->sbase + WBCIR_REG_SP3_BGDL); |
867 | outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH); | 867 | outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH); |
868 | 868 | ||
869 | /* Set CEIR mode */ | 869 | /* Set CEIR mode */ |
@@ -872,9 +872,12 @@ wbcir_init_hw(struct wbcir_data *data) | |||
872 | inb(data->sbase + WBCIR_REG_SP3_LSR); /* Clear LSR */ | 872 | inb(data->sbase + WBCIR_REG_SP3_LSR); /* Clear LSR */ |
873 | inb(data->sbase + WBCIR_REG_SP3_MSR); /* Clear MSR */ | 873 | inb(data->sbase + WBCIR_REG_SP3_MSR); /* Clear MSR */ |
874 | 874 | ||
875 | /* Disable RX demod, enable run-length enc/dec, set freq span */ | 875 | /* |
876 | * Disable RX demod, enable run-length enc/dec, set freq span and | ||
877 | * enable over-sampling | ||
878 | */ | ||
876 | wbcir_select_bank(data, WBCIR_BANK_7); | 879 | wbcir_select_bank(data, WBCIR_BANK_7); |
877 | outb(0x90, data->sbase + WBCIR_REG_SP3_RCCFG); | 880 | outb(0xd0, data->sbase + WBCIR_REG_SP3_RCCFG); |
878 | 881 | ||
879 | /* Disable timer */ | 882 | /* Disable timer */ |
880 | wbcir_select_bank(data, WBCIR_BANK_4); | 883 | wbcir_select_bank(data, WBCIR_BANK_4); |
@@ -1017,6 +1020,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1017 | data->dev->priv = data; | 1020 | data->dev->priv = data; |
1018 | data->dev->dev.parent = &device->dev; | 1021 | data->dev->dev.parent = &device->dev; |
1019 | data->dev->timeout = MS_TO_NS(100); | 1022 | data->dev->timeout = MS_TO_NS(100); |
1023 | data->dev->rx_resolution = US_TO_NS(2); | ||
1020 | data->dev->allowed_protos = RC_BIT_ALL; | 1024 | data->dev->allowed_protos = RC_BIT_ALL; |
1021 | 1025 | ||
1022 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | 1026 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { |