From patchwork Tue Aug 7 02:46:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1282721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6ECC83FC8A for ; Tue, 7 Aug 2012 02:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548Ab2HGCsh (ORCPT ); Mon, 6 Aug 2012 22:48:37 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:52727 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932480Ab2HGCrz (ORCPT ); Mon, 6 Aug 2012 22:47:55 -0400 Received: by mail-vc0-f174.google.com with SMTP id fk26so3432709vcb.19 for ; Mon, 06 Aug 2012 19:47:55 -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:in-reply-to:references :x-gm-message-state; bh=TTg0fhttkfPE0EJQH2VEO1FluTiyIF5/XLOzdEXj2Sg=; b=fHed1EJaa+aVNYAoMEbENfhYO/f0z0TMni285scSDvezeHBP0qOLV6VMsdRzNfy5YZ bagAWgIa5svt9XhsmAg6eclcrzDe5SZtPdmByZvFk/kLCZXzJFk/pAymF0asowscn1pq XadcJLSouDaLk63mohytBOrJ1/H+Z6+4dNYyq0jdnLZjXr/HBk5cqFXqmoPrduWIWu1u 2QyDZthOfQPB/QZOmtXw43+D2wTNlxCEHHQ7KyVVY6Dp6ToPMFV0Tqy8XXq/9grZnN0P WP4G5Oj5EG9ZgCHB0kyEBX0Qpp4h9SY/V2tlstV2UqBjeqTOvR9Ou+df4U03ereAm6oT 1zrQ== Received: by 10.220.218.144 with SMTP id hq16mr7953438vcb.61.1344307675022; Mon, 06 Aug 2012 19:47:55 -0700 (PDT) Received: from localhost.localdomain (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id e9sm17555638vdf.21.2012.08.06.19.47.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 19:47:54 -0700 (PDT) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller Subject: [PATCH 09/24] au0828: make sure video standard is setup in tuner-core Date: Mon, 6 Aug 2012 22:46:59 -0400 Message-Id: <1344307634-11673-10-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> References: <1344307634-11673-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQmoOJYVP9Q2I/lk4/HGtgAhb62SflOtVXm5i0RkRILhT6pAwO3yHNqT10hc9di0XzOv+ESk Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If the user performs a tuning attempt without explicitly calling the s_std ioctl(), a value of zero is sent from tuner-core to xc5000. This causes the xc5000 driver to leave the standard unchanged. The problem was masked by the fact that the xc5000 driver defaulted to NTSC, but if you happened to perform an ATSC/ClearQAM tuning attempt and then do an analog tune, the net effect is an analog tune with the standard still set to DTV6. Keep track of whether the standard has ever been sent to tuner-core. We don't make an s_std subdev call explicitly during probe because that will cause a firmware load (which is very time consuming on the 950q). With the logic in this patch, the s_std call will occur automatically on the s_freq call if it hasn't already been set. Signed-off-by: Devin Heitmueller --- drivers/media/video/au0828/au0828-video.c | 10 ++++++++++ drivers/media/video/au0828/au0828.h | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index b1f8d18..f3e6e3f 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -1330,6 +1330,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm) buffer, which is currently hardcoded at 720x480 */ v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, *norm); + dev->std_set_in_tuner_core = 1; return 0; } @@ -1540,6 +1541,15 @@ static int vidioc_s_frequency(struct file *file, void *priv, dev->ctrl_freq = freq->frequency; + if (dev->std_set_in_tuner_core == 0) { + /* If we've never sent the standard in tuner core, do so now. We + don't do this at device probe because we don't want to incur + the cost of a firmware load */ + v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, + dev->vdev->tvnorms); + dev->std_set_in_tuner_core = 1; + } + v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, freq); au0828_analog_stream_reset(dev); diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h index 61cd63e..66a56ef 100644 --- a/drivers/media/video/au0828/au0828.h +++ b/drivers/media/video/au0828/au0828.h @@ -225,6 +225,7 @@ struct au0828_dev { unsigned int frame_count; int ctrl_freq; int input_type; + int std_set_in_tuner_core; unsigned int ctrl_input; enum au0828_dev_state dev_state; enum au0828_stream_state stream_state;