All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: mchehab@infradead.org, david@hardeman.nu
Cc: linux-media@vger.kernel.org
Subject: [PATCH 3/3] [media] winbond-cir: Adjust sample frequency to improve reliability
Date: Mon, 2 Jul 2012 11:59:37 +1000	[thread overview]
Message-ID: <20120702115937.623d3b41@kryten> (raw)
In-Reply-To: <20120702115800.1275f944@kryten>


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.

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 */

  parent reply	other threads:[~2012-07-02  1:59 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 ` Anton Blanchard [this message]
2012-07-03 20:28   ` [PATCH 3/3] [media] winbond-cir: Adjust sample frequency to improve reliability David Härdeman
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=20120702115937.623d3b41@kryten \
    --to=anton@samba.org \
    --cc=david@hardeman.nu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.