Commit 224be454 authored by Mark Brown's avatar Mark Brown

ASoC: Intel: machine driver updates for 6.6

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

Lots of small cleanups coming from Bard Liao and Charles Keepax for
SoundWire platforms, and minor additions for RVPs and Chromebooks.
parents d09fd7eb a60ed3b7
...@@ -671,14 +671,15 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH ...@@ -671,14 +671,15 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
select SND_SOC_RT711_SDCA_SDW select SND_SOC_RT711_SDCA_SDW
select SND_SOC_RT712_SDCA_SDW select SND_SOC_RT712_SDCA_SDW
select SND_SOC_RT712_SDCA_DMIC_SDW select SND_SOC_RT712_SDCA_DMIC_SDW
select SND_SOC_RT715_SDW
select SND_SOC_RT715_SDCA_SDW
select SND_SOC_RT1308_SDW select SND_SOC_RT1308_SDW
select SND_SOC_RT1308 select SND_SOC_RT1308
select SND_SOC_RT1316_SDW select SND_SOC_RT1316_SDW
select SND_SOC_RT1318_SDW select SND_SOC_RT1318_SDW
select SND_SOC_RT715_SDW
select SND_SOC_RT715_SDCA_SDW
select SND_SOC_RT5682_SDW select SND_SOC_RT5682_SDW
select SND_SOC_CS42L42_SDW select SND_SOC_CS42L42_SDW
select SND_SOC_CS35L56_SDW
select SND_SOC_DMIC select SND_SOC_DMIC
select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_HDA_DSP_COMMON
select SND_SOC_INTEL_SOF_MAXIM_COMMON select SND_SOC_INTEL_SOF_MAXIM_COMMON
......
...@@ -42,7 +42,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o \ ...@@ -42,7 +42,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o \
sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \
sof_sdw_rt712_sdca.o sof_sdw_rt715.o \ sof_sdw_rt712_sdca.o sof_sdw_rt715.o \
sof_sdw_rt715_sdca.o sof_sdw_dmic.o \ sof_sdw_rt715_sdca.o sof_sdw_dmic.o \
sof_sdw_cs42l42.o \ sof_sdw_cs42l42.o sof_sdw_cs_amp.o \
sof_sdw_hdmi.o sof_sdw_hdmi.o
obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o
......
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
#define SOF_RT1019_SPEAKER_AMP_PRESENT BIT(26) #define SOF_RT1019_SPEAKER_AMP_PRESENT BIT(26)
#define SOF_RT5650_HEADPHONE_CODEC_PRESENT BIT(27) #define SOF_RT5650_HEADPHONE_CODEC_PRESENT BIT(27)
/* HDMI capture*/
#define SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT 27
#define SOF_SSP_HDMI_CAPTURE_PRESENT_MASK (GENMASK(30, 27))
#define SOF_HDMI_CAPTURE_SSP_MASK(quirk) \
(((quirk) << SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT) & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK)
/* Default: MCLK on, MCLK 19.2M, SSP0 */ /* Default: MCLK on, MCLK 19.2M, SSP0 */
static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN | static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
...@@ -670,6 +675,7 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, ...@@ -670,6 +675,7 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
struct snd_soc_dai_link_component *cpus; struct snd_soc_dai_link_component *cpus;
struct snd_soc_dai_link *links; struct snd_soc_dai_link *links;
int i, id = 0; int i, id = 0;
int hdmi_id_offset = 0;
links = devm_kcalloc(dev, sof_audio_card_rt5682.num_links, links = devm_kcalloc(dev, sof_audio_card_rt5682.num_links,
sizeof(struct snd_soc_dai_link), GFP_KERNEL); sizeof(struct snd_soc_dai_link), GFP_KERNEL);
...@@ -891,6 +897,34 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, ...@@ -891,6 +897,34 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
links[id].num_cpus = 1; links[id].num_cpus = 1;
} }
/* HDMI-In SSP */
if (sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) {
unsigned long hdmi_in_ssp = (sof_rt5682_quirk &
SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) >>
SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT;
int port = 0;
for_each_set_bit(port, &hdmi_in_ssp, 32) {
links[id].cpus = &cpus[id];
links[id].cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL,
"SSP%d Pin", port);
if (!links[id].cpus->dai_name)
return NULL;
links[id].name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-HDMI", port);
if (!links[id].name)
return NULL;
links[id].id = id + hdmi_id_offset;
links[id].codecs = &asoc_dummy_dlc;
links[id].num_codecs = 1;
links[id].platforms = platform_component;
links[id].num_platforms = ARRAY_SIZE(platform_component);
links[id].dpcm_capture = 1;
links[id].no_pcm = 1;
links[id].num_cpus = 1;
id++;
}
}
return links; return links;
devm_err: devm_err:
return NULL; return NULL;
...@@ -997,6 +1031,11 @@ static int sof_audio_probe(struct platform_device *pdev) ...@@ -997,6 +1031,11 @@ static int sof_audio_probe(struct platform_device *pdev)
if (sof_rt5682_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) if (sof_rt5682_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
sof_audio_card_rt5682.num_links++; sof_audio_card_rt5682.num_links++;
if (sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK)
sof_audio_card_rt5682.num_links +=
hweight32((sof_rt5682_quirk & SOF_SSP_HDMI_CAPTURE_PRESENT_MASK) >>
SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT);
dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp, dai_links = sof_card_dai_links_create(&pdev->dev, ssp_codec, ssp_amp,
dmic_be_num, hdmi_num, ctx->idisp_codec); dmic_be_num, hdmi_num, ctx->idisp_codec);
if (!dai_links) if (!dai_links)
...@@ -1163,6 +1202,22 @@ static const struct platform_device_id board_ids[] = { ...@@ -1163,6 +1202,22 @@ static const struct platform_device_id board_ids[] = {
SOF_BT_OFFLOAD_SSP(2) | SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT), SOF_SSP_BT_OFFLOAD_PRESENT),
}, },
{
.name = "adl_rt5682_c1_h02",
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
SOF_RT5682_SSP_CODEC(1) |
SOF_RT5682_NUM_HDMIDEV(3) |
/* SSP 0 and SSP 2 are used for HDMI IN */
SOF_HDMI_CAPTURE_SSP_MASK(0x5)),
},
{
.name = "rpl_mx98357_rt5682",
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
SOF_RT5682_SSP_CODEC(0) |
SOF_SPEAKER_AMP_PRESENT |
SOF_RT5682_SSP_AMP(2) |
SOF_RT5682_NUM_HDMIDEV(4)),
},
{ {
.name = "rpl_mx98360_rt5682", .name = "rpl_mx98360_rt5682",
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
......
This diff is collapsed.
...@@ -80,6 +80,7 @@ struct sof_sdw_dai_info { ...@@ -80,6 +80,7 @@ struct sof_sdw_dai_info {
struct sof_sdw_codec_info { struct sof_sdw_codec_info {
const int part_id; const int part_id;
const int version_id; const int version_id;
const char *codec_name;
int amp_num; int amp_num;
const u8 acpi_id[ACPI_ID_LEN]; const u8 acpi_id[ACPI_ID_LEN];
const bool ignore_pch_dmic; const bool ignore_pch_dmic;
...@@ -205,4 +206,10 @@ int sof_sdw_cs42l42_init(struct snd_soc_card *card, ...@@ -205,4 +206,10 @@ int sof_sdw_cs42l42_init(struct snd_soc_card *card,
struct sof_sdw_codec_info *info, struct sof_sdw_codec_info *info,
bool playback); 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);
#endif #endif
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2023 Intel Corporation
/*
* sof_sdw_cs_amp - Helpers to handle CS35L56 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"
#define CODEC_NAME_SIZE 8
static int cs_spk_init(struct snd_soc_pcm_runtime *rtd)
{
const char *dai_name = rtd->dai_link->codecs->dai_name;
struct snd_soc_card *card = rtd->card;
char codec_name[CODEC_NAME_SIZE];
snprintf(codec_name, CODEC_NAME_SIZE, "%s", dai_name);
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s spk:%s",
card->components, codec_name);
if (!card->components)
return -ENOMEM;
return 0;
}
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)
{
/* Count amp number and do init on playback link only. */
if (!playback)
return 0;
info->amp_num++;
dai_links->init = cs_spk_init;
return 0;
}
...@@ -568,6 +568,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { ...@@ -568,6 +568,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
.quirk_data = &adl_max98390_amp, .quirk_data = &adl_max98390_amp,
.sof_tplg_filename = "sof-adl-max98390-rt5682.tplg", .sof_tplg_filename = "sof-adl-max98390-rt5682.tplg",
}, },
{
.comp_ids = &adl_rt5682_rt5682s_hp,
.drv_name = "adl_rt5682_c1_h02",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &adl_lt6911_hdmi,
.sof_tplg_filename = "sof-adl-rt5682-ssp1-hdmi-ssp02.tplg",
},
{ {
.comp_ids = &adl_rt5682_rt5682s_hp, .comp_ids = &adl_rt5682_rt5682s_hp,
.drv_name = "adl_rt5682", .drv_name = "adl_rt5682",
......
...@@ -308,6 +308,15 @@ static const struct snd_soc_acpi_link_adr rpl_sdw_rt1316_link12_rt714_link0[] = ...@@ -308,6 +308,15 @@ static const struct snd_soc_acpi_link_adr rpl_sdw_rt1316_link12_rt714_link0[] =
{} {}
}; };
static const struct snd_soc_acpi_link_adr rpl_sdca_rvp[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
.adr_d = rt711_sdca_0_adr,
},
{}
};
static const struct snd_soc_acpi_link_adr rplp_crb[] = { static const struct snd_soc_acpi_link_adr rplp_crb[] = {
{ {
.mask = BIT(2), .mask = BIT(2),
...@@ -322,6 +331,11 @@ static const struct snd_soc_acpi_codecs rpl_rt5682_hp = { ...@@ -322,6 +331,11 @@ static const struct snd_soc_acpi_codecs rpl_rt5682_hp = {
.codecs = {"10EC5682", "RTL5682"}, .codecs = {"10EC5682", "RTL5682"},
}; };
static const struct snd_soc_acpi_codecs rpl_max98357a_amp = {
.num_codecs = 1,
.codecs = {"MX98357A"}
};
static const struct snd_soc_acpi_codecs rpl_max98360a_amp = { static const struct snd_soc_acpi_codecs rpl_max98360a_amp = {
.num_codecs = 1, .num_codecs = 1,
.codecs = {"MX98360A"}, .codecs = {"MX98360A"},
...@@ -338,6 +352,13 @@ static const struct snd_soc_acpi_codecs rpl_rt1019p_amp = { ...@@ -338,6 +352,13 @@ static const struct snd_soc_acpi_codecs rpl_rt1019p_amp = {
}; };
struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = { struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[] = {
{
.comp_ids = &rpl_rt5682_hp,
.drv_name = "rpl_mx98357_rt5682",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &rpl_max98357a_amp,
.sof_tplg_filename = "sof-rpl-max98357a-rt5682.tplg",
},
{ {
.comp_ids = &rpl_rt5682_hp, .comp_ids = &rpl_rt5682_hp,
.drv_name = "rpl_mx98360_rt5682", .drv_name = "rpl_mx98360_rt5682",
...@@ -413,6 +434,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = { ...@@ -413,6 +434,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[] = {
.drv_name = "sof_sdw", .drv_name = "sof_sdw",
.sof_tplg_filename = "sof-rpl-rt711-l0.tplg", .sof_tplg_filename = "sof-rpl-rt711-l0.tplg",
}, },
{
.link_mask = 0x1, /* link0 required */
.links = rpl_sdca_rvp,
.drv_name = "sof_sdw",
.sof_tplg_filename = "sof-rpl-rt711-l0.tplg",
},
{ {
.link_mask = 0x4, /* link2 required */ .link_mask = 0x4, /* link2 required */
.links = rplp_crb, .links = rplp_crb,
......
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