From patchwork Fri Jan 17 17:18:43 2014 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: 3506381 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 3F5D5C02DC for ; Fri, 17 Jan 2014 17:17:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 602ED2015E for ; Fri, 17 Jan 2014 17:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 878AB2015D for ; Fri, 17 Jan 2014 17:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbaAQRRt (ORCPT ); Fri, 17 Jan 2014 12:17:49 -0500 Received: from mail-ee0-f54.google.com ([74.125.83.54]:45862 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbaAQRRr (ORCPT ); Fri, 17 Jan 2014 12:17:47 -0500 Received: by mail-ee0-f54.google.com with SMTP id e53so1503461eek.27 for ; Fri, 17 Jan 2014 09:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ulIxjnrC01pUQ7YnqyuiqfVPXphLrevQ6tqQNsog2SE=; b=iknaYWG+dhX2V3Mgx/PObtSqZieGas262U2S89drjk/50o/kjIwGkQ+RwEc/u7oRka IoiI+ffwuSgQrlJgiBl/SSWxCfOSlnnL4jfROsQmJrkttkfHWvYaxrLYGLoThFx95b92 j0D759qoI7aFuX3TcGna4656iGyyo4ZKhb2NIILH1La5Lf1H3HM0E8iklQaPyDSUp6YL EJoFRbPmrNXWmmdSG+QpoBdP+PJoDvUhzcb5faYBOHEdBP+tphSy0ZRIdmFFTkOwPFxI 6CAdzmbXrY/mMMmaC01vbI6aScQS6j4u99lAdOAMu4eTONqtk09ZLqxwag2U4VCR9Z5M yp4A== X-Received: by 10.15.109.196 with SMTP id cf44mr3865921eeb.12.1389979066347; Fri, 17 Jan 2014 09:17:46 -0800 (PST) Received: from Athlon64X2-5000.site (ip-178-200-115-160.unitymediagroup.de. [178.200.115.160]) by mx.google.com with ESMTPSA id l41sm28495313eep.17.2014.01.17.09.17.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2014 09:17:45 -0800 (PST) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 2/2] em28xx-audio: make sure audio is unmuted on open() Date: Fri, 17 Jan 2014 18:18:43 +0100 Message-Id: <1389979123-6919-2-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389979123-6919-1-git-send-email-fschaefer.oss@googlemail.com> References: <1389979123-6919-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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-audio.c | 42 ++++++++++++++++--------------- 1 Datei geändert, 22 Zeilen hinzugefügt(+), 20 Zeilen entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index dfdfa77..a3daf07 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -273,26 +273,28 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) mutex_lock(&dev->lock); runtime->hw = snd_em28xx_hw_capture; - if ((dev->alt == 0 || dev->is_audio_only) && dev->adev.users == 0) { - if (dev->is_audio_only) - /* vendor audio is on a separate interface */ - dev->alt = 1; - else - /* vendor audio is on the same interface as video */ - dev->alt = 7; - /* - * FIXME: The intention seems to be to select the alt - * setting with the largest wMaxPacketSize for the video - * endpoint. - * At least dev->alt should be used instead, but we - * should probably not touch it at all if it is - * already >0, because wMaxPacketSize of the audio - * endpoints seems to be the same for all. - */ - - dprintk("changing alternate number on interface %d to %d\n", - dev->ifnum, dev->alt); - usb_set_interface(dev->udev, dev->ifnum, dev->alt); + + if (dev->adev.users == 0) { + if (dev->alt == 0 || dev->is_audio_only) { + if (dev->is_audio_only) + /* audio is on a separate interface */ + dev->alt = 1; + else + /* audio is on the same interface as video */ + dev->alt = 7; + /* + * FIXME: The intention seems to be to select + * the alt setting with the largest + * wMaxPacketSize for the video endpoint. + * At least dev->alt should be used instead, but + * we should probably not touch it at all if it + * is already >0, because wMaxPacketSize of the + * audio endpoints seems to be the same for all. + */ + dprintk("changing alternate number on interface %d to %d\n", + dev->ifnum, dev->alt); + usb_set_interface(dev->udev, dev->ifnum, dev->alt); + } /* Sets volume, mute, etc */ dev->mute = 0;