Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17992945ybl; Thu, 2 Jan 2020 16:23:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwZd8gWAXoycGsYNzv4pdZU8K3DPmfFVxhaxqcoZVlBsx/qEor1k23BjAs8NeRd+TWwLwHD X-Received: by 2002:a9d:6b17:: with SMTP id g23mr91761948otp.265.1578011009085; Thu, 02 Jan 2020 16:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578011009; cv=none; d=google.com; s=arc-20160816; b=z8W/lmaMT85Wr2e2KmnJiVqkZsB6lk+BjSrkvweUdJHTa6MgIWwn6HStYGC0MBodR9 9LIso3Kc9SiUPzTla+MOgxWKzknRVE52Eg0LBJFOcQ5S/iViHoj0CxeXcn56Qj01U7Au 1HgRr/5hKIGsfuTbaO1dRFksOOuj7R7EiwP0lg0qPQ0sZieT175tH7HalJK20jU+khZm 6f/tI+CdSQ2tZhlWuzfNyceTwkTCEQyJUONLDN6eZT5tN9HlVLVUHUg2UrIfIAYdemVD MWHhLlFD/hrQahMYkUiZHhw6QFy1QwJA5XQWQI/Z9HlqPoma0UPp2NUFGtD0sEvio+ca FfOw== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tUxq8i1QoyN076FNd9no9rm0JfBtqoMlndPucVdwL+Q=; b=sfAxjWahl4zBKsPyoKqIEv3QVio3/m1Rq/gx0gBIcMFH3GQDIDAsbfhx+W78hVADBF G+Ds32kWYcr7GLU34GmTLshasmNuR1r9ytoX5U4YiBS0VMe+jgRTsHDIr52oBg8P4msb h5itYEgRM9wTWmoIOZTx+6f1VVE8gjpJdnWnNhlkZijFyQ8mePzPoTHtMQrd9QmwRmpx Agh/xv4zbeUphcE31NVu4nRjwPD9Dwx5jQtRYEBjTd0jmYaKj/QMpwmKUEa06/WRQQnn /nu4PYfmhz0xr0W1/xbxrGWYytLai3wpHKJp/y6uN4fgS59k6Rc5Rc0ZneuXlf8IgqbM rLRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NqzpcO36; 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 x5si26882769oic.72.2020.01.02.16.23.16; Thu, 02 Jan 2020 16:23:29 -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=NqzpcO36; 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 S1726194AbgACAWT (ORCPT + 99 others); Thu, 2 Jan 2020 19:22:19 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44391 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbgACAWT (ORCPT ); Thu, 2 Jan 2020 19:22:19 -0500 Received: by mail-pg1-f193.google.com with SMTP id x7so22643446pgl.11 for ; Thu, 02 Jan 2020 16:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tUxq8i1QoyN076FNd9no9rm0JfBtqoMlndPucVdwL+Q=; b=NqzpcO36JT0r16vm2kcKH+pdauNyQQsUIyYJUhYlvwWBIhP3Z7RwiQn+rEob1LSmIJ EHgZH319tZBynp9cwUiYu7c25RRgTa3chhWSfbqGv2Emm5LQXtQg3KK7pPCXCYZAeyk3 YRqWfrp07i9FKtXMYxREunS7kK4YIr1T2p9JU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tUxq8i1QoyN076FNd9no9rm0JfBtqoMlndPucVdwL+Q=; b=GjiI/knRpfYOIkEhJ5IE7aF+P3Noz6GDiwX7NP9nrYce6EpiKeTxvNFUnUIl1FXpHd +fL2ZaqmqzrpJkKFN4Xir1EuOKqUhnJW6LjHMP+XG+/UCFQ2cShFMNzkV7hZmGYDs9Kz MmIDWNuYcrwFyjYHA21YTja6tFY8p1qBi/ywaWCuvHeI35bvk9Mb+3ZuJGci2F+c6w8e q38vXJ40/rbCyvHHqUyZ1SGA2KQUZRF9UW8Au8smGrKHI47pWtjuQFU9uSt0C75Felcb NIB9wZlCz97soFTD0ffiEknEt8xZFnL+uDoi0FKf2/QWh2dJg/MyqN6toi/WzATR02TC LfCg== X-Gm-Message-State: APjAAAV1tTHg9x1vFIox3FyKXw2Z1lLDbyrODsJx+KjYkoqDWz5cWyCU 1h/6AP4vMFKo4AJyuk1eDWBLpi8UvqA= X-Received: by 2002:a63:1b49:: with SMTP id b9mr92068426pgm.258.1578010938307; Thu, 02 Jan 2020 16:22:18 -0800 (PST) Received: from localhost ([2401:fa00:9:15:c479:b58e:61d1:15d5]) by smtp.gmail.com with ESMTPSA id z64sm64784446pfz.23.2020.01.02.16.22.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jan 2020 16:22:17 -0800 (PST) From: Sam McNally To: LKML Cc: Sam McNally , Jaroslav Kysela , Liam Girdwood , alsa-devel@alsa-project.org, Bard Liao , Sathya Prakash M R , Mark Brown , Cezary Rojewski , Kuninori Morimoto , Pierre-Louis Bossart , Takashi Iwai , Jairaj Arava , Xun Zhang , Jie Yang , Sathyanarayana Nujella Subject: [PATCH v2] ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. Date: Fri, 3 Jan 2020 11:22:06 +1100 Message-Id: <20200103112158.v2.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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, -- 2.24.1.735.g03f4e72817-goog