From patchwork Thu Aug 27 17:33:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 11741177 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10FC0109B for ; Thu, 27 Aug 2020 17:36:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95F1F2087E for ; Thu, 27 Aug 2020 17:36:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="mZdklpXQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="PxYfTVtr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95F1F2087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D84091828; Thu, 27 Aug 2020 19:35:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D84091828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1598549764; bh=hXDyegF3OBnlvyi3lCWTfrDRSxC4lYOaCNgAQSkWQ94=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mZdklpXQWNU5tWGSVMkx6LHEhuBQz4kMaol+7W3xGcQOZm7ojYdMyGPIEdMM7/Dvk dHq2zgLXSnSgTEUyqV3IULVqPtXp5uBr+9Q9OmGW5aE7NTb/Bg5HMvWm5PtIqR1dv/ 2ItyAZ7fdN/T9DZNE5ymjyohkajEkiMnD8GOYuHY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D0370F80245; Thu, 27 Aug 2020 19:34:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4F53F8025A; Thu, 27 Aug 2020 19:34:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 87F12F801D9 for ; Thu, 27 Aug 2020 19:34:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87F12F801D9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="PxYfTVtr" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200827173428euoutp02b68a01fb9325d69e34d7bb31004f1894~vMHQdbV9y2598725987euoutp02i for ; Thu, 27 Aug 2020 17:34:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200827173428euoutp02b68a01fb9325d69e34d7bb31004f1894~vMHQdbV9y2598725987euoutp02i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598549668; bh=wFMLyUMElLYUTG35lzNQlKN/voBWwST2pPYptKilXs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PxYfTVtrZyGO4DwmsGdluocOPuXdlG5cEJQPcsIrhxgeFBTf1FXNJCOpUB2s1kH66 GzpZrBfQMiYDGYGeOmvRZuYLgAdPacHSy8MGIrLLO5iM0gsbFu3OpPjO5Mchnf4NJY MnB58OJo1oRht5aut9FshSIJbAPa4LuZ+NCZ+xHk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200827173427eucas1p1aabdd7d6624406b2d54e10b9b1cc4770~vMHQQlTUM2355023550eucas1p1T; Thu, 27 Aug 2020 17:34:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 41.1C.06456.3AEE74F5; Thu, 27 Aug 2020 18:34:27 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200827173426eucas1p13f9f7d358dfcc440db160de3dc658ddf~vMHPbXoEN2355723557eucas1p1M; Thu, 27 Aug 2020 17:34:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200827173426eusmtrp1fd6176141ac3bed27fc1e0a9130388dd~vMHPavXXn1826418264eusmtrp1P; Thu, 27 Aug 2020 17:34:26 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-dd-5f47eea36d06 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 58.C6.06314.2AEE74F5; Thu, 27 Aug 2020 18:34:26 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200827173426eusmtip112b67de1ca4586f3308c4e8bca11ebd5~vMHO7gs0W0514105141eusmtip1O; Thu, 27 Aug 2020 17:34:26 +0000 (GMT) From: Sylwester Nawrocki To: broonie@kernel.org, lgirdwood@gmail.com Subject: [PATCH 2/2] ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions Date: Thu, 27 Aug 2020 19:33:57 +0200 Message-Id: <20200827173357.31891-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827173357.31891-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42LZduzned3F79zjDT5f07W4cvEQk8XGGetZ LaY+fMJmcaV1E6PF+fMb2C2+Xelgsri8aw6bxdojd9ktPr/fz2px+E07qwOXx4bPTWweO2fd ZffYtKqTzWP6nP+MHn1bVjF6fN4kF8AWxWWTkpqTWZZapG+XwJXx8QpnwVS+iv2rGhgbGF9w dzFycEgImEg8vVTSxcjFISSwglGi9ctTti5GTiDnC6PExLkJEInPjBIfrk5kB0mANMy+f40R IrGcUeJ20z0muI5zU0xBbDYBQ4neo32MILaIgLbEnJsdbCANzAKdTBInJ18FmyQskCBx9vFV sGYWAVWJazMugzXwClhLfP50lA1im7zE6g0HmEFO5RSwkWj+BXaRhEA/u8TufzeYIWpcJF7f bWeBsIUlXh3fAnWpjMTpyT0sEA3NjBI9u2+zQzgTGCXuH1/ACFFlLXHn3C82kA3MApoS63fp Q8LFUeJLryiEySdx460gSDEzkDlp23RmiDCvREebEMQMFYnfq6YzQdhSEt1P/kNd4yFx/vhZ ZkhY9TNKND7pY5zAKD8LYdcCRsZVjOKppcW56anFhnmp5XrFibnFpXnpesn5uZsYgWnk9L/j n3Ywfr2UdIhRgINRiYd3xz73eCHWxLLiytxDjBIczEoivE5nT8cJ8aY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NW3vZZZe4ZN/mzOXSkr/agwTUjQq7pMxDkpVYinOSDTUYi4qTgQAW1DUhoICAAA= X-CMS-MailID: 20200827173426eucas1p13f9f7d358dfcc440db160de3dc658ddf X-Msg-Generator: CA X-RootMTR: 20200827173426eucas1p13f9f7d358dfcc440db160de3dc658ddf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200827173426eucas1p13f9f7d358dfcc440db160de3dc658ddf References: <20200827173357.31891-1-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, ckeepax@opensource.cirrus.com, b.zolnierkie@samsung.com, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , m.szyprowski@samsung.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 --- 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 b3ba053..fc9ea19 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -3514,6 +3514,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]; @@ -3561,6 +3563,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); @@ -3932,6 +3936,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); @@ -4000,6 +4006,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);