Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sound/soc/intel/boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ config SND_SOC_INTEL_SOF_CS42L42_MACH
(MFD_INTEL_LPSS || COMPILE_TEST))
select SND_SOC_CS42L42
select SND_SOC_MAX98357A
select SND_SOC_MAX98396
select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
select SND_SOC_INTEL_HDA_DSP_COMMON
Expand Down
21 changes: 21 additions & 0 deletions sound/soc/intel/boards/sof_cs42l42.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
(((quirk) << SOF_CS42L42_SSP_BT_SHIFT) & SOF_CS42L42_SSP_BT_MASK)
#define SOF_MAX98357A_SPEAKER_AMP_PRESENT BIT(29)
#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(30)
#define SOF_MAX98396_SPEAKER_AMP_PRESENT BIT(31)

enum {
LINK_NONE = 0,
Expand Down Expand Up @@ -222,11 +223,15 @@ static int sof_card_late_probe(struct snd_soc_card *card)
static const struct snd_kcontrol_new sof_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
SOC_DAPM_PIN_SWITCH("Left Spk"),
SOC_DAPM_PIN_SWITCH("Right Spk"),
};

static const struct snd_soc_dapm_widget sof_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_SPK("Left Spk", NULL),
SND_SOC_DAPM_SPK("Right Spk", NULL),
};

static const struct snd_soc_dapm_widget dmic_widgets[] = {
Expand Down Expand Up @@ -320,6 +325,8 @@ static int create_spk_amp_dai_links(struct device *dev,
max_98357a_dai_link(&links[*id]);
} else if (sof_cs42l42_quirk & SOF_MAX98360A_SPEAKER_AMP_PRESENT) {
max_98360a_dai_link(&links[*id]);
} else if (sof_cs42l42_quirk & SOF_MAX98396_SPEAKER_AMP_PRESENT) {
max_98396_dai_link(&links[*id]);
} else {
dev_err(dev, "no amp defined\n");
ret = -EINVAL;
Expand Down Expand Up @@ -651,6 +658,9 @@ static int sof_audio_probe(struct platform_device *pdev)

if (sof_cs42l42_quirk & SOF_SPEAKER_AMP_PRESENT)
sof_audio_card_cs42l42.num_links++;
if (sof_cs42l42_quirk & SOF_MAX98396_SPEAKER_AMP_PRESENT)
sof_max98396_codec_conf(&sof_audio_card_cs42l42);

if (sof_cs42l42_quirk & SOF_BT_OFFLOAD_PRESENT)
sof_audio_card_cs42l42.num_links++;

Expand Down Expand Up @@ -707,6 +717,17 @@ static const struct platform_device_id board_ids[] = {
SOF_CS42L42_SSP_BT(2) |
SOF_CS42L42_DAILINK(LINK_HP, LINK_DMIC, LINK_HDMI, LINK_SPK, LINK_BT)),
},
{
.name = "adl_mx98396_cs4242",
.driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) |
SOF_SPEAKER_AMP_PRESENT |
SOF_MAX98396_SPEAKER_AMP_PRESENT |
SOF_CS42L42_SSP_AMP(1) |
SOF_CS42L42_NUM_HDMIDEV(4) |
SOF_BT_OFFLOAD_PRESENT |
SOF_CS42L42_SSP_BT(2) |
SOF_CS42L42_DAILINK(LINK_HP, LINK_DMIC, LINK_HDMI, LINK_SPK, LINK_BT)),
},
{ }
};
MODULE_DEVICE_TABLE(platform, board_ids);
Expand Down
51 changes: 49 additions & 2 deletions sound/soc/intel/boards/sof_maxim_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ static int max_98373_hw_params(struct snd_pcm_substream *substream,
int j;

for_each_rtd_codec_dais(rtd, j, codec_dai) {
if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME) ||
!strcmp(codec_dai->component->name, MAX_98396_DEV0_NAME)) {
/* DEV0 tdm slot configuration */
snd_soc_dai_set_tdm_slot(codec_dai, 0x03, 3, 8, 32);
}
if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME) ||
!strcmp(codec_dai->component->name, MAX_98396_DEV1_NAME)) {
/* DEV1 tdm slot configuration */
snd_soc_dai_set_tdm_slot(codec_dai, 0x0C, 3, 8, 32);
}
Expand Down Expand Up @@ -313,6 +315,51 @@ void max_98390_set_codec_conf(struct snd_soc_card *card, int ch)
}
EXPORT_SYMBOL_NS(max_98390_set_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);

/*
* Maxim MAX98396
*/
static struct snd_soc_codec_conf max_98396_codec_conf[] = {
{
.dlc = COMP_CODEC_CONF(MAX_98396_DEV0_NAME),
.name_prefix = "Right",
},
{
.dlc = COMP_CODEC_CONF(MAX_98396_DEV1_NAME),
.name_prefix = "Left",
},
};

static struct snd_soc_dai_link_component max_98396_components[] = {
{ /* For Right */
.name = MAX_98396_DEV0_NAME,
.dai_name = MAX_98396_CODEC_DAI,
},
{ /* For Left */
.name = MAX_98396_DEV1_NAME,
.dai_name = MAX_98396_CODEC_DAI,
},
};

static const struct snd_soc_ops max_98396_ops = {
.hw_params = max_98373_hw_params,
};

void max_98396_dai_link(struct snd_soc_dai_link *link)
{
link->codecs = max_98396_components;
link->num_codecs = ARRAY_SIZE(max_98396_components);
link->init = max_98373_spk_codec_init;
link->ops = &max_98396_ops;
}
EXPORT_SYMBOL_NS(max_98396_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);

void sof_max98396_codec_conf(struct snd_soc_card *card)
{
card->codec_conf = max_98396_codec_conf;
card->num_configs = ARRAY_SIZE(max_98396_codec_conf);
}
EXPORT_SYMBOL_NS(sof_max98396_codec_conf, SND_SOC_INTEL_SOF_MAXIM_COMMON);

/*
* Maxim MAX98357A/MAX98360A
*/
Expand Down
10 changes: 10 additions & 0 deletions sound/soc/intel/boards/sof_maxim_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ extern const struct snd_soc_ops max_98390_ops;
void max_98390_set_codec_conf(struct snd_soc_card *card, int ch);
int max_98390_spk_codec_init(struct snd_soc_pcm_runtime *rtd);

/*
* Maxim MAX98396
*/
#define MAX_98396_CODEC_DAI "max98396-aif1"
#define MAX_98396_DEV0_NAME "i2c-ADS8396-00"
#define MAX_98396_DEV1_NAME "i2c-ADS8396-01"

void max_98396_dai_link(struct snd_soc_dai_link *link);
void sof_max98396_codec_conf(struct snd_soc_card *card);

/*
* Maxim MAX98357A/MAX98360A
*/
Expand Down
12 changes: 12 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-adl-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ static const struct snd_soc_acpi_codecs adl_max98390_amp = {
.codecs = {"MX98390"}
};

static const struct snd_soc_acpi_codecs adl_max98396_amp = {
.num_codecs = 1,
.codecs = {"ADS8396"}
};

static const struct snd_soc_acpi_codecs adl_lt6911_hdmi = {
.num_codecs = 1,
.codecs = {"INTC10B0"}
Expand Down Expand Up @@ -580,6 +585,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
.quirk_data = &adl_max98360a_amp,
.sof_tplg_filename = "sof-adl-max98360a-cs42l42.tplg",
},
{
.id = "10134242",
.drv_name = "adl_mx98396_cs4242",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &adl_max98396_amp,
.sof_tplg_filename = "sof-adl-max98396-cs42l42.tplg",
},
{
.comp_ids = &essx_83x6,
.drv_name = "adl_es83x6_c1_h02",
Expand Down