From patchwork Mon Oct 1 12:34:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ira Krufky X-Patchwork-Id: 14775 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TIfSY-0007Dl-EU for patchwork@linuxtv.org; Mon, 01 Oct 2012 14:50:54 +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-2) with esmtp for id 1TIfSX-00041N-IC; Mon, 01 Oct 2012 14:50:54 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752967Ab2JAMuw (ORCPT ); Mon, 1 Oct 2012 08:50:52 -0400 Received: from mail.hauppauge.com ([167.206.143.4]:1961 "EHLO mail.hauppauge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503Ab2JAMuv (ORCPT ); Mon, 1 Oct 2012 08:50:51 -0400 Received: from 24.193.167.210 [24.193.167.210] by mail.hauppauge.com with XWall v3.41e ; Mon, 1 Oct 2012 08:20:19 -0400 From: Michael Krufky To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, Michael Krufky , Antti Palosaari , Devin Heitmueller Subject: [PATCH 2/2] tda18271: make 'low-power standby mode after attach' multi-instance safe Date: Mon, 1 Oct 2012 08:34:24 -0400 Message-Id: <1349094864-19293-2-git-send-email-mkrufky@linuxtv.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349094864-19293-1-git-send-email-mkrufky@linuxtv.org> References: <1349094864-19293-1-git-send-email-mkrufky@linuxtv.org> 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.10.1.123920 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 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_FROM 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 ' Ensure that unnecessary features are powered down at the end of the attach() function on attach of the tuner's first instance. If the configuration requires the loop thru or xtout features, they will remain enabled. This must *only* be done after attaching the first instance of the tuner. If there are multiple instances of the tuner, the bridge driver will need to maintain power managament by itself. Cc: Antti Palosaari Cc: Devin Heitmueller Signed-off-by: Michael Krufky --- drivers/media/tuners/tda18271-fe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c index 5f5d866..de21197 100644 --- a/drivers/media/tuners/tda18271-fe.c +++ b/drivers/media/tuners/tda18271-fe.c @@ -1285,6 +1285,10 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, (priv->id == TDA18271HDC2)) tda18271c2_rf_cal_init(fe); + /* enter standby mode, with required output features enabled */ + ret = tda18271_toggle_output(fe, 1); + tda_fail(ret); + mutex_unlock(&priv->lock); break; default: @@ -1323,9 +1327,6 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, if (tda18271_debug & (DBG_MAP | DBG_ADV)) tda18271_dump_std_map(fe); - ret = tda18271_sleep(fe); - tda_fail(ret); - return fe; fail: mutex_unlock(&tda18271_list_mutex);