From patchwork Thu Mar 21 17:51:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 2316261 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A728E40213 for ; Thu, 21 Mar 2013 17:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751939Ab3CURuu (ORCPT ); Thu, 21 Mar 2013 13:50:50 -0400 Received: from mail-ee0-f53.google.com ([74.125.83.53]:61212 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751896Ab3CURuk (ORCPT ); Thu, 21 Mar 2013 13:50:40 -0400 Received: by mail-ee0-f53.google.com with SMTP id e53so1840698eek.12 for ; Thu, 21 Mar 2013 10:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Z6KA88bBaFoK57uzIZSe/rjdzUIHP9UlLNEAlqDnKsc=; b=FF6MB/YobbOL/Q/Y6wz93m8UUpz5u+Ua26qk/eqAbjC3fnLIMxPQ5F7mdnPKUFy5rD F/Gl2Bwd8zluziKqYNIsG8D4tYyVOQUNaMtFfIRjDy3PxiAgQPUYy7GfFDfSXtsK6AOn LDjGoUU37g0Qn428HnOos1Zm1Qv/Q8YX2XGWhUdMypwMRY43Rjh+3mDrOobzKUciodCX WxL8VxnG4B/J2NlBaQpBQAlpSs8m/A6XX3o7ynlTG9eMvwHsmyR5X23AZ/ikmsSlLMzY XLk8WPYCV5X2EcCcx1ffAnmhxiG1gcR0om6sAiMzbWaPl0rR9RBMVFFxiF5Eym15QE6N Imjw== X-Received: by 10.14.206.132 with SMTP id l4mr58375938eeo.38.1363888238664; Thu, 21 Mar 2013 10:50:38 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-109-90-213-82.unitymediagroup.de. [109.90.213.82]) by mx.google.com with ESMTPS id k7sm9808377een.8.2013.03.21.10.50.37 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 10:50:38 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: mchehab@redhat.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 5/8] bttv: separate GPIO part from function audio_mux() Date: Thu, 21 Mar 2013 18:51:17 +0100 Message-Id: <1363888280-28724-6-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363888280-28724-1-git-send-email-fschaefer.oss@googlemail.com> References: <1363888280-28724-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Move the GPIO part of function audio_mux() to a separate function audio_mux_gpio(). This prepares the code for the next patch which will separate mute and input setting. Signed-off-by: Frank Schäfer Acked-by: Hans Verkuil --- drivers/media/pci/bt8xx/bttv-driver.c | 18 ++++++++++++------ 1 Datei geändert, 12 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 81ee70d..f1cb0db 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -989,11 +989,10 @@ static char *audio_modes[] = { "audio: intern", "audio: mute" }; -static int -audio_mux(struct bttv *btv, int input, int mute) +static void +audio_mux_gpio(struct bttv *btv, int input, int mute) { int gpio_val, signal, mute_gpio; - struct v4l2_ctrl *ctrl; gpio_inout(bttv_tvcards[btv->c.type].gpiomask, bttv_tvcards[btv->c.type].gpiomask); @@ -1020,8 +1019,14 @@ audio_mux(struct bttv *btv, int input, int mute) if (bttv_gpio) bttv_gpio_tracking(btv, audio_modes[mute_gpio ? 4 : input]); - if (in_interrupt()) - return 0; +} + +static int +audio_mux(struct bttv *btv, int input, int mute) +{ + struct v4l2_ctrl *ctrl; + + audio_mux_gpio(btv, input, mute); if (btv->sd_msp34xx) { u32 in; @@ -3846,7 +3851,8 @@ static irqreturn_t bttv_irq(int irq, void *dev_id) bttv_irq_switch_video(btv); if ((astat & BT848_INT_HLOCK) && btv->opt_automute) - audio_mute(btv, btv->mute); /* trigger automute */ + /* trigger automute */ + audio_mux_gpio(btv, btv->audio_input, btv->mute); if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) { pr_info("%d: %s%s @ %08x,",