From patchwork Fri Jun 14 13:59:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 2721701 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 809E6C0AB1 for ; Fri, 14 Jun 2013 13:59:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30ABE20286 for ; Fri, 14 Jun 2013 13:59:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E2322027A for ; Fri, 14 Jun 2013 13:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752942Ab3FNN7o (ORCPT ); Fri, 14 Jun 2013 09:59:44 -0400 Received: from mail-qe0-f53.google.com ([209.85.128.53]:51291 "EHLO mail-qe0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660Ab3FNN7n (ORCPT ); Fri, 14 Jun 2013 09:59:43 -0400 Received: by mail-qe0-f53.google.com with SMTP id 1so328243qee.12 for ; Fri, 14 Jun 2013 06:59:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=xF6jTDu48sJydJK8DMOFrMkryLar+NWZnESpgRSq/3I=; b=gxYt8ZQMnjF2DwBTMoeHsOptOfenpaGSaobIcoR4QX79pK9GHDELTL9ZxSln28O8RT xnJjTMNC0iSzDJP5pMbjIgyL9hC5oRwRdvWTECQSUo2gkUOF4HCvZNpBqmwZg/f9YUeQ XKxR2JpPt0n/2/PhAl6sfz35IC6uhsR1skGPR2Q6PkG9sjzxd80mol4nFaBzfpZ7MBG9 yecHVw0+coGQXWt9fVcOcYFaDZ/e5clANXjwODn8KsBkZZ7UV9NEBhGUMF4ygNu+SPcP kQjXFGbed0w2+eBVsAgbwJn+nasAqnNtcPOiAnH7MbGMy+kaMF3jpidiP70wbd5WbIt6 dpUQ== X-Received: by 10.224.28.66 with SMTP id l2mr2332300qac.23.1371218383110; Fri, 14 Jun 2013 06:59:43 -0700 (PDT) Received: from devin-MacBookPro.home (pool-108-41-154-188.nycmny.fios.verizon.net. [108.41.154.188]) by mx.google.com with ESMTPSA id 11sm3102324qek.1.2013.06.14.06.59.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Jun 2013 06:59:42 -0700 (PDT) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller Subject: [PATCH] Don't call G_TUNER unless actually performing a tuning related call Date: Fri, 14 Jun 2013 09:59:26 -0400 Message-Id: <1371218366-16081-1-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.8.1.2 X-Gm-Message-State: ALoCoQkzC4873Z1hSdwppPUGt6UKrzNvkaBND3AjS1IZLfwwCOl8XFZ+uRRKxnJiHAXE1/5Y+qD3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Making G_TUNER calls can take a long time on some tuners, in particular those that load firmware or do power management. As a result, we don't want to call G_TUNER unless the user is actually doing a tuning related call. The current code makes a G_TUNER call regardless of what command the user is attempting to perform. Problem originally identified on the HVR-950q, where even doing operations like toggling from the composite to the s-video input would take over 1000ms. Signed-off-by: Devin Heitmueller --- utils/v4l2-ctl/v4l2-ctl-tuner.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp index ebe74d3..9af6b13 100644 --- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp @@ -254,6 +254,13 @@ void tuner_set(int fd) V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; double fac = 16; + if (!options[OptSetFreq] && ! options[OptSetTuner] && !options[OptListFreqBands] + && !options[OptSetModulator] && !options[OptFreqSeek]) { + /* Don't actually call G_[MODULATOR/TUNER] if we don't intend to + actually perform any tuner related function */ + return; + } + if (capabilities & V4L2_CAP_MODULATOR) { type = V4L2_TUNER_RADIO; modulator.index = tuner_index;