Adjust usage of rt5682(s) power supply properties
Subsystems (7)
v2 cover Adjust usage of rt5682(s) power supply properties
This series sets straight the usage of power supply properties for the rt5682 and rt5682s audio codecs.
These properties were already being used by sc7180-trogdor.dtsi (and derived DTs like sc7180-trogdor-kingoftown.dtsi).
We start by documenting the power supplies that are already in use and then add few others that were missing to the bindings.
Then we update the drivers to also support the new supplies.
Finally we update the trogdor DTs so they have the newly added but required supplies and remove a superfluous one that was causing warnings.
v1: https://lore.kernel.org/all/[email protected]
Changes in v2:
- Made new supply names uppercase to be consistent with the existing ones
Nícolas F. R. A. Prado (8):
ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies
ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies
ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
ASoC: rt5682s: Support DBVDD and LDO1-IN supplies
ASoC: rt5682: Support DBVDD and LDO1-IN supplies
arm64: dts: qcom: sc7180-trogdor: Add missing supplies for rt5682
arm64: dts: qcom: sc7180-trogdor: Remove VBAT supply from rt5682s
.../bindings/sound/realtek,rt5682s.yaml | 23 +++++++++++++++++++ .../devicetree/bindings/sound/rt5682.txt | 20 ++++++++++++++++ .../dts/qcom/sc7180-trogdor-kingoftown.dtsi | 1 + ...0-trogdor-wormdingler-rev1-boe-rt5682s.dts | 1 + ...0-trogdor-wormdingler-rev1-inx-rt5682s.dts | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 ++ sound/soc/codecs/rt5682.c | 2 ++ sound/soc/codecs/rt5682.h | 2 +- sound/soc/codecs/rt5682s.c | 22 ++++++++++++++++++ sound/soc/codecs/rt5682s.h | 2 ++ 10 files changed, 75 insertions(+), 1 deletion(-)
Signature · 1 line
2.38.1
PATCH v2 1/8 ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies
The rt5682s codec has two supplies - AVDD and MICVDD - which are already used by sc7180-trogdor-kingoftown.dtsi. Document them in the binding.
---
(no changes since v1)
.../devicetree/bindings/sound/realtek,rt5682s.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/sound/realtek,rt5682s.yaml +12 -0
@@ -90,11 +90,20 @@ properties: "#sound-dai-cells": const: 1 + AVDD-supply: + description: Regulator supplying analog power through the AVDD pin. + + MICVDD-supply: + description: Regulator supplying power for the microphone bias through the + MICVDD pin. + additionalProperties: false required: - compatible - reg + - AVDD-supply + - MICVDD-supply examples: - |
@@ -120,5 +129,8 @@ examples: clocks = <&osc>; clock-names = "mclk"; + + AVDD-supply = <&avdd_reg>; + MICVDD-supply = <&micvdd_reg>; }; };
Signature · 1 line
2.38.1
PATCH v2 2/8 ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
In reply to Nícolas F. R. A. PradoThe rt5682s codec has two additional power supply pins, DBVDD and LDO1_IN, that aren't currently described in the binding. Add them.
---
Changes in v2:
- Made names uppercase
.../devicetree/bindings/sound/realtek,rt5682s.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+)
Documentation/devicetree/bindings/sound/realtek,rt5682s.yaml +11 -0
@@ -97,6 +97,13 @@ properties: description: Regulator supplying power for the microphone bias through the MICVDD pin. + DBVDD-supply: + description: Regulator supplying I/O power through the DBVDD pin. + + LDO1-IN-supply: + description: Regulator supplying power to the digital core and charge pump + through the LDO1_IN pin. + additionalProperties: false required:
@@ -104,6 +111,8 @@ required: - reg - AVDD-supply - MICVDD-supply + - DBVDD-supply + - LDO1-IN-supply examples: - |
@@ -132,5 +141,7 @@ examples: AVDD-supply = <&avdd_reg>; MICVDD-supply = <&micvdd_reg>; + DBVDD-supply = <&dbvdd_reg>; + LDO1-IN-supply = <&ldo1_in_reg>; }; };
Signature · 1 line
2.38.1
Re: [PATCH v2 2/8] ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
Quoted 6 lines · Nícolas F. R. A. Prado
The rt5682s codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.Reviewed-by AngeloGioacchino Del Regno <[email protected]>Signed-off-by Nícolas F. R. A. Prado <[email protected]>
Quoted 8 lines
---
Changes in v2:
- Made names uppercase.../devicetree/bindings/sound/realtek,rt5682s.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+)
PATCH v2 3/8 ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies
In reply to Nícolas F. R. A. PradoThe rt5682 codec has three supplies - AVDD, MICVDD and VBAT - which are already used by sc7180-trogdor.dtsi. Document them in the binding.
---
(no changes since v1)
Documentation/devicetree/bindings/sound/rt5682.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/sound/rt5682.txt +12 -0
@@ -8,6 +8,15 @@ Required properties: - reg : The I2C address of the device. +- AVDD-supply: phandle to the regulator supplying analog power through the + AVDD pin + +- MICVDD-supply: phandle to the regulator supplying power for the microphone + bias through the MICVDD pin. Either MICVDD or VBAT should be present. + +- VBAT-supply: phandle to the regulator supplying battery power through the + VBAT pin. Either MICVDD or VBAT should be present. + Optional properties: - interrupts : The CODEC's interrupt output.
@@ -75,4 +84,7 @@ rt5682 { clocks = <&osc>; clock-names = "mclk"; + + AVDD-supply = <&avdd_reg>; + MICVDD-supply = <&micvdd_reg>; };
Signature · 1 line
2.38.1
PATCH v2 4/8 ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
In reply to Nícolas F. R. A. PradoThe rt5682 codec has two additional power supply pins, DBVDD and LDO1_IN, that aren't currently described in the binding. Add them.
---
Changes in v2:
- Made names uppercase
Documentation/devicetree/bindings/sound/rt5682.txt | 8 ++++++++ 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/sound/rt5682.txt +8 -0
@@ -17,6 +17,12 @@ Required properties: - VBAT-supply: phandle to the regulator supplying battery power through the VBAT pin. Either MICVDD or VBAT should be present. +- DBVDD-supply: phandle to the regulator supplying I/O power through the DBVDD + pin. + +- LDO1-IN-supply: phandle to the regulator supplying power to the digital core + and charge pump through the LDO1_IN pin. + Optional properties: - interrupts : The CODEC's interrupt output.
@@ -87,4 +93,6 @@ rt5682 { AVDD-supply = <&avdd_reg>; MICVDD-supply = <&micvdd_reg>; + DBVDD-supply = <&dbvdd_reg>; + LDO1-IN-supply = <&ldo1_in_reg>; };
Signature · 1 line
2.38.1
Re: [PATCH v2 4/8] ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
Quoted 5 lines · Nícolas F. R. A. Prado
The rt5682 codec has two additional power supply pins, DBVDD and
LDO1_IN, that aren't currently described in the binding. Add them.Signed-off-by Nícolas F. R. A. Prado <[email protected]>
Quoted 8 lines
---
Changes in v2:
- Made names uppercaseDocumentation/devicetree/bindings/sound/rt5682.txt | 8 ++++++++ 1 file changed, 8 insertions(+)
PATCH v2 5/8 ASoC: rt5682s: Support DBVDD and LDO1-IN supplies
In reply to Nícolas F. R. A. PradoAdd support for the DBVDD and LDO1-IN supplies.
---
Changes in v2:
- Made names uppercase
sound/soc/codecs/rt5682s.c | 22 ++++++++++++++++++++++ sound/soc/codecs/rt5682s.h | 2 ++ 2 files changed, 24 insertions(+)
sound/soc/codecs/rt5682s.c +22 -0
@@ -44,6 +44,8 @@ static const struct rt5682s_platform_data i2s_default_platform_data = {static const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES ] = { [RT5682S_SUPPLY_AVDD ] ="AVDD" , [RT5682S_SUPPLY_MICVDD ] ="MICVDD" , + [RT5682S_SUPPLY_DBVDD ] ="DBVDD" , + [RT5682S_SUPPLY_LDO1_IN ] ="LDO1-IN" , };static const struct reg_sequence patch_list[] = {
@@ -3089,6 +3091,14 @@ static void rt5682s_i2c_disable_regulators(void *data)if (ret)dev_err (dev,"Failed to disable supply AVDD: %d\n" , ret); + ret =regulator_disable (rt5682s->supplies[RT5682S_SUPPLY_DBVDD ].consumer); +if (ret) +dev_err (dev,"Failed to disable supply DBVDD: %d\n" , ret); + + ret =regulator_disable (rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN ].consumer); +if (ret) +dev_err (dev,"Failed to disable supply LDO1-IN: %d\n" , ret); +usleep_range (1000 ,1500 ); ret =regulator_disable (rt5682s->supplies[RT5682S_SUPPLY_MICVDD ].consumer);
@@ -3150,6 +3160,18 @@ static int rt5682s_i2c_probe(struct i2c_client *i2c)return ret; } + ret =regulator_enable (rt5682s->supplies[RT5682S_SUPPLY_DBVDD ].consumer); +if (ret) { +dev_err (&i2c->dev,"Failed to enable supply DBVDD: %d\n" , ret); +return ret; + } + + ret =regulator_enable (rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN ].consumer); +if (ret) { +dev_err (&i2c->dev,"Failed to enable supply LDO1-IN: %d\n" , ret); +return ret; + } +if (gpio_is_valid (rt5682s->pdata.ldo1_en)) {if (devm_gpio_request_one (&i2c->dev, rt5682s->pdata.ldo1_en,GPIOF_OUT_INIT_HIGH ,"rt5682s" ))
sound/soc/codecs/rt5682s.h +2 -0
@@ -1438,6 +1438,8 @@ struct pll_calc_map {enum {RT5682S_SUPPLY_AVDD ,RT5682S_SUPPLY_MICVDD , +RT5682S_SUPPLY_DBVDD , +RT5682S_SUPPLY_LDO1_IN ,RT5682S_NUM_SUPPLIES , };
Signature · 1 line
2.38.1
PATCH v2 6/8 ASoC: rt5682: Support DBVDD and LDO1-IN supplies
In reply to Nícolas F. R. A. PradoAdd support for the DBVDD and LDO1-IN supplies.
---
Changes in v2:
- Made names uppercase
sound/soc/codecs/rt5682.c | 2 ++ sound/soc/codecs/rt5682.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5682.c +2 -0
@@ -35,6 +35,8 @@ const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = {"AVDD" ,"MICVDD" ,"VBAT" , +"DBVDD" , +"LDO1-IN" , };EXPORT_SYMBOL_GPL (rt5682_supply_names);
sound/soc/codecs/rt5682.h +1 -1
@@ -1424,7 +1424,7 @@ enum { RT5682_CLK_SEL_I2S2_ASRC, }; -#define RT5682_NUM_SUPPLIES 3 +#define RT5682_NUM_SUPPLIES 5struct rt5682_priv {struct snd_soc_component *component;
Signature · 1 line
2.38.1
PATCH v2 7/8 arm64: dts: qcom: sc7180-trogdor: Add missing supplies for rt5682
In reply to Nícolas F. R. A. PradoThe DBVDD and LDO1-IN supplies for rt5682 are required but are missing. They are supplied by the same power rail as AVDD. Add them.
---
Changes in v2:
- Made names uppercase
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +2 -0
@@ -768,6 +768,8 @@ alc5682: codec@1a { interrupts = <28 IRQ_TYPE_EDGE_BOTH>; AVDD-supply = <&pp1800_alc5682>; + DBVDD-supply = <&pp1800_alc5682>; + LDO1-IN-supply = <&pp1800_alc5682>; MICVDD-supply = <&pp3300_codec>; VBAT-supply = <&pp3300_audio>;
Signature · 1 line
2.38.1
PATCH v2 8/8 arm64: dts: qcom: sc7180-trogdor: Remove VBAT supply from rt5682s
In reply to Nícolas F. R. A. PradoThese devicetrees override a rt5682 node to use the rt5682s compatible, however, unlike rt5682, rt5682s doesn't have a VBAT supply. Remove the inexistent supply in the rt5682s nodes.
---
(no changes since v1)
arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi | 1 + .../dts/qcom/sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dts | 1 + .../dts/qcom/sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dts | 1 + 3 files changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi +1 -0
@@ -11,6 +11,7 @@ &alc5682 { compatible = "realtek,rt5682s"; + /delete-property/ VBAT-supply; realtek,dmic1-clk-pin = <2>; realtek,dmic-clk-rate-hz = <2048000>; };
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dts +1 -0
@@ -19,6 +19,7 @@ / { &alc5682 { compatible = "realtek,rt5682s"; + /delete-property/ VBAT-supply; realtek,dmic1-clk-pin = <2>; realtek,dmic-clk-rate-hz = <2048000>; };
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dts +1 -0
@@ -19,6 +19,7 @@ / { &alc5682 { compatible = "realtek,rt5682s"; + /delete-property/ VBAT-supply; realtek,dmic1-clk-pin = <2>; realtek,dmic-clk-rate-hz = <2048000>; };
Signature · 1 line
2.38.1
Mark Brown
maintainerRe: (subset) [PATCH v2 0/8] Adjust usage of rt5682(s) power supply properties
In reply to Nícolas F. R. A. PradoQuoted 10 lines · Nícolas F. R. A. Prado
This series sets straight the usage of power supply properties for the rt5682 and rt5682s audio codecs.
These properties were already being used by
sc7180-trogdor.dtsi(and derived DTs likesc7180-trogdor-kingoftown.dtsi).We start by documenting the power supplies that are already in use and then add few others that were missing to the bindings.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/8] ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies
commit: 163460262782b183a28d07255403fa72151fa20b
[2/8] ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies
commit: ed20a9bf3f16e413a41cd09db74fc7f8dcb1dcef
[3/8] ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies
commit: 4d3c884ca7fb8ea25555c9a4b5ab1f9acad22587
[4/8] ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies
commit: 9354fa7f6ee4ef721351c29316b59eb8f724ca49
[5/8] ASoC: rt5682s: Support DBVDD and LDO1-IN supplies
commit: 5aab1a56b3dd031603a50ed7fd53e3c607a42a86
[6/8] ASoC: rt5682: Support DBVDD and LDO1-IN supplies
commit: 318ff0693095defc683d00bb3fd7c482d10b03d7All 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
Re: (subset) [PATCH v2 0/8] Adjust usage of rt5682(s) power supply properties
In reply to Nícolas F. R. A. PradoQuoted 10 lines · Nícolas F. R. A. Prado
This series sets straight the usage of power supply properties for the rt5682 and rt5682s audio codecs.
These properties were already being used by
sc7180-trogdor.dtsi(and derived DTs likesc7180-trogdor-kingoftown.dtsi).We start by documenting the power supplies that are already in use and then add few others that were missing to the bindings.
[...]
Applied, thanks!
[7/8] arm64: dts: qcom: sc7180-trogdor: Add missing supplies for rt5682
commit: 172cb25fd25786a3290cffd38dea677edb0b7cca
[8/8] arm64: dts: qcom: sc7180-trogdor: Remove VBAT supply from rt5682s
commit: 147e8b2080f1a0496a1f51739cf591324f133619Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>