From patchwork Sun Jun 8 16:54:53 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: 4317071 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 47C5D9F3B4 for ; Sun, 8 Jun 2014 16:56:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 737692015E for ; Sun, 8 Jun 2014 16:56:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AE022017D for ; Sun, 8 Jun 2014 16:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753482AbaFHQ41 (ORCPT ); Sun, 8 Jun 2014 12:56:27 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50598 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753449AbaFHQ40 (ORCPT ); Sun, 8 Jun 2014 12:56:26 -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 1WtgOO-0000mG-CM; Sun, 08 Jun 2014 16:56:24 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1WtgN3-0000fi-67; 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 3/8] au8522: be sure that we'll setup audio routing at the right time Date: Sun, 8 Jun 2014 13:54:53 -0300 Message-Id: <1402246498-2532-4-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 Let's set the the audio routing also at stream start. With this change, we don't risk enabling the analog demux while not streaming, reducing the risk of interfering with a DVB demux that might be happening. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/au8522_decoder.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/au8522_decoder.c b/drivers/media/dvb-frontends/au8522_decoder.c index b2b9f04a1340..53f6dea6b3cb 100644 --- a/drivers/media/dvb-frontends/au8522_decoder.c +++ b/drivers/media/dvb-frontends/au8522_decoder.c @@ -429,8 +429,9 @@ static void disable_audio_input(struct au8522_state *state) } /* 0=disable, 1=SIF */ -static void set_audio_input(struct au8522_state *state, int aud_input) +static void set_audio_input(struct au8522_state *state) { + int aud_input = state->aud_input; int i; /* Note that this function needs to be used in conjunction with setting @@ -580,8 +581,6 @@ static int au8522_s_stream(struct v4l2_subdev *sd, int enable) struct au8522_state *state = to_state(sd); if (enable) { - state->operational_mode = AU8522_ANALOG_MODE; - /* * Clear out any state associated with the digital side of the * chip, so that when it gets powered back up it won't think @@ -596,6 +595,10 @@ static int au8522_s_stream(struct v4l2_subdev *sd, int enable) AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H_CVBS); au8522_video_set(state); + + set_audio_input(state); + + state->operational_mode = AU8522_ANALOG_MODE; } else { /* This does not completely power down the device (it only reduces it from around 140ma to 80ma) */ @@ -632,7 +635,12 @@ static int au8522_s_audio_routing(struct v4l2_subdev *sd, u32 input, u32 output, u32 config) { struct au8522_state *state = to_state(sd); - set_audio_input(state, input); + + state->aud_input = input; + + if (state->operational_mode == AU8522_ANALOG_MODE) + set_audio_input(state); + return 0; }