From: Hans de Goede Date: Sun, 26 Nov 2023 21:40:23 +0000 (+0100) Subject: ASoC: rt5645: Add mono speaker information to the components string X-Git-Tag: v6.8-rc1~20^2~1^2~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8184e1db699befc5101bcfe401283becfc228a0b;p=linux-block.git ASoC: rt5645: Add mono speaker information to the components string 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 Link: https://msgid.link/r/20231126214024.300505-7-hdegoede@redhat.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 4f3ef004f555..e109ee2e321c 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -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)