From patchwork Tue Jan 29 16:34:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 10786585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B7916C2 for ; Tue, 29 Jan 2019 16:34:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BD9F2CD01 for ; Tue, 29 Jan 2019 16:34:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A5322CD33; Tue, 29 Jan 2019 16:34:03 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 884352CD01 for ; Tue, 29 Jan 2019 16:34:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728344AbfA2QeC (ORCPT ); Tue, 29 Jan 2019 11:34:02 -0500 Received: from gofer.mess.org ([88.97.38.141]:55585 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbfA2QeB (ORCPT ); Tue, 29 Jan 2019 11:34:01 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id C9443601E2; Tue, 29 Jan 2019 16:34:00 +0000 (GMT) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH v4l-utils] Print receiver timeout Date: Tue, 29 Jan 2019 16:34:00 +0000 Message-Id: <20190129163400.22280-1-sean@mess.org> X-Mailer: git-send-email 2.11.0 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 Signed-off-by: Sean Young --- utils/ir-ctl/ir-ctl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c index 7ecb1317..f8f4e0aa 100644 --- a/utils/ir-ctl/ir-ctl.c +++ b/utils/ir-ctl/ir-ctl.c @@ -708,8 +708,13 @@ static void lirc_features(struct arguments *args, int fd, unsigned features) if (features & LIRC_CAN_MEASURE_CARRIER) printf(_(" - Can measure carrier\n")); if (features & LIRC_CAN_SET_REC_TIMEOUT) { - unsigned min_timeout, max_timeout; - int rc = ioctl(fd, LIRC_GET_MIN_TIMEOUT, &min_timeout); + unsigned min_timeout, max_timeout, timeout; + + // This ioctl is only supported from kernel 4.18 onwards + int rc = ioctl(fd, LIRC_GET_REC_TIMEOUT, &timeout); + if (rc == 0) + printf(_(" - Receiving timeout %u microseconds\n"), timeout); + rc = ioctl(fd, LIRC_GET_MIN_TIMEOUT, &min_timeout); if (rc) { fprintf(stderr, _("warning: %s: device supports setting receiving timeout but LIRC_GET_MIN_TIMEOUT returns: %m\n"), dev); min_timeout = 0; @@ -724,7 +729,7 @@ static void lirc_features(struct arguments *args, int fd, unsigned features) } if (min_timeout || max_timeout) - printf(_(" - Can set receiving timeout min:%u microseconds max:%u microseconds\n"), min_timeout, max_timeout); + printf(_(" - Can set receiving timeout min %u microseconds, max %u microseconds\n"), min_timeout, max_timeout); } } else if (features & LIRC_CAN_REC_LIRCCODE) { printf(_(" - Device can receive using device dependent LIRCCODE mode (not supported)\n"));