Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21867645ybl; Mon, 6 Jan 2020 12:59:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxvHbRslmUNnlNh9HjZE/DVbus7vaehP1PqEmL0k7HJswSn9LAYyTvhnQqOnsSPtAXi9A6R X-Received: by 2002:a9d:6b12:: with SMTP id g18mr114004753otp.211.1578344385800; Mon, 06 Jan 2020 12:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578344385; cv=none; d=google.com; s=arc-20160816; b=j4fe9900My0FH+Zs5AX57uhxqINf9ObMJQrNVdXcN69tIPOQPytpmd0SmPoAmvYL32 2Wn3X3ETwLtLqgsr/ZrTyr62e89SSSg4HIuv8O11KmqE5SWOlDIcfTAfc9u2DCnegaZ0 /8p/Wfq8ZcD+Ec9C+XAHHC5ZLEqjrZB4+/QrzDmlW+hEZ+QeJYP54zcMynmuo8QkJM2x U5dAUTuHtKbyM14igVeMtHt1pf8dGm8ZQEzWsWQyDJLO1d8zEsQNRg4YSLEjkS24Y5I1 h4dJ0/4ZaiC2XSNZytWelyGIqh4f7aVxaP+29Ak8jWv+bYQ5DrGgU/SnQlBGU5Agc1d5 t9hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=PhlkHXfE5NUBQqufwBECS8GHzTQYDqKzvZAU/XO0ykE=; b=dXhO/rPkws++81sxjUFvUUgXYVErS3PmzM5zpO7TlWDlfqW5cP35ftl+XWkNxqCYm5 NJwVkq1G9Y0/pihUe2UmR136L3DhzTaum26ZB5eBtpHg1RTVKeosYbqnvdmuHN9ieUmF tHHzuGV47yE6bV+98dbyA1FFKHdnIcyduA4SptorOeTyP0vjtywS2aDWZ8dFLV4EctPZ ZC6O0os00qbv10Y+QDYdKrRrYQFVsB6/RRgjsK17p/tt4eXAsKHF4sY5ljdVR1UmhMgM Mi5yeBVWDHjM6+gtZB9tFN6hpv8bWAJDdqGgfxvOwbSME5x+s8dpVw/pXdy3KDOn9xsv Sw7w== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o206si34131469oih.143.2020.01.06.12.59.34; Mon, 06 Jan 2020 12:59:45 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbgAFUu5 (ORCPT + 99 others); Mon, 6 Jan 2020 15:50:57 -0500 Received: from foss.arm.com ([217.140.110.172]:49178 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbgAFUu4 (ORCPT ); Mon, 6 Jan 2020 15:50:56 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F26CA328; Mon, 6 Jan 2020 12:50:55 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 797643F534; Mon, 6 Jan 2020 12:50:55 -0800 (PST) Date: Mon, 06 Jan 2020 20:50:54 +0000 From: Mark Brown To: Sam McNally Cc: alsa-devel@alsa-project.org, Bard Liao , Cezary Rojewski , Jaroslav Kysela , Jie Yang , Kuninori Morimoto , Liam Girdwood , LKML , Mark Brown , Pierre-Louis Bossart , Sathyanarayana Nujella , Sathya Prakash M R , Takashi Iwai , Xun Zhang Subject: Applied "ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one." to the asoc tree In-Reply-To: <20200103124921.v3.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From d4b74e218a8d0d6cf58e546627ab9d4d4f2645ab Mon Sep 17 00:00:00 2001 From: Sam McNally Date: Fri, 3 Jan 2020 12:50:19 +1100 Subject: [PATCH] ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one. Some members of the Google_Hatch family include a rt5682 jack codec, but no speaker amplifier. This uses the same driver (sof_rt5682) as a combination of rt5682 jack codec and max98357a speaker amplifier. Within the sof_rt5682 driver, these cases are not currently distinguishable, relying on a DMI quirk to decide the configuration. This causes an incorrect configuration when only the rt5682 is present on a Google_Hatch device. For CML, the jack codec is used as the primary key when matching, with a possible speaker amplifier described in quirk_data. The two cases of interest are the second and third 10EC5682 entries in snd_soc_acpi_intel_cml_machines[]. The second entry matches the combination of rt5682 and max98357a, resulting in the quirk_data field in the snd_soc_acpi_mach being non-null, pointing at max98357a_spk_codecs, the snd_soc_acpi_codecs for the matched speaker amplifier. The third entry matches just the rt5682, resulting in a null quirk_data. The sof_rt5682 driver's DMI data matching identifies that a speaker amplifier is present for all Google_Hatch family devices. Detect cases where there is no speaker amplifier by checking for a null quirk_data in the snd_soc_acpi_mach and remove the speaker amplifier bit in that case. Signed-off-by: Sam McNally Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200103124921.v3.1.Ib87c4a7fbb3fc818ea12198e291b87dc2d5bc8c2@changeid Signed-off-by: Mark Brown --- 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.20.1