Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18007628ybl; Thu, 2 Jan 2020 16:42:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzboZNtjHZe3jNUA8mlDHcYn0vAiM2d5wTgdGBpII4d3E9EuDeVNnVqtqQqJJmHe6b/6d9h X-Received: by 2002:a9d:7c91:: with SMTP id q17mr80691472otn.293.1578012163316; Thu, 02 Jan 2020 16:42:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578012163; cv=none; d=google.com; s=arc-20160816; b=CNIUOTrCqxKu/fcHFj3HaR7S2u0gJa1Y+wRt1+g2PnHBZVq3AI2HwbzOgwOO81AbWH HR86koJHpTYdsClgoGDi+sSJD1EMx1haN22+pVOj9pyCpCF4Tt8qtyEbNZMi49nujrdn u+OId2f6ScX+36rNwmo5t22CS0HYKNvvSedK8q28VviFLlEX4z06YyatS4m8eA8FAb3e N3z+85A2/dwT3r8784oi4jILrufyGteMRL29OZCyTlq93ZgL0T49wFJOpzG7DK8UET1a GSWxypjsjsylh8Hxl3D1G3R5yZC4oQFAolzLu7h2bIu9vBBsnnp3ivcv/tYF0lBHANcl 81Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=rcQ+2nPhDLELYKPQzdA60zMk2mYXD2XMUJ6Ew62mC0g=; b=vM4JOESkfBjRX9rsUqTmvH2YMA4I1tKyhNAB/RvF8E+DQZfPAhtvqv3cLzToqrudMv GlsJ2PYZltE5ahTVQi226U99zwd2cxB/ZSQf+h8sBKT/m8o4y/kqHi4YONACINvKso7I gKl7/PyZWy4ivvubGqz2NXOPDSavz8S5LBcDjLpZWltsadyLB9Imowjo8crhvmav6xFo jIMuWDWi9VBDe9dSoVOtPWv6MO7Y4DbwsM6q+yVVYKbdjRaT7GS/cZCV4uMOGJzyPcNd fBrHyUkvb+4J2eRGv66e7VVPmXqr3HYwqA+6tpiofwsQUZjFeJtlLjdJqZWtXvj8s4Mm JhQw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si30102221otn.117.2020.01.02.16.42.30; Thu, 02 Jan 2020 16:42:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726292AbgACAlt (ORCPT + 99 others); Thu, 2 Jan 2020 19:41:49 -0500 Received: from mga03.intel.com ([134.134.136.65]:27624 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbgACAls (ORCPT ); Thu, 2 Jan 2020 19:41:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 16:41:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,388,1571727600"; d="scan'208";a="231960405" Received: from lavazque-mobl.amr.corp.intel.com (HELO [10.255.86.75]) ([10.255.86.75]) by orsmga002.jf.intel.com with ESMTP; 02 Jan 2020 16:41:46 -0800 Subject: Re: [alsa-devel] [PATCH v2] ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. To: Sam McNally , LKML Cc: Xun Zhang , alsa-devel@alsa-project.org, Jairaj Arava , Kuninori Morimoto , Takashi Iwai , Jie Yang , Cezary Rojewski , Liam Girdwood , Mark Brown , Sathyanarayana Nujella , Sathya Prakash M R , Bard Liao References: <20200103112158.v2.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid> From: Pierre-Louis Bossart Message-ID: <4fa9702a-f95c-6135-745b-5374eebb4880@linux.intel.com> Date: Thu, 2 Jan 2020 18:41:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200103112158.v2.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/2/20 6:22 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, the first 10EC5682 > entry in snd_soc_acpi_intel_cml_machines[] matches, finding the > MX98357A as well, resulting in the quirk_data field in the > snd_soc_acpi_mach being non-null. When only the rt5682 is present, the > second 10EC5682 entry is matched instead and quirk_data is left null. Ah yes, I confused GLK and CML code names. The code looks fine, but would you mind updating your commit message? We've reshuffled the 10EC5682 entries to account for the variations with RT1011, so it's technically the 3rd entry that does not have a speaker amplifier. And we should also mention that for CML we use the jack codec as the primary key, so the quirk data does really refer to the speaker amplifier. > > 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 > --- > > Changes in v2: > - Added details about the relevant ACPI matches to the description > > 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, >