From patchwork Mon Sep 1 20:23:59 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: 4822011 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 EAF729F32F for ; Mon, 1 Sep 2014 20:22:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F19C720160 for ; Mon, 1 Sep 2014 20:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E98862015D for ; Mon, 1 Sep 2014 20:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbaIAUWm (ORCPT ); Mon, 1 Sep 2014 16:22:42 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:59609 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804AbaIAUWl (ORCPT ); Mon, 1 Sep 2014 16:22:41 -0400 Received: by mail-la0-f48.google.com with SMTP id gl10so6567705lab.21 for ; Mon, 01 Sep 2014 13:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=iJaCI3TYVStIBu6zSKFhcdhGDroQdOJw6zIvLMj5ZwY=; b=G9uR75jBiOFhbSTthFB8KPqd1Zw2PjaNOAyh9Ou14i+353GVHmEBo11kNOfoZ9c4TV 7SoOY/Xno9Ar+HscK2/AXZ0p5NE5ZTqHz4WbzGwr82FclaaZJ8sKOZQodSbYQmASs9ib 8bEXwEUwlrtxOgssykI5XpvQzitRMoKHJR5hunixGHQ6IQcXyUiR0wDCzH2fICWGQi0V EE3Cp4doGaVd6m7Gal7m11oZR0en1XZ0qsvUJv5fen/gGTSwWgYYGCheyg0In7hJM/MA WpFki4jgSeiMSUKBwx5XjBkENc3n2T27ZEoHGWKmouULLayiNvQG32Y8s8yhZZNmc/E8 IcRw== X-Received: by 10.112.50.52 with SMTP id z20mr4540029lbn.87.1409602959943; Mon, 01 Sep 2014 13:22:39 -0700 (PDT) Received: from Athlon64X2-5000.lan (ip-178-200-115-56.hsi07.unitymediagroup.de. [178.200.115.56]) by mx.google.com with ESMTPSA id gn7sm2493980lbc.10.2014.09.01.13.22.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Sep 2014 13:22:39 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: oravecz@nytud.mta.hu, linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= , Subject: [PATCH for 3.17] Revert "[media] em28xx: check if a device has audio earlier" Date: Mon, 1 Sep 2014 22:23:59 +0200 Message-Id: <1409603039-15774-1-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.8.4.5 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=-8.4 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=unavailable 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 This reverts commit b99f0aadd33fad269c8e62b5bec8b5c012a44a56 Author: Mauro Carvalho Chehab Date: Fri Dec 27 00:16:13 2013 -0300 [media] em28xx: check if a device has audio earlier Better to split chipset detection from the audio setup. So, move the detection code to em28xx_init_dev(). It broke analog audio of the Hauppauge winTV HVR 900 and very likely many other em28xx devices. Background: The local variable has_audio in em28xx_usb_probe() describes if the currently probed _usb_interface_ has an audio endpoint, while dev->audio_mode.has_audio means that the _device_ as a whole provides analog audio. Hence it is wrong to set dev->audio_mode.has_audio = has_audio in em28xx_usb_probe(). As result, audio support is no longer detected and configured on devices which have the audio endpoint on a separate interface, because em28xx_audio_setup() bails out immediately at the beginning. Revert the faulty commit to restore the old audio detection procedure, which checks the chip configuration register to determine if the device has analog audio. Cc: # 3.14 to 3.16 Reported-by: Oravecz Csaba Tested-by: Oravecz Csaba Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-cards.c | 11 ----------- drivers/media/usb/em28xx/em28xx-core.c | 12 +++++++++++- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index a7e24848..912ea1b 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -3098,16 +3098,6 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, } } - if (dev->chip_id == CHIP_ID_EM2870 || - dev->chip_id == CHIP_ID_EM2874 || - dev->chip_id == CHIP_ID_EM28174 || - dev->chip_id == CHIP_ID_EM28178) { - /* Digital only device - don't load any alsa module */ - dev->audio_mode.has_audio = false; - dev->has_audio_class = false; - dev->has_alsa_audio = false; - } - if (chip_name != default_chip_name) printk(KERN_INFO DRIVER_NAME ": chip ID is %s\n", chip_name); @@ -3377,7 +3367,6 @@ static int em28xx_usb_probe(struct usb_interface *interface, dev->alt = -1; dev->is_audio_only = has_audio && !(has_video || has_dvb); dev->has_alsa_audio = has_audio; - dev->audio_mode.has_audio = has_audio; dev->has_video = has_video; dev->ifnum = ifnum; diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 523d7e9..0f6caa4 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -506,8 +506,18 @@ int em28xx_audio_setup(struct em28xx *dev) int vid1, vid2, feat, cfg; u32 vid; - if (!dev->audio_mode.has_audio) + if (dev->chip_id == CHIP_ID_EM2870 || + dev->chip_id == CHIP_ID_EM2874 || + dev->chip_id == CHIP_ID_EM28174 || + dev->chip_id == CHIP_ID_EM28178) { + /* Digital only device - don't load any alsa module */ + dev->audio_mode.has_audio = false; + dev->has_audio_class = false; + dev->has_alsa_audio = false; return 0; + } + + dev->audio_mode.has_audio = true; /* See how this device is configured */ cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG);