From patchwork Mon Jul 2 01:59:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 1145371 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 84A443FE4F for ; Mon, 2 Jul 2012 01:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754571Ab2GBB7g (ORCPT ); Sun, 1 Jul 2012 21:59:36 -0400 Received: from ozlabs.org ([203.10.76.45]:44675 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753217Ab2GBB7g (ORCPT ); Sun, 1 Jul 2012 21:59:36 -0400 Received: from kryten (ppp121-45-170-72.lns20.syd6.internode.on.net [121.45.170.72]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id 342A12C01D1; Mon, 2 Jul 2012 11:59:35 +1000 (EST) Date: Mon, 2 Jul 2012 11:59:37 +1000 From: Anton Blanchard 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 Message-ID: <20120702115937.623d3b41@kryten> In-Reply-To: <20120702115800.1275f944@kryten> References: <20120702115800.1275f944@kryten> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */