From patchwork Fri Dec 2 17:16:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 9458915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A422E60515 for ; Fri, 2 Dec 2016 17:17:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 911422858E for ; Fri, 2 Dec 2016 17:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8612828590; Fri, 2 Dec 2016 17:17:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40CED2858E for ; Fri, 2 Dec 2016 17:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbcLBRRT (ORCPT ); Fri, 2 Dec 2016 12:17:19 -0500 Received: from gofer.mess.org ([80.229.237.210]:47771 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbcLBRRK (ORCPT ); Fri, 2 Dec 2016 12:17:10 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id 4E79460C76; Fri, 2 Dec 2016 17:16:15 +0000 (GMT) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH 6/8] [media] rc: allow software timeout to be set Date: Fri, 2 Dec 2016 17:16:12 +0000 Message-Id: <1480698974-9093-6-git-send-email-sean@mess.org> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both the iguanair and the technotrend usb ir do not do any timeout handling in hardware, so timeout is entirely done in ir_raw_event_store_with_filter(). Any sensible timeout value will do, so allow it to be set using LIRC_SET_REC_TIMEOUT. Signed-off-by: Sean Young --- drivers/media/rc/iguanair.c | 4 +++- drivers/media/rc/ttusbir.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c index 5f63454..139a09c 100644 --- a/drivers/media/rc/iguanair.c +++ b/drivers/media/rc/iguanair.c @@ -504,7 +504,9 @@ static int iguanair_probe(struct usb_interface *intf, rc->tx_ir = iguanair_tx; rc->driver_name = DRIVER_NAME; rc->map_name = RC_MAP_RC6_MCE; - rc->timeout = MS_TO_NS(100); + rc->min_timeout = 1; + rc->timeout = IR_DEFAULT_TIMEOUT; + rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT; rc->rx_resolution = RX_RESOLUTION; iguanair_set_tx_carrier(rc, 38000); diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index bc214e2..8393014 100644 --- a/drivers/media/rc/ttusbir.c +++ b/drivers/media/rc/ttusbir.c @@ -322,7 +322,10 @@ static int ttusbir_probe(struct usb_interface *intf, rc->priv = tt; rc->driver_name = DRIVER_NAME; rc->map_name = RC_MAP_TT_1500; - rc->timeout = MS_TO_NS(100); + rc->min_timeout = 1; + rc->timeout = IR_DEFAULT_TIMEOUT; + rc->max_timeout = 10 * IR_DEFAULT_TIMEOUT; + /* * The precision is NS_PER_BIT, but since every 8th bit can be * overwritten with garbage the accuracy is at best 2 * NS_PER_BIT.