ASoC: Intel: boards: updates for 6.10 - part2
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This second part provides SoundWire-related cleanups and extensions required by Realtek RT722 and Cirrus Logic codecs. Also included is a cleanup of the RT715-sdca DAI naming and new tables for ACPI-based board detections.
This commit is contained in:
commit
cc98380308
@ -933,7 +933,7 @@ static const struct snd_soc_dai_ops rt715_sdca_ops = {
|
||||
|
||||
static struct snd_soc_dai_driver rt715_sdca_dai[] = {
|
||||
{
|
||||
.name = "rt715-aif1",
|
||||
.name = "rt715-sdca-aif1",
|
||||
.id = RT715_AIF1,
|
||||
.capture = {
|
||||
.stream_name = "DP6 Capture",
|
||||
@ -945,7 +945,7 @@ static struct snd_soc_dai_driver rt715_sdca_dai[] = {
|
||||
.ops = &rt715_sdca_ops,
|
||||
},
|
||||
{
|
||||
.name = "rt715-aif2",
|
||||
.name = "rt715-sdca-aif2",
|
||||
.id = RT715_AIF2,
|
||||
.capture = {
|
||||
.stream_name = "DP4 Capture",
|
||||
|
@ -678,7 +678,6 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
|
||||
depends on MFD_INTEL_LPSS || COMPILE_TEST
|
||||
depends on SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES || COMPILE_TEST
|
||||
depends on SOUNDWIRE
|
||||
select SND_SOC_INTEL_SOF_BOARD_HELPERS
|
||||
select SND_SOC_MAX98363
|
||||
select SND_SOC_MAX98373_I2C
|
||||
select SND_SOC_MAX98373_SDW
|
||||
|
@ -40,8 +40,8 @@ snd-soc-sof-sdw-objs += sof_sdw.o \
|
||||
sof_sdw_maxim.o sof_sdw_rt_amp.o \
|
||||
sof_sdw_rt5682.o sof_sdw_rt700.o \
|
||||
sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \
|
||||
sof_sdw_rt712_sdca.o sof_sdw_rt715.o \
|
||||
sof_sdw_rt715_sdca.o sof_sdw_rt722_sdca.o \
|
||||
sof_sdw_rt712_sdca.o sof_sdw_rt722_sdca.o \
|
||||
sof_sdw_rt_dmic.o \
|
||||
sof_sdw_cs42l42.o sof_sdw_cs42l43.o \
|
||||
sof_sdw_cs_amp.o \
|
||||
sof_sdw_dmic.o \
|
||||
|
@ -630,24 +630,6 @@ sof_intel_board_get_ctx(struct device *dev, unsigned long board_quirk)
|
||||
}
|
||||
EXPORT_SYMBOL_NS(sof_intel_board_get_ctx, SND_SOC_INTEL_SOF_BOARD_HELPERS);
|
||||
|
||||
struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd,
|
||||
const char * const dai_name[], int num_dais)
|
||||
{
|
||||
struct snd_soc_dai *dai;
|
||||
int index;
|
||||
int i;
|
||||
|
||||
for (index = 0; index < num_dais; index++)
|
||||
for_each_rtd_codec_dais(rtd, i, dai)
|
||||
if (strstr(dai->name, dai_name[index])) {
|
||||
dev_dbg(rtd->card->dev, "get dai %s\n", dai->name);
|
||||
return dai;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_NS(get_codec_dai_by_name, SND_SOC_INTEL_SOF_BOARD_HELPERS);
|
||||
|
||||
MODULE_DESCRIPTION("ASoC Intel SOF Machine Driver Board Helpers");
|
||||
MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -167,7 +167,4 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card,
|
||||
struct sof_card_private *
|
||||
sof_intel_board_get_ctx(struct device *dev, unsigned long board_quirk);
|
||||
|
||||
struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd,
|
||||
const char * const dai_name[], int num_dais);
|
||||
|
||||
#endif /* __SOF_INTEL_BOARD_HELPERS_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -50,7 +50,10 @@ enum {
|
||||
#define SOF_SDW_PCH_DMIC BIT(6)
|
||||
#define SOF_SSP_PORT(x) (((x) & GENMASK(5, 0)) << 7)
|
||||
#define SOF_SSP_GET_PORT(quirk) (((quirk) >> 7) & GENMASK(5, 0))
|
||||
/* Deprecated and no longer supported by the code */
|
||||
#define SOF_SDW_NO_AGGREGATION BIT(14)
|
||||
/* If a CODEC has an optional speaker output, this quirk will enable it */
|
||||
#define SOF_CODEC_SPKR BIT(15)
|
||||
|
||||
/* BT audio offload: reserve 3 bits for future */
|
||||
#define SOF_BT_OFFLOAD_SSP_SHIFT 15
|
||||
@ -63,7 +66,7 @@ enum {
|
||||
#define SOF_SDW_DAI_TYPE_AMP 1
|
||||
#define SOF_SDW_DAI_TYPE_MIC 2
|
||||
|
||||
#define SOF_SDW_MAX_DAI_NUM 3
|
||||
#define SOF_SDW_MAX_DAI_NUM 8
|
||||
|
||||
struct sof_sdw_codec_info;
|
||||
|
||||
@ -73,13 +76,13 @@ struct sof_sdw_dai_info {
|
||||
const int dai_type;
|
||||
const int dailink[2]; /* dailink id for each direction */
|
||||
int (*init)(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
|
||||
int (*rtd_init)(struct snd_soc_pcm_runtime *rtd);
|
||||
bool rtd_init_done; /* Indicate that the rtd_init callback is done */
|
||||
unsigned long quirk;
|
||||
};
|
||||
|
||||
struct sof_sdw_codec_info {
|
||||
@ -103,10 +106,16 @@ struct mc_private {
|
||||
struct device *amp_dev1, *amp_dev2;
|
||||
/* To store SDW Pin index for each SoundWire link */
|
||||
unsigned int sdw_pin_index[SDW_MAX_LINKS];
|
||||
bool append_dai_type;
|
||||
bool ignore_pch_dmic;
|
||||
};
|
||||
|
||||
extern unsigned long sof_sdw_quirk;
|
||||
|
||||
struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd,
|
||||
const char * const dai_name[],
|
||||
int num_dais);
|
||||
|
||||
int sdw_startup(struct snd_pcm_substream *substream);
|
||||
int sdw_prepare(struct snd_pcm_substream *substream);
|
||||
int sdw_trigger(struct snd_pcm_substream *substream, int cmd);
|
||||
@ -125,7 +134,6 @@ int sof_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd);
|
||||
|
||||
/* RT711 support */
|
||||
int sof_sdw_rt711_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
@ -133,7 +141,6 @@ int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_l
|
||||
|
||||
/* RT711-SDCA support */
|
||||
int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
@ -144,34 +151,25 @@ extern struct snd_soc_ops sof_sdw_rt1308_i2s_ops;
|
||||
|
||||
/* generic amp support */
|
||||
int sof_sdw_rt_amp_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
|
||||
|
||||
/* RT722-SDCA support */
|
||||
int sof_sdw_rt722_spk_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
int sof_sdw_rt722_sdca_dmic_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
|
||||
/* MAXIM codec support */
|
||||
int sof_sdw_maxim_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
|
||||
/* CS42L43 support */
|
||||
int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
|
||||
/* CS AMP support */
|
||||
int sof_sdw_cs_amp_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
@ -180,16 +178,16 @@ int sof_sdw_cs_amp_init(struct snd_soc_card *card,
|
||||
|
||||
int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt712_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt715_sdca_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/jack.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
static const struct snd_soc_dapm_widget cs42l42_widgets[] = {
|
||||
|
@ -30,6 +30,17 @@ static const struct snd_soc_dapm_route cs42l43_hs_map[] = {
|
||||
{ "cs42l43 ADC1_IN1_N", NULL, "Headset Mic" },
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget cs42l43_spk_widgets[] = {
|
||||
SND_SOC_DAPM_SPK("Speaker", NULL),
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_route cs42l43_spk_map[] = {
|
||||
{ "Speaker", NULL, "cs42l43 AMP1_OUT_P", },
|
||||
{ "Speaker", NULL, "cs42l43 AMP1_OUT_N", },
|
||||
{ "Speaker", NULL, "cs42l43 AMP2_OUT_P", },
|
||||
{ "Speaker", NULL, "cs42l43 AMP2_OUT_N", },
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget cs42l43_dmic_widgets[] = {
|
||||
SND_SOC_DAPM_MIC("DMIC", NULL),
|
||||
};
|
||||
@ -108,6 +119,45 @@ int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s spk:cs42l43-spk",
|
||||
card->components);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = snd_soc_dapm_new_controls(&card->dapm, cs42l43_spk_widgets,
|
||||
ARRAY_SIZE(cs42l43_spk_widgets));
|
||||
if (ret) {
|
||||
dev_err(card->dev, "cs42l43 speaker widgets addition failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, cs42l43_spk_map,
|
||||
ARRAY_SIZE(cs42l43_spk_map));
|
||||
if (ret)
|
||||
dev_err(card->dev, "cs42l43 speaker map addition failed: %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
{
|
||||
/* Do init on playback link only. */
|
||||
if (!playback)
|
||||
return 0;
|
||||
|
||||
info->amp_num++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
|
@ -57,7 +57,6 @@ int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
}
|
||||
|
||||
int sof_sdw_cs_amp_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
|
@ -139,7 +139,6 @@ static int mx8373_sdw_late_probe(struct snd_soc_card *card)
|
||||
}
|
||||
|
||||
int sof_sdw_maxim_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/jack.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
static const struct snd_soc_dapm_widget rt5682_widgets[] = {
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/jack.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
static const struct snd_soc_dapm_widget rt700_widgets[] = {
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/jack.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
/*
|
||||
@ -159,7 +158,6 @@ int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_l
|
||||
}
|
||||
|
||||
int sof_sdw_rt711_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
static const struct snd_soc_dapm_widget rt712_spk_widgets[] = {
|
||||
@ -67,27 +66,3 @@ int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const char * const dmics[] = {
|
||||
"rt712-sdca-dmic"
|
||||
};
|
||||
|
||||
int rt712_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai;
|
||||
struct snd_soc_component *component;
|
||||
|
||||
codec_dai = get_codec_dai_by_name(rtd, dmics, ARRAY_SIZE(dmics));
|
||||
if (!codec_dai)
|
||||
return -EINVAL;
|
||||
|
||||
component = codec_dai->component;
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
||||
"%s mic:%s",
|
||||
card->components, component->name_prefix);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS);
|
||||
|
@ -1,26 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// Copyright (c) 2020 Intel Corporation
|
||||
|
||||
/*
|
||||
* sof_sdw_rt715 - Helpers to handle RT715 from generic machine driver
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/errno.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
||||
"%s mic:rt715",
|
||||
card->components);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// Copyright (c) 2020 Intel Corporation
|
||||
|
||||
/*
|
||||
* sof_sdw_rt715_sdca - Helpers to handle RT715-SDCA from generic machine driver
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/errno.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
int rt715_sdca_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
||||
"%s mic:rt715-sdca",
|
||||
card->components);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ static const struct snd_kcontrol_new rt722_spk_controls[] = {
|
||||
SOC_DAPM_PIN_SWITCH("Speaker"),
|
||||
};
|
||||
|
||||
static int rt722_spk_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
@ -59,39 +59,3 @@ static int rt722_spk_init(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int sof_sdw_rt722_spk_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
{
|
||||
dai_links->init = rt722_spk_init;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rt722_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
||||
"%s mic:%s",
|
||||
card->components, component->name_prefix);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sof_sdw_rt722_sdca_dmic_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
{
|
||||
dai_links->init = rt722_sdca_dmic_rtd_init;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -281,7 +281,6 @@ int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_
|
||||
}
|
||||
|
||||
int sof_sdw_rt_amp_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
|
54
sound/soc/intel/boards/sof_sdw_rt_dmic.c
Normal file
54
sound/soc/intel/boards/sof_sdw_rt_dmic.c
Normal file
@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// Copyright (c) 2024 Intel Corporation
|
||||
|
||||
/*
|
||||
* sof_sdw_rt_dmic - Helpers to handle Realtek SDW DMIC from generic machine driver
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/errno.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
static const char * const dmics[] = {
|
||||
"rt715",
|
||||
"rt715-sdca",
|
||||
"rt712-sdca-dmic",
|
||||
"rt722-sdca",
|
||||
};
|
||||
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_component *component;
|
||||
struct snd_soc_dai *codec_dai;
|
||||
char *mic_name;
|
||||
|
||||
codec_dai = get_codec_dai_by_name(rtd, dmics, ARRAY_SIZE(dmics));
|
||||
if (!codec_dai)
|
||||
return -EINVAL;
|
||||
|
||||
component = codec_dai->component;
|
||||
|
||||
/*
|
||||
* rt715-sdca (aka rt714) is a special case that uses different name in card->components
|
||||
* and component->name_prefix.
|
||||
*/
|
||||
if (!strcmp(component->name_prefix, "rt714"))
|
||||
mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca");
|
||||
else
|
||||
mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix);
|
||||
|
||||
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
|
||||
"%s mic:%s", card->components,
|
||||
mic_name);
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
dev_dbg(card->dev, "card->components: %s\n", card->components);
|
||||
|
||||
return 0;
|
||||
}
|
||||
MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS);
|
@ -15,7 +15,6 @@
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/jack.h>
|
||||
#include "sof_board_helpers.h"
|
||||
#include "sof_sdw_common.h"
|
||||
|
||||
/*
|
||||
@ -86,7 +85,7 @@ static struct snd_soc_jack_pin rt_sdca_jack_pins[] = {
|
||||
};
|
||||
|
||||
static const char * const jack_codecs[] = {
|
||||
"rt711", "rt712", "rt713"
|
||||
"rt711", "rt712", "rt713", "rt722"
|
||||
};
|
||||
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
@ -192,7 +191,6 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link
|
||||
}
|
||||
|
||||
int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card,
|
||||
const struct snd_soc_acpi_link_adr *link,
|
||||
struct snd_soc_dai_link *dai_links,
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback)
|
||||
|
@ -68,13 +68,6 @@ enum sof_ssp_codec {
|
||||
enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev);
|
||||
enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev);
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SOF_SSP_COMMON)
|
||||
const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type);
|
||||
#else
|
||||
static inline const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SOF_SSP_COMMON_H */
|
||||
|
@ -24,6 +24,15 @@ static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
|
||||
}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
|
||||
{
|
||||
.adr = 0x000030025D071101ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.name_prefix = "rt711"
|
||||
}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_link_adr arl_rvp[] = {
|
||||
{
|
||||
.mask = BIT(0),
|
||||
@ -33,6 +42,15 @@ static const struct snd_soc_acpi_link_adr arl_rvp[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = {
|
||||
{
|
||||
.mask = BIT(0),
|
||||
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
|
||||
.adr_d = rt711_sdca_0_adr,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = {
|
||||
{},
|
||||
};
|
||||
@ -46,6 +64,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_tplg_filename = "sof-arl-rt711.tplg",
|
||||
},
|
||||
{
|
||||
.link_mask = 0x1, /* link0 required */
|
||||
.links = arl_sdca_rvp,
|
||||
.drv_name = "sof_sdw",
|
||||
.sof_tplg_filename = "sof-arl-rt711-l0.tplg",
|
||||
},
|
||||
{},
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_sdw_machines);
|
||||
|
@ -338,11 +338,38 @@ static const struct snd_soc_acpi_link_adr mtl_712_only[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
|
||||
{ /* Jack Playback Endpoint */
|
||||
.num = 0,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* DMIC Capture Endpoint */
|
||||
.num = 1,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* Jack Capture Endpoint */
|
||||
.num = 2,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* Speaker Playback Endpoint */
|
||||
.num = 3,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = {
|
||||
{
|
||||
.adr = 0x00003001FA424301ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
|
||||
.endpoints = cs42l43_endpoints,
|
||||
.name_prefix = "cs42l43"
|
||||
}
|
||||
};
|
||||
@ -352,13 +379,13 @@ static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
|
||||
.adr = 0x00013701FA355601ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &spk_r_endpoint,
|
||||
.name_prefix = "AMP8"
|
||||
.name_prefix = "AMP3"
|
||||
},
|
||||
{
|
||||
.adr = 0x00013601FA355601ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &spk_3_endpoint,
|
||||
.name_prefix = "AMP7"
|
||||
.name_prefix = "AMP4"
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -414,11 +414,38 @@ static const struct snd_soc_acpi_link_adr tgl_712_only[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = {
|
||||
{ /* Jack Playback Endpoint */
|
||||
.num = 0,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* DMIC Capture Endpoint */
|
||||
.num = 1,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* Jack Capture Endpoint */
|
||||
.num = 2,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
{ /* Speaker Playback Endpoint */
|
||||
.num = 3,
|
||||
.aggregated = 0,
|
||||
.group_position = 0,
|
||||
.group_id = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_soc_acpi_adr_device cs42l43_3_adr[] = {
|
||||
{
|
||||
.adr = 0x00033001FA424301ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.num_endpoints = ARRAY_SIZE(cs42l43_endpoints),
|
||||
.endpoints = cs42l43_endpoints,
|
||||
.name_prefix = "cs42l43"
|
||||
}
|
||||
};
|
||||
@ -443,13 +470,13 @@ static const struct snd_soc_acpi_adr_device cs35l56_1_adr[] = {
|
||||
.adr = 0x00013701FA355601ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &spk_l_endpoint,
|
||||
.name_prefix = "AMP8"
|
||||
.name_prefix = "AMP3"
|
||||
},
|
||||
{
|
||||
.adr = 0x00013601FA355601ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &spk_2_endpoint,
|
||||
.name_prefix = "AMP7"
|
||||
.name_prefix = "AMP4"
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user