From patchwork Thu Jul 5 22:59:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 50888 Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbDEO-0006yW-5K; Thu, 05 Jul 2018 23:00:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbeGEXAD (ORCPT + 1 other); Thu, 5 Jul 2018 19:00:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50684 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753806AbeGEW7n (ORCPT ); Thu, 5 Jul 2018 18:59:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/qs61wzpkgBvpI38QHjFf8RI7YoPrAAr0mas2lk3eJw=; b=P1fO8l82t9H91Lm+tcicQF14j 5t9KCJciQFnueONqznC7VFIKIXCG4lr5OqhGpPxQC+DPZ9kx/P3YwmiC/wWoSmRp09qwSbSry5uLK p4HhsFFnQ1PsCa4Gn2c2KK9vU+77TzJn0zxlhzCHjVFIL05fj/QzbZNgo2A29TrxsHtPcgoawU8WU I6Pi52TJaXhXrUWaGnbGptsAkrabzQGmy4OUfDs3iF4MJlpEv2jkKfhpS9wZ0Nzaa7V0vzbg8iSUU hNsqeZuYdzATIi/pY69KLAPxY5Zov5h3lvLf+VpDRoVvlsBgns5OlrYVN6Trk6KWWl2vgdfO08hl/ 27poayRPQ==; Received: from 179.176.112.175.dynamic.adsl.gvt.net.br ([179.176.112.175] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fbDDx-0006xv-TJ; Thu, 05 Jul 2018 22:59:41 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1fbDDv-0003Xg-Nv; Thu, 05 Jul 2018 19:59:39 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Shuah Khan , Jaedon Shin , Colin Ian King , Satendra Singh Thakur Subject: [PATCH v2 3/3] dvb_frontend: ensure that the step is ok for both FE and tuner Date: Thu, 5 Jul 2018 19:59:37 -0300 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The frequency step should take into account the tuner step, as, if tuner step is bigger than frontend step, the zigzag algorithm won't be doing the right thing, as it will be tuning multiple times at the same frequency. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-core/dvb_frontend.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 3b9dca7d7d02..67198de8a1ba 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -939,7 +939,10 @@ static void dvb_frontend_get_frequency_limits(struct dvb_frontend *fe, static u32 dvb_frontend_get_stepsize(struct dvb_frontend *fe) { struct dtv_frontend_properties *c = &fe->dtv_property_cache; - u32 step = fe->ops.info.frequency_stepsize_hz; + u32 fe_step = fe->ops.info.frequency_stepsize_hz; + u32 tuner_step = fe->ops.tuner_ops.info.frequency_step_hz; + u32 step = max(fe_step, tuner_step); + switch (c->delivery_system) { case SYS_DVBS: case SYS_DVBS2: