From patchwork Mon Jul 21 17:55:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4597741 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 8913FC0514 for ; Mon, 21 Jul 2014 17:55:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC22620109 for ; Mon, 21 Jul 2014 17:55:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC10D20103 for ; Mon, 21 Jul 2014 17:55:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933146AbaGURzP (ORCPT ); Mon, 21 Jul 2014 13:55:15 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:44958 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbaGURzO (ORCPT ); Mon, 21 Jul 2014 13:55:14 -0400 Received: from 189-69-52-47.dsl.telesp.net.br ([189.69.52.47] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9Hns-0002JS-72; Mon, 21 Jul 2014 17:55:12 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1X9Hno-0005kq-2U; Mon, 21 Jul 2014 14:55:08 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH v2] mb86a20s: fix ISDB-T mode handling Date: Mon, 21 Jul 2014 14:55:05 -0300 Message-Id: <1405965305-22074-1-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 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 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The driver was reporting an incorrect mode, when mode 2 is selected. While testing it, noticed that neither mode 1 or guard interval 1/32 is supported by this device. Document it, and ensure that it will report _AUTO when it doesn't lock, in order to not report a wrong detection to userspace. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/mb86a20s.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 227a420f7069..b931179c70a4 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -711,11 +711,10 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe) rc = mb86a20s_readreg(state, 0x07); if (rc < 0) return rc; + c->transmission_mode = TRANSMISSION_MODE_AUTO; if ((rc & 0x60) == 0x20) { - switch (rc & 0x0c >> 2) { - case 0: - c->transmission_mode = TRANSMISSION_MODE_2K; - break; + /* Only modes 2 and 3 are supported */ + switch ((rc >> 2) & 0x03) { case 1: c->transmission_mode = TRANSMISSION_MODE_4K; break; @@ -724,7 +723,9 @@ static int mb86a20s_get_frontend(struct dvb_frontend *fe) break; } } + c->guard_interval = GUARD_INTERVAL_AUTO; if (!(rc & 0x10)) { + /* Guard interval 1/32 is not supported */ switch (rc & 0x3) { case 0: c->guard_interval = GUARD_INTERVAL_1_4;