* [PATCH 0/2] ASoC: adau1977: Add support for micbias in DT @ 2019-02-19 14:11 Bogdan Togorean 2019-02-19 14:11 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Bogdan Togorean 2019-02-19 14:11 ` [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT Bogdan Togorean 0 siblings, 2 replies; 6+ messages in thread From: Bogdan Togorean @ 2019-02-19 14:11 UTC (permalink / raw) To: alsa-devel Cc: devicetree, lars, linux-kernel, lgirdwood, robh+dt, tiwai, Bogdan Togorean, broonie 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings 2019-02-19 14:11 [PATCH 0/2] ASoC: adau1977: Add support for micbias in DT Bogdan Togorean @ 2019-02-19 14:11 ` Bogdan Togorean 2019-02-19 15:50 ` Applied "ASoC: adau1977: Add MICBIAS example in DT bindings" to the asoc tree Mark Brown 2019-02-22 14:31 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Rob Herring 2019-02-19 14:11 ` [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT Bogdan Togorean 1 sibling, 2 replies; 6+ messages in thread From: Bogdan Togorean @ 2019-02-19 14:11 UTC (permalink / raw) To: alsa-devel Cc: lars, lgirdwood, broonie, robh+dt, tiwai, devicetree, linux-kernel, Bogdan Togorean Add MICBIAS property to the optional devicetree bindings. Signed-off-by: Bogdan Togorean <bogdan.togorean@gmail.com> --- 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 = <®ulator>; DVDD-supply = <®ulator_digital>; + adi,micbias = <3>; reset_gpio = <&gpio 10 GPIO_ACTIVE_LOW>; }; -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Applied "ASoC: adau1977: Add MICBIAS example in DT bindings" to the asoc tree 2019-02-19 14:11 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Bogdan Togorean @ 2019-02-19 15:50 ` Mark Brown 2019-02-22 14:31 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Rob Herring 1 sibling, 0 replies; 6+ messages in thread From: Mark Brown @ 2019-02-19 15:50 UTC (permalink / raw) To: Bogdan Togorean Cc: Mark Brown, alsa-devel, devicetree, lars, linux-kernel, lgirdwood, robh+dt, tiwai 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 <bogdan.togorean@gmail.com> 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 <bogdan.togorean@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> --- 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 = <®ulator>; DVDD-supply = <®ulator_digital>; + adi,micbias = <3>; reset_gpio = <&gpio 10 GPIO_ACTIVE_LOW>; }; -- 2.20.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings 2019-02-19 14:11 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Bogdan Togorean 2019-02-19 15:50 ` Applied "ASoC: adau1977: Add MICBIAS example in DT bindings" to the asoc tree Mark Brown @ 2019-02-22 14:31 ` Rob Herring 1 sibling, 0 replies; 6+ messages in thread From: Rob Herring @ 2019-02-22 14:31 UTC (permalink / raw) To: Bogdan Togorean Cc: Linux-ALSA, Lars-Peter Clausen, Liam Girdwood, Mark Brown, Takashi Iwai, devicetree, linux-kernel@vger.kernel.org On Tue, Feb 19, 2019 at 8:12 AM Bogdan Togorean <bogdan.togorean@gmail.com> wrote: > > Add MICBIAS property to the optional devicetree bindings. > > Signed-off-by: Bogdan Togorean <bogdan.togorean@gmail.com> > --- > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT 2019-02-19 14:11 [PATCH 0/2] ASoC: adau1977: Add support for micbias in DT Bogdan Togorean 2019-02-19 14:11 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Bogdan Togorean @ 2019-02-19 14:11 ` Bogdan Togorean 2019-02-19 15:50 ` Applied "ASoC: adau1977: Add support for setting MICBIAS via DT" to the asoc tree Mark Brown 1 sibling, 1 reply; 6+ messages in thread From: Bogdan Togorean @ 2019-02-19 14:11 UTC (permalink / raw) To: alsa-devel Cc: lars, lgirdwood, broonie, robh+dt, tiwai, devicetree, linux-kernel, Bogdan Togorean 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 <bogdan.togorean@gmail.com> --- 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Applied "ASoC: adau1977: Add support for setting MICBIAS via DT" to the asoc tree 2019-02-19 14:11 ` [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT Bogdan Togorean @ 2019-02-19 15:50 ` Mark Brown 0 siblings, 0 replies; 6+ messages in thread From: Mark Brown @ 2019-02-19 15:50 UTC (permalink / raw) To: Bogdan Togorean Cc: Mark Brown, alsa-devel, devicetree, lars, linux-kernel, lgirdwood, robh+dt, tiwai 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 <bogdan.togorean@gmail.com> 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 <bogdan.togorean@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> --- 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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-22 14:31 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-02-19 14:11 [PATCH 0/2] ASoC: adau1977: Add support for micbias in DT Bogdan Togorean 2019-02-19 14:11 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Bogdan Togorean 2019-02-19 15:50 ` Applied "ASoC: adau1977: Add MICBIAS example in DT bindings" to the asoc tree Mark Brown 2019-02-22 14:31 ` [PATCH 1/2] ASoC: adau1977: Add MICBIAS example in DT bindings Rob Herring 2019-02-19 14:11 ` [PATCH 2/2] ASoC: adau1977: Add support for setting MICBIAS via DT Bogdan Togorean 2019-02-19 15:50 ` Applied "ASoC: adau1977: Add support for setting MICBIAS via DT" to the asoc tree 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).