From patchwork Sat Dec 13 00:18:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 5486091 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98591BEEA8 for ; Sat, 13 Dec 2014 00:19:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3A7C201FB for ; Sat, 13 Dec 2014 00:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2EBD201EF for ; Sat, 13 Dec 2014 00:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893AbaLMATB (ORCPT ); Fri, 12 Dec 2014 19:19:01 -0500 Received: from smtp.bredband2.com ([83.219.192.166]:52966 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883AbaLMASz (ORCPT ); Fri, 12 Dec 2014 19:18:55 -0500 Received: from localhost.localdomain (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id BA80E99ED; Sat, 13 Dec 2014 01:18:45 +0100 (CET) From: Benjamin Larsson To: crope@iki.fi Cc: Linux Media Mailing List Subject: [PATCH 1/4] mn88472: implement dvb-t signal lock Date: Sat, 13 Dec 2014 01:18:42 +0100 Message-Id: <1418429925-16342-1-git-send-email-benjamin@southpole.se> X-Mailer: git-send-email 2.1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Benjamin Larsson --- drivers/staging/media/mn88472/mn88472.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index 107552a..4d80046 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -238,6 +238,7 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) struct dtv_frontend_properties *c = &fe->dtv_property_cache; int ret; unsigned int utmp; + int lock = 0; *status = 0; @@ -248,6 +249,12 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) switch (c->delivery_system) { case SYS_DVBT: + ret = regmap_read(dev->regmap[0], 0x7F, &utmp); + if (ret) + goto err; + if ((utmp&0xF) > 8) + lock = 1; + break; case SYS_DVBT2: /* FIXME: implement me */ utmp = 0x08; /* DVB-C lock value */ @@ -262,7 +269,7 @@ static int mn88472_read_status(struct dvb_frontend *fe, fe_status_t *status) goto err; } - if (utmp == 0x08) + if (lock) *status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;