From patchwork Thu May 19 18:49:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoel Pinheiro X-Patchwork-Id: 799532 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4JIoDr9000423 for ; Thu, 19 May 2011 18:50:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934044Ab1ESSuK (ORCPT ); Thu, 19 May 2011 14:50:10 -0400 Received: from blu0-omc2-s36.blu0.hotmail.com ([65.55.111.111]:38062 "EHLO blu0-omc2-s36.blu0.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933933Ab1ESSuK (ORCPT ); Thu, 19 May 2011 14:50:10 -0400 Received: from BLU0-SMTP109 ([65.55.111.72]) by blu0-omc2-s36.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 May 2011 11:50:09 -0700 X-Originating-IP: [189.78.51.20] X-Originating-Email: [pinusdtv@hotmail.com] Message-ID: Received: from atl2700.localnet ([189.78.51.20]) by BLU0-SMTP109.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 May 2011 11:50:08 -0700 From: Manoel PN To: linux-media@vger.kernel.org Subject: [RFC] add i2c_gate_ctrl to mb86a20s.c Date: Thu, 19 May 2011 15:49:58 -0300 User-Agent: KMail/1.13.5 (Linux/2.6.39-rc7+; KDE/4.4.5; x86_64; ; ) MIME-Version: 1.0 X-OriginalArrivalTime: 19 May 2011 18:50:09.0204 (UTC) FILETIME=[93A5A740:01CC1655] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 19 May 2011 18:50:14 +0000 (UTC) The register 0xfe controls the i2c-bus from the mb86a20s to tuner. Signed-off-by: Manoel Pinheiro struct mb86a20s_state *state = fe->demodulator_priv; @@ -626,6 +637,7 @@ static struct dvb_frontend_ops mb86a20s_ops = { .release = mb86a20s_release, + .i2c_gate_ctrl = mb86a20s_i2c_gate_ctrl, .init = mb86a20s_initfe, .set_frontend = mb86a20s_set_frontend, .get_frontend = mb86a20s_get_frontend, --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb/frontends/mb86a20s.c b/drivers/media/dvb/frontends/mb86a20s.c index 0f867a5..f3c4013 100644 --- a/drivers/media/dvb/frontends/mb86a20s.c +++ b/drivers/media/dvb/frontends/mb86a20s.c @@ -370,6 +370,17 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state *state, mb86a20s_i2c_writeregdata(state, state->config->demod_address, \ regdata, ARRAY_SIZE(regdata)) +static int mb86a20s_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) +{ + struct mb86a20s_state *state = fe->demodulator_priv; + + /* Enable/Disable I2C bus for tuner control */ + if (enable) + return mb86a20s_writereg(state, 0xfe, 0); + else + return mb86a20s_writereg(state, 0xfe, 1); +} + static int mb86a20s_initfe(struct dvb_frontend *fe) {