From patchwork Sun Jun 25 11:26:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9808109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 523CD6088A for ; Sun, 25 Jun 2017 11:26:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42B17286C5 for ; Sun, 25 Jun 2017 11:26:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31578286EC; Sun, 25 Jun 2017 11:26:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BC36271CB for ; Sun, 25 Jun 2017 11:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbdFYL0w (ORCPT ); Sun, 25 Jun 2017 07:26:52 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35533 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbdFYL0u (ORCPT ); Sun, 25 Jun 2017 07:26:50 -0400 Received: by mail-wr0-f196.google.com with SMTP id z45so24022064wrb.2 for ; Sun, 25 Jun 2017 04:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A1zhdj4lcJs3bOo82AGMN82d+SKiRIPcT/Dwu6aNKPc=; b=X8clBB04XN483LvL024LYLFgUhZxHWOI2vsT5BG+6BwougkfdIIacDkS1qG9cU16PW mI86Npomxs0KaYVukY1p/3a9U+mrNHHv0chDOyy+/pohepB3QeE8vTvFXwidw1Od9zCW W90XdoOHgHLxd7CZcLNkovkme59IjZZfMdtWCBsN3ltiyQpD0fuRYO1fgKrW/FUn+b3u +gjEMDTxcVvOUt/3N/iCPnCYqQX7dTKWRsXuVWx6hRILrcebF2qJC4JskNV4qfUJaSlb tWwdg3Sbw3mePRV42ill0rqT7/JvsB7+gJQijKViiPY6d76PaxwsIuquA2QTLuSABL5D b7GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A1zhdj4lcJs3bOo82AGMN82d+SKiRIPcT/Dwu6aNKPc=; b=VuJ2H0XlRfS3gEujgRYZ5sG+WqI6p+yvmRvu9h8+3pCIGh6RfBVRJXNpK1FzALDLKp F8Lq3F0FoCzZQ8QRDiVr6iOcsDTvHhz8G6IJPCiN4LoFLPdx2izS0GZrVamEmbbVM7/M lzCxiPHIlEcTcOAW92KNIi8+AU+CJ31fy35VNC2NmomYXVEk8KCsrJhvq002oSuhSDkp Aw+960pGFX3hBCoSRxZfRYYs5hxFSkjcwftOsvfCMg+rBCQcRk+1kNntxZRAEXyaFDfy XR2UVS35Wjdly1CTCY4ryuL+gzPNBKwkZSNRF05fgnm3R0FeT5auB3OKhvaFEx3Sho6m fUCg== X-Gm-Message-State: AKS2vOwt8Rd3FkJNs+70XAw4x+WxKv1dc04D9/NYmMmnFlit+P93YkKJ +yEDVOyMuRoxhnBJ X-Received: by 10.28.130.213 with SMTP id e204mr9976427wmd.33.1498390009205; Sun, 25 Jun 2017 04:26:49 -0700 (PDT) Received: from dvbdev.wuest.de (ip-37-24-178-151.hsi14.unitymediagroup.de. [37.24.178.151]) by smtp.gmail.com with ESMTPSA id b131sm9896099wma.11.2017.06.25.04.26.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Jun 2017 04:26:48 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: liplianin@netup.ru, rjkm@metzlerbros.de, crope@iki.fi Subject: [PATCH v3 1/4] [media] dvb-frontends/stv0367: Improve DVB-C/T frontend status Date: Sun, 25 Jun 2017 13:26:43 +0200 Message-Id: <20170625112646.7973-2-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170625112646.7973-1-d.scheller.oss@gmail.com> References: <20170625112646.7973-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mauro Carvalho Chehab The stv0367 driver provide a lot of status on its state machine. Change the logic to provide more information about frontend locking status. Also, while any detailed status isn't available, provide a more complete FE_STATUS for DVB-T. Signed-off-by: Mauro Carvalho Chehab Tested-by: Daniel Scheller Signed-off-by: Daniel Scheller --- drivers/media/dvb-frontends/stv0367.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index f266c18c574c..9e5432b761b5 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -1507,7 +1507,8 @@ static int stv0367ter_read_status(struct dvb_frontend *fe, *status = 0; if (stv0367_readbits(state, F367TER_LK)) { - *status |= FE_HAS_LOCK; + *status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI + | FE_HAS_SYNC | FE_HAS_LOCK; dprintk("%s: stv0367 has locked\n", __func__); } @@ -2155,6 +2156,18 @@ static int stv0367cab_read_status(struct dvb_frontend *fe, *status = 0; + if (state->cab_state->state > FE_CAB_NOSIGNAL) + *status |= FE_HAS_SIGNAL; + + if (state->cab_state->state > FE_CAB_NOCARRIER) + *status |= FE_HAS_CARRIER; + + if (state->cab_state->state >= FE_CAB_DEMODOK) + *status |= FE_HAS_VITERBI; + + if (state->cab_state->state >= FE_CAB_DATAOK) + *status |= FE_HAS_SYNC; + if (stv0367_readbits(state, (state->cab_state->qamfec_status_reg ? state->cab_state->qamfec_status_reg : F367CAB_QAMFEC_LOCK))) { *status |= FE_HAS_LOCK;