From patchwork Sun Jul 3 20:13:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafi Rubin X-Patchwork-Id: 941062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p63KVwbm002892 for ; Sun, 3 Jul 2011 20:31:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752938Ab1GCUbz (ORCPT ); Sun, 3 Jul 2011 16:31:55 -0400 Received: from fox.seas.upenn.edu ([158.130.68.12]:58953 "EHLO fox.seas.upenn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753214Ab1GCUbw (ORCPT ); Sun, 3 Jul 2011 16:31:52 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 03 Jul 2011 20:31:58 +0000 (UTC) X-Greylist: delayed 1058 seconds by postgrey-1.27 at vger.kernel.org; Sun, 03 Jul 2011 16:31:51 EDT Received: from bb.home ([71.175.80.180]) (authenticated bits=0) by fox.seas.upenn.edu (8.14.4/8.14.3) with ESMTP id p63KE0Qn013700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 3 Jul 2011 16:14:04 -0400 From: Rafi Rubin To: linux-media@vger.kernel.org, linux-input@vger.kernel.org, jarod@redhat.com Cc: Rafi Rubin Subject: [PATCH 1/2] mceusb: Timeout unit corrections Date: Sun, 3 Jul 2011 16:13:52 -0400 Message-Id: <1309724033-27804-1-git-send-email-rafi@seas.upenn.edu> X-Mailer: git-send-email 1.7.5.4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813, 1.0.211, 0.0.0000 definitions=2011-07-03_07:2011-07-02, 2011-07-03, 1970-01-01 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Unit missmatch in mceusb_handle_command. It should be converting to us, not 1/10th of ms. mceusb_dev_printdata 100us/ms -> 1000us/ms Signed-off-by: Rafi Rubin --- Fixing the interpretation of the timeout corrects buggy behavior, particularly when using a mceusb reciever in lirc mode for arbitrary remote controls (the mce remotes actually worked, don't know why). --- 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 ad927fc..377f826 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -551,7 +551,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, case MCE_CMD_S_TIMEOUT: /* value is in units of 50us, so x*50/100 or x/2 ms */ dev_info(dev, "%s receive timeout of %d ms\n", - inout, ((data1 << 8) | data2) / 2); + inout, ((data1 << 8) | data2) / 20); break; case MCE_CMD_G_TIMEOUT: dev_info(dev, "Get receive timeout\n"); @@ -835,7 +835,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 = US_TO_NS((hi << 8 | lo) / 2); + ir->rc->timeout = US_TO_NS((hi << 8 | lo) * MCE_TIME_UNIT); break; /* 1-byte return value commands */