2019-02-19 14:14:40

by Bogdan Togorean

[permalink] [raw]
Subject: [PATCH 0/2] ASoC: adau1977: Add support for micbias in DT

Currently micbias voltage is set based on platform_data.
If driver is instantiated using DT only default voltage for
micbias is possible.

This patch adds the possibility to specify an optional DT
property to configure the output voltage for micbias.

Bogdan Togorean (2):
ASoC: adau1977: Add MICBIAS example in DT bindings
ASoC: adau1977: Add support for setting MICBIAS via DT

.../devicetree/bindings/sound/adi,adau1977.txt | 7 +++++++
sound/soc/codecs/adau1977.c | 12 +++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)

--
2.20.1



2019-02-19 14:13:34

by Bogdan Togorean

[permalink] [raw]
Subject: [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings

Add MICBIAS property to the optional devicetree bindings.

Signed-off-by: Bogdan Togorean <[email protected]>
---
Documentation/devicetree/bindings/sound/adi,adau1977.txt | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/adi,adau1977.txt b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
index e79aeef73f28..87c16e6f2e7c 100644
--- a/Documentation/devicetree/bindings/sound/adi,adau1977.txt
+++ b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
@@ -23,6 +23,12 @@ Optional properties:
- DVDD-supply: supply voltage for the digital core, please consult
Documentation/devicetree/bindings/regulator/regulator.txt

+- adi,micbias: configures the voltage setting for the MICBIAS pin.
+ Select 0/1/2/3/4/5/6/7/8 to specify MICBIAS voltage
+ 5V/5.5V/6V/6.5V/7V/7.5V/8V/8.5V/9V
+ If not specified the default value will be "7" meaning 8.5 Volts.
+ This property is only valid for the ADAU1977
+
For required properties on SPI, please consult
Documentation/devicetree/bindings/spi/spi-bus.txt

@@ -40,6 +46,7 @@ Examples:
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;

+ adi,micbias = <3>;
reset_gpio = <&gpio 10 GPIO_ACTIVE_LOW>;
};

--
2.20.1


2019-02-19 14:13:36

by Bogdan Togorean

[permalink] [raw]
Subject: [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT

If platform_data is NULL add reading of optional adi,micbias
property from DT. If adi,micbias is not set keep the default
value for micbias.

Signed-off-by: Bogdan Togorean <[email protected]>
---
sound/soc/codecs/adau1977.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c
index 116af6a9ce3b..11c53bcb71dd 100644
--- a/sound/soc/codecs/adau1977.c
+++ b/sound/soc/codecs/adau1977.c
@@ -885,13 +885,15 @@ static int adau1977_setup_micbias(struct adau1977 *adau1977)
struct adau1977_platform_data *pdata = adau1977->dev->platform_data;
unsigned int micbias;

- if (pdata) {
+ if (pdata)
micbias = pdata->micbias;
- if (micbias > ADAU1977_MICBIAS_9V0)
- return -EINVAL;
-
- } else {
+ else if (device_property_read_u32(adau1977->dev, "adi,micbias",
+ &micbias))
micbias = ADAU1977_MICBIAS_8V5;
+
+ if (micbias > ADAU1977_MICBIAS_9V0) {
+ dev_err(adau1977->dev, "Invalid value for 'adi,micbias'\n");
+ return -EINVAL;
}

return regmap_update_bits(adau1977->regmap, ADAU1977_REG_MICBIAS,
--
2.20.1


2019-02-20 11:15:55

by Mark Brown

[permalink] [raw]
Subject: Applied "ASoC: adau1977: Add MICBIAS example in DT bindings" to the asoc tree

The patch

ASoC: adau1977: Add MICBIAS example in DT bindings

has been applied to the asoc tree at

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

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

From fb7a97456e324b4ac13044db17a4f5b974e49e33 Mon Sep 17 00:00:00 2001
From: Bogdan Togorean <[email protected]>
Date: Tue, 19 Feb 2019 16:11:38 +0200
Subject: [PATCH] ASoC: adau1977: Add MICBIAS example in DT bindings

Add MICBIAS property to the optional devicetree bindings.

Signed-off-by: Bogdan Togorean <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
---
Documentation/devicetree/bindings/sound/adi,adau1977.txt | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/adi,adau1977.txt b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
index e79aeef73f28..87c16e6f2e7c 100644
--- a/Documentation/devicetree/bindings/sound/adi,adau1977.txt
+++ b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
@@ -23,6 +23,12 @@ Optional properties:
- DVDD-supply: supply voltage for the digital core, please consult
Documentation/devicetree/bindings/regulator/regulator.txt

+- adi,micbias: configures the voltage setting for the MICBIAS pin.
+ Select 0/1/2/3/4/5/6/7/8 to specify MICBIAS voltage
+ 5V/5.5V/6V/6.5V/7V/7.5V/8V/8.5V/9V
+ If not specified the default value will be "7" meaning 8.5 Volts.
+ This property is only valid for the ADAU1977
+
For required properties on SPI, please consult
Documentation/devicetree/bindings/spi/spi-bus.txt

@@ -40,6 +46,7 @@ Examples:
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;

+ adi,micbias = <3>;
reset_gpio = <&gpio 10 GPIO_ACTIVE_LOW>;
};

--
2.20.1


2019-02-20 11:16:11

by Mark Brown

[permalink] [raw]
Subject: Applied "ASoC: adau1977: Add support for setting MICBIAS via DT" to the asoc tree

The patch

ASoC: adau1977: Add support for setting MICBIAS via DT

has been applied to the asoc tree at

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

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

From 65d257ee12860340947bbc336243b4a9a5d721df Mon Sep 17 00:00:00 2001
From: Bogdan Togorean <[email protected]>
Date: Tue, 19 Feb 2019 16:11:39 +0200
Subject: [PATCH] ASoC: adau1977: Add support for setting MICBIAS via DT

If platform_data is NULL add reading of optional adi,micbias
property from DT. If adi,micbias is not set keep the default
value for micbias.

Signed-off-by: Bogdan Togorean <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
---
sound/soc/codecs/adau1977.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c
index 116af6a9ce3b..11c53bcb71dd 100644
--- a/sound/soc/codecs/adau1977.c
+++ b/sound/soc/codecs/adau1977.c
@@ -885,13 +885,15 @@ static int adau1977_setup_micbias(struct adau1977 *adau1977)
struct adau1977_platform_data *pdata = adau1977->dev->platform_data;
unsigned int micbias;

- if (pdata) {
+ if (pdata)
micbias = pdata->micbias;
- if (micbias > ADAU1977_MICBIAS_9V0)
- return -EINVAL;
-
- } else {
+ else if (device_property_read_u32(adau1977->dev, "adi,micbias",
+ &micbias))
micbias = ADAU1977_MICBIAS_8V5;
+
+ if (micbias > ADAU1977_MICBIAS_9V0) {
+ dev_err(adau1977->dev, "Invalid value for 'adi,micbias'\n");
+ return -EINVAL;
}

return regmap_update_bits(adau1977->regmap, ADAU1977_REG_MICBIAS,
--
2.20.1


2019-02-22 14:32:03

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings

On Tue, Feb 19, 2019 at 8:12 AM Bogdan Togorean
<[email protected]> wrote:
>
> Add MICBIAS property to the optional devicetree bindings.
>
> Signed-off-by: Bogdan Togorean <[email protected]>
> ---
> Documentation/devicetree/bindings/sound/adi,adau1977.txt | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/adi,adau1977.txt b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
> index e79aeef73f28..87c16e6f2e7c 100644
> --- a/Documentation/devicetree/bindings/sound/adi,adau1977.txt
> +++ b/Documentation/devicetree/bindings/sound/adi,adau1977.txt
> @@ -23,6 +23,12 @@ Optional properties:
> - DVDD-supply: supply voltage for the digital core, please consult
> Documentation/devicetree/bindings/regulator/regulator.txt
>
> +- adi,micbias: configures the voltage setting for the MICBIAS pin.
> + Select 0/1/2/3/4/5/6/7/8 to specify MICBIAS voltage
> + 5V/5.5V/6V/6.5V/7V/7.5V/8V/8.5V/9V
> + If not specified the default value will be "7" meaning 8.5 Volts.
> + This property is only valid for the ADAU1977

There's no shortage of mic bias properties for codecs. We should
define a common property for this.

But looks like this is already applied, so what's one more...

Rob