From patchwork Thu Jan 6 19:59:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 5457 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Thu, 06 Jan 2011 18:17:47 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PawHK-0007Cr-OH for mchehab@gaivota; Thu, 06 Jan 2011 18:17:47 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 06 Jan 2011 18:17:46 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Paw6t-0003Gb-Sw; Thu, 06 Jan 2011 20:07:00 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935Ab1AFUCY (ORCPT + 1 other); Thu, 6 Jan 2011 15:02:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586Ab1AFUAR (ORCPT ); Thu, 6 Jan 2011 15:00:17 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06K0GvN013548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Jan 2011 15:00:17 -0500 Received: from xeratul.lab.bos.redhat.com (amd-tyan2915-01.lab.eng.bos.redhat.com [10.16.42.12]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p06JxnQR013208; Thu, 6 Jan 2011 15:00:15 -0500 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: Jarod Wilson Subject: [PATCH 6/6] rc/mceusb: timeout should be in ns, not us Date: Thu, 6 Jan 2011 14:59:37 -0500 Message-Id: <1294343977-31929-7-git-send-email-jarod@redhat.com> In-Reply-To: <1294343839-31784-1-git-send-email-jarod@redhat.com> References: <1294343839-31784-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab Fixes an egregious bug in mceusb driver, where the receiver was being put into idle mode far sooner than it should have, thanks to storing a timeout value that in us where it should be ns. Basically, the receiver kept going into idle mode before a trailing space had been fully received, which was causing problems for some protocols, most notably manifesting as lirc userspace never receiving a trailing space for any rc5 signals. Signed-off-by: Jarod Wilson --- drivers/media/rc/mceusb.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 2d91134..079353e 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -816,7 +816,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) switch (ir->buf_in[index]) { /* 2-byte return value commands */ case MCE_CMD_S_TIMEOUT: - ir->rc->timeout = MS_TO_US((hi << 8 | lo) / 2); + ir->rc->timeout = MS_TO_NS((hi << 8 | lo) / 2); break; /* 1-byte return value commands */ @@ -1060,7 +1060,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) rc->priv = ir; rc->driver_type = RC_DRIVER_IR_RAW; rc->allowed_protos = RC_TYPE_ALL; - rc->timeout = MS_TO_US(1000); + rc->timeout = MS_TO_NS(1000); if (!ir->flags.no_tx) { rc->s_tx_mask = mceusb_set_tx_mask; rc->s_tx_carrier = mceusb_set_tx_carrier;