From patchwork Mon May 14 22:10:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Krufky X-Patchwork-Id: 11254 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SU3UL-0006Qn-5U for patchwork@linuxtv.org; Tue, 15 May 2012 00:11:33 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1SU3UK-0002m6-BC; Tue, 15 May 2012 00:11:33 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932544Ab2ENWLa (ORCPT ); Mon, 14 May 2012 18:11:30 -0400 Received: from mail-qa0-f49.google.com ([209.85.216.49]:44405 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932526Ab2ENWL1 (ORCPT ); Mon, 14 May 2012 18:11:27 -0400 Received: by mail-qa0-f49.google.com with SMTP id j40so5345287qab.1 for ; Mon, 14 May 2012 15:11:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=QVrG45bK5nXBYDLzUkXDl0aw2ddR4lY93krqt5d4MXc=; b=a+Zpb59JZkwUTKAj9viDBvKf+4OoChzCaleBsiZr4scx1ysgckQMuq/QcrcGYcIvw1 m+ItAPA9S+QmYZ5YNUDGwbP6yLCchoHs/R8AgsgkgY0aF8T4bcIPrKgbkDY4U54b1xu2 PS8ZJEu6s1dE+C0gYfJrHnO5dd2NSQcRnQZ3C43EQ5doyKH5m4bmy4YnuO5xtVCQgANd 3SHSM3ZbbHpwf2XpHMSDh6uRP3l5xaKF3sqxwe20shMmI9X68/KUAsbeYKP7P3Q5Q1yU Rb3UMqvY/Kzcc3W3q2tEtfW1/wQKskBgKSkgEgEyrteMPu9Fv1eAHDV8w0vjJRl59ITD v8Lg== Received: by 10.224.27.5 with SMTP id g5mr15814555qac.2.1337033486805; Mon, 14 May 2012 15:11:26 -0700 (PDT) Received: from outlands.localdomain6 (cpe-67-247-37-142.nyc.res.rr.com. [67.247.37.142]) by mx.google.com with ESMTPS id i8sm41897420qap.0.2012.05.14.15.11.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 15:11:26 -0700 (PDT) From: Michael Krufky To: linux-media@vger.kernel.org Cc: mchehab@infradead.org, Michael Krufky Subject: [PATCH 06/11] lg2160: update internal api interfaces and enable build Date: Mon, 14 May 2012 18:10:48 -0400 Message-Id: <1337033453-22119-6-git-send-email-mkrufky@linuxtv.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1337033453-22119-1-git-send-email-mkrufky@linuxtv.org> References: <1337033453-22119-1-git-send-email-mkrufky@linuxtv.org> X-Gm-Message-State: ALoCoQlLAQxXrWLeoRESG/tLgMYDjacscHU1PYN/wNDO8RlQpIZZchNjJmgTBjhNUfOiYRAnZb/L Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.14.220018 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' The lg2160 driver was written against the older dvb frontend internal api. Because of this, the previous patch that adds the lg2160 driver leaves it disabled in the build. This patch updates the driver to the new internal api and enables it in the build. Signed-off-by: Michael Krufky --- drivers/media/dvb/frontends/Kconfig | 8 ++++++++ drivers/media/dvb/frontends/lg2160.c | 25 +++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index 2124670..09e21c9 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig @@ -531,6 +531,14 @@ config DVB_LGDT3305 An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want to support this frontend. +config DVB_LG2160 + tristate "LG Electronics LG216x based" + depends on DVB_CORE && I2C + default m if DVB_FE_CUSTOMISE + help + An ATSC/MH demodulator module. Say Y when you want + to support this frontend. + config DVB_S5H1409 tristate "Samsung S5H1409 based" depends on DVB_CORE && I2C diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c index 269ab7b..daa8596 100644 --- a/drivers/media/dvb/frontends/lg2160.c +++ b/drivers/media/dvb/frontends/lg2160.c @@ -939,17 +939,15 @@ static int lg216x_read_rs_err_count(struct lg216x_state *state, u16 *err) /* ------------------------------------------------------------------------ */ -static int lg216x_get_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *param) +static int lg216x_get_frontend(struct dvb_frontend *fe) { struct lg216x_state *state = fe->demodulator_priv; int ret; lg_dbg("\n"); - param->u.vsb.modulation = VSB_8; /* FIXME (MH) */ - param->frequency = state->current_frequency; - + fe->dtv_property_cache.modulation = VSB_8; + fe->dtv_property_cache.frequency = state->current_frequency; fe->dtv_property_cache.delivery_system = SYS_ATSCMH; ret = lg216x_get_fic_version(state, @@ -1051,28 +1049,25 @@ fail: static int lg216x_get_property(struct dvb_frontend *fe, struct dtv_property *tvp) { - struct dvb_frontend_parameters param; - return (DTV_ATSCMH_FIC_VER == tvp->cmd) ? - lg216x_get_frontend(fe, ¶m) : 0; + lg216x_get_frontend(fe) : 0; } -static int lg2160_set_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *param) +static int lg2160_set_frontend(struct dvb_frontend *fe) { struct lg216x_state *state = fe->demodulator_priv; int ret; - lg_dbg("(%d, %d)\n", param->frequency, param->u.vsb.modulation); + lg_dbg("(%d)\n", fe->dtv_property_cache.frequency); if (fe->ops.tuner_ops.set_params) { - ret = fe->ops.tuner_ops.set_params(fe, param); + ret = fe->ops.tuner_ops.set_params(fe); if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); if (lg_fail(ret)) goto fail; - state->current_frequency = param->frequency; + state->current_frequency = fe->dtv_property_cache.frequency; } ret = lg2160_agc_fix(state, 0, 0); @@ -1129,7 +1124,7 @@ static int lg2160_set_frontend(struct dvb_frontend *fe, ret = lg216x_enable_fic(state, 1); lg_fail(ret); - lg216x_get_frontend(fe, param); + lg216x_get_frontend(fe); fail: return ret; } @@ -1359,7 +1354,6 @@ static struct dvb_frontend_ops lg2160_ops = { .frequency_min = 54000000, .frequency_max = 858000000, .frequency_stepsize = 62500, - .caps = FE_CAN_8VSB | FE_HAS_EXTENDED_CAPS /* FIXME (MH) */ }, .i2c_gate_ctrl = lg216x_i2c_gate_ctrl, #if 0 @@ -1389,7 +1383,6 @@ static struct dvb_frontend_ops lg2161_ops = { .frequency_min = 54000000, .frequency_max = 858000000, .frequency_stepsize = 62500, - .caps = FE_CAN_8VSB | FE_HAS_EXTENDED_CAPS /* FIXME (MH) */ }, .i2c_gate_ctrl = lg216x_i2c_gate_ctrl, #if 0