Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp21073pxv; Tue, 13 Jul 2021 20:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweBG0hXcEdzRn44F3+UOb0akp7vKmR+X75Y/9CcMvi4RhuBqHBz9gL8Qx9Rnh8ZhQx1yY9 X-Received: by 2002:a17:906:1284:: with SMTP id k4mr9457901ejb.329.1626233044751; Tue, 13 Jul 2021 20:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626233044; cv=none; d=google.com; s=arc-20160816; b=wcRjxGuwAsNrxfqaYn6c7cHz2D6LPLlEwTkV1wi8VD2TY8UzUMGiL7WIHUKXx/Qrhg Uc7y1NOWtWHTS3Pein7rIz90V9QnmXn/4XS49ccd/eQtoTaFoWOnFTefMUE8l/CTWLy4 NLQy2fWipVpmiHtLaokw6qne0XEmZ3w0HBPP6WHBDP5w44z02dNn2tiN5crU31/eip4j 1Oop7GPiJiCcrorrdMfxCevUbn/o0Ig5VLDDh0vT3OfeMnCqRfqM91eLdR+mX31L6Ukx QsVF5DgqT7NsPBMBo2orwd2K+lX3RH3Ab580wg0MWH5Snb2h+NBsQl6ZOp38NFdkGZea S09A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=rglMWqlBdEe1cM5rpQpygjCpLpK3cQZ0EptNbYD4YU0=; b=IbuIgOiFjgjwIV0JMpP6GnpO4vMXuiMvYJfw2i7AMLS6qFqIKan20KCagHzsF4RFJ2 AmtzTdP1sNypvS4UG5MsIpKc7z9Hv3r246gLGkCHyEOvSIeksu5SeFml+4Kmqbkwjwoi DPloOXEbaETzNl9oC55yw8X2LvUO/W3F4SfL3U2r4xz1n5fT2epmoXXeuAP0SVZOWGCA cJhrV/soBpPUR/PiQa/ruHzjDZBMFdQkHJG4sCBVxaRPB5A2vOODuVbgdY+kkaUUctQg L3gsLS0ecPaTJSHOeBsINXOXZDqW5I6omA+r+BBRETIzzlFIURMAPln6V4xBHgVsPxH0 g3cw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si1058590eju.284.2021.07.13.20.23.42; Tue, 13 Jul 2021 20:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237798AbhGNDZZ (ORCPT + 99 others); Tue, 13 Jul 2021 23:25:25 -0400 Received: from mga14.intel.com ([192.55.52.115]:9187 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237811AbhGNDZY (ORCPT ); Tue, 13 Jul 2021 23:25:24 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10044"; a="210095744" X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="210095744" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 20:22:33 -0700 X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="459818155" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 20:22:31 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, srinivas.kandagatla@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, bard.liao@intel.com Subject: [PATCH 04/10] ASoC: Intel: boards: sof_sdw: add SoundWire mockup codecs for tests Date: Wed, 14 Jul 2021 11:22:03 +0800 Message-Id: <20210714032209.11284-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714032209.11284-1-yung-chuan.liao@linux.intel.com> References: <20210714032209.11284-1-yung-chuan.liao@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart Add support for SoundWire mockup devices. The configurations assume the same topology as the CML SoundWire devices and can be used to test the SOF firmware on a development board (RVP, UpExtreme) without any hardware connected. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_sdw.c | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 7e29b0d911e2..046955bf717c 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -602,6 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_DMIC select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON + select SND_SOC_SDW_MOCKUP help Add support for Intel SoundWire-based platforms connected to MAX98373, RT700, RT711, RT1308 and RT715 diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 1a867c73a48e..82d909ef7a97 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -328,6 +328,19 @@ static const struct snd_soc_ops sdw_ops = { .shutdown = sdw_shutdown, }; +static int sof_sdw_mic_codec_mockup_init(const struct snd_soc_acpi_link_adr *link, + struct snd_soc_dai_link *dai_links, + struct sof_sdw_codec_info *info, + bool playback) +{ + /* + * force DAI link to use same ID as RT715 and DMIC + * to reuse topologies + */ + dai_links->id = SDW_DMIC_DAI_ID; + return 0; +} + static struct sof_sdw_codec_info codec_info_list[] = { { .part_id = 0x700, @@ -410,6 +423,34 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_name = "rt5682-sdw", .init = sof_sdw_rt5682_init, }, + { + .part_id = 0xaaaa, /* generic codec mockup */ + .version_id = 0, + .direction = {true, true}, + .dai_name = "sdw-mockup-aif1", + .init = NULL, + }, + { + .part_id = 0xaa55, /* headset codec mockup */ + .version_id = 0, + .direction = {true, true}, + .dai_name = "sdw-mockup-aif1", + .init = NULL, + }, + { + .part_id = 0x55aa, /* amplifier mockup */ + .version_id = 0, + .direction = {true, false}, + .dai_name = "sdw-mockup-aif1", + .init = NULL, + }, + { + .part_id = 0x5555, + .version_id = 0, + .direction = {false, true}, + .dai_name = "sdw-mockup-aif1", + .init = sof_sdw_mic_codec_mockup_init, + }, }; static inline int find_codec_info_part(u64 adr) -- 2.17.1