From patchwork Sun Jan 6 12:40:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 1937661 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 637AE3FED4 for ; Sun, 6 Jan 2013 12:41:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755568Ab3AFMkv (ORCPT ); Sun, 6 Jan 2013 07:40:51 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:57361 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755264Ab3AFMku (ORCPT ); Sun, 6 Jan 2013 07:40:50 -0500 Received: by mail-ee0-f46.google.com with SMTP id e53so8717926eek.5 for ; Sun, 06 Jan 2013 04:40:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding; bh=br1ISU9O70VRzED2QWadhAZb3j/GIbvN6wQQWvKb/7c=; b=UWcq50M/FJesyWYKKI6siANIaRU6xj82sz41RoZISRFitCbqzO9ueJhxhcegzrYlJn cbVZakNklntz5d7xe52WvqJoov6us8UN0KJ7Kt3AzqFgvmIQjDCso5R40/i+ZTds9Xlb Xnc+c4IS5IOFCG2HFmYVkTcgRfo288JJ3Cc3NihZhgCvi3IZGk3Jat6APbD+RKnixb0F k6L8YxETHK0vsSxbCK+3MQUGiGsLdFssC71y9ihvjk4cYka4yM26ocR3m5sk+S3yVN/O RvoMhNwpI2RGqI21MpTZAdRo71mlR5uWEg4EeSwSxZpjg1TdBYwcRaESBXqeM6gSq8I9 b/Sw== X-Received: by 10.14.223.200 with SMTP id v48mr159728540eep.24.1357476049461; Sun, 06 Jan 2013 04:40:49 -0800 (PST) Received: from [192.168.1.100] (92.41.208.115.threembb.co.uk. [92.41.208.115]) by mx.google.com with ESMTPS id f49sm124115426eep.12.2013.01.06.04.40.46 (version=SSLv3 cipher=OTHER); Sun, 06 Jan 2013 04:40:48 -0800 (PST) Message-ID: <1357476042.16016.8.camel@canaries64> Subject: [PATCH] ts2020: call get_rf_strength from frontend From: Malcolm Priestley To: linux-media Cc: "Igor M. Liplianin" , Konstantin Dimitrov Date: Sun, 06 Jan 2013 12:40:42 +0000 X-Mailer: Evolution 3.6.2-0ubuntu2 Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Restore ds3000.c read_signal_strength. Call tuner get_rf_strength from frontend read_signal_strength. We are able to do a NULL check and doesn't limit the tuner attach to the frontend attach area. At the moment the lmedm04 tuner attach is stuck in frontend attach area. Signed-off-by: Malcolm Priestley --- drivers/media/dvb-frontends/ds3000.c | 10 ++++++++++ drivers/media/dvb-frontends/m88rs2000.c | 4 +++- drivers/media/dvb-frontends/ts2020.c | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index d128f85..1e344b0 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -533,6 +533,15 @@ static int ds3000_read_ber(struct dvb_frontend *fe, u32* ber) return 0; } +static int ds3000_read_signal_strength(struct dvb_frontend *fe, + u16 *signal_strength) +{ + if (fe->ops.tuner_ops.get_rf_strength) + fe->ops.tuner_ops.get_rf_strength(fe, signal_strength); + + return 0; +} + /* calculate DS3000 snr value in dB */ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) { @@ -1102,6 +1111,7 @@ static struct dvb_frontend_ops ds3000_ops = { .i2c_gate_ctrl = ds3000_i2c_gate_ctrl, .read_status = ds3000_read_status, .read_ber = ds3000_read_ber, + .read_signal_strength = ds3000_read_signal_strength, .read_snr = ds3000_read_snr, .read_ucblocks = ds3000_read_ucblocks, .set_voltage = ds3000_set_voltage, diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 283c90f..4da5272 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -446,7 +446,9 @@ static int m88rs2000_read_ber(struct dvb_frontend *fe, u32 *ber) static int m88rs2000_read_signal_strength(struct dvb_frontend *fe, u16 *strength) { - *strength = 0; + if (fe->ops.tuner_ops.get_rf_strength) + fe->ops.tuner_ops.get_rf_strength(fe, strength); + return 0; } diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c index f50e237..ad7ad85 100644 --- a/drivers/media/dvb-frontends/ts2020.c +++ b/drivers/media/dvb-frontends/ts2020.c @@ -363,7 +363,6 @@ struct dvb_frontend *ts2020_attach(struct dvb_frontend *fe, memcpy(&fe->ops.tuner_ops, &ts2020_tuner_ops, sizeof(struct dvb_tuner_ops)); - fe->ops.read_signal_strength = fe->ops.tuner_ops.get_rf_strength; return fe; }