From patchwork Thu Mar 21 17:51:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Schaefer X-Patchwork-Id: 17546 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1UIjdQ-0007Hz-2I; Thu, 21 Mar 2013 18:50:40 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1UIjdP-0005iA-EC; Thu, 21 Mar 2013 18:50:39 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897Ab3CURuh (ORCPT + 1 other); Thu, 21 Mar 2013 13:50:37 -0400 Received: from mail-ea0-f178.google.com ([209.85.215.178]:37149 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561Ab3CURuf (ORCPT ); Thu, 21 Mar 2013 13:50:35 -0400 Received: by mail-ea0-f178.google.com with SMTP id g14so1037750eak.37 for ; Thu, 21 Mar 2013 10:50:34 -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=2W3BwBvjhr802Mf+jCysoMlrtVI4msbHjixeQx32Xbs=; b=H+bhz9Hyg7x0E7P9jylAFV77hTD80KQgoZIMFnKFXl4+9QAiSZ3cpwF+xPNJ+rZU5B P1erAjGMNNTkqYB0m0keHzP73HIE+VJUac/hAHqVggDqxjSVbnZPa9msoVeyK+E5maJC pVS+geHXq0/q47nd7F4HshHKllvwKFEt8ibgjs26eiWPeTjj7k4/GggTCyWbeawCqsEt NZVRR/BiD2yL0xT3j6eDo6QnSKlCwc90Gdma+OfP2c6cXH7aR2jhq7GnXI+EYi7EWPJz NkYWc/i2/9mDjVcRUsyT5ZPYmhmp1RIXkPUBcjw4IKqhN65TbZCzAHy4ijtviP3N3Jbu MHVg== X-Received: by 10.14.218.71 with SMTP id j47mr84241846eep.28.1363888234671; Thu, 21 Mar 2013 10:50:34 -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.33 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 10:50:33 -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 1/8] bttv: audio_mux(): use a local variable "gpio_mute" instead of modifying the function parameter "mute" Date: Thu, 21 Mar 2013 18:51:13 +0100 Message-Id: <1363888280-28724-2-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 X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.3.21.173918 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Function audio_mux() actually deals with two types of mute: gpio mute and subdevice muting. This patch claryfies the meaning of these values, but mainly prepares the code for the next patch. Signed-off-by: Frank Schäfer Acked-by: Hans Verkuil --- drivers/media/pci/bt8xx/bttv-driver.c | 8 ++++---- 1 Datei geändert, 4 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-) diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 8610b6a..a584d82 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -992,7 +992,7 @@ static char *audio_modes[] = { static int audio_mux(struct bttv *btv, int input, int mute) { - int gpio_val, signal; + int gpio_val, signal, mute_gpio; struct v4l2_ctrl *ctrl; gpio_inout(bttv_tvcards[btv->c.type].gpiomask, @@ -1003,10 +1003,10 @@ audio_mux(struct bttv *btv, int input, int mute) btv->audio = input; /* automute */ - mute = mute || (btv->opt_automute && (!signal || !btv->users) + mute_gpio = mute || (btv->opt_automute && (!signal || !btv->users) && !btv->has_radio_tuner); - if (mute) + if (mute_gpio) gpio_val = bttv_tvcards[btv->c.type].gpiomute; else gpio_val = bttv_tvcards[btv->c.type].gpiomux[input]; @@ -1022,7 +1022,7 @@ audio_mux(struct bttv *btv, int input, int mute) } if (bttv_gpio) - bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]); + bttv_gpio_tracking(btv, audio_modes[mute_gpio ? 4 : input]); if (in_interrupt()) return 0;