From patchwork Tue Feb 4 20:27:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 3579071 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8EA849F2E9 for ; Tue, 4 Feb 2014 20:27:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E44620179 for ; Tue, 4 Feb 2014 20:27:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C422520131 for ; Tue, 4 Feb 2014 20:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754840AbaBDU1i (ORCPT ); Tue, 4 Feb 2014 15:27:38 -0500 Received: from mail-we0-f176.google.com ([74.125.82.176]:41204 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754490AbaBDU1h (ORCPT ); Tue, 4 Feb 2014 15:27:37 -0500 Received: by mail-we0-f176.google.com with SMTP id q58so4625725wes.21 for ; Tue, 04 Feb 2014 12:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:content-type:mime-version :content-transfer-encoding; bh=P0EnKU3GP9hNv/JnEW4n6hclbTnlmq2HHBv370KIfO0=; b=Eof8NCEHItoktmcpbTGIzBJqzLlXif9pRQBafn9LIm3raB8/rDXSuMjbX1YfOD3DYq 9EQiQ5IEMi4/x9PlQCn8AEF89GOLZIz31BMfFeFZsou3fl1SoB4/dzQfyf9CGknuAsb7 /EVMTg/ekZr3Nz0BbESa9n6wG83iNCt0wS8jUxo3rZ6Pc06mbaIP/qGjrOU2VwoOg1KE PFKlq5dQU6Wq7svgI8QBtMjMnfvNJO2wiO5evsVC9/9Z+NrNuf88p7hLo0mMa7YPmDiM 9SyxuhHzdPBLsnuhSgvYnWUxqAhE5zsGRAj/x0IEnpIhakQGZGK4Epqt2JLlpMhwyXKy Kc1Q== X-Received: by 10.194.81.196 with SMTP id c4mr3156118wjy.57.1391545655813; Tue, 04 Feb 2014 12:27:35 -0800 (PST) Received: from [192.168.1.100] (188.28.136.71.threembb.co.uk. [188.28.136.71]) by mx.google.com with ESMTPSA id ju6sm55415605wjc.1.2014.02.04.12.27.34 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 04 Feb 2014 12:27:35 -0800 (PST) Message-ID: <1391545644.11112.26.camel@canaries32-MCP7A> Subject: [PATCH 2/2] m88rs2000: add m88rs2000_get_tune_settings From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Tue, 04 Feb 2014 20:27:24 +0000 X-Mailer: Evolution 3.10.3-0ubuntu3 Mime-Version: 1.0 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 Add min delay of 2000 ms on symbol rate more than 3000000 and delay of 3000ms less than this. This prevents crashing the frontend on continuous transponder scans. Otherwise other dvb_frontend_tune_settings are the same as default. This makes very little time difference to good channel scans, but slows down the set frontend where lock can never be achieved i.e. DVB-S2. Signed-off-by: Malcolm Priestley Cc: stable@vger.kernel.org # v3.9+ --- drivers/media/dvb-frontends/m88rs2000.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index ee2fec8..32cffca 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -715,6 +715,22 @@ static int m88rs2000_get_frontend(struct dvb_frontend *fe) return 0; } +static int m88rs2000_get_tune_settings(struct dvb_frontend *fe, + struct dvb_frontend_tune_settings *tune) +{ + struct dtv_frontend_properties *c = &fe->dtv_property_cache; + + if (c->symbol_rate > 3000000) + tune->min_delay_ms = 2000; + else + tune->min_delay_ms = 3000; + + tune->step_size = c->symbol_rate / 16000; + tune->max_drift = c->symbol_rate / 2000; + + return 0; +} + static int m88rs2000_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) { struct m88rs2000_state *state = fe->demodulator_priv; @@ -766,6 +782,7 @@ static struct dvb_frontend_ops m88rs2000_ops = { .set_frontend = m88rs2000_set_frontend, .get_frontend = m88rs2000_get_frontend, + .get_tune_settings = m88rs2000_get_tune_settings, }; struct dvb_frontend *m88rs2000_attach(const struct m88rs2000_config *config,