From patchwork Tue Sep 29 11:00:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B941C4727C for ; Tue, 29 Sep 2020 11:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25251206F7 for ; Tue, 29 Sep 2020 11:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380649; bh=HJ0fqNrp+Bhcjke61Potcbjf5sO95xFxNuP7mRzpk34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mcXK8E0B920KRKH9FRumOaQlOMscjPQyklNeCxyN5m/qz/Yptiq6iFQmtHQgeAdlx aIHjcdRXll2L+suaig/FjQw+M2z0iHHCdHSbjVn43nk+jkeMBbDaXcADZalZ/1SeAL XRlqz946/jZ7iNp0k1eLAcuN3q6fzBSOpkNuWdOs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731509AbgI2L5N (ORCPT ); Tue, 29 Sep 2020 07:57:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:41654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730764AbgI2LnY (ORCPT ); Tue, 29 Sep 2020 07:43:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B11322065C; Tue, 29 Sep 2020 11:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379803; bh=HJ0fqNrp+Bhcjke61Potcbjf5sO95xFxNuP7mRzpk34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7Zx6D1JubJMOYx+05SiJB0IHtLn1C+dC51FNbZGtkh3Wo2uTmd9BJenocTbkOO3e tvlto7CRPfNbG8Xio+2kjBTA0FoodUTO+vmLs2N/X2hA+pdIR2JNHkJuGYJ8kvYF56 0KIjdBSvmmMUYfp3F8WTNKyEBcy2VRmYD6YOpZZE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sylwester Nawrocki , Krzysztof Kozlowski , Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.4 325/388] ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions Date: Tue, 29 Sep 2020 13:00:56 +0200 Message-Id: <20200929110026.202754349@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sylwester Nawrocki [ Upstream commit f5a2cda4f1db89776b64c4f0f2c2ac609527ac70 ] When the wm8958_mic_detect, wm8994_mic_detect functions get called from the machine driver, e.g. from the card's late_probe() callback, the CODEC device may be PM runtime suspended and any regmap writes have no effect. Add PM runtime calls to these functions to ensure the device registers are updated as expected. This suppresses an error during boot "wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec" caused by the regmap access error due to the cache_only flag being set. Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200827173357.31891-2-s.nawrocki@samsung.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8994.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 64635f9cdae65..6dbab3fc6537e 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3372,6 +3372,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * return -EINVAL; } + pm_runtime_get_sync(component->dev); + switch (micbias) { case 1: micdet = &wm8994->micdet[0]; @@ -3419,6 +3421,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * snd_soc_dapm_sync(dapm); + pm_runtime_put(component->dev); + return 0; } EXPORT_SYMBOL_GPL(wm8994_mic_detect); @@ -3786,6 +3790,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * return -EINVAL; } + pm_runtime_get_sync(component->dev); + if (jack) { snd_soc_dapm_force_enable_pin(dapm, "CLK_SYS"); snd_soc_dapm_sync(dapm); @@ -3854,6 +3860,8 @@ int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * snd_soc_dapm_sync(dapm); } + pm_runtime_put(component->dev); + return 0; } EXPORT_SYMBOL_GPL(wm8958_mic_detect);