From patchwork Wed Dec 30 16:43:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7934231 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F3FAE9F3CD for ; Wed, 30 Dec 2015 16:46:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34C13202E9 for ; Wed, 30 Dec 2015 16:46:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DCB5202FE for ; Wed, 30 Dec 2015 16:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754976AbbL3Qqy (ORCPT ); Wed, 30 Dec 2015 11:46:54 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38164 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753222AbbL3Qqw (ORCPT ); Wed, 30 Dec 2015 11:46:52 -0500 Received: by mail-wm0-f44.google.com with SMTP id b14so55522735wmb.1 for ; Wed, 30 Dec 2015 08:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=nwYPcHnqanbU4oRwYLyMhudrj6QYbbzw0xo+NFBXoio=; b=ZzuU4vKROW3N9+TYB5CEQO6Z2t9JfYQqSjuolmb8EzTZyalxTviQb/TU2XckUgslXJ CrYLtSnLNZqFgEC5LIlrKQhT0j8qnoBw3a9pr16CldFkZfJAyB8PuVZzndhuOEKO3OxU zuvY/4Za7WCXNTdl7M1Be36qnIeosfUgeeZvX6ZAi3/T9VvelI082NgPTf8YstGib8xU M8J26D+S4gEBAHmozgnQQAWRcsEt0b/8cDANpD4jA7gelBX6ZIMJIOTuVaGdz07QvhX/ 6PTxnDYLISBl2xyuZ8UghLOhOBV0FgPcOqFvBV3CYCKu2pfRc30elnqN9bO+qJ2GIGHr Btjw== X-Received: by 10.28.6.201 with SMTP id 192mr61124848wmg.0.1451494011766; Wed, 30 Dec 2015 08:46:51 -0800 (PST) Received: from ?IPv6:2003:62:5f55:ba00:84bb:b7f:fe67:66b9? (p200300625F55BA0084BB0B7FFE6766B9.dip0.t-ipconnect.de. [2003:62:5f55:ba00:84bb:b7f:fe67:66b9]) by smtp.googlemail.com with ESMTPSA id z137sm31769949wmc.8.2015.12.30.08.46.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Dec 2015 08:46:50 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 09/16] media: rc: nuvoton-cir: use IR_DEFAULT_TIMEOUT and consider SAMPLE_PERIOD To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Message-ID: <568409A6.2000502@gmail.com> Date: Wed, 30 Dec 2015 17:43:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch to using the recently introduced IR default timeout value (IR_DEFAULT_TIMEOUT) and consider the value of SAMPLE_PERIOD when calculating the limit count register value. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h index 0ad15d3..6a3de08 100644 --- a/drivers/media/rc/nuvoton-cir.h +++ b/drivers/media/rc/nuvoton-cir.h @@ -157,8 +157,8 @@ struct nvt_dev { /* total length of CIR and CIR WAKE */ #define CIR_IOREG_LENGTH 0x0f -/* RX limit length, 8 high bits for SLCH, 8 low bits for SLCL (0x7d0 = 2000) */ -#define CIR_RX_LIMIT_COUNT 0x7d0 +/* RX limit length, 8 high bits for SLCH, 8 low bits for SLCL */ +#define CIR_RX_LIMIT_COUNT (IR_DEFAULT_TIMEOUT / US_TO_NS(SAMPLE_PERIOD)) /* CIR Regs */ #define CIR_IRCON 0x00