devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix vaud18 power leakage of mt6359
@ 2020-11-09  9:30 Shane Chien
  2020-11-09  9:30 ` [PATCH v2 1/2] ASoC: " Shane Chien
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shane Chien @ 2020-11-09  9:30 UTC (permalink / raw)
  To: Matthias Brugger, Mark Brown, Liam Girdwood, Rob Herring
  Cc: linux-kernel, linux-mediatek, devicetree, wsd_upstream,
	jiaxin.yu, chipeng.chang, shane.chien

From: "Shane.Chien" <shane.chien@mediatek.com>

This series of patches is to fix vaud18 power leakage problem.
vaud18 will be enable only when mt6359 audio path is turned on.

Change since v1:
 - use dapm regulator supply widget for vaud18 control.
 - add vaud18 regulator property in mt6359 dt-binding.

Shane.Chien (2):
  ASoC: Fix vaud18 power leakage of mt6359
  dt-bindings: mediatek: mt6359: Add new property for mt6359

 .../devicetree/bindings/sound/mt6359.yaml          |    9 +++++++
 sound/soc/codecs/mt6359.c                          |   25 +-------------------
 sound/soc/codecs/mt6359.h                          |    8 -------
 3 files changed, 10 insertions(+), 32 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] ASoC: Fix vaud18 power leakage of mt6359
  2020-11-09  9:30 [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Shane Chien
@ 2020-11-09  9:30 ` Shane Chien
  2020-11-09  9:30 ` [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359 Shane Chien
  2020-11-10 16:02 ` [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Shane Chien @ 2020-11-09  9:30 UTC (permalink / raw)
  To: Matthias Brugger, Mark Brown, Liam Girdwood, Rob Herring
  Cc: linux-kernel, linux-mediatek, devicetree, wsd_upstream,
	jiaxin.yu, chipeng.chang, shane.chien

From: "Shane.Chien" <shane.chien@mediatek.com>

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 <shane.chien@mediatek.com>
---
 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"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359
  2020-11-09  9:30 [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Shane Chien
  2020-11-09  9:30 ` [PATCH v2 1/2] ASoC: " Shane Chien
@ 2020-11-09  9:30 ` Shane Chien
  2020-11-09 15:43   ` Rob Herring
  2020-11-10 16:02 ` [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Shane Chien @ 2020-11-09  9:30 UTC (permalink / raw)
  To: Matthias Brugger, Mark Brown, Liam Girdwood, Rob Herring
  Cc: linux-kernel, linux-mediatek, devicetree, wsd_upstream,
	jiaxin.yu, chipeng.chang, shane.chien

From: "Shane.Chien" <shane.chien@mediatek.com>

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 <shane.chien@mediatek.com>
---
 .../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..7ccaa8c 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>;
     };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359
  2020-11-09  9:30 ` [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359 Shane Chien
@ 2020-11-09 15:43   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2020-11-09 15:43 UTC (permalink / raw)
  To: Shane Chien
  Cc: wsd_upstream, chipeng.chang, Rob Herring, Matthias Brugger,
	linux-kernel, jiaxin.yu, Liam Girdwood, Mark Brown, devicetree,
	linux-mediatek

On Mon, 09 Nov 2020 17:30:09 +0800, Shane Chien wrote:
> From: "Shane.Chien" <shane.chien@mediatek.com>
> 
> 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 <shane.chien@mediatek.com>
> ---
>  .../devicetree/bindings/sound/mt6359.yaml          |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 


My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/mt6359.yaml: properties:LDO_VAUD18-supply: Additional properties are not allowed ('ref' was unexpected)
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/mt6359.yaml: properties:LDO_VAUD18-supply: 'ref' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/mt6359.yaml: ignoring, error in schema: properties: LDO_VAUD18-supply
warning: no schema found in file: ./Documentation/devicetree/bindings/sound/mt6359.yaml


See https://patchwork.ozlabs.org/patch/1396618

The base for the patch is generally the last rc1. Any dependencies
should be noted.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Fix vaud18 power leakage of mt6359
  2020-11-09  9:30 [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Shane Chien
  2020-11-09  9:30 ` [PATCH v2 1/2] ASoC: " Shane Chien
  2020-11-09  9:30 ` [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359 Shane Chien
@ 2020-11-10 16:02 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-11-10 16:02 UTC (permalink / raw)
  To: Liam Girdwood, Matthias Brugger, Rob Herring, Shane Chien
  Cc: linux-mediatek, wsd_upstream, linux-kernel, jiaxin.yu,
	devicetree, chipeng.chang

On Mon, 9 Nov 2020 17:30:07 +0800, Shane Chien wrote:
> This series of patches is to fix vaud18 power leakage problem.
> vaud18 will be enable only when mt6359 audio path is turned on.
> 
> Change since v1:
>  - use dapm regulator supply widget for vaud18 control.
>  - add vaud18 regulator property in mt6359 dt-binding.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Fix vaud18 power leakage of mt6359
      commit: 64a70744b77898a15d7a5b2b4dc0fa9523a75cde

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-10 16:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09  9:30 [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Shane Chien
2020-11-09  9:30 ` [PATCH v2 1/2] ASoC: " Shane Chien
2020-11-09  9:30 ` [PATCH v2 2/2] dt-bindings: mediatek: mt6359: Add new property for mt6359 Shane Chien
2020-11-09 15:43   ` Rob Herring
2020-11-10 16:02 ` [PATCH v2 0/2] Fix vaud18 power leakage of mt6359 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).