From patchwork Mon Feb 24 13:51:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11400541 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 DC61A14E3 for ; Mon, 24 Feb 2020 13:52:26 +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 73C6B20866 for ; Mon, 24 Feb 2020 13:52:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SZUwwcTk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="LEA3mgsi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73C6B20866 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 9C4181676; Mon, 24 Feb 2020 14:51:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C4181676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1582552344; bh=gCO62gZOXqlB1Ijv5sjID0iHH8ewenDro5vImslll60=; h=From:To:Subject:Date:References:Cc:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=SZUwwcTkG4oZooqLv+Lkaf+WYUj0Mlc0oeHQEGCvP9FGpj9/YpmaBh25rWpQ75WL0 LvyGWv446sk/ACQv+kHUfXksrOcNRZrwS3wGlWTJ4gxKKCnz9MrMJ+Mb1VJQCqeBQW nc1u/2/LK6EmbclE19txaBorosRuSy27dhYDNep0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E07B4F8014D; Mon, 24 Feb 2020 14:51:39 +0100 (CET) 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 4B2D7F8014E; Mon, 24 Feb 2020 14:51:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 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,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D53BFF80137 for ; Mon, 24 Feb 2020 14:51:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D53BFF80137 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="LEA3mgsi" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200224135133euoutp013fde8194cda4baaec7219ef905b6febe~2Wu0Fd1Zp0466804668euoutp01B for ; Mon, 24 Feb 2020 13:51:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200224135133euoutp013fde8194cda4baaec7219ef905b6febe~2Wu0Fd1Zp0466804668euoutp01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1582552293; bh=EzeGv53Ui4L1MziFSWesdry8RRpPQMeyYmWPuFhfIA0=; h=From:To:Cc:Subject:Date:References:From; b=LEA3mgsis/be8V9IuHN5/2l5fTpTkoF6KnpTVldxVhFqBqkvLa+SbIc5ewOWXYMqp 6xdcjV6rkx9+TyK1p3V/5EfkokYqzZEMsxURrwXeYJzmurMCHgh+DelliZy3/lV0Pc +NO9IT55lo3iP9//CzK1OZT0xEbAUf5so3BwMqvs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200224135132eucas1p27fc7695f55c0537660d0142c827ddff8~2Wuz2S5Ol2987629876eucas1p2u; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 23.82.60679.4E4D35E5; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200224135132eucas1p22bb497f3d77452c531dc3d6658d26ff3~2WuzfFB__2993529935eucas1p28; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200224135132eusmtrp18acc57360217780c55163a2266331ebd~2WuzedBm23154231542eusmtrp1F; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-80-5e53d4e45c8f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F7.6F.08375.4E4D35E5; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200224135132eusmtip1c1375166c17b8ebafe9fa03189b1ca7e~2WuzHqWAT0548905489eusmtip1y; Mon, 24 Feb 2020 13:51:32 +0000 (GMT) From: Marek Szyprowski To: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mfd: wm8994: Fix driver operation if loaded as modules Date: Mon, 24 Feb 2020 14:51:22 +0100 Message-Id: <20200224135123.27301-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPIsWRmVeSWpSXmKPExsWy7djP87pPrgTHGZxq0LW4cvEQk8XGGetZ LaY+fMJmcf/rUUaLy7vmsFmsPXKX3eLwm3ZWB3aPDZ+b2Dw2repk87hzbQ+bR9+WVYwenzfJ BbBGcdmkpOZklqUW6dslcGXse36QreAiV8WeE/tZGxifcXQxcnJICJhIdEyfy9LFyMUhJLCC UWLHvXdsEM4XRomHJx6yQzifGSW2TlvKCtPybucpZojEckaJiw8bGOFaZu5fwQ5SxSZgKNH1 tosNxBYRsJV4vaMBbAmzwE2gJXf6gBwODmEBb4mLlxRBTBYBVYmv61lAynmByn/92MoIsUxe YvWGA2DLJASus0lceXyaBSLhIjF7+wooW1ji1fEt7BC2jMTpyT0sEA3NQD+cW8sO4fQwSlxu mgE11lrizrlfbCCbmQU0Jdbv0ocIO0o0z/3PDhKWEOCTuPFWECTMDGRO2jadGSLMK9HRJgRR rSYx6/g6uLUHL1xihrA9JDq2PwAHlpBArETHuu9MExjlZiHsWsDIuIpRPLW0ODc9tdgoL7Vc rzgxt7g0L10vOT93EyMwGZz+d/zLDsZdf5IOMQpwMCrx8ErsDY4TYk0sK67MPcQowcGsJMLr zRgUJ8SbklhZlVqUH19UmpNafIhRmoNFSZzXeNHLWCGB9MSS1OzU1ILUIpgsEwenVANjxe41 P5+p/eP/XfRxymy7J3M28aw0EfU/dcqj92rR9bSOhIAZzXYXLS2uH2HcszXKeWdnjLjVpB4p Xd57LgxHSg6lL6s69Cxpa6hX4osFSVmO5j38+W+/zmh7sqdmWu+j3H+l/feCEw27WW5/XL5Q ydczyq0gg/8zz2S12mnbP9RorqzbaCmsxFKckWioxVxUnAgAuhwRtwIDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xu7pPrgTHGfTulLS4cvEQk8XGGetZ LaY+fMJmcf/rUUaLy7vmsFmsPXKX3eLwm3ZWB3aPDZ+b2Dw2repk87hzbQ+bR9+WVYwenzfJ BbBG6dkU5ZeWpCpk5BeX2CpFG1oY6RlaWugZmVjqGRqbx1oZmSrp29mkpOZklqUW6dsl6GXs e36QreAiV8WeE/tZGxifcXQxcnJICJhIvNt5irmLkYtDSGApo8T7bwfZIRIyEienNbBC2MIS f651sUEUfWKUuHLvBSNIgk3AUKLrLUiCk0NEwF7iwa9/YDazwF2gotd+XYwcHMIC3hIXLymC mCwCqhJf17OAVPAK2Er8+rGVEWK8vMTqDQeYJzDyLGBkWMUoklpanJueW2yoV5yYW1yal66X nJ+7iREYgNuO/dy8g/HSxuBDjAIcjEo8vBJ7g+OEWBPLiitzDzFKcDArifB6MwbFCfGmJFZW pRblxxeV5qQWH2I0Bdo9kVlKNDkfGB15JfGGpobmFpaG5sbmxmYWSuK8HQIHY4QE0hNLUrNT UwtSi2D6mDg4pRoYZXWi8vm938veWCzDWKvGPjdAa032zbmeUut3f/IIKJxQqVtwQ/LDvjmT r9a3X36hG/vlmf6sWayPj326V/1Z5mjj2Xfh9qUWq3YHb3qW5HjP8+D5+MYln+MsBHb6ym1p MLSpPPtIyMW4bIbSlnqu4iaVgFxf1obE8woeh0xPvyyY7SnPlCqvxFKckWioxVxUnAgA13rj AlYCAAA= X-CMS-MailID: 20200224135132eucas1p22bb497f3d77452c531dc3d6658d26ff3 X-Msg-Generator: CA X-RootMTR: 20200224135132eucas1p22bb497f3d77452c531dc3d6658d26ff3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200224135132eucas1p22bb497f3d77452c531dc3d6658d26ff3 References: Cc: Bartlomiej Zolnierkiewicz , Mark Brown , Lee Jones , Sylwester Nawrocki , Marek Szyprowski 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" WM8994 chip has built-in regulators, which might be used for chip operation. They are controlled by a separate wm8994-regulator driver, which should be loaded before this driver calls regulator_get(), because that driver also provides consumer-supply mapping for the them. If that driver is not yet loaded, regulator core substitute them with dummy regulator, what breaks chip operation, because the built-in regulators are never enabled. Fix this by adding a comment and a call to module_request() helper. Signed-off-by: Marek Szyprowski --- drivers/mfd/wm8994-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 1e9fe7d92597..f15f12d8bccc 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -321,6 +321,13 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) int ret, i, patch_regs = 0; int pulls = 0; + /* + * Request a driver for built-in regulators first, because they are + * default supplies for "AVDD1" and "DCVDD". Otherwise, getting them + * fails due to lack of consumer mapping defined by that driver. + */ + request_module("wm8994_regulator"); + if (dev_get_platdata(wm8994->dev)) { pdata = dev_get_platdata(wm8994->dev); wm8994->pdata = *pdata; From patchwork Mon Feb 24 13:51:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 11400547 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 621A113A4 for ; Mon, 24 Feb 2020 13:53:20 +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 ED80220836 for ; Mon, 24 Feb 2020 13:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="laTuOPvv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="nRaItZnp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED80220836 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 320851687; Mon, 24 Feb 2020 14:52:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 320851687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1582552398; bh=I5jH2F4m81983LtYduOjdXzqEYcFWty5tAcnI+twdag=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=laTuOPvveBLPvpUghwFoHepsaAwjrC+JXw3VZkptkRioPQIX/7kYJbEFXIOqoFMQg Rod5MhjGReGcR4J2AeiSYYkWPetIyVo3hd6u4XWSki3mGsxqG+/bbtppMnp4zTYO9V XpHHeB3zCG/XXnOdL5jtplhIWDBs2h0Z8yhTyPZY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 49196F801F2; Mon, 24 Feb 2020 14:51:43 +0100 (CET) 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 419EDF8014E; Mon, 24 Feb 2020 14:51:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 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,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A947FF800C6 for ; Mon, 24 Feb 2020 14:51:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A947FF800C6 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="nRaItZnp" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200224135135euoutp01b83bd44d20e34e0463a1af0a29880daf~2Wu2gLjhW0466204662euoutp01_ for ; Mon, 24 Feb 2020 13:51:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200224135135euoutp01b83bd44d20e34e0463a1af0a29880daf~2Wu2gLjhW0466204662euoutp01_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1582552295; bh=a+1ZrR03pNe3rzc0952jizmxS7VZ+Cze9rghvIqv2M0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nRaItZnpR7SS4wm9zA/j8mYPuBPd0gX1B8e8Ybq5czwyy3n/xLSWMGHof4Mmsgnhi P2GKyRZS2Zyzu6txtI8vzY5UOKwLGhxCqfg2CMyFgT+QPzfHRwAEHgTseYBU5lUhNb DVv3XtJQyUMXBPSCeVjU/BEysSfG9ey6rWZJrPF4= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200224135135eucas1p1e480937a6fab393983c3f4668eb3e91d~2Wu2NN7mF1388613886eucas1p1d; Mon, 24 Feb 2020 13:51:35 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 85.82.60679.7E4D35E5; Mon, 24 Feb 2020 13:51:35 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200224135135eucas1p1a08b34f6329d157c77994965f89a6050~2Wu16DZcq1388613886eucas1p1c; Mon, 24 Feb 2020 13:51:35 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200224135135eusmtrp17a50d0601f4fce20e15cc6cc099e2903~2Wu15dWuF3154231542eusmtrp1N; Mon, 24 Feb 2020 13:51:35 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-8c-5e53d4e773c0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D9.6F.08375.6E4D35E5; Mon, 24 Feb 2020 13:51:34 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200224135134eusmtip1cdaa2480183cde734550715176fbf51a~2Wu1gb7Ef0192801928eusmtip1P; Mon, 24 Feb 2020 13:51:34 +0000 (GMT) From: Marek Szyprowski To: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mfd: wm8994: Fix unbalanced calls to regulator_bulk_disable() Date: Mon, 24 Feb 2020 14:51:23 +0100 Message-Id: <20200224135123.27301-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200224135123.27301-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNIsWRmVeSWpSXmKPExsWy7djP87rPrwTHGTRsFbO4cvEQk8XGGetZ LaY+fMJmcf/rUUaLy7vmsFmsPXKX3eLwm3ZWB3aPDZ+b2Dw2repk87hzbQ+bR9+WVYwenzfJ BbBGcdmkpOZklqUW6dslcGXcuX+MqeA/d8Wp7e+ZGhhncHUxcnJICJhI7L04j7GLkYtDSGAF o8TUy/dYQRJCAl8YJX7vZIdIfGaUuL2lhxmm4/6HiywQRcsZJX48d4AoAmr4tOseO0iCTcBQ outtFxuILSJgK/F6RwMLSBGzwE1GiR13+sC6hQVCJP6dX8EIYrMIqEq8/boFKM7BwQvUcGRG LsQyeYnVGw6ALeYUsJN43bGdGWSOhMB7NomVX7czQhS5SDyedJYVwhaWeHV8CzuELSNxenIP C0RDM6PEw3Nr2SGcHkaJy00zoLqtJe6c+8UGsplZQFNi/S59iLCjxI4zG9lBwhICfBI33gqC hJmBzEnbpjNDhHklOtqEIKrVJGYdXwe39uCFS9DA8pCY0XkCGooTGSVmP13LMoFRfhbCsgWM jKsYxVNLi3PTU4uN8lLL9YoTc4tL89L1kvNzNzECk8Tpf8e/7GDc9SfpEKMAB6MSD6/E3uA4 IdbEsuLK3EOMEhzMSiK83oxBcUK8KYmVValF+fFFpTmpxYcYpTlYlMR5jRe9jBUSSE8sSc1O TS1ILYLJMnFwSjUwVh9YXLqyQ/+R8YLv+5mCt23m5BeJPejuXTplo4fPHZajBhX/1xxT6+P8 t9j13Q+PL4U5qsHvDfhv5lXU3VZNmmV0akrnhEnFOW/+hQgy/ha2rxX72XUoQXFDPpvJo/bJ nTHdjKHnAyx6vNKjnSc2WQsb32D5kiBkvviSwDPVafE+tTsm8CQrsRRnJBpqMRcVJwIAQgmN Xw4DAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsVy+t/xu7rPrgTHGTy5Z21x5eIhJouNM9az Wkx9+ITN4v7Xo4wWl3fNYbNYe+Quu8XhN+2sDuweGz43sXlsWtXJ5nHn2h42j74tqxg9Pm+S C2CN0rMpyi8tSVXIyC8usVWKNrQw0jO0tNAzMrHUMzQ2j7UyMlXSt7NJSc3JLEst0rdL0Mu4 c/8YU8F/7opT298zNTDO4Opi5OSQEDCRuP/hIksXIxeHkMBSRomju08zQiRkJE5Oa2CFsIUl /lzrYoMo+sQo8bXtLhtIgk3AUKLrbReYLSJgL/Hg1z8wm1ngLqPEldd+ILawQJDE/mtvwYay CKhKvP26BWgbBwevgK3EkRm5EPPlJVZvOMAMYnMK2Em87tgOZgsBlaw8sollAiPfAkaGVYwi qaXFuem5xYZ6xYm5xaV56XrJ+bmbGIEhu+3Yz807GC9tDD7EKMDBqMTDK7E3OE6INbGsuDL3 EKMEB7OSCK83Y1CcEG9KYmVValF+fFFpTmrxIUZToJsmMkuJJucD4ymvJN7Q1NDcwtLQ3Njc 2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwenVAOjyAe/WMsd6wtf6rq8vfjosoNE5uJOh5VP C/yPNW/q5U3+eYPPc4+suPqPyJkiLq1HVSV5d5utzzHWDv9/PthQdvKZ1jI7tpgnu9IFw+a/ L7jLnST/L/jkEe/d4iHBhxonHp/29bWXuQifY2uFfeUTg2ePLh+1Vd4Q8dr2mfRnr4fqG4WW 8RUpsRRnJBpqMRcVJwIA9FY0828CAAA= X-CMS-MailID: 20200224135135eucas1p1a08b34f6329d157c77994965f89a6050 X-Msg-Generator: CA X-RootMTR: 20200224135135eucas1p1a08b34f6329d157c77994965f89a6050 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200224135135eucas1p1a08b34f6329d157c77994965f89a6050 References: <20200224135123.27301-1-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Mark Brown , Lee Jones , Sylwester Nawrocki , Marek Szyprowski 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 runtime PM is enabled, regulators are being controlled by the driver's suspend and resume callbacks. They are also unconditionally enabled at driver's probe(), and disabled in remove() functions. Add more calls to runtime PM framework to ensure that the device's runtime PM state matches the regulators state: 1. at the end of probe() function: set runtime PM state to active, so there will be no spurious call to resume(); 2. in remove(), ensure that resume() is called before disabling runtime PM management and unconditionally disabling the regulators. Signed-off-by: Marek Szyprowski --- drivers/mfd/wm8994-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index f15f12d8bccc..f2668f52a6bd 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -591,6 +591,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) goto err_irq; } + pm_runtime_set_active(wm8994->dev); pm_runtime_enable(wm8994->dev); pm_runtime_idle(wm8994->dev); @@ -610,7 +611,9 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) static void wm8994_device_exit(struct wm8994 *wm8994) { + pm_runtime_get_sync(wm8994->dev); pm_runtime_disable(wm8994->dev); + pm_runtime_put_noidle(wm8994->dev); wm8994_irq_exit(wm8994); regulator_bulk_disable(wm8994->num_supplies, wm8994->supplies); regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);