Commit 5f14536b authored by Mark Brown's avatar Mark Brown

ASoC: Intel: updates for 6.10 - part4

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

More cleanups from Brent, notably the removal of the redundant
cml_rt1011_rt5682 machine driver, fixes for SoundWire platforms and
changes to sof_rt5682 to allow for 96+ sampling rates.

For the rest of this kernel cycle, we are still working on SoundWire
updates for MeteorLake (usual missing ACPI signature required for
topology selection and jack detection information). We'll provide
those patches as soon as they are reviewed/validated.
parents f284b238 dcc2cd80
......@@ -595,17 +595,11 @@ config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH
config SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH
tristate "CML with RT1011 and RT5682 in I2S Mode"
depends on I2C && ACPI
depends on MFD_INTEL_LPSS || COMPILE_TEST
depends on SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC
select SND_SOC_RT1011
select SND_SOC_RT5682_I2C
select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
select SND_SOC_INTEL_HDA_DSP_COMMON
imply SND_SOC_INTEL_SOF_RT5682_MACH
help
This adds support for ASoC machine driver for SOF platform with
RT1011 + RT5682 I2S codec.
RT1011 + RT5682 I2S codec. This option is deprecated and please used
SND_SOC_INTEL_SOF_RT5682_MACH instead.
Say Y if you have such a device.
If unsure select "N".
......
......@@ -24,7 +24,6 @@ snd-soc-sof_cs42l42-objs := sof_cs42l42.o
snd-soc-sof_es8336-objs := sof_es8336.o
snd-soc-sof_nau8825-objs := sof_nau8825.o
snd-soc-sof_da7219-objs := sof_da7219.o
snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o
snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o
snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o
snd-soc-kbl_rt5663_max98927-objs := kbl_rt5663_max98927.o
......@@ -71,7 +70,6 @@ obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_CX2072X_MACH) += snd-soc-sst-byt-cht-cx2072x.
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH) += snd-soc-sst-byt-cht-da7213.o
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH) += snd-soc-sst-byt-cht-es8316.o
obj-$(CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH) += snd-soc-sst-byt-cht-nocodec.o
obj-$(CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH) += snd-soc-cml_rt1011_rt5682.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH) += snd-soc-kbl_da7219_max98357a.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_DA7219_MAX98927_MACH) += snd-soc-kbl_da7219_max98927.o
obj-$(CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH) += snd-soc-kbl_rt5663_max98927.o
......
This diff is collapsed.
......@@ -398,6 +398,14 @@ static const struct platform_device_id board_ids[] = {
SOF_SSP_PORT_BT_OFFLOAD(2) |
SOF_BT_OFFLOAD_PRESENT),
},
{
.name = "mtl_da7219_def",
.driver_data = (kernel_ulong_t)(SOF_DA7219_MCLK_EN |
SOF_SSP_PORT_CODEC(2) |
SOF_SSP_PORT_AMP(0) |
SOF_SSP_PORT_BT_OFFLOAD(1) |
SOF_BT_OFFLOAD_PRESENT),
},
{ }
};
MODULE_DEVICE_TABLE(platform, board_ids);
......
......@@ -15,10 +15,40 @@
#include "../../codecs/rt1011.h"
#include "../../codecs/rt1015.h"
#include "../../codecs/rt1308.h"
#include "../common/soc-intel-quirks.h"
#include "sof_realtek_common.h"
/*
* Current only 2-amp configuration is supported for rt1011
* Common structures and functions
*/
static const struct snd_kcontrol_new realtek_4spk_kcontrols[] = {
SOC_DAPM_PIN_SWITCH("WL Ext Spk"),
SOC_DAPM_PIN_SWITCH("WR Ext Spk"),
SOC_DAPM_PIN_SWITCH("TL Ext Spk"),
SOC_DAPM_PIN_SWITCH("TR Ext Spk"),
};
static const struct snd_soc_dapm_widget realtek_4spk_widgets[] = {
SND_SOC_DAPM_SPK("WL Ext Spk", NULL),
SND_SOC_DAPM_SPK("WR Ext Spk", NULL),
SND_SOC_DAPM_SPK("TL Ext Spk", NULL),
SND_SOC_DAPM_SPK("TR Ext Spk", NULL),
};
/* helper function to get the number of specific codec */
static unsigned int get_num_codecs(const char *hid)
{
struct acpi_device *adev;
unsigned int dev_num = 0;
for_each_acpi_dev_match(adev, hid, NULL, -1)
dev_num++;
return dev_num;
}
/*
* Realtek ALC1011
*/
static const struct snd_soc_dapm_route speaker_map_lr[] = {
/* speaker */
......@@ -26,16 +56,14 @@ static const struct snd_soc_dapm_route speaker_map_lr[] = {
{ "Right Spk", NULL, "Right SPO" },
};
/*
* Make sure device's Unique ID follows this configuration:
*
* Two speakers:
* 0: left, 1: right
* Four speakers:
* 0: Woofer left, 1: Woofer right
* 2: Tweeter left, 3: Tweeter right
*/
static struct snd_soc_codec_conf rt1011_codec_confs[] = {
static const struct snd_soc_dapm_route rt1011_4spk_routes[] = {
{"WL Ext Spk", NULL, "WL SPO" },
{"WR Ext Spk", NULL, "WR SPO" },
{"TL Ext Spk", NULL, "TL SPO" },
{"TR Ext Spk", NULL, "TR SPO" },
};
static struct snd_soc_codec_conf rt1011_2spk_codec_confs[] = {
{
.dlc = COMP_CODEC_CONF(RT1011_DEV0_NAME),
.name_prefix = "Left",
......@@ -46,6 +74,25 @@ static struct snd_soc_codec_conf rt1011_codec_confs[] = {
},
};
static struct snd_soc_codec_conf rt1011_4spk_codec_confs[] = {
{
.dlc = COMP_CODEC_CONF(RT1011_DEV0_NAME),
.name_prefix = "WL",
},
{
.dlc = COMP_CODEC_CONF(RT1011_DEV1_NAME),
.name_prefix = "WR",
},
{
.dlc = COMP_CODEC_CONF(RT1011_DEV2_NAME),
.name_prefix = "TL",
},
{
.dlc = COMP_CODEC_CONF(RT1011_DEV3_NAME),
.name_prefix = "TR",
},
};
static struct snd_soc_dai_link_component rt1011_dai_link_components[] = {
{
.name = RT1011_DEV0_NAME,
......@@ -55,6 +102,14 @@ static struct snd_soc_dai_link_component rt1011_dai_link_components[] = {
.name = RT1011_DEV1_NAME,
.dai_name = RT1011_CODEC_DAI,
},
{
.name = RT1011_DEV2_NAME,
.dai_name = RT1011_CODEC_DAI,
},
{
.name = RT1011_DEV3_NAME,
.dai_name = RT1011_CODEC_DAI,
},
};
static const struct {
......@@ -63,6 +118,8 @@ static const struct {
} rt1011_tdm_mask[] = {
{.tx = 0x4, .rx = 0x1},
{.tx = 0x8, .rx = 0x2},
{.tx = 0x1, .rx = 0x1},
{.tx = 0x2, .rx = 0x2},
};
static int rt1011_hw_params(struct snd_pcm_substream *substream,
......@@ -118,28 +175,109 @@ static const struct snd_soc_ops rt1011_ops = {
static int rt1011_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID);
int ret;
ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr,
ARRAY_SIZE(speaker_map_lr));
if (ret)
dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
switch (num_codecs) {
case 2:
if (!soc_intel_is_cml()) {
ret = snd_soc_dapm_add_routes(&card->dapm, speaker_map_lr,
ARRAY_SIZE(speaker_map_lr));
if (ret) {
dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n",
ret);
return ret;
}
break;
}
/*
* register speaker widgets "WL Ext Spk" and "WR Ext Spk" to
* keep backward compatible with cml devices
*/
fallthrough;
case 4:
ret = snd_soc_dapm_new_controls(&card->dapm, realtek_4spk_widgets,
num_codecs);
if (ret) {
dev_err(rtd->dev, "fail to add rt1011 widgets, ret %d\n",
ret);
return ret;
}
ret = snd_soc_add_card_controls(card, realtek_4spk_kcontrols,
num_codecs);
if (ret) {
dev_err(rtd->dev, "fail to add rt1011 controls, ret %d\n",
ret);
return ret;
}
ret = snd_soc_dapm_add_routes(&card->dapm, rt1011_4spk_routes,
num_codecs);
if (ret) {
dev_err(rtd->dev, "fail to add rt1011 routes, ret %d\n",
ret);
return ret;
}
break;
default:
dev_err(rtd->dev, "rt1011: invalid num_codecs %d\n", num_codecs);
return -EINVAL;
}
return ret;
}
void sof_rt1011_dai_link(struct snd_soc_dai_link *link)
void sof_rt1011_dai_link(struct device *dev, struct snd_soc_dai_link *link)
{
unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID);
link->codecs = rt1011_dai_link_components;
link->num_codecs = ARRAY_SIZE(rt1011_dai_link_components);
switch (num_codecs) {
case 2:
case 4:
link->num_codecs = num_codecs;
break;
default:
dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs);
break;
}
link->init = rt1011_init;
link->ops = &rt1011_ops;
}
EXPORT_SYMBOL_NS(sof_rt1011_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
void sof_rt1011_codec_conf(struct snd_soc_card *card)
void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card)
{
card->codec_conf = rt1011_codec_confs;
card->num_configs = ARRAY_SIZE(rt1011_codec_confs);
unsigned int num_codecs = get_num_codecs(RT1011_ACPI_HID);
switch (num_codecs) {
case 2:
if (soc_intel_is_cml()) {
/*
* use name prefix 'WL' and 'WR' for speaker widgets to
* keep backward compatible with cml devices
*/
card->codec_conf = rt1011_4spk_codec_confs;
} else {
card->codec_conf = rt1011_2spk_codec_confs;
}
card->num_configs = num_codecs;
break;
case 4:
card->codec_conf = rt1011_4spk_codec_confs;
card->num_configs = ARRAY_SIZE(rt1011_4spk_codec_confs);
break;
default:
dev_err(dev, "rt1011: invalid num_codecs %d\n", num_codecs);
break;
}
}
EXPORT_SYMBOL_NS(sof_rt1011_codec_conf, SND_SOC_INTEL_SOF_REALTEK_COMMON);
......
......@@ -23,8 +23,8 @@
#define RT1011_DEV2_NAME "i2c-" RT1011_ACPI_HID ":02"
#define RT1011_DEV3_NAME "i2c-" RT1011_ACPI_HID ":03"
void sof_rt1011_dai_link(struct snd_soc_dai_link *link);
void sof_rt1011_codec_conf(struct snd_soc_card *card);
void sof_rt1011_dai_link(struct device *dev, struct snd_soc_dai_link *link);
void sof_rt1011_codec_conf(struct device *dev, struct snd_soc_card *card);
/*
* Realtek ALC1015 (AUTO)
......
......@@ -340,8 +340,19 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
clk_id = RT5682_SCLK_S_PLL1;
break;
case CODEC_RT5682S:
pll_id = RT5682S_PLL2;
clk_id = RT5682S_SCLK_S_PLL2;
/*
* For MCLK = 24.576MHz and sample rate = 96KHz case, use PLL1 We don't test
* pll_out or params_rate() here since rt5682s PLL2 doesn't support 24.576MHz
* input, so we have no choice but to use PLL1. Besides, we will not use PLL at
* all if pll_in == pll_out. ex, MCLK = 24.576Mhz and sample rate = 48KHz
*/
if (pll_in == 24576000) {
pll_id = RT5682S_PLL1;
clk_id = RT5682S_SCLK_S_PLL1;
} else {
pll_id = RT5682S_PLL2;
clk_id = RT5682S_SCLK_S_PLL2;
}
break;
default:
dev_err(rtd->dev, "invalid codec type %d\n", ctx->codec_type);
......@@ -576,7 +587,7 @@ sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
max_98390_dai_link(dev, ctx->amp_link);
break;
case CODEC_RT1011:
sof_rt1011_dai_link(ctx->amp_link);
sof_rt1011_dai_link(dev, ctx->amp_link);
break;
case CODEC_RT1015:
sof_rt1015_dai_link(ctx->amp_link);
......@@ -606,6 +617,7 @@ static int sof_audio_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
struct sof_card_private *ctx;
char *card_name;
bool is_legacy_cpu = false;
int ret;
......@@ -631,14 +643,27 @@ static int sof_audio_probe(struct platform_device *pdev)
return -ENOMEM;
if (ctx->codec_type == CODEC_RT5650) {
sof_audio_card_rt5682.name = devm_kstrdup(&pdev->dev, "rt5650",
GFP_KERNEL);
card_name = devm_kstrdup(&pdev->dev, "rt5650", GFP_KERNEL);
if (!card_name)
return -ENOMEM;
sof_audio_card_rt5682.name = card_name;
/* create speaker dai link also */
if (ctx->amp_type == CODEC_NONE)
ctx->amp_type = CODEC_RT5650;
}
if (ctx->amp_type == CODEC_RT1011 && soc_intel_is_cml()) {
/* backward-compatible with existing cml devices */
card_name = devm_kstrdup(&pdev->dev, "cml_rt1011_rt5682",
GFP_KERNEL);
if (!card_name)
return -ENOMEM;
sof_audio_card_rt5682.name = card_name;
}
if (is_legacy_cpu) {
ctx->rt5682.is_legacy_cpu = true;
ctx->dmic_be_num = 0;
......@@ -683,7 +708,7 @@ static int sof_audio_probe(struct platform_device *pdev)
max_98390_set_codec_conf(&pdev->dev, &sof_audio_card_rt5682);
break;
case CODEC_RT1011:
sof_rt1011_codec_conf(&sof_audio_card_rt5682);
sof_rt1011_codec_conf(&pdev->dev, &sof_audio_card_rt5682);
break;
case CODEC_RT1015:
sof_rt1015_codec_conf(&sof_audio_card_rt5682);
......
......@@ -27,7 +27,7 @@ static void log_quirks(struct device *dev)
dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n",
SOF_JACK_JDSRC(sof_sdw_quirk));
if (sof_sdw_quirk & SOF_SDW_FOUR_SPK)
dev_dbg(dev, "quirk SOF_SDW_FOUR_SPK enabled\n");
dev_err(dev, "quirk SOF_SDW_FOUR_SPK enabled but no longer supported\n");
if (sof_sdw_quirk & SOF_SDW_TGL_HDMI)
dev_dbg(dev, "quirk SOF_SDW_TGL_HDMI enabled\n");
if (sof_sdw_quirk & SOF_SDW_PCH_DMIC)
......@@ -80,8 +80,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
},
.driver_data = (void *)(RT711_JD2 |
SOF_SDW_FOUR_SPK),
.driver_data = (void *)(RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -89,8 +88,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
},
.driver_data = (void *)(RT711_JD2 |
SOF_SDW_FOUR_SPK),
.driver_data = (void *)(RT711_JD2),
},
/* IceLake devices */
{
......@@ -141,8 +139,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5D")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -151,8 +148,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -162,7 +158,6 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
SOF_SDW_PCH_DMIC |
SOF_SDW_FOUR_SPK |
SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT),
},
......@@ -173,8 +168,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Ripto"),
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
SOF_SDW_PCH_DMIC |
SOF_SDW_FOUR_SPK),
SOF_SDW_PCH_DMIC),
},
{
/*
......@@ -258,8 +252,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A32")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -290,7 +283,6 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
SOF_SDW_PCH_DMIC |
SOF_SDW_FOUR_SPK |
SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT),
},
......@@ -301,8 +293,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF0")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -311,8 +302,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AF3"),
},
/* No Jack */
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
SOF_SDW_FOUR_SPK),
.driver_data = (void *)(SOF_SDW_TGL_HDMI),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -321,8 +311,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFE")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -331,8 +320,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0AFF")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -341,8 +329,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B00")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -351,8 +338,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B01")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -361,8 +347,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B11")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -371,8 +356,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B12")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -400,8 +384,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0B29"),
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -428,6 +411,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0BDA")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C0F")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
......@@ -439,8 +431,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C10"),
},
/* No Jack */
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
SOF_SDW_FOUR_SPK),
.driver_data = (void *)(SOF_SDW_TGL_HDMI),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -449,8 +440,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C11")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -459,8 +449,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C40")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
{
.callback = sof_sdw_quirk_cb,
......@@ -469,8 +458,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C4F")
},
.driver_data = (void *)(SOF_SDW_TGL_HDMI |
RT711_JD2 |
SOF_SDW_FOUR_SPK),
RT711_JD2),
},
/* MeteorLake devices */
{
......@@ -498,6 +486,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
SOF_BT_OFFLOAD_SSP(1) |
SOF_SSP_BT_OFFLOAD_PRESENT),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Transcend Gaming Laptop"),
},
.driver_data = (void *)(RT711_JD2),
},
/* LunarLake devices */
{
.callback = sof_sdw_quirk_cb,
......@@ -737,6 +734,8 @@ static struct sof_sdw_codec_info codec_info_list[] = {
.dai_name = "rt712-sdca-aif2",
.dai_type = SOF_SDW_DAI_TYPE_AMP,
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
.init = sof_sdw_rt_amp_init,
.exit = sof_sdw_rt_amp_exit,
.rtd_init = rt712_spk_rtd_init,
},
},
......@@ -912,6 +911,8 @@ static struct sof_sdw_codec_info codec_info_list[] = {
.dai_type = SOF_SDW_DAI_TYPE_AMP,
/* No feedback capability is provided by rt722-sdca codec driver*/
.dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
.init = sof_sdw_rt_amp_init,
.exit = sof_sdw_rt_amp_exit,
.rtd_init = rt722_spk_rtd_init,
},
{
......@@ -1987,9 +1988,7 @@ static int mc_probe(struct platform_device *pdev)
amp_num += codec_info_list[i].amp_num;
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"cfg-spk:%d cfg-amp:%d",
(sof_sdw_quirk & SOF_SDW_FOUR_SPK)
? 4 : 2, amp_num);
"cfg-amp:%d", amp_num);
if (!card->components)
return -ENOMEM;
......
......@@ -45,6 +45,7 @@ enum {
};
#define SOF_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0))
/* Deprecated and no longer supported by the code */
#define SOF_SDW_FOUR_SPK BIT(4)
#define SOF_SDW_TGL_HDMI BIT(5)
#define SOF_SDW_PCH_DMIC BIT(6)
......
......@@ -453,11 +453,6 @@ static const struct snd_soc_acpi_codecs adl_max98357a_amp = {
.codecs = {"MX98357A"}
};
static const struct snd_soc_acpi_codecs adl_max98360a_amp = {
.num_codecs = 1,
.codecs = {"MX98360A"}
};
static const struct snd_soc_acpi_codecs adl_rt5682_rt5682s_hp = {
.num_codecs = 2,
.codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID},
......@@ -510,13 +505,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
},
{
.id = "DLGS7219",
.drv_name = "adl_da7219_def",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &adl_max98360a_amp,
.sof_tplg_filename = "sof-adl-max98360a-da7219.tplg",
},
/* place boards for each headphone codec: sof driver will complete the
* tplg name and machine driver will detect the amp type
*/
......@@ -527,6 +515,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = DA7219_ACPI_HID,
.drv_name = "adl_da7219_def",
.sof_tplg_filename = "sof-adl", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = NAU8825_ACPI_HID,
.drv_name = "adl_nau8825_def",
......
......@@ -42,7 +42,7 @@ static const struct snd_soc_acpi_codecs max98390_spk_codecs = {
struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_machines[] = {
{
.id = "10EC5682",
.drv_name = "cml_rt1011_rt5682",
.drv_name = "cml_rt5682_def",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &rt1011_spk_codecs,
.sof_tplg_filename = "sof-cml-rt1011-rt5682.tplg",
......
......@@ -76,6 +76,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = DA7219_ACPI_HID,
.drv_name = "mtl_da7219_def",
.sof_tplg_filename = "sof-mtl", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = NAU8825_ACPI_HID,
.drv_name = "mtl_nau8825_def",
......@@ -296,6 +303,15 @@ static const struct snd_soc_acpi_adr_device rt1316_2_group2_adr[] = {
}
};
static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
{
.adr = 0x000330025D131601ull,
.num_endpoints = 1,
.endpoints = &single_endpoint,
.name_prefix = "rt1316-1"
}
};
static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = {
{
.adr = 0x000130025D131801ull,
......@@ -562,6 +578,20 @@ static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12[] = {
{}
};
static const struct snd_soc_acpi_link_adr mtl_rt711_l0_rt1316_l3[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
.adr_d = rt711_sdca_0_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt1316_3_single_adr),
.adr_d = rt1316_3_single_adr,
},
{}
};
static const struct snd_soc_acpi_adr_device mx8363_2_adr[] = {
{
.adr = 0x000230019F836300ull,
......@@ -703,6 +733,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg",
},
{
.link_mask = 0x9, /* 2 active links required */
.links = mtl_rt711_l0_rt1316_l3,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-mtl-rt711-l0-rt1316-l3.tplg",
},
{
.link_mask = BIT(0),
.links = mtl_rt722_only,
......
......@@ -361,11 +361,6 @@ static const struct snd_soc_acpi_codecs rpl_max98357a_amp = {
.codecs = {"MX98357A"}
};
static const struct snd_soc_acpi_codecs rpl_max98360a_amp = {
.num_codecs = 1,
.codecs = {"MX98360A"},
};
static const struct snd_soc_acpi_codecs rpl_lt6911_hdmi = {
.num_codecs = 1,
.codecs = {"INTC10B0"}
......@@ -411,6 +406,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = {
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = DA7219_ACPI_HID,
.drv_name = "rpl_da7219_def",
.sof_tplg_filename = "sof-rpl", /* the tplg suffix is added at run time */
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_AMP_NAME |
SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME,
},
{
.id = NAU8825_ACPI_HID,
.drv_name = "rpl_nau8825_def",
......@@ -438,13 +440,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = {
.drv_name = "rpl_lt6911_hdmi_ssp",
.sof_tplg_filename = "sof-rpl-nocodec-hdmi-ssp02.tplg"
},
{
.id = "DLGS7219",
.drv_name = "rpl_da7219_def",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &rpl_max98360a_amp,
.sof_tplg_filename = "sof-rpl-max98360a-da7219.tplg",
},
{},
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_rpl_machines);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment