From patchwork Tue Feb 1 22:40:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor M. Liplianin" X-Patchwork-Id: 5772 Return-path: Envelope-to: mchehab@pedra Delivery-date: Tue, 01 Feb 2011 20:41:28 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PkOud-0002ln-F6 for mchehab@pedra; Tue, 01 Feb 2011 20:41:27 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Tue, 01 Feb 2011 20:41:27 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PkOtw-0006r7-Bc; Tue, 01 Feb 2011 22:40:44 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751294Ab1BAWkm (ORCPT + 1 other); Tue, 1 Feb 2011 17:40:42 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:38207 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221Ab1BAWkl (ORCPT ); Tue, 1 Feb 2011 17:40:41 -0500 Received: by fxm20 with SMTP id 20so7348272fxm.19 for ; Tue, 01 Feb 2011 14:40:40 -0800 (PST) Received: by 10.223.86.199 with SMTP id t7mr921133fal.29.1296600040160; Tue, 01 Feb 2011 14:40:40 -0800 (PST) Received: from useri.localnet ([93.125.74.3]) by mx.google.com with ESMTPS id z1sm8107237fau.21.2011.02.01.14.40.38 (version=SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 14:40:39 -0800 (PST) Subject: [PATCH 1/9 v2] ds3000: fill in demod init function To: mchehab@infradead.org, linux-media@vger.kernel.org From: "Igor M. Liplianin" Date: Wed, 2 Feb 2011 00:40:03 +0200 MIME-Version: 1.0 Message-Id: <201102020040.03555.liplianin@me.by> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Make some initializations in init, not in tune function Signed-off-by: Igor M. Liplianin --- drivers/media/dvb/frontends/ds3000.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c index 125dfad..4773916 100644 --- a/drivers/media/dvb/frontends/ds3000.c +++ b/drivers/media/dvb/frontends/ds3000.c @@ -1092,10 +1092,6 @@ static int ds3000_tune(struct dvb_frontend *fe, /* Reset status register */ status = 0; /* Tune */ - /* TS2020 init */ - ds3000_tuner_writereg(state, 0x42, 0x73); - ds3000_tuner_writereg(state, 0x05, 0x01); - ds3000_tuner_writereg(state, 0x62, 0xf5); /* unknown */ ds3000_tuner_writereg(state, 0x07, 0x02); ds3000_tuner_writereg(state, 0x10, 0x00); @@ -1345,7 +1341,19 @@ static enum dvbfe_algo ds3000_get_algo(struct dvb_frontend *fe) */ static int ds3000_initfe(struct dvb_frontend *fe) { + struct ds3000_state *state = fe->demodulator_priv; + int ret; + dprintk("%s()\n", __func__); + /* hard reset */ + ds3000_writereg(state, 0x08, 0x01 | ds3000_readreg(state, 0x08)); + msleep(1); + + /* TS2020 init */ + ds3000_tuner_writereg(state, 0x42, 0x73); + ds3000_tuner_writereg(state, 0x05, 0x01); + ds3000_tuner_writereg(state, 0x62, 0xf5); + return 0; }