From patchwork Mon Jul 29 15:51:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 11064177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 913E313AC for ; Mon, 29 Jul 2019 16:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F72C285E8 for ; Mon, 29 Jul 2019 16:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7228B2861D; Mon, 29 Jul 2019 16:17:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDEBC285E8 for ; Mon, 29 Jul 2019 16:17:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 69BF51811; Mon, 29 Jul 2019 17:52:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 69BF51811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1564415574; bh=qz1+0Ist6b7ipO6hpJl9N1I66L2OtfOM8qo/kx1KWNA=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=AILOY0u/6CBr4FbNCHilf5zk0vPjnCto9Fu/r3Ps4j4d/vr/9E+k43Hgvy7BTc9wB A4PDQ9zORimAW6jQ/5Coz5MJ/dBXmKvutJsHUTV1vtamdEtpzovsJ30wBbH4Rj9FLm EwOx5YlPwvaHGKvSb/hZTydomqN8tram9a14tDsk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D062BF8048F; Mon, 29 Jul 2019 17:52:03 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5C4BF8048D; Mon, 29 Jul 2019 17:52:01 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EE19DF800BF for ; Mon, 29 Jul 2019 17:51:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EE19DF800BF X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2019 08:51:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,323,1559545200"; d="scan'208";a="165534149" Received: from lquinn-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.252.130.206]) by orsmga008.jf.intel.com with ESMTP; 29 Jul 2019 08:51:54 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Mon, 29 Jul 2019 10:51:46 -0500 Message-Id: <20190729155151.14055-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Cezary Rojewski , tiwai@suse.de, Pierre-Louis Bossart , Daniel Drake , Hui Wang , Curtis Malainey , broonie@kernel.org Subject: [alsa-devel] [PATCH v4 0/5] ALSA/HDA: abort probe when DMICs are detected X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is the second take on same problem of detecting when the HDaudio legacy driver can be used and when the SST or SOF drivers are required. The previous attempt based on a the PCI Class information was a resounding failure and broke audio on Linus' laptop, so we need additional information to avoid enabling a DSP-based driver without a good reason to do so. This patchset suggests the use of the NHLT information which *in theory* exposes DMIC endpoints. The legacy HDaudio driver cannot handle DMICs and will not provide any capture capabilities. Since it's typically the first one to probe due to the Makefile order, aborting the probe will let the PCI subsystem look for the next driver which hopefully will support this capability. I tested this patch on 5 devices (SKL, KBL, APL, GLK, WHL), three without DMICs and two with, and the detection seems to work as planned. Additional testing by Canonical and Endless folks did not expose any issues. Changes since v3 (Feedback from Cezary) Code cleanups (spaces and unnecessary inits) Flipped test statement to return on errors and reduce indentation Removed ACPI leak by adding missing ACPI_FREE() Changes since v2 (Feedback from Takahi and Cezary) Added comment in Kconfig to alert the user to the dependency on ACPI Changes since v1 (Feedback from Takashi): Squashed patch3 in patch2 Changed log to dbg_info Fixed module parameter handling Changes since RFC: Cosmetic code improvements Moved intel-nhlt.h to include/sound Moved intel-nhlt.c to sound/hda Removed SOC prefixes Added full-support for vendor-defined geometries Added Kconfig and kernel module parameter to opt-in Pierre-Louis Bossart (5): ASoC: Intel: Skylake: move NHLT header to common directory ALSA: hda: move parts of NHLT code to new module ALSA: hda: intel-nhlt: handle NHLT VENDOR_DEFINED DMIC geometry ASoC: Intel: Skylake: use common NHLT module ALSA: hda/intel: stop probe if DMICS are detected on Skylake+ platforms .../skl-nhlt.h => include/sound/intel-nhlt.h | 51 +++++++-- sound/hda/Kconfig | 5 + sound/hda/Makefile | 3 + sound/hda/intel-nhlt.c | 107 ++++++++++++++++++ sound/pci/hda/Kconfig | 10 ++ sound/pci/hda/hda_intel.c | 34 ++++++ sound/soc/intel/Kconfig | 1 + sound/soc/intel/skylake/skl-nhlt.c | 91 +-------------- sound/soc/intel/skylake/skl-ssp-clk.c | 1 + sound/soc/intel/skylake/skl-topology.c | 1 + sound/soc/intel/skylake/skl.c | 12 +- sound/soc/intel/skylake/skl.h | 4 - 12 files changed, 212 insertions(+), 108 deletions(-) rename sound/soc/intel/skylake/skl-nhlt.h => include/sound/intel-nhlt.h (65%) create mode 100644 sound/hda/intel-nhlt.c