From patchwork Wed Jun 1 15:25:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Martin X-Patchwork-Id: 840602 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51FPTti009619 for ; Wed, 1 Jun 2011 15:25:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757594Ab1FAPZ2 (ORCPT ); Wed, 1 Jun 2011 11:25:28 -0400 Received: from tuur.schedom-europe.net ([193.109.184.94]:49614 "EHLO tuur.schedom-europe.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757055Ab1FAPZ1 (ORCPT ); Wed, 1 Jun 2011 11:25:27 -0400 Received: (qmail 26660 invoked by uid 507); 1 Jun 2011 17:25:24 +0200 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on tuur.schedom-europe.net X-Spam-Level: *********** X-Spam-Status: No, score=11.2 required=15.0 tests=BAYES_99, FH_DATE_PAST_20XX, RCVD_IN_PBL,RDNS_DYNAMIC autolearn=disabled version=3.2.5 Received: from ip115.dyn1.liege.schedom-europe.net (HELO ibiza.bxl.tuxicoman.be) (83.101.5.115) by tuur.schedom-europe.net with SMTP; 1 Jun 2011 17:25:18 +0200 Received: from [2001:6f8:310:300:224:8cff:fe0b:7d8e] (helo=borg.bxl.tuxicoman.be) by ibiza.bxl.tuxicoman.be with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1QRoEO-00030m-Sp; Wed, 01 Jun 2011 18:25:16 +0200 Date: Wed, 1 Jun 2011 17:25:16 +0200 From: Guy Martin To: , Manu Abraham Subject: [PATCH] stv090x: set status bits when there is no lock Message-ID: <20110601172516.28a153c8@borg.bxl.tuxicoman.be> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 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 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 15:25:30 +0000 (UTC) Currently, the stv090x driver only set the status bits to SCVYL when there is a lock. This patch set the right bits even if there is no lock. Signed-off-by: Guy Martin --- drivers/media/dvb/frontends/stv090x.c | 35 ++++++++++++++------------------ 1 files changed, 15 insertions(+), 20 deletions(-) -- 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/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index 52d8712..ebda419 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -3463,9 +3463,15 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe, struct dvb_fron static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) { struct stv090x_state *state = fe->demodulator_priv; - u32 reg; + u32 reg, dstatus; u8 search_state; + *status = 0; + + dstatus = STV090x_READ_DEMOD(state, DSTATUS); + if (STV090x_GETFIELD_Px(dstatus, CAR_LOCK_FIELD)) + *status |= FE_HAS_SIGNAL | FE_HAS_CARRIER; + reg = STV090x_READ_DEMOD(state, DMDSTATE); search_state = STV090x_GETFIELD_Px(reg, HEADER_MODE_FIELD); @@ -3474,41 +3480,30 @@ static int stv090x_read_status(struct dvb_frontend *fe, enum fe_status *status) case 1: /* first PLH detected */ default: dprintk(FE_DEBUG, 1, "Status: Unlocked (Searching ..)"); - *status = 0; break; case 2: /* DVB-S2 mode */ dprintk(FE_DEBUG, 1, "Delivery system: DVB-S2"); - reg = STV090x_READ_DEMOD(state, DSTATUS); - if (STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD)) { + if (STV090x_GETFIELD_Px(dstatus, LOCK_DEFINITIF_FIELD)) { reg = STV090x_READ_DEMOD(state, PDELSTATUS1); if (STV090x_GETFIELD_Px(reg, PKTDELIN_LOCK_FIELD)) { + *status |= FE_HAS_VITERBI; reg = STV090x_READ_DEMOD(state, TSSTATUS); - if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { - *status = FE_HAS_SIGNAL | - FE_HAS_CARRIER | - FE_HAS_VITERBI | - FE_HAS_SYNC | - FE_HAS_LOCK; - } + if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) + *status |= FE_HAS_SYNC | FE_HAS_LOCK; } } break; case 3: /* DVB-S1/legacy mode */ dprintk(FE_DEBUG, 1, "Delivery system: DVB-S"); - reg = STV090x_READ_DEMOD(state, DSTATUS); - if (STV090x_GETFIELD_Px(reg, LOCK_DEFINITIF_FIELD)) { + if (STV090x_GETFIELD_Px(dstatus, LOCK_DEFINITIF_FIELD)) { reg = STV090x_READ_DEMOD(state, VSTATUSVIT); if (STV090x_GETFIELD_Px(reg, LOCKEDVIT_FIELD)) { + *status |= FE_HAS_VITERBI; reg = STV090x_READ_DEMOD(state, TSSTATUS); - if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) { - *status = FE_HAS_SIGNAL | - FE_HAS_CARRIER | - FE_HAS_VITERBI | - FE_HAS_SYNC | - FE_HAS_LOCK; - } + if (STV090x_GETFIELD_Px(reg, TSFIFO_LINEOK_FIELD)) + *status |= FE_HAS_SYNC | FE_HAS_LOCK; } } break;