Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17992017ybl; Thu, 2 Jan 2020 16:22:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzq+OjA7e2OqQ6soI9s1B01cY9dfSrc5dBHyM8+8peZWW6/dzNsZ65jIU1GYeVtUlgikeKY X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr92021143otr.82.1578010923843; Thu, 02 Jan 2020 16:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578010923; cv=none; d=google.com; s=arc-20160816; b=KyNvgQ+2Maow2KFkTvpJGWZ6lUcwdzWrBSqAdYM5QDb8xJ7+raeyw8FLIw+G3s0p3j hXVFyHYz6mWqlzoZCsqpeBOQOvoW5YDzEu3Ocq7A3TAmsi5KOiisWQOrgSvYi3t7MrZw Bsi2wPGi24mQXHNB6tunHrbnz/MJ0vovfXURs28N/W6+wfDVjNCuZGtXIss8NyYlxPFa mtNlpkM+ajnBWKFxpIaVe83u7HcHBwDY02MfYAokqdfEK9dJEUjHSezmLwGUMyYBxtKg nM6INGJkJe0hhjvVY7WX3g5OM5KqxT6pgahEWVp2qfMqLeyaW0v/9tFpSkgw5KcxjoF0 lgiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PRPBkou+uS1zWNSOaxrecr/7LWg1sY/IJLNmSa72PP0=; b=HwnU2mPKIZYfEEMxThHxM7X8n7J9kAzaKWQ+BA6FxU5cXJvCjHszekY4+nOJLNHNAr C+/EwmRW3ucPGSv76WcBE7McqYnDYPpvL01JR41VyDVFxwPLpkCuULrw6Dqxk/cn0bKE NZX60iKlcJyNHyOq+Js3G8l7TpL1qC+CBuT+sKvfXE1UBs5p65rg44Y93TSlEn2YsmMQ Fsi84uHkp6QUn4cdbKUXRaVlkldvBKZwXTdv4T7PpvEGPkZ8tVQyTJghUEBMf59GqDDe 95UvlvfvIs/l8KTdp2hLqbf9+PObz6wXQ8WMBWXs0YMKfdenKM/V2zx7RPSo1OzpZXKd flmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KzOw1b7W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x185si25265292oig.201.2020.01.02.16.21.51; Thu, 02 Jan 2020 16:22:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KzOw1b7W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbgACAVG (ORCPT + 99 others); Thu, 2 Jan 2020 19:21:06 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54172 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbgACAVG (ORCPT ); Thu, 2 Jan 2020 19:21:06 -0500 Received: by mail-wm1-f68.google.com with SMTP id m24so7057087wmc.3 for ; Thu, 02 Jan 2020 16:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PRPBkou+uS1zWNSOaxrecr/7LWg1sY/IJLNmSa72PP0=; b=KzOw1b7W+dgKGAThSM9EsvLpjbfAF32G6nByR78jmSLIj8CsDCnVA+3qESaq9lo/Mz tlp9GPLePItxsfN3nNTGPHtReAGQMwMxGwKDT8ZOpX1rOSgrWQte8t5TFTPm7CjZRVld MghGWqE/AP95QTb63M2Vc9Uh0tOBGjV4KG2So= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PRPBkou+uS1zWNSOaxrecr/7LWg1sY/IJLNmSa72PP0=; b=svhVi7kRJ6njD7MfIGjQeYzj/SUBpHi6e+E+tF+ZpiFEX0eY/k7bW8lSCxlUZiPNQr wZ4wd7Lo8fc07ozreOqNaPabXPbE5CfiAHR52A0EpEY6pKkS5Yc6pofYS2HUOE1Q9tsh E8qXf+uzjVPK1yYwwEK4nrZlRjhaPQXShNPpJ5Vo8EHxNBKRS81biiL/nNav5qxhWdQJ 8NP8g7mOUCdRDgAKWTfbPfna+TtDF0QQ3dJPL2x8+gF2GUzJf89Q9LE68PDUnb3MZ0f/ B4L+yaF/b20vucU8UkYNUv7hr3/ZvoH3zP9QtLpZtyR9HRkwDiXsW2vTZpENX96mk3Qx 7xDg== X-Gm-Message-State: APjAAAU4NJkUlI0mIl0u6vrrcRn2MUopNzLTCLpIYtnGIsAvpMYy+HQV o0sPxfS9hvB/dMmuBceesFEweppintvQck/gqTap8A== X-Received: by 2002:a1c:7715:: with SMTP id t21mr15944147wmi.149.1578010864658; Thu, 02 Jan 2020 16:21:04 -0800 (PST) MIME-Version: 1.0 References: <20200102112558.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid> In-Reply-To: From: Sam McNally Date: Fri, 3 Jan 2020 11:20:27 +1100 Message-ID: Subject: Re: [alsa-devel] [PATCH] ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. To: Pierre-Louis Bossart Cc: LKML , Jaroslav Kysela , Liam Girdwood , alsa-devel@alsa-project.org, Bard Liao , Sathya Prakash M R , Mark Brown , Cezary Rojewski , Kuninori Morimoto , Takashi Iwai , Jairaj Arava , Xun Zhang , Jie Yang , Kai Vehmanen , Sathyanarayana Nujella Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Jan 2020 at 08:18, Pierre-Louis Bossart wrote: > > > > On 1/1/20 6:28 PM, Sam McNally wrote: > > Some members of the Google_Hatch family include a rt5682, but not a > > speaker amp. When a speaker amp is also present, it matches MX98357A > > as well, resulting in the quirk_data field in the snd_soc_acpi_mach > > being non-null. When only the rt5682 is present, quirk_data is left > > null. > > Sorry, I don't get this last sentence. > > There is a single entry for 10EC5682 in sound-acpi-intel-glk-match.c and > quirk_data is assigned - thus can never be NULL. > > I wonder if your Chrome kernel has an extra entry in > snd_soc_acpi_intel_glk_machines[] ? What I am missing? > I was referring to the duplicate 10EC5682 entries in snd_soc_acpi_intel_cml_machines[]. Sorry for the confusion. I'll send a new version with those details in the description. > > > > The sof_rt5682 driver's DMI data matching identifies that a speaker amp > > is present for all Google_Hatch family devices. Detect cases where there > > is no speaker amp by checking for a null quirk_data in the > > snd_soc_acpi_mach and remove the speaker amp bit in that case. > > > > Signed-off-by: Sam McNally > > --- > > > > sound/soc/intel/boards/sof_rt5682.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c > > index ad8a2b4bc709..8a13231dee15 100644 > > --- a/sound/soc/intel/boards/sof_rt5682.c > > +++ b/sound/soc/intel/boards/sof_rt5682.c > > @@ -603,6 +603,14 @@ static int sof_audio_probe(struct platform_device *pdev) > > > > dmi_check_system(sof_rt5682_quirk_table); > > > > + mach = (&pdev->dev)->platform_data; > > + > > + /* A speaker amp might not be present when the quirk claims one is. > > + * Detect this via whether the machine driver match includes quirk_data. > > + */ > > + if ((sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT) && !mach->quirk_data) > > + sof_rt5682_quirk &= ~SOF_SPEAKER_AMP_PRESENT; > > + > > if (soc_intel_is_byt() || soc_intel_is_cht()) { > > is_legacy_cpu = 1; > > dmic_be_num = 0; > > @@ -663,7 +671,6 @@ static int sof_audio_probe(struct platform_device *pdev) > > INIT_LIST_HEAD(&ctx->hdmi_pcm_list); > > > > sof_audio_card_rt5682.dev = &pdev->dev; > > - mach = (&pdev->dev)->platform_data; > > > > /* set platform name for each dailink */ > > ret = snd_soc_fixup_dai_links_platform_name(&sof_audio_card_rt5682, > >