]> git.itanic.dy.fi Git - linux-stable/commitdiff
ASoC: rt5645: Add mono speaker information to the components string
authorHans de Goede <hdegoede@redhat.com>
Sun, 26 Nov 2023 21:40:23 +0000 (22:40 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 21 Dec 2023 21:00:47 +0000 (21:00 +0000)
The GPD Win and Teclast X80 Pro both only have 1 speaker add information
about this to the components string.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://msgid.link/r/20231126214024.300505-7-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5645.c

index 4f3ef004f555037bfdae502bd236de2fa80c0dcb..e109ee2e321c5d70affe8159643a05649fe126cc 100644 (file)
@@ -428,6 +428,9 @@ struct rt5645_platform_data {
        /* Invert HP detect status polarity */
        bool inv_hp_pol;
 
+       /* Only 1 speaker connected */
+       bool mono_speaker;
+
        /* Value to assign to snd_soc_card.long_name */
        const char *long_name;
 
@@ -3653,6 +3656,7 @@ static const struct rt5645_platform_data buddy_platform_data = {
 static const struct rt5645_platform_data gpd_win_platform_data = {
        .jd_mode = 3,
        .inv_jd1_1 = true,
+       .mono_speaker = true,
        .long_name = "gpd-win-pocket-rt5645",
        /* The GPD pocket has a diff. mic, for the win this does not matter. */
        .in2_diff = true,
@@ -3676,6 +3680,11 @@ static const struct rt5645_platform_data lenovo_ideapad_miix_310_pdata = {
        .in2_diff = true,
 };
 
+static const struct rt5645_platform_data jd_mode3_monospk_platform_data = {
+       .jd_mode = 3,
+       .mono_speaker = true,
+};
+
 static const struct rt5645_platform_data jd_mode3_platform_data = {
        .jd_mode = 3,
 };
@@ -3795,7 +3804,7 @@ static const struct dmi_system_id dmi_platform_data[] = {
                        DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "X80 Pro"),
                },
-               .driver_data = (void *)&jd_mode3_platform_data,
+               .driver_data = (void *)&jd_mode3_monospk_platform_data,
        },
        {
                .ident = "Lenovo Ideapad Miix 310",
@@ -3911,6 +3920,9 @@ const char *rt5645_components(struct device *codec_dev)
 
        rt5645_get_pdata(codec_dev, &pdata);
 
+       if (pdata.mono_speaker)
+               spk = 1;
+
        if (pdata.dmic1_data_pin && pdata.dmic2_data_pin)
                mic = "dmics12";
        else if (pdata.dmic1_data_pin)