From patchwork Thu Jul 5 14:16:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1160941 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 632CD3FE4F for ; Thu, 5 Jul 2012 14:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754353Ab2GEOQg (ORCPT ); Thu, 5 Jul 2012 10:16:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281Ab2GEOQg (ORCPT ); Thu, 5 Jul 2012 10:16:36 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q65EGZJg028910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Jul 2012 10:16:35 -0400 Received: from pedra (vpn1-4-171.gru2.redhat.com [10.97.4.171]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q65EGYwe030009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Jul 2012 10:16:35 -0400 Received: from v4l by pedra with local (Exim 4.76) (envelope-from ) id 1SmmrB-0001aQ-Sc; Thu, 05 Jul 2012 11:16:33 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH 1/3] [media] tuner-core: call has_signal for both TV and radio Date: Thu, 5 Jul 2012 11:16:30 -0300 Message-Id: <1341497792-6066-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If g_tuner is called and the tuner is able to return the signal strength via has_signal(), call the tunner callback to retrieve such data for all tuner types, not only for radio ones. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tuner-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 1ad5ab6..98adeee 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -1178,6 +1178,8 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) return 0; if (vt->type == t->mode && analog_ops->get_afc) vt->afc = analog_ops->get_afc(&t->fe); + if (analog_ops->has_signal) + vt->signal = analog_ops->has_signal(&t->fe); if (vt->type != V4L2_TUNER_RADIO) { vt->capability |= V4L2_TUNER_CAP_NORM; vt->rangelow = tv_range[0] * 16; @@ -1197,8 +1199,6 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; } - if (analog_ops->has_signal) - vt->signal = analog_ops->has_signal(&t->fe); vt->audmode = t->audmode; } vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;