Commit c643c189 authored by Mac Chiang's avatar Mac Chiang Committed by Mark Brown

ASoC: Intel: boards: Add Cometlake machine driver support

reuse and add Cometlake support with:
SSP0 for DA7219 headphone codec
SSP1 for MAX98357a speaker amp codec
Signed-off-by: default avatarMac Chiang <mac.chiang@intel.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1565851909-13825-1-git-send-email-mac.chiang@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 72b745e3
...@@ -256,16 +256,20 @@ config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH ...@@ -256,16 +256,20 @@ config SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH
endif ## SND_SOC_INTEL_SKL endif ## SND_SOC_INTEL_SKL
config SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
tristate
select SND_SOC_DA7219
select SND_SOC_MAX98357A
select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
if SND_SOC_INTEL_APL if SND_SOC_INTEL_APL
config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH config SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH
tristate "Broxton with DA7219 and MAX98357A in I2S Mode" tristate "Broxton with DA7219 and MAX98357A in I2S Mode"
depends on I2C && ACPI depends on I2C && ACPI
depends on MFD_INTEL_LPSS || COMPILE_TEST depends on MFD_INTEL_LPSS || COMPILE_TEST
select SND_SOC_DA7219 select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
select SND_SOC_MAX98357A
select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
select SND_HDA_DSP_LOADER select SND_HDA_DSP_LOADER
help help
This adds support for ASoC machine driver for Broxton-P platforms This adds support for ASoC machine driver for Broxton-P platforms
...@@ -326,10 +330,7 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH ...@@ -326,10 +330,7 @@ config SND_SOC_INTEL_KBL_DA7219_MAX98357A_MACH
tristate "KBL with DA7219 and MAX98357A in I2S Mode" tristate "KBL with DA7219 and MAX98357A in I2S Mode"
depends on I2C && ACPI depends on I2C && ACPI
depends on MFD_INTEL_LPSS || COMPILE_TEST depends on MFD_INTEL_LPSS || COMPILE_TEST
select SND_SOC_DA7219 select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
select SND_SOC_MAX98357A
select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI
help help
This adds support for ASoC Onboard Codec I2S machine driver. This will This adds support for ASoC Onboard Codec I2S machine driver. This will
create an alsa sound card for DA7219 + MAX98357A I2S audio codec. create an alsa sound card for DA7219 + MAX98357A I2S audio codec.
...@@ -413,4 +414,14 @@ config SND_SOC_INTEL_SOF_RT5682_MACH ...@@ -413,4 +414,14 @@ config SND_SOC_INTEL_SOF_RT5682_MACH
If unsure select "N". If unsure select "N".
endif ## SND_SOC_SOF_HDA_COMMON || SND_SOC_SOF_BAYTRAIL endif ## SND_SOC_SOF_HDA_COMMON || SND_SOC_SOF_BAYTRAIL
if (SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK)
config SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH
tristate "CML_LP with DA7219 and MAX98357A in I2S Mode"
depends on I2C && ACPI
depends on MFD_INTEL_LPSS || COMPILE_TEST
select SND_SOC_INTEL_DA7219_MAX98357A_GENERIC
endif ## SND_SOC_SOF_COMETLAKE_LP && SND_SOC_SOF_HDA_LINK
endif ## SND_SOC_INTEL_MACH endif ## SND_SOC_INTEL_MACH
...@@ -179,10 +179,17 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -179,10 +179,17 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
int ret; int ret;
struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_component *component = rtd->codec_dai->component; struct snd_soc_component *component = rtd->codec_dai->component;
int clk_freq;
/* Configure sysclk for codec */ /* Configure sysclk for codec */
ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, 19200000, if (soc_intel_is_cml())
clk_freq = 24000000;
else
clk_freq = 19200000;
ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK, clk_freq,
SND_SOC_CLOCK_IN); SND_SOC_CLOCK_IN);
if (ret) { if (ret) {
dev_err(rtd->dev, "can't set codec sysclk configuration\n"); dev_err(rtd->dev, "can't set codec sysclk configuration\n");
return ret; return ret;
...@@ -683,6 +690,25 @@ static int broxton_audio_probe(struct platform_device *pdev) ...@@ -683,6 +690,25 @@ static int broxton_audio_probe(struct platform_device *pdev)
broxton_dais[i].cpus->dai_name = "SSP2 Pin"; broxton_dais[i].cpus->dai_name = "SSP2 Pin";
} }
} }
} else if (soc_intel_is_cml()) {
unsigned int i;
broxton_audio_card.name = "cmlda7219max";
for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) {
/* MAXIM_CODEC is connected to SSP1. */
if (!strcmp(broxton_dais[i].codecs->dai_name,
BXT_MAXIM_CODEC_DAI)) {
broxton_dais[i].name = "SSP1-Codec";
broxton_dais[i].cpus->dai_name = "SSP1 Pin";
}
/* DIALOG_CODEC is connected to SSP0 */
else if (!strcmp(broxton_dais[i].codecs->dai_name,
BXT_DIALOG_CODEC_DAI)) {
broxton_dais[i].name = "SSP0-Codec";
broxton_dais[i].cpus->dai_name = "SSP0 Pin";
}
}
} }
/* override plaform name, if required */ /* override plaform name, if required */
...@@ -700,6 +726,7 @@ static int broxton_audio_probe(struct platform_device *pdev) ...@@ -700,6 +726,7 @@ static int broxton_audio_probe(struct platform_device *pdev)
static const struct platform_device_id bxt_board_ids[] = { static const struct platform_device_id bxt_board_ids[] = {
{ .name = "bxt_da7219_max98357a" }, { .name = "bxt_da7219_max98357a" },
{ .name = "glk_da7219_max98357a" }, { .name = "glk_da7219_max98357a" },
{ .name = "cml_da7219_max98357a" },
{ } { }
}; };
...@@ -720,6 +747,8 @@ MODULE_AUTHOR("Rohit Ainapure <rohit.m.ainapure@intel.com>"); ...@@ -720,6 +747,8 @@ MODULE_AUTHOR("Rohit Ainapure <rohit.m.ainapure@intel.com>");
MODULE_AUTHOR("Harsha Priya <harshapriya.n@intel.com>"); MODULE_AUTHOR("Harsha Priya <harshapriya.n@intel.com>");
MODULE_AUTHOR("Conrad Cooke <conrad.cooke@intel.com>"); MODULE_AUTHOR("Conrad Cooke <conrad.cooke@intel.com>");
MODULE_AUTHOR("Naveen Manohar <naveen.m@intel.com>"); MODULE_AUTHOR("Naveen Manohar <naveen.m@intel.com>");
MODULE_AUTHOR("Mac Chiang <mac.chiang@intel.com>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:bxt_da7219_max98357a"); MODULE_ALIAS("platform:bxt_da7219_max98357a");
MODULE_ALIAS("platform:glk_da7219_max98357a"); MODULE_ALIAS("platform:glk_da7219_max98357a");
MODULE_ALIAS("platform:cml_da7219_max98357a");
...@@ -19,6 +19,11 @@ static struct snd_soc_acpi_codecs cml_codecs = { ...@@ -19,6 +19,11 @@ static struct snd_soc_acpi_codecs cml_codecs = {
.codecs = {"10EC5682"} .codecs = {"10EC5682"}
}; };
static struct snd_soc_acpi_codecs cml_spk_codecs = {
.num_codecs = 1,
.codecs = {"MX98357A"}
};
struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
{ {
.id = "INT34C2", .id = "INT34C2",
...@@ -28,6 +33,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = { ...@@ -28,6 +33,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
.sof_fw_filename = "sof-cnl.ri", .sof_fw_filename = "sof-cnl.ri",
.sof_tplg_filename = "sof-cnl-rt274.tplg", .sof_tplg_filename = "sof-cnl-rt274.tplg",
}, },
{
.id = "DLGS7219",
.drv_name = "cml_da7219_max98357a",
.quirk_data = &cml_spk_codecs,
.sof_fw_filename = "sof-cnl.ri",
.sof_tplg_filename = "sof-cml-da7219-max98357a.tplg",
},
{ {
.id = "MX98357A", .id = "MX98357A",
.drv_name = "sof_rt5682", .drv_name = "sof_rt5682",
......
...@@ -36,6 +36,7 @@ SOC_INTEL_IS_CPU(byt, INTEL_FAM6_ATOM_SILVERMONT); ...@@ -36,6 +36,7 @@ SOC_INTEL_IS_CPU(byt, INTEL_FAM6_ATOM_SILVERMONT);
SOC_INTEL_IS_CPU(cht, INTEL_FAM6_ATOM_AIRMONT); SOC_INTEL_IS_CPU(cht, INTEL_FAM6_ATOM_AIRMONT);
SOC_INTEL_IS_CPU(apl, INTEL_FAM6_ATOM_GOLDMONT); SOC_INTEL_IS_CPU(apl, INTEL_FAM6_ATOM_GOLDMONT);
SOC_INTEL_IS_CPU(glk, INTEL_FAM6_ATOM_GOLDMONT_PLUS); SOC_INTEL_IS_CPU(glk, INTEL_FAM6_ATOM_GOLDMONT_PLUS);
SOC_INTEL_IS_CPU(cml, INTEL_FAM6_KABYLAKE_MOBILE);
static inline bool soc_intel_is_byt_cr(struct platform_device *pdev) static inline bool soc_intel_is_byt_cr(struct platform_device *pdev)
{ {
...@@ -110,6 +111,10 @@ static inline bool soc_intel_is_glk(void) ...@@ -110,6 +111,10 @@ static inline bool soc_intel_is_glk(void)
return false; return false;
} }
static inline bool soc_intel_is_cml(void)
{
return false;
}
#endif #endif
#endif /* _SND_SOC_INTEL_QUIRKS_H */ #endif /* _SND_SOC_INTEL_QUIRKS_H */
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