diff options
Diffstat (limited to 'drivers/media/rc/winbond-cir.c')
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 5d06b899e859..bec8abc965f7 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -6,8 +6,8 @@ | |||
6 | * could probably support others (Winbond WEC102X, NatSemi, etc) | 6 | * could probably support others (Winbond WEC102X, NatSemi, etc) |
7 | * with minor modifications. | 7 | * with minor modifications. |
8 | * | 8 | * |
9 | * Original Author: David Härdeman <david@hardeman.nu> | 9 | * Original Author: David Härdeman <david@hardeman.nu> |
10 | * Copyright (C) 2009 - 2010 David Härdeman <david@hardeman.nu> | 10 | * Copyright (C) 2009 - 2011 David Härdeman <david@hardeman.nu> |
11 | * | 11 | * |
12 | * Dedicated to my daughter Matilda, without whose loving attention this | 12 | * Dedicated to my daughter Matilda, without whose loving attention this |
13 | * driver would have been finished in half the time and with a fraction | 13 | * driver would have been finished in half the time and with a fraction |
@@ -577,16 +577,12 @@ wbcir_txmask(struct rc_dev *dev, u32 mask) | |||
577 | } | 577 | } |
578 | 578 | ||
579 | static int | 579 | static int |
580 | wbcir_tx(struct rc_dev *dev, int *buf, u32 bufsize) | 580 | wbcir_tx(struct rc_dev *dev, unsigned *buf, unsigned count) |
581 | { | 581 | { |
582 | struct wbcir_data *data = dev->priv; | 582 | struct wbcir_data *data = dev->priv; |
583 | u32 count; | ||
584 | unsigned i; | 583 | unsigned i; |
585 | unsigned long flags; | 584 | unsigned long flags; |
586 | 585 | ||
587 | /* bufsize has been sanity checked by the caller */ | ||
588 | count = bufsize / sizeof(int); | ||
589 | |||
590 | /* Not sure if this is possible, but better safe than sorry */ | 586 | /* Not sure if this is possible, but better safe than sorry */ |
591 | spin_lock_irqsave(&data->spinlock, flags); | 587 | spin_lock_irqsave(&data->spinlock, flags); |
592 | if (data->txstate != WBCIR_TXSTATE_INACTIVE) { | 588 | if (data->txstate != WBCIR_TXSTATE_INACTIVE) { |
@@ -876,18 +872,8 @@ wbcir_init_hw(struct wbcir_data *data) | |||
876 | /* prescaler 1.0, tx/rx fifo lvl 16 */ | 872 | /* prescaler 1.0, tx/rx fifo lvl 16 */ |
877 | outb(0x30, data->sbase + WBCIR_REG_SP3_EXCR2); | 873 | outb(0x30, data->sbase + WBCIR_REG_SP3_EXCR2); |
878 | 874 | ||
879 | /* Set baud divisor to generate one byte per bit/cell */ | 875 | /* Set baud divisor to sample every 10 us */ |
880 | switch (protocol) { | 876 | outb(0x0F, data->sbase + WBCIR_REG_SP3_BGDL); |
881 | case IR_PROTOCOL_RC5: | ||
882 | outb(0xA7, data->sbase + WBCIR_REG_SP3_BGDL); | ||
883 | break; | ||
884 | case IR_PROTOCOL_RC6: | ||
885 | outb(0x53, data->sbase + WBCIR_REG_SP3_BGDL); | ||
886 | break; | ||
887 | case IR_PROTOCOL_NEC: | ||
888 | outb(0x69, data->sbase + WBCIR_REG_SP3_BGDL); | ||
889 | break; | ||
890 | } | ||
891 | outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH); | 877 | outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH); |
892 | 878 | ||
893 | /* Set CEIR mode */ | 879 | /* Set CEIR mode */ |
@@ -896,9 +882,9 @@ wbcir_init_hw(struct wbcir_data *data) | |||
896 | inb(data->sbase + WBCIR_REG_SP3_LSR); /* Clear LSR */ | 882 | inb(data->sbase + WBCIR_REG_SP3_LSR); /* Clear LSR */ |
897 | inb(data->sbase + WBCIR_REG_SP3_MSR); /* Clear MSR */ | 883 | inb(data->sbase + WBCIR_REG_SP3_MSR); /* Clear MSR */ |
898 | 884 | ||
899 | /* Disable RX demod, run-length encoding/decoding, set freq span */ | 885 | /* Disable RX demod, enable run-length enc/dec, set freq span */ |
900 | wbcir_select_bank(data, WBCIR_BANK_7); | 886 | wbcir_select_bank(data, WBCIR_BANK_7); |
901 | outb(0x10, data->sbase + WBCIR_REG_SP3_RCCFG); | 887 | outb(0x90, data->sbase + WBCIR_REG_SP3_RCCFG); |
902 | 888 | ||
903 | /* Disable timer */ | 889 | /* Disable timer */ |
904 | wbcir_select_bank(data, WBCIR_BANK_4); | 890 | wbcir_select_bank(data, WBCIR_BANK_4); |