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 @@ -516,6 +516,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_INTEL_HDA_DSP_COMMON
select SND_SOC_INTEL_SOF_BOARD_HELPERS
Expand Down
27 changes: 27 additions & 0 deletions sound/soc/intel/boards/sof_cs42l42.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ static int create_spk_amp_dai_links(struct device *dev,
case CODEC_MAX98360A:
max_98360a_dai_link(&links[*id]);
break;
case CODEC_MAX98396:
max_98396_dai_link(&links[*id]);
break;

default:
dev_err(dev, "invalid amp type %d\n", amp_type);
return -EINVAL;
Expand Down Expand Up @@ -466,6 +470,19 @@ static int sof_audio_probe(struct platform_device *pdev)

sof_audio_card_cs42l42.dai_link = dai_links;

/* update codec_conf */
switch (ctx->amp_type) {
case CODEC_MAX98396:
max_98396_set_codec_conf(&sof_audio_card_cs42l42);
break;
case CODEC_NONE:
/* no codec conf required */
break;
default:
dev_err(&pdev->dev, "invalid amp type %d\n", ctx->amp_type);
return -EINVAL;
}

sof_audio_card_cs42l42.dev = &pdev->dev;

/* set platform name for each dailink */
Expand Down Expand Up @@ -502,6 +519,16 @@ 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_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
52 changes: 50 additions & 2 deletions sound/soc/intel/boards/sof_maxim_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,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 @@ -343,6 +345,52 @@ void max_98390_set_codec_conf(struct device *dev, struct snd_soc_card *card)
}
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",
},
};

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,
.trigger = max_98373_trigger,
};

void max_98396_dai_link(struct snd_soc_dai_link *link)
{
link->codecs = max_98396_components;
link->num_codecs = get_num_codecs(MAX_98396_ACPI_HID);
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(max_98396_set_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 @@ int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);
void max_98390_dai_link(struct device *dev, struct snd_soc_dai_link *link);
void max_98390_set_codec_conf(struct device *dev, struct snd_soc_card *card);

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

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

/*
* Maxim MAX98357A/MAX98360A
*/
Expand Down
1 change: 1 addition & 0 deletions sound/soc/intel/boards/sof_ssp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static const struct codec_map amps[] = {
CODEC_MAP_ENTRY("MAX98360A", MAX_98360A_ACPI_HID, CODEC_MAX98360A),
CODEC_MAP_ENTRY("MAX98373", MAX_98373_ACPI_HID, CODEC_MAX98373),
CODEC_MAP_ENTRY("MAX98390", MAX_98390_ACPI_HID, CODEC_MAX98390),
CODEC_MAP_ENTRY("ADS8396", MAX_98396_ACPI_HID, CODEC_MAX98396),

/* Nuvoton */
CODEC_MAP_ENTRY("NAU8318", NAU8318_ACPI_HID, CODEC_NAU8318),
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/intel/boards/sof_ssp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define MAX_98360A_ACPI_HID "MX98360A"
#define MAX_98373_ACPI_HID "MX98373"
#define MAX_98390_ACPI_HID "MX98390"
#define MAX_98396_ACPI_HID "ADS8396"

/* Nuvoton */
#define NAU8318_ACPI_HID "NVTN2012"
Expand Down Expand Up @@ -63,6 +64,7 @@ enum sof_ssp_codec {
CODEC_RT1015P,
CODEC_RT1019P,
CODEC_RT1308,
CODEC_MAX98396,
};

enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev);
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 @@ -497,6 +497,11 @@ static struct snd_soc_acpi_codecs adl_rt5650_amp = {
.codecs = {"10EC5650"}
};

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

struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
{
.comp_ids = &adl_rt5682_rt5682s_hp,
Expand Down Expand Up @@ -592,6 +597,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