From patchwork Sun Jun 8 16:54:55 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: 4317021 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 664279F314 for ; Sun, 8 Jun 2014 16:55:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FDD32018A for ; Sun, 8 Jun 2014 16:55:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1CDE2017D for ; Sun, 8 Jun 2014 16:55:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753535AbaFHQzM (ORCPT ); Sun, 8 Jun 2014 12:55:12 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50491 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488AbaFHQzK (ORCPT ); Sun, 8 Jun 2014 12:55:10 -0400 Received: from [201.74.152.26] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1WtgN8-0000mN-3T; Sun, 08 Jun 2014 16:55:06 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1WtgN3-0000fq-7S; Sun, 08 Jun 2014 13:55:01 -0300 From: Mauro Carvalho Chehab Cc: Devin Heitmueller , Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 5/8] au8522: Fix demod analog mode setting Date: Sun, 8 Jun 2014 13:54:55 -0300 Message-Id: <1402246498-2532-6-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1402246498-2532-1-git-send-email-m.chehab@samsung.com> References: <1402246498-2532-1-git-send-email-m.chehab@samsung.com> 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=-7.5 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 There are several issues on the current code: 1) msleep(1) is actually equivalent to msleep(10); 2) au8522_video_set() will set reg 0xa4 to the proper value for SIF, CVBS or S-Video. No need to force it to CVBS; 3) Let's not hardcode 0x9d for CBS on audio_set. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/au8522_decoder.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index 569922232eb8..b971c20624bf 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -458,8 +458,9 @@ static void set_audio_input(struct au8522_state *state) au8522_writereg(state, AU8522_I2C_CONTROL_REG0_REG090H, 0x84); msleep(150); au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, 0x00); - msleep(1); - au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, 0x9d); + msleep(10); + au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, + AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H_CVBS); msleep(50); au8522_writereg(state, AU8522_AUDIO_VOLUME_L_REG0F2H, 0x7F); au8522_writereg(state, AU8522_AUDIO_VOLUME_R_REG0F3H, 0x7F); @@ -585,12 +586,9 @@ static int au8522_s_stream(struct v4l2_subdev *sd, int enable) au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, 0x01); - msleep(1); - au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, - AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H_CVBS); + msleep(10); au8522_video_set(state); - set_audio_input(state); state->operational_mode = AU8522_ANALOG_MODE;