From patchwork Mon Aug 13 22:33:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1317491 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 27009DF25A for ; Mon, 13 Aug 2012 22:33:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754233Ab2HMWdt (ORCPT ); Mon, 13 Aug 2012 18:33:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28411 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199Ab2HMWdr (ORCPT ); Mon, 13 Aug 2012 18:33:47 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DMXlhP009889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 18:33:47 -0400 Received: from pedra (vpn1-5-253.gru2.redhat.com [10.97.5.253]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7DMXjVY007499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Aug 2012 18:33:46 -0400 Received: from v4l by pedra with local (Exim 4.76) (envelope-from ) id 1T13Ch-0007iJ-Ju; Mon, 13 Aug 2012 19:33:43 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH] [media] dvb: frontend API: Add a flag to indicate that get_frontend() can be called Date: Mon, 13 Aug 2012 19:33:38 -0300 Message-Id: <1344897218-28307-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org get_frontend() can't be called too early, as the device may not have it yet. Yet, get_frontend() on OFDM standards can happen before FE_HAS_LOCK, as the TMCC carriers (ISDB-T) or the TPS carriers (DVB-T) require a very low signal to noise relation to be detected. The other carriers use different modulations, so they require a higher SNR. Signed-off-by: Mauro Carvalho Chehab --- v2: rebase for patch at http://patchwork.linuxtv.org/patch/9562 --- Documentation/DocBook/media/dvb/frontend.xml | 13 ++++++++++++- include/linux/dvb/frontend.h | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml index 1ab2e1a..3c2b8c0 100644 --- a/Documentation/DocBook/media/dvb/frontend.xml +++ b/Documentation/DocBook/media/dvb/frontend.xml @@ -215,6 +215,7 @@ typedef enum fe_status { FE_HAS_LOCK = 0x10, FE_TIMEDOUT = 0x20, FE_REINIT = 0x40, + FE_HAS_PARAMETERS = 0x80, } fe_status_t; to indicate the current state and/or state changes of the frontend hardware: @@ -243,7 +244,17 @@ typedef enum fe_status { FE_REINIT The frontend was reinitialized, application is recommended to reset DiSEqC, tone and parameters - + +FE_HAS_PARAMETERS + +FE_GET_PROPERTY/FE_SET_PROPERTY or +FE_GET_FRONTEND can now be +called to provide the detected network parameters. +This should be risen for example when the DVB-T TPS/ISDB-T TMCC is locked. +This status can be risen before FE_HAS_SYNC, as the SNR required for +parameters detection is lower than the requirement for the other +carriers on the OFDM delivery systems. + diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index bb51edf..8ff49c6 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -131,6 +131,9 @@ typedef enum fe_sec_mini_cmd { * @FE_TIMEDOUT: no lock within the last ~2 seconds * @FE_REINIT: frontend was reinitialized, application is recommended * to reset DiSEqC, tone and parameters + * @FE_HAS_PARAMETERS: get_frontend() can now be called to provide the + * detected network parameters. This should be risen + * for example when the DVB-T TPS/ISDB-T TMCC is locked. */ typedef enum fe_status { @@ -141,6 +144,7 @@ typedef enum fe_status { FE_HAS_LOCK = 0x10, FE_TIMEDOUT = 0x20, FE_REINIT = 0x40, + FE_HAS_PARAMETERS = 0x80, } fe_status_t; typedef enum fe_spectral_inversion {