[PATCH v2 0/3] ASoC: nau8822: add speaker Bridge Tied Output
From: Francesco Dolcini francesco.dolcini@toradex.com
Add support for BTL (Bridge Tied Load) configuration to NAU8822 audio codec, since this requires adding a new property to the binding convert it from txt to yaml first.
v2: - added Krzysztof reviewed-by and acked-by - removed non-relevant information about SPI not being supported from binding document
Emanuele Ghidoli (3): ASoC: dt-bindings: nau8822: convert to the dtschema ASoC: dt-bindings: nau8822: add nuvoton,spk-btl property to dtschema ASoC: nau8822: add speaker Bridge Tied Output configuration
.../devicetree/bindings/sound/nau8822.txt | 16 ------- .../bindings/sound/nuvoton,nau8822.yaml | 46 +++++++++++++++++++ sound/soc/codecs/nau8822.c | 10 ++++ sound/soc/codecs/nau8822.h | 9 ++++ 4 files changed, 65 insertions(+), 16 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nau8822.txt create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml
From: Emanuele Ghidoli emanuele.ghidoli@toradex.com
Convert nau8822 devicetree binding to dtschema. Change file name to match dtschema naming.
Cc: David Lin CTLIN0@nuvoton.com Signed-off-by: Emanuele Ghidoli emanuele.ghidoli@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- v2: - added Reviewed-by: Krzysztof - removed sentence on SPI being not supported --- .../devicetree/bindings/sound/nau8822.txt | 16 -------- .../bindings/sound/nuvoton,nau8822.yaml | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 16 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nau8822.txt create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml
diff --git a/Documentation/devicetree/bindings/sound/nau8822.txt b/Documentation/devicetree/bindings/sound/nau8822.txt deleted file mode 100644 index a471d162d4e5..000000000000 --- a/Documentation/devicetree/bindings/sound/nau8822.txt +++ /dev/null @@ -1,16 +0,0 @@ -NAU8822 audio CODEC - -This device supports I2C only. - -Required properties: - - - compatible : "nuvoton,nau8822" - - - reg : the I2C address of the device. - -Example: - -codec: nau8822@1a { - compatible = "nuvoton,nau8822"; - reg = <0x1a>; -}; diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml new file mode 100644 index 000000000000..2810924e3a47 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nuvoton,nau8822.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NAU8822 audio CODEC + +description: | + 24 bit stereo audio codec with speaker driver. + This device supports I2C/SPI. + +maintainers: + - David Lin CTLIN0@nuvoton.com + +properties: + compatible: + enum: + - nuvoton,nau8822 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@1a { + compatible = "nuvoton,nau8822"; + reg = <0x1a>; + }; + };
From: Emanuele Ghidoli emanuele.ghidoli@toradex.com
Allow configuring the two loudspeaker outputs as a single Bridge Tied Load output getting higher output power.
Signed-off-by: Emanuele Ghidoli emanuele.ghidoli@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- sound/soc/codecs/nau8822.c | 9 +++++++++ sound/soc/codecs/nau8822.h | 9 +++++++++ 2 files changed, 18 insertions(+)
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index 1aef281a9972..d5006d8de639 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -1056,6 +1056,7 @@ static const int update_reg[] = { static int nau8822_probe(struct snd_soc_component *component) { int i; + struct device_node *of_node = component->dev->of_node;
/* * Set the update bit in all registers, that have one. This way all @@ -1066,6 +1067,14 @@ static int nau8822_probe(struct snd_soc_component *component) snd_soc_component_update_bits(component, update_reg[i], 0x100, 0x100);
+ /* Check property to configure the two loudspeaker outputs as + * a single Bridge Tied Load output + */ + if (of_property_read_bool(of_node, "nuvoton,spk-btl")) + snd_soc_component_update_bits(component, + NAU8822_REG_RIGHT_SPEAKER_CONTROL, + NAU8822_RSUBBYP, NAU8822_RSUBBYP); + return 0; }
diff --git a/sound/soc/codecs/nau8822.h b/sound/soc/codecs/nau8822.h index 547ec057f853..646f6bb64bc5 100644 --- a/sound/soc/codecs/nau8822.h +++ b/sound/soc/codecs/nau8822.h @@ -187,6 +187,15 @@ /* NAU8822_REG_PLL_K3 (0x27) */ #define NAU8822_PLLK3_MASK 0x1FF
+/* NAU8822_REG_RIGHT_SPEAKER_CONTROL (0x2B) */ +#define NAU8822_RMIXMUT 0x20 +#define NAU8822_RSUBBYP 0x10 + +#define NAU8822_RAUXRSUBG_SFT 1 +#define NAU8822_RAUXRSUBG_MASK 0x0E + +#define NAU8822_RAUXSMUT 0x01 + /* System Clock Source */ enum { NAU8822_CLK_MCLK,
From: Emanuele Ghidoli emanuele.ghidoli@toradex.com
Add nuvoton,spk-btl to configure the two loudspeaker outputs as Bridge Tied Load
Cc: David Lin CTLIN0@nuvoton.com Signed-off-by: Emanuele Ghidoli emanuele.ghidoli@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com Acked-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- v2: Added Acked-by: Krzysztof --- .../devicetree/bindings/sound/nuvoton,nau8822.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml index 2810924e3a47..65105402a53d 100644 --- a/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8822.yaml @@ -21,6 +21,12 @@ properties: reg: maxItems: 1
+ nuvoton,spk-btl: + description: + If set, configure the two loudspeaker outputs as a Bridge Tied Load output + to drive a high power external loudspeaker. + $ref: /schemas/types.yaml#/definitions/flag + required: - compatible - reg
On Wed, 04 Jan 2023 15:04:09 +0100, Francesco Dolcini wrote:
Add support for BTL (Bridge Tied Load) configuration to NAU8822 audio codec, since this requires adding a new property to the binding convert it from txt to yaml first.
v2:
- added Krzysztof reviewed-by and acked-by
- removed non-relevant information about SPI not being supported from binding document
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: dt-bindings: nau8822: convert to the dtschema commit: 76fa6279eff931b43482f0bef5d65cdcf325de87 [3/3] ASoC: nau8822: add speaker Bridge Tied Output configuration commit: 968b42069fe5dab362b623c6b8a1565709a12f5b
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
On Mon, Jan 09, 2023 at 04:49:05PM +0000, Mark Brown wrote:
On Wed, 04 Jan 2023 15:04:09 +0100, Francesco Dolcini wrote:
Add support for BTL (Bridge Tied Load) configuration to NAU8822 audio codec, since this requires adding a new property to the binding convert it from txt to yaml first.
v2:
- added Krzysztof reviewed-by and acked-by
- removed non-relevant information about SPI not being supported from binding document
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Hello Mark, patch 2/3 was not applied, can you check? Let me know if this is because of some mistake on my side.
$ git log --grep=nau8822 --author=toradex --oneline kernel.org/broonie-sound/for-next 968b42069fe5 ASoC: nau8822: add speaker Bridge Tied Output configuration 76fa6279eff9 ASoC: dt-bindings: nau8822: convert to the dtschema
Francesco
Thanks!
[1/3] ASoC: dt-bindings: nau8822: convert to the dtschema commit: 76fa6279eff931b43482f0bef5d65cdcf325de87 [3/3] ASoC: nau8822: add speaker Bridge Tied Output configuration commit: 968b42069fe5dab362b623c6b8a1565709a12f5b
On Wed, 04 Jan 2023 15:04:09 +0100, Francesco Dolcini wrote:
Add support for BTL (Bridge Tied Load) configuration to NAU8822 audio codec, since this requires adding a new property to the binding convert it from txt to yaml first.
v2:
- added Krzysztof reviewed-by and acked-by
- removed non-relevant information about SPI not being supported from binding document
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[2/3] ASoC: dt-bindings: nau8822: add nuvoton,spk-btl property to dtschema commit: af20f01e4d1d8fdb0ef14dcb95bd76fa8006dfdd
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
participants (2)
-
Francesco Dolcini
-
Mark Brown