From patchwork Tue Nov 10 02:31:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Chien X-Patchwork-Id: 11892949 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 E13D6139F for ; Tue, 10 Nov 2020 02:31:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8FAC1205CB for ; Tue, 10 Nov 2020 02:31:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mHHvY+Fc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="hOSthtkL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FAC1205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UcoYFrP4oaKkqFlIgQyyjLq1S0n7YrLPBxkcZ3rimNU=; b=mHHvY+FcogTkD4g2ncHH1exsZ eqF7wwVbRsKsHJnmoTQEGtLMwpdfPwCeqKA1WXXE4RxfS29nvo4cev0pMLBzaAxtCbgX31NcoYppw 77X+ndzvJhjMqB5EF3KbdeAawtGsIFHQ41zsAt7mLgC8u/WewvqTuvxsipMgGF14dCfIQS05bTicz X32gOOrq8KYDGSGzC+NydRfnPr0gCMvE3LaLOqBYqau2Okuxs7A1jwmnzv6jcwW1UHbqXjOJ08LD/ BNR3J7rKUrO5VrOwQ33W2ipS7HI57np4ko0/wsxamZFoYMplJ0kEKv59tVu3Rw7+4GYCfpY+ky45V 8BzVSJvuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcJRo-0000PQ-P0; Tue, 10 Nov 2020 02:31:52 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcJRi-0000MX-5D for linux-mediatek@lists.infradead.org; Tue, 10 Nov 2020 02:31:48 +0000 X-UUID: 6585c7216fd7499e8ac0614f492b7f08-20201109 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=GnfMW8jsJKJKjkxKfIW5PrpfQm7eCsYrh92o5wGt4tQ=; b=hOSthtkL1UwF/lwrEYRsOYk9tPxHoIciUyxu00PV4gs/WDTRnmtKtC47fUfzr/90Nt3uovlhhxUJPXnGaLngHFep/K30Ugw7IwKeAOTssj4p++l1F8ZWQhaBt/GRIUNaPRyBctwU3pmWEe1HJbBe27D6ivQkd1l+uV1VUCicFtk=; X-UUID: 6585c7216fd7499e8ac0614f492b7f08-20201109 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 583679734; Mon, 09 Nov 2020 18:31:42 -0800 Received: from mtkmbs08n1.mediatek.inc (172.21.101.55) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 9 Nov 2020 18:31:40 -0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Nov 2020 10:31:38 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Nov 2020 10:31:40 +0800 From: Shane Chien To: Matthias Brugger , Mark Brown , Liam Girdwood , Rob Herring Subject: [PATCH v3 1/2] ASoC: Fix vaud18 power leakage of mt6359 Date: Tue, 10 Nov 2020 10:31:31 +0800 Message-ID: <1604975492-6142-2-git-send-email-shane.chien@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1604975492-6142-1-git-send-email-shane.chien@mediatek.com> References: <1604975492-6142-1-git-send-email-shane.chien@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_213146_427765_8429D0C7 X-CRM114-Status: GOOD ( 14.86 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, wsd_upstream@mediatek.com, chipeng.chang@mediatek.com, linux-kernel@vger.kernel.org, jiaxin.yu@mediatek.com, shane.chien@mediatek.com, linux-mediatek@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: "Shane.Chien" vaud18 is power of mt6359 audio path. It should only enable when audio is used, instead of in boot up stage. Once mt6359 audio path is enabled or disabled, vaud18 is controlled by regulator supply widget "LDO_VAUD18". Due to vaud18 is controlled by regulator dapm macro instead of regmap, the macro MT6359_LDO_VAUD18_CON0 and variable avdd_reg is no used and removed from mt6359.h. Signed-off-by: Shane.Chien --- sound/soc/codecs/mt6359.c | 25 +------------------------ sound/soc/codecs/mt6359.h | 8 -------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c index d20c59a..ecdfd57 100644 --- a/sound/soc/codecs/mt6359.c +++ b/sound/soc/codecs/mt6359.c @@ -1943,9 +1943,7 @@ static int mt_ncp_event(struct snd_soc_dapm_widget *w, SND_SOC_DAPM_SUPPLY_S("CLK_BUF", SUPPLY_SEQ_CLK_BUF, MT6359_DCXO_CW12, RG_XO_AUDIO_EN_M_SFT, 0, NULL, 0), - SND_SOC_DAPM_SUPPLY_S("LDO_VAUD18", SUPPLY_SEQ_LDO_VAUD18, - MT6359_LDO_VAUD18_CON0, - RG_LDO_VAUD18_EN_SFT, 0, NULL, 0), + SND_SOC_DAPM_REGULATOR_SUPPLY("LDO_VAUD18", 0, 0), SND_SOC_DAPM_SUPPLY_S("AUDGLB", SUPPLY_SEQ_AUD_GLB, MT6359_AUDDEC_ANA_CON13, RG_AUDGLB_PWRDN_VA32_SFT, 1, NULL, 0), @@ -2807,20 +2805,6 @@ static int mt6359_platform_driver_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, priv); priv->dev = &pdev->dev; - priv->avdd_reg = devm_regulator_get(&pdev->dev, "vaud18"); - if (IS_ERR(priv->avdd_reg)) { - dev_err(&pdev->dev, "%s(), have no vaud18 supply: %ld", - __func__, PTR_ERR(priv->avdd_reg)); - return PTR_ERR(priv->avdd_reg); - } - - ret = regulator_enable(priv->avdd_reg); - if (ret) { - dev_err(&pdev->dev, "%s(), failed to enable regulator!\n", - __func__); - return ret; - } - ret = mt6359_parse_dt(priv); if (ret) { dev_warn(&pdev->dev, "%s() failed to parse dts\n", __func__); @@ -2841,13 +2825,6 @@ static int mt6359_platform_driver_remove(struct platform_device *pdev) dev_dbg(&pdev->dev, "%s(), dev name %s\n", __func__, dev_name(&pdev->dev)); - ret = regulator_disable(priv->avdd_reg); - if (ret) { - dev_err(&pdev->dev, "%s(), failed to disable regulator!\n", - __func__); - return ret; - } - return 0; } diff --git a/sound/soc/codecs/mt6359.h b/sound/soc/codecs/mt6359.h index af6f07f..35f806b 100644 --- a/sound/soc/codecs/mt6359.h +++ b/sound/soc/codecs/mt6359.h @@ -135,11 +135,6 @@ /* MT6359_DCXO_CW12 */ #define RG_XO_AUDIO_EN_M_SFT 13 -/* LDO_VAUD18_CON0 */ -#define RG_LDO_VAUD18_EN_SFT 0 -#define RG_LDO_VAUD18_EN_MASK 0x1 -#define RG_LDO_VAUD18_EN_MASK_SFT (0x1 << 0) - /* AUD_TOP_CKPDN_CON0 */ #define RG_VOW13M_CK_PDN_SFT 13 #define RG_VOW13M_CK_PDN_MASK 0x1 @@ -2132,7 +2127,6 @@ #define MT6359_DCXO_CW11 0x7a6 #define MT6359_DCXO_CW12 0x7a8 -#define MT6359_LDO_VAUD18_CON0 0x1c98 #define MT6359_GPIO_MODE0 0xcc #define MT6359_GPIO_MODE0_SET 0xce @@ -2469,7 +2463,6 @@ enum { enum { /* common */ SUPPLY_SEQ_CLK_BUF, - SUPPLY_SEQ_LDO_VAUD18, SUPPLY_SEQ_AUD_GLB, SUPPLY_SEQ_HP_PULL_DOWN, SUPPLY_SEQ_CLKSQ, @@ -2629,7 +2622,6 @@ struct mt6359_priv { int hp_gain_ctl; int hp_hifi_mode; int mtkaif_protocol; - struct regulator *avdd_reg; }; #define CODEC_MT6359_NAME "mtk-codec-mt6359" From patchwork Tue Nov 10 02:31:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Chien X-Patchwork-Id: 11892951 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 D94D5139F for ; Tue, 10 Nov 2020 02:31:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8CF03205CB for ; Tue, 10 Nov 2020 02:31:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o/ZhbuW7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="YJGyUeUK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CF03205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yed2zq+C65kiT7cIUSKTkNSq/4B9zLAZLjwc+i9ROl8=; b=o/ZhbuW7P23q6Bt+wNyS+XLOE anyEyVsHnOQ92DMQfvNULzv1vBPs7rAUQl4DHxZQxX6E2pYC+rgjA/2b7K88/k4NKerp76gl5zudr vOUnS3uFg+hSj+VYuhZ3bfDFbfFRpnY87xJhereV72dqZSZPmE/J15mAKPegWIUrJxp9WF8ogkTn7 pDY0W61LWRUp+27IF3FHinPENt+h8kskT146QQSV7ADKhe8C6ypis27diH1k0GBdIfKoTdTbSI2px 0JGzm4HsYeuoeLi6EZJy+lYlaE+aelVxkrbuiI6hfjEwdfzDgyWyKfiTcwbji4o7YR9JBle2FXPH9 pcBC0tbPg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcJRq-0000QY-3t; Tue, 10 Nov 2020 02:31:54 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcJRj-0000Ni-OD for linux-mediatek@lists.infradead.org; Tue, 10 Nov 2020 02:31:50 +0000 X-UUID: 588d78022eb0491983eac77adc3ca440-20201109 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=bfB8uRS9X8aESx2umkW0vBndZoRP0giOPAWPrpwyHvE=; b=YJGyUeUKJSPt35nB2iGoCIBWvVjMMxZjPju2FEmfwoMeA69bhoKMOyiXcmXwopMpFNOw+yHlO5kVqkywovX0p8y9Jaf/Oqe0fQKc7PvgxqTVlKzZFtiYtKgklQUYWoURUvKwDHGGk5BqozwwT0IjPFEnvy6G0dcNmbUuBulrpH4=; X-UUID: 588d78022eb0491983eac77adc3ca440-20201109 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 406309141; Mon, 09 Nov 2020 18:31:45 -0800 Received: from mtkmbs08n2.mediatek.inc (172.21.101.56) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 9 Nov 2020 18:31:44 -0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 10 Nov 2020 10:31:41 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 10 Nov 2020 10:31:41 +0800 From: Shane Chien To: Matthias Brugger , Mark Brown , Liam Girdwood , Rob Herring Subject: [PATCH v3 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359 Date: Tue, 10 Nov 2020 10:31:32 +0800 Message-ID: <1604975492-6142-3-git-send-email-shane.chien@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1604975492-6142-1-git-send-email-shane.chien@mediatek.com> References: <1604975492-6142-1-git-send-email-shane.chien@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: FACEFA9603373427B634BAE8CE32DDF62F07EE1ED3D97E0FBE505E2C7E028E6D2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_213148_010858_62EFD04F X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, wsd_upstream@mediatek.com, chipeng.chang@mediatek.com, linux-kernel@vger.kernel.org, jiaxin.yu@mediatek.com, shane.chien@mediatek.com, linux-mediatek@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org From: "Shane.Chien" This patch add "LDO_VAUD18-supply" property to control vaud18 regulator. It is labeled as required due to mt6359 audio path always need to enable vaud18. Signed-off-by: Shane.Chien --- .../devicetree/bindings/sound/mt6359.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt6359.yaml b/Documentation/devicetree/bindings/sound/mt6359.yaml index a54f466..ef027c7 100644 --- a/Documentation/devicetree/bindings/sound/mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/mt6359.yaml @@ -17,6 +17,11 @@ description: | Must be a child node of PMIC wrapper. properties: + LDO_VAUD18-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + Regulator of LDO VAUD18 at 1.8V. + mediatek,dmic-mode: $ref: /schemas/types.yaml#/definitions/uint32 description: | @@ -49,11 +54,15 @@ properties: description: | Specifies the type of mic type connected to adc2 +required: + - LDO_VAUD18-supply + additionalProperties: false examples: - | mt6359codec: mt6359codec { + LDO_VAUD18-supply = <&mt6359p_vaud18_reg>; mediatek,dmic-mode = <0>; mediatek,mic-type-0 = <2>; };