ASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker
authorMac Chiang <mac.chiang@intel.com>
Fri, 16 Jun 2023 06:36:17 +0000 (02:36 -0400)
committerMark Brown <broonie@kernel.org>
Wed, 21 Jun 2023 12:42:48 +0000 (13:42 +0100)
This patch support below hardware configuration:

SSP2: 10EC5682/RTL5682 codec
SSP0: RTL1019 amplifier

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230616063617.25900-2-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_rt5682.c
sound/soc/intel/common/soc-acpi-intel-mtl-match.c

index be34d75..7c034d6 100644 (file)
@@ -243,6 +243,20 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = {
                .callback = sof_rt5682_quirk_cb,
                .matches = {
                        DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"),
+                       DMI_MATCH(DMI_OEM_STRING, "AUDIO-ALC1019_ALC5682I_I2S"),
+               },
+               .driver_data = (void *)(SOF_RT5682_MCLK_EN |
+                                       SOF_RT5682_SSP_CODEC(2) |
+                                       SOF_SPEAKER_AMP_PRESENT |
+                                       SOF_RT1019_SPEAKER_AMP_PRESENT |
+                                       SOF_RT5682_SSP_AMP(0) |
+                                       SOF_RT5682_NUM_HDMIDEV(3)
+                                       ),
+       },
+       {
+               .callback = sof_rt5682_quirk_cb,
+               .matches = {
+                       DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"),
                },
                .driver_data = (void *)(SOF_RT5682_MCLK_EN |
                                        SOF_RT5682_SSP_CODEC(2) |
@@ -1155,6 +1169,15 @@ static const struct platform_device_id board_ids[] = {
                                        SOF_RT5682_SSP_AMP(1) |
                                        SOF_RT5682_NUM_HDMIDEV(4)),
        },
+       {
+               .name = "mtl_rt1019_rt5682",
+               .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
+                                       SOF_RT5682_SSP_CODEC(2) |
+                                       SOF_SPEAKER_AMP_PRESENT |
+                                       SOF_RT1019_SPEAKER_AMP_PRESENT |
+                                       SOF_RT5682_SSP_AMP(0) |
+                                       SOF_RT5682_NUM_HDMIDEV(3)),
+       },
        { }
 };
 MODULE_DEVICE_TABLE(platform, board_ids);
index 3d5cf88..ed9821a 100644 (file)
@@ -20,6 +20,11 @@ static const struct snd_soc_acpi_codecs mtl_max98360a_amp = {
        .codecs = {"MX98360A"}
 };
 
+static const struct snd_soc_acpi_codecs mtl_rt1019p_amp = {
+       .num_codecs = 1,
+       .codecs = {"RTL1019"}
+};
+
 static const struct snd_soc_acpi_codecs mtl_rt5682_rt5682s_hp = {
        .num_codecs = 2,
        .codecs = {"10EC5682", "RTL5682"},
@@ -40,6 +45,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[] = {
                .quirk_data = &mtl_max98360a_amp,
                .sof_tplg_filename = "sof-mtl-max98360a-rt5682.tplg",
        },
+       {
+               .comp_ids = &mtl_rt5682_rt5682s_hp,
+               .drv_name = "mtl_rt1019_rt5682",
+               .machine_quirk = snd_soc_acpi_codec_list,
+               .quirk_data = &mtl_rt1019p_amp,
+               .sof_tplg_filename = "sof-mtl-rt1019-rt5682.tplg",
+       },
        {},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_machines);