From patchwork Thu Oct 27 19:35:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13022642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C2F1FA3740 for ; Thu, 27 Oct 2022 19:37:03 +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 E55B32DA5; Thu, 27 Oct 2022 21:36:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E55B32DA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666899421; bh=aEMBOOAVWVzFmaVy2Xesokxw9Ix/2aoPkybnnAljzJw=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=MImFAB+xwCSR4yeNRHXRIXkm5+G247cVzWqcu3sikutnnUdTj0OoHVea3hAdZHngh N2A7XTzVs7NF3nj84rwnk5AeeoWkDBKsLO2Fpo9B1tkpfzyc9yostT2zW35fOhoym9 IeGvh2kd2N1gglC2gAGDPqB7t8SsU5EbYsAdXDFs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 771CCF80496; Thu, 27 Oct 2022 21:36:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3ED59F804AD; Thu, 27 Oct 2022 21:36:09 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 C64DDF80095 for ; Thu, 27 Oct 2022 21:36:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C64DDF80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="csqogxuz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666899366; x=1698435366; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aEMBOOAVWVzFmaVy2Xesokxw9Ix/2aoPkybnnAljzJw=; b=csqogxuzE4wzX9wgQqR6NnB3NW95BI4yqDLa6Il33yrQfhFee1NsKvB3 3dAq4LzoTBh3scfnOTte2njQLrDzA8MLMae0XEZtqpd/prJpCBrWqeFiO 3TM4WFlvSqZbZGVXP2cgaTWD2ybXfPQu2lMAR83lhJm+WhlcrjZEeAKzI auAx2oiDNRa6X1+Wl1nCndj6K4AdNXERLDsIk2HB3gKmKFrdOBXKzx2fC ao5nFn9/7VQT2s4OUcL8MW877FAUuahxkQ2+MibDG9bSMnnw3oiGurP2Y MS6FH3Wfk4T3AIYhHmd+5V5bcoUr5fPJRbSTOxqfTLQnj+b7bwDCeiTFq A==; X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="334957797" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="334957797" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 12:36:02 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="632526935" X-IronPort-AV: E=Sophos;i="5.95,218,1661842800"; d="scan'208";a="632526935" Received: from vmehta-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.6.254]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 12:36:01 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 00/21] ASoC: SOF: Intel: HDA: refactor codec and multi-link suport Date: Thu, 27 Oct 2022 15:35:19 -0400 Message-Id: <20221027193540.259520-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Cc: tiwai@suse.de, Cezary Rojewski , broonie@kernel.org, Pierre-Louis Bossart 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" Existing HDaudio controllers expose an HDAudio DMA which is used to interface with HDaudio codecs. All other interfaces supported by Intel (SoundWire, SSP, DMIC) rely for data transfers on another GP-DMA managed by the DSP firmware - the HDaudio DMA is only used for memory-to-DSP transfers. New HDaudio extensions will enable the use of this HDaudio DMA for all of SoundWire, SSP, DMIC. These extensions will be backwards-compatible for HDaudio and iDISP codecs, but will require new programming sequences and DAI callbacks for SoundWire, SSP and DMIC. Before we add support for 'extended audio links' and the programming sequences for the DMA, we need to refactor the code. All HDaudio codec support needs to be well identified in a separate file, and likewise all the 'multi-link' handling needs to be better split. This patchset removes a number of 'old' Kconfig dependencies and options, adds helpers with a fallback to remove IS_ENABLED checks in the code and tries to simplify programming sequences when possible. One indirect benefit from this refactoring is that developers can switch with a kernel parameter from HDaudio support to a variant of 'nocodec' support. This proves extremely useful to test on existing Intel RVPs and Up boards, where the same build can be used to check 3 interfaces (HDaudio, SSP, DMIC) by just removing modules, setting the kernel parameter and reloading modules. Pierre-Louis Bossart (21): ASoC: SOF: Intel: remove option to disable the common_hdmi handling ASoC: SOF: Intel: remove all dependencies on SND_SOC_HDAC_HDMI ASoC: SOF: Intel: hda-codec: simplify SND_SOC_SOF_HDA_AUDIO_CODEC handling ASoC: SOF: Intel: move codec state change to hda-codec.c ASoC: SOF: Intel: start moving multi-link handling in dedicated file ASoC: SOF: Intel: hda: add multi-link helper for LOSVID ASoC: SOF: Intel: move all RIRB/CMD_IO helpers to hda-codec.c ASoC: SOF: Intel: hda-ctrl: add codec wakeup helper ASoC: SOF: Intel: hda-codec: add hda_codec_device_remove() helper ASoC: SOF: Intel: hda-codec: add stop_cmd_io helper ASoC: SOF: Intel: hda-stream: always allocate CORB/RIRB buffer ASoC: SOF: Intel: hda-codec: add hda_codec_check_rirb_status() helper ASoC: SOF: Intel: hda-ctrl: use helper to clear RIRB status ASoC: SOF: Intel: hda-dsp: clarify dependencies on SND_SOC_SOF_HDA ASoC: SOF: Intel: hda-codec: add helpers to suspend and resume cmd_io ASoC: SOF: Intel: clarify bus_init and bus_exit sequences ASoC: SOF: Intel: hda-mlink: add helpers to suspend/resume links ASoC: SOF: Intel: add hda_bus_ml_free helper ASoC: SOF: Intel: hda: clarify Kconfig dependencies ASoC: SOF: Intel: hda-codec: use GPL-2.0-only license ASoC: SOF: introduce new DEBUG_NOCODEC mode sound/soc/sof/Kconfig | 18 ++- sound/soc/sof/intel/Kconfig | 2 +- sound/soc/sof/intel/Makefile | 2 +- sound/soc/sof/intel/hda-bus.c | 23 ++- sound/soc/sof/intel/hda-codec.c | 252 +++++++++++++++++++++++++------ sound/soc/sof/intel/hda-ctrl.c | 63 ++------ sound/soc/sof/intel/hda-dai.c | 10 +- sound/soc/sof/intel/hda-dsp.c | 44 ++---- sound/soc/sof/intel/hda-mlink.c | 89 +++++++++++ sound/soc/sof/intel/hda-stream.c | 30 +--- sound/soc/sof/intel/hda.c | 62 ++------ sound/soc/sof/intel/hda.h | 63 ++++++-- sound/soc/sof/sof-audio.c | 5 + sound/soc/sof/sof-priv.h | 3 + 14 files changed, 438 insertions(+), 228 deletions(-) create mode 100644 sound/soc/sof/intel/hda-mlink.c