From patchwork Fri Oct 31 13:13:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 5204331 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 A9A6CC11AC for ; Fri, 31 Oct 2014 13:14:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACADC20173 for ; Fri, 31 Oct 2014 13:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B18D82015D for ; Fri, 31 Oct 2014 13:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932672AbaJaNOY (ORCPT ); Fri, 31 Oct 2014 09:14:24 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:53717 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932646AbaJaNOV (ORCPT ); Fri, 31 Oct 2014 09:14:21 -0400 Received: by mail-pd0-f174.google.com with SMTP id p10so7219123pdj.19 for ; Fri, 31 Oct 2014 06:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=S2ixeL7D8oghwmviWmTEcuVgSDMtYwJFLBt4PmXfKTQ=; b=iNjhld3z5bkpO5Cpp4BK911pr2z8YRl6GmXLwIS/RGlt9wvIG8MGMCOyQIaQDs9XzU PlxA3u5i+Hl3kaQ/rxpEHjQRWGq6S+Euy5F35DK4cJapSuJNSMN12/yKpzPSc8/wtvzM 1x+l8Io8dBlJp7OpyVDLllcTwghIcISP0fGzn2Cq2SWHai4KaCimQcGTmVRxG+Q7P4gD FFZKYY761hA+cf0pqAhgQf87AgS+AvC2vFiUK5xNDghVizpjqrQ1M+QoVpVJNs0s6M5O VXKI6bDkd+sEDcAajb/8Upf0BvTO65K626gztmPaYXjat0GaUiujyLSt1n3ZtPOAtRnJ 7yMw== X-Received: by 10.68.216.70 with SMTP id oo6mr24875284pbc.124.1414761261091; Fri, 31 Oct 2014 06:14:21 -0700 (PDT) Received: from seabird.localdomain.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by mx.google.com with ESMTPSA id mo1sm9895815pbc.69.2014.10.31.06.14.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Oct 2014 06:14:20 -0700 (PDT) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: m.chehab@samsung.com, Akihiro Tsukada Subject: [PATCH v3 3/7] v4l-utils/libdvbv5: wrong frequency in the output of satellite delsys scans Date: Fri, 31 Oct 2014 22:13:40 +0900 Message-Id: <1414761224-32761-4-git-send-email-tskd08@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1414761224-32761-1-git-send-email-tskd08@gmail.com> References: <1414761224-32761-1-git-send-email-tskd08@gmail.com> 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Akihiro Tsukada In the output of satellite delsys's scanning, channel frequencies were offset by the LNB's LO frequency, which should be not. Signed-off-by: Akihiro Tsukada --- lib/libdvbv5/dvb-fe.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c index f535311..01b2848 100644 --- a/lib/libdvbv5/dvb-fe.c +++ b/lib/libdvbv5/dvb-fe.c @@ -604,8 +604,12 @@ int dvb_fe_get_parms(struct dvb_v5_fe_parms *p) } /* copy back params from temporary fe_prop */ - for (i = 0; i < n; i++) + for (i = 0; i < n; i++) { + if (dvb_fe_is_satellite(p->current_sys) + && fe_prop[i].cmd == DTV_FREQUENCY) + fe_prop[i].u.data += parms->freq_offset; dvb_fe_store_parm(&parms->p, fe_prop[i].cmd, fe_prop[i].u.data); + } if (parms->p.verbose) { dvb_log("Got parameters for %s:", @@ -683,8 +687,19 @@ int dvb_fe_set_parms(struct dvb_v5_fe_parms *p) dvb_logdbg("LNA is %s", parms->p.lna ? "ON" : "OFF"); } - if (dvb_fe_is_satellite(tmp_parms.p.current_sys)) + if (dvb_fe_is_satellite(tmp_parms.p.current_sys)) { dvb_sat_set_parms(&tmp_parms.p); + /* + * even though the frequncy prop is kept un-modified here, + * a later call to dvb_fe_get_parms() issues FE_GET_PROPERTY + * ioctl and overwrites it with the offset-ed value from + * the FE. So we need to save the offset here and + * re-add it in dvb_fe_get_parms(). + * note that dvbv5-{scan,zap} utilities call dvb_fe_get_parms() + * indirectly from check_frontend() via dvb_fe_get_stats(). + */ + parms->freq_offset = tmp_parms.freq_offset; + } /* Filter out any user DTV_foo property such as DTV_POLARIZATION */ tmp_parms.n_props = dvb_copy_fe_props(tmp_parms.dvb_prop,