From: "David Härdeman" <david@hardeman.nu>
To: Anton Blanchard <anton@samba.org>
Cc: mchehab@infradead.org, linux-media@vger.kernel.org
Subject: Re: [PATCH 3/3] [media] winbond-cir: Adjust sample frequency to improve reliability
Date: Tue, 3 Jul 2012 22:28:25 +0200 [thread overview]
Message-ID: <20120703202825.GC29839@hardeman.nu> (raw)
In-Reply-To: <20120702115937.623d3b41@kryten>
On Mon, Jul 02, 2012 at 11:59:37AM +1000, Anton Blanchard wrote:
>
>When using my Logitech Harmony remote I get regular dropped events
>(about 1 in every 3). Adjusting the sample frequency to 6us so we
>sample at a multiple of an RC-6 pulse (444us) fixes it.
Sounds weird.
The in-kernel RC6 decoder already has margins of around 50% for most
pulse/spaces (i.e. 444us +/- 222us). Changing the sample resolution from
10 to 6 us should have little to no effect on the RC6 decoding (also,
the Windows driver uses a 50us resolution IIRC).
Do you have a log of a successful and unsuccesful event (the timings
that is)?
>Signed-off-by: Anton Blanchard <anton@samba.org>
>---
>
>Index: linux/drivers/media/rc/winbond-cir.c
>===================================================================
>--- linux.orig/drivers/media/rc/winbond-cir.c 2012-07-01 14:54:28.993475033 +1000
>+++ linux/drivers/media/rc/winbond-cir.c 2012-07-01 14:55:50.500939910 +1000
>@@ -358,7 +358,7 @@ wbcir_irq_rx(struct wbcir_data *data, st
> if (data->rxstate == WBCIR_RXSTATE_ERROR)
> continue;
> rawir.pulse = irdata & 0x80 ? false : true;
>- rawir.duration = US_TO_NS((irdata & 0x7F) * 10);
>+ rawir.duration = US_TO_NS((irdata & 0x7F) * 6);
> ir_raw_event_store_with_filter(data->dev, &rawir);
> }
>
>@@ -874,8 +874,8 @@ wbcir_init_hw(struct wbcir_data *data)
> /* prescaler 1.0, tx/rx fifo lvl 16 */
> outb(0x30, data->sbase + WBCIR_REG_SP3_EXCR2);
>
>- /* Set baud divisor to sample every 10 us */
>- outb(0x0F, data->sbase + WBCIR_REG_SP3_BGDL);
>+ /* Set baud divisor to sample every 6 us */
>+ outb(0x09, data->sbase + WBCIR_REG_SP3_BGDL);
> outb(0x00, data->sbase + WBCIR_REG_SP3_BGDH);
>
> /* Set CEIR mode */
>
next prev parent reply other threads:[~2012-07-03 20:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 1:58 [PATCH 1/3] [media] winbond-cir: Fix txandrx module info Anton Blanchard
2012-07-02 1:58 ` [PATCH 2/3] [media] winbond-cir: Initialise timeout, driver_type and allowed_protos Anton Blanchard
2012-07-03 20:22 ` David Härdeman
2012-07-02 1:59 ` [PATCH 3/3] [media] winbond-cir: Adjust sample frequency to improve reliability Anton Blanchard
2012-07-03 20:28 ` David Härdeman [this message]
2012-07-05 10:30 ` Anton Blanchard
2012-07-05 11:04 ` Konstantin Dimitrov
2012-07-05 14:13 ` David Härdeman
2012-07-05 14:39 ` Konstantin Dimitrov
2012-07-05 14:45 ` David Härdeman
2012-07-05 14:56 ` Konstantin Dimitrov
2012-07-09 2:02 ` Anton Blanchard
2012-08-20 21:40 ` David Härdeman
2012-07-03 20:18 ` [PATCH 1/3] [media] winbond-cir: Fix txandrx module info David Härdeman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120703202825.GC29839@hardeman.nu \
--to=david@hardeman.nu \
--cc=anton@samba.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).