From patchwork Wed Aug 22 20:24:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10573175 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 8E21B921 for ; Wed, 22 Aug 2018 20:25:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CAAD2A076 for ; Wed, 22 Aug 2018 20:25:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609382B6E7; Wed, 22 Aug 2018 20:25:36 +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,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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CDF02A076 for ; Wed, 22 Aug 2018 20:25:34 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D8C332676C7; Wed, 22 Aug 2018 22:25:32 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6C0E02676C9; Wed, 22 Aug 2018 22:25:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by alsa0.perex.cz (Postfix) with ESMTP id 7688F267663 for ; Wed, 22 Aug 2018 22:25:26 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2018 13:25:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,275,1531810800"; d="scan'208";a="256419681" Received: from rsork-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.255.38.64]) by fmsmga005.fm.intel.com with ESMTP; 22 Aug 2018 13:25:12 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Wed, 22 Aug 2018 15:24:56 -0500 Message-Id: <20180822202503.16609-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, Pierre-Louis Bossart Subject: [alsa-devel] =?utf-8?q?=5BPATCH_v8_0/7=5D_Enable_HDA_Codec_support_?= =?utf-8?q?on_Intel_Platforms=E2=80=8B?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Many Intel platforms (SKL, KBL) etc. in the market supports enhanced audio capabilities which also includes DSP processing. The default HDaudio legacy driver does not allow for the use of the DSP, this patch set makes it possible while reusing existing code for HDAudio codecs and without significant changes to the legacy driver. This v8 is based on Marks' for-next branch - the merge of topic/drm_audio_component is not included here. Tests were run successfully on multiple platforms (Dell XPS13, KBL NUC, APL NUC and LeafHill reference board). Both the HDaudio and HDMI outputs were tested. Credits: all the initial code was written by Rakesh Ughreja, the rebase to broonie/for-next, cleanups and additional tests were done by Pierre Bossart. TODO in future update: 1. fix the HDMI jack detection which only works after the mixer values are set, which isn't practical for headless devices always connected (this is a problem in the hdac_hdmi codec that was present before this series was submitted) 2. when the screen goes blank, HDMI playback stops. This isn't related to this patchset since we rely on the existing hdac_hdmi codec, but will need additional investigations. Changes v8: (comments from Takashi) - move hda_codec.h to include/sound (from sound/pci/hda) - remove unnecessary includes (local.h) - remove Kconfig option to control HDaudio suppport Changes v7 - fix route count for headless boards such as Up2 to enable all 3 iDisp routes (only iDisp3 was set-up due to a bad macro). Changes v6 (comments from Mark and Takashi) - simplify Kconfig options, remove FORCE for now and make code simpler - change SPDIX style to C++ for C files - add log message if invalid configuration reached - remove static int counter, added private counter in context instead - fixed a couple of indendation issues to make checkpatch.pl --strict happy Changes v5 (comments from Vinod) - fix SPDIF style across patches - patch 1: update commit message to remove reference to "fix" - patch 3: remove platform name assignment and Xmas tree style - patch 7: simplify error handling, add missing _put() on errors, remove tests on ops, add switch statement, fix alignment - patch 8: fix indentation issues, use bool instead of tristate Changes v4: - rebase/update on Takashi's topic/drm_audio_component branch - changes in the HDaudio detection to avoid adding a fake ACPI ID - new Kconfigs to control HDaudio detection Changes v3: - port to component model - additional tests on ApolloLake and KabyLake NUC devices - cleanups (alignment, typos, etc) Changes v2: - Resolved review comments and rebased to latest kernel. - added module load support for codec drivers. Pierre-Louis Bossart (2): ALSA: hda: move hda_codec.h to include/sound ASoC: Intel: common: add table for HDA-based platforms Rakesh Ughreja (5): ASoC: Intel: Boards: Machine driver for SKL+ w/ HDAudio codecs ASoC: Intel: Skylake: use HDAudio if ACPI enumeration fails ASoC: Intel: Skylake: add HDA BE DAIs ASoC: Intel: Skylake: use hda_bus instead of hdac_bus ASoC: hdac_hda: add asoc extension for legacy HDA codec drivers {sound/pci/hda => include/sound}/hda_codec.h | 0 include/sound/soc-acpi-intel-match.h | 6 + sound/pci/hda/hda_auto_parser.c | 2 +- sound/pci/hda/hda_beep.h | 2 +- sound/pci/hda/hda_bind.c | 14 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_controller.h | 2 +- sound/pci/hda/hda_eld.c | 2 +- sound/pci/hda/hda_generic.c | 2 +- sound/pci/hda/hda_hwdep.c | 2 +- sound/pci/hda/hda_intel.c | 2 +- sound/pci/hda/hda_jack.c | 2 +- sound/pci/hda/hda_proc.c | 2 +- sound/pci/hda/hda_sysfs.c | 2 +- sound/pci/hda/hda_tegra.c | 2 +- sound/pci/hda/patch_analog.c | 2 +- sound/pci/hda/patch_ca0110.c | 2 +- sound/pci/hda/patch_ca0132.c | 2 +- sound/pci/hda/patch_cirrus.c | 2 +- sound/pci/hda/patch_cmedia.c | 2 +- sound/pci/hda/patch_conexant.c | 2 +- sound/pci/hda/patch_hdmi.c | 2 +- sound/pci/hda/patch_realtek.c | 2 +- sound/pci/hda/patch_si3054.c | 2 +- sound/pci/hda/patch_sigmatel.c | 2 +- sound/pci/hda/patch_via.c | 2 +- sound/soc/codecs/Kconfig | 5 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/hdac_hda.c | 484 ++++++++++++++++++ sound/soc/codecs/hdac_hda.h | 24 + sound/soc/intel/boards/Kconfig | 9 + sound/soc/intel/boards/Makefile | 2 + sound/soc/intel/boards/skl_hda_dsp_common.c | 127 +++++ sound/soc/intel/boards/skl_hda_dsp_common.h | 38 ++ sound/soc/intel/boards/skl_hda_dsp_generic.c | 182 +++++++ sound/soc/intel/common/Makefile | 3 +- .../intel/common/soc-acpi-intel-hda-match.c | 40 ++ sound/soc/intel/skylake/skl-pcm.c | 70 ++- sound/soc/intel/skylake/skl.c | 96 +++- sound/soc/intel/skylake/skl.h | 12 +- 40 files changed, 1109 insertions(+), 51 deletions(-) rename {sound/pci/hda => include/sound}/hda_codec.h (100%) create mode 100644 sound/soc/codecs/hdac_hda.c create mode 100644 sound/soc/codecs/hdac_hda.h create mode 100644 sound/soc/intel/boards/skl_hda_dsp_common.c create mode 100644 sound/soc/intel/boards/skl_hda_dsp_common.h create mode 100644 sound/soc/intel/boards/skl_hda_dsp_generic.c create mode 100644 sound/soc/intel/common/soc-acpi-intel-hda-match.c