Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp16888032ybl; Wed, 1 Jan 2020 16:31:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwF1hDbuztTqRPOrQi/giHCCNGmvMKMTnN0wOT/50w6KA69d+0aa1zWnwY1e2f6033lRGco X-Received: by 2002:a05:6830:12da:: with SMTP id a26mr66091912otq.223.1577925066959; Wed, 01 Jan 2020 16:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577925066; cv=none; d=google.com; s=arc-20160816; b=kPac2X1y7egp/DG8alTQYDTx8chVuR0DIvea24iQ5RSlGjoD72sGm8KG//iJpVuLD4 XT3sWrI2HAKqGwwiXOjh4Qde1ij8RFR7ndxQa5KwXB430S1RUKo00gv6ovRIsgW8DzoW jPBzmPauufw9SKb8XyTca0ndiLx1sFI6RmGutmdIVMW7PvG7EJxNa10RxHw/lAUxUEVP 03Q/IMgQ8YmsRQv0ul0I31SfLoYaQRU/t/pfIpDg6XD5z/q3Jkqjv7RN4taF32g3CLz+ ox2R5q5xzOsSBZSbwj/5WIhvhfYiu7oE+CYAOXSfWliIG296NtOzjaOtxHYm/OHDV7l1 UXXw== 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=9GJYS2xwYL6+Da0JsxP8DsSxNZ3j5TIjH/wHBFm0PRA=; b=yP8EUNBztwQ9E8fPrSwPNp/N0P9j1jo9aLfLuxEFuTk6nO/rVAge60Mhn31LPc5Iqn wlq05YjG/03PE8kLoonxpNBZfnhRLJ+pHnIO5Fcrb0vSUxhDNSTXDHBHw/SUekxDMFCu plFfm9QONLwvlloHN+wQHhcQQyvUcSOcwJ0GZFfAZAe/aIBOmbSnEhl76oyumDUetL3r h6QJsVIrPzR7CqDEBl400fLAFMEd/vOSm4lXZp46uw1jr6ML3sMLW0KlEO/wj8ip4yRG PLCn3gc7qm6G5ksU4Cedwvw+0oKhTAWTqT9dMrDGehZtGZchuesPwi62B1nOv9MANKch 552Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mf6oJFqD; 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 e13si21044475otp.164.2020.01.01.16.30.40; Wed, 01 Jan 2020 16:31:06 -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=mf6oJFqD; 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 S1727493AbgABA3F (ORCPT + 99 others); Wed, 1 Jan 2020 19:29:05 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43937 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbgABA3F (ORCPT ); Wed, 1 Jan 2020 19:29:05 -0500 Received: by mail-pl1-f193.google.com with SMTP id p27so17181388pli.10 for ; Wed, 01 Jan 2020 16:29:04 -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=9GJYS2xwYL6+Da0JsxP8DsSxNZ3j5TIjH/wHBFm0PRA=; b=mf6oJFqDXwxAXyg4aXPM84cAGHIdCVNqcZT5aleGPlTquh+FLh1f+dyPgxcXX5RXfM Qce0ahB7vz5jMsconZUcEGtyAUQ+lv75rMVTUlh+62VKKOT94OENioubYP82GLE24SkO y5wTcSP8uunA6ljabFPF+vsqwVSuabg6vh9ZU= 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=9GJYS2xwYL6+Da0JsxP8DsSxNZ3j5TIjH/wHBFm0PRA=; b=Sj1VqRPL2LUjvNIxvLguCfnGo5fp58vCMcucGtqwIVYO3f+L6xXdlZORpwPWJ+VQTZ 5feP73ZSFOBEf0tvBp/ix20Xq4mipyOGSqtrXYh5btx8xiz+3JOpp2HXlm01BYslxO6/ g2iCw2RDdEKDVzRqjvNXDNc+U7cX/FtVtzOTUgHLucCTsOP2cPyy5pu3ukycdvcw4zB0 IYeccRo7kS2sHWHl4oli8IyptL1csBss649aPw7rQimpYZglS2gq/ef1POum82HmoXU8 epRhxZzDJXqLNPJuv2tVTu6RPaeYgxDXGE8VqXtoSefvyeRjf9ocjS0IOGpxNWwlgm2m q+hg== X-Gm-Message-State: APjAAAVB2k4XMAAyxwUXylBtce3l5AYaShFsTN16J88YB6XxwFYxpW6i gH7diSak3z3mMdlJ5F3WxX2/SXS97/g= X-Received: by 2002:a17:90b:3c9:: with SMTP id go9mr16175122pjb.7.1577924944088; Wed, 01 Jan 2020 16:29:04 -0800 (PST) Received: from localhost ([2401:fa00:9:15:c479:b58e:61d1:15d5]) by smtp.gmail.com with ESMTPSA id b65sm58498229pgc.18.2020.01.01.16.28.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jan 2020 16:29:03 -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 , Kai Vehmanen , Sathyanarayana Nujella Subject: [PATCH] ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. Date: Thu, 2 Jan 2020 11:28:12 +1100 Message-Id: <20200102112558.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, 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. 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, -- 2.24.1.735.g03f4e72817-goog