[PATCH 3/3] [media] winbond-cir: Adjust sample frequency to improve reliability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux