Add the Renesas X9250 potentiometers ASoC support
Subsystems (3)
cover Add the Renesas X9250 potentiometers ASoC support
Hi,
The Renesas X9250 is a quad digitally controlled potentiometers.
In the audio path, it can be present on amplifiers designs and it can be used in ALSA as an auxiliary audio device to control these amplifiers.
Best regards,
Herve Codina
Herve Codina (3):
dt-bindings: sound: Add the Renesas X9250 potentiometers
ASoC: codecs: Add support for the Renesas X9250 potentiometers
MAINTAINERS: add the Renesas X9250 ASoC entry
.../bindings/sound/renesas,x9250.yaml | 60 ++++ MAINTAINERS | 7 + sound/soc/codecs/Kconfig | 11 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/x9250.c | 276 ++++++++++++++++++ 5 files changed, 356 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/renesas,x9250.yaml create mode 100644 sound/soc/codecs/x9250.c
Signature · 1 line
2.39.0
PATCH 1/3 dt-bindings: sound: Add the Renesas X9250 potentiometers
The Renesas X9250 is a quad digitally controlled potentiometers.
--- .../bindings/sound/renesas,x9250.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/renesas,x9250.yaml
Documentation/devicetree/bindings/sound/renesas,x9250.yaml new file +60 -0
@@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/renesas,x9250.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas X9250 quad potentiometers + +maintainers: + - Herve Codina <[email protected]> + +description: | + The Renesas X9250 is a quad digitally controlled potentiometers. + + In the audio path, it can be present on amplifiers designs and it can be used + in ALSA as an auxiliary audio device to control these amplifiers. + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml + - $ref: dai-common.yaml# + +properties: + compatible: + const: renesas,x9250 + + reg: + description: + SPI device address. + maxItems: 1 + + spi-max-frequency: + maximum: 2000000 + +patternProperties: + "^renesas,cmd[0-3]-invert$": + description: + The related command is inverted meaning that the minimum command value + set the wiper to Rh and the maximum command value set the wiper to Rl. + Without this property, the minimum command value set the wiper to Rl and + the maximum to Rh. + type: boolean + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + x9250@0 { + compatible = "renesas,x9250"; + reg = <0>; + spi-max-frequency = <2000000>; + renesas,cmd3-invert; + }; + };
Signature · 1 line
2.39.0
Rob Herring
maintainerRe: [PATCH 1/3] dt-bindings: sound: Add the Renesas X9250 potentiometers
Quoted 17 lines · Herve Codina
The Renesas X9250 is a quad digitally controlled potentiometers.
Signed-off-by Herve Codina <[email protected]>--- .../bindings/sound/renesas,x9250.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/renesas,x9250.yamlDocumentation/devicetree/bindings/sound/renesas,x9250.yaml new file +3
-0@@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +---
Documentation/devicetree/bindings/sound/renesas,x9250.yaml line 13
Quoted 10 lines
Documentation/devicetree/bindings/sound/renesas,x9250.yaml new file +10
-0+$id: http://devicetree.org/schemas/sound/renesas,x9250.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas X9250 quad potentiometers + +maintainers: + - Herve Codina <[email protected]> + +description: | + The Renesas X9250 is a quad digitally controlled potentiometers.
...is a chip with quad...
Documentation/devicetree/bindings/sound/renesas,x9250.yaml line 16
Quoted 3 lines
Documentation/devicetree/bindings/sound/renesas,x9250.yaml new file +3
-0+ + In the audio path, it can be present on amplifiers designs and it can be used + in ALSA as an auxiliary audio device to control these amplifiers.
ALSA? Linux details should not be in bindings.
Quoted 47 lines
Documentation/devicetree/bindings/sound/renesas,x9250.yaml new file +44
-0+ +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml + - $ref: dai-common.yaml# + +properties: + compatible: + const: renesas,x9250 + + reg: + description: + SPI device address. + maxItems: 1 + + spi-max-frequency: + maximum: 2000000 + +patternProperties: + "^renesas,cmd[0-3]-invert$": + description: + The related command is inverted meaning that the minimum command value + set the wiper to Rh and the maximum command value set the wiper to Rl. + Without this property, the minimum command value set the wiper to Rl and + the maximum to Rh. + type: boolean + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + x9250@0 { + compatible = "renesas,x9250"; + reg = <0>; + spi-max-frequency = <2000000>; + renesas,cmd3-invert; + }; + };Signature · 1 line
2.39.0
PATCH 2/3 ASoC: codecs: Add support for the Renesas X9250 potentiometers
In reply to Herve CodinaThe Renesas X9250 is a quad digitally controlled potentiometers.
--- sound/soc/codecs/Kconfig | 11 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/x9250.c | 276 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 sound/soc/codecs/x9250.c
sound/soc/codecs/Kconfig +11 -0
@@ -314,6 +314,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_WM9713 imply SND_SOC_WSA881X imply SND_SOC_WSA883X + imply SND_SOC_X9250 imply SND_SOC_ZL38060 help Normally ASoC codec drivers are only built if a machine driver which
@@ -2053,6 +2054,16 @@ config SND_SOC_WSA883X This enables support for Qualcomm WSA8830/WSA8835 Class-D Smart Speaker Amplifier. +config SND_SOC_X9250 + tristate "Renesas X9250 quad controlled potentiometers" + depends on SPI + help + Enable support for the Renesas X9250 quad controlled + potentiometers. + + To compile this driver as a module, choose M here: the module + will be called snd-soc-x9250. + config SND_SOC_ZL38060 tristate "Microsemi ZL38060 Connected Home Audio Processor" depends on SPI_MASTER
sound/soc/codecs/Makefile +2 -0
@@ -346,6 +346,7 @@ snd-soc-wm9713-objs := wm9713.o snd-soc-wm-hubs-objs := wm_hubs.o snd-soc-wsa881x-objs := wsa881x.o snd-soc-wsa883x-objs := wsa883x.o +snd-soc-x9250-objs := x9250.o snd-soc-zl38060-objs := zl38060.o # Amp snd-soc-max9877-objs := max9877.o
@@ -708,6 +709,7 @@ obj-$(CONFIG_SND_SOC_WM_ADSP) += snd-soc-wm-adsp.o obj-$(CONFIG_SND_SOC_WM_HUBS) += snd-soc-wm-hubs.o obj-$(CONFIG_SND_SOC_WSA881X) += snd-soc-wsa881x.o obj-$(CONFIG_SND_SOC_WSA883X) += snd-soc-wsa883x.o +obj-$(CONFIG_SND_SOC_X9250) += snd-soc-x9250.o obj-$(CONFIG_SND_SOC_ZL38060) += snd-soc-zl38060.o # Amp
sound/soc/codecs/x9250.c new file +276 -0
276 lines not on this page · raw message
Signature · 1 line
2.39.0
Mark Brown
maintainerRe: [PATCH 2/3] ASoC: codecs: Add support for the Renesas X9250 potentiometers
sound/soc/codecs/x9250.c line 172
Quoted 6 lines · Herve Codina
sound/soc/codecs/x9250.c new file +6
-0+static const struct snd_kcontrol_new x9250_controls_std[] = { +SOC_SINGLE_EXT ("CMD0" ,0 ,0 ,255 ,0 , x8250_kctrl_cmd_get, x8250_kctrl_cmd_put), +SOC_SINGLE_EXT ("CMD1" ,1 ,0 ,255 ,0 , x8250_kctrl_cmd_get, x8250_kctrl_cmd_put), +SOC_SINGLE_EXT ("CMD2" ,2 ,0 ,255 ,0 , x8250_kctrl_cmd_get, x8250_kctrl_cmd_put), +SOC_SINGLE_EXT ("CMD3" ,3 ,0 ,255 ,0 , x8250_kctrl_cmd_get, x8250_kctrl_cmd_put), +};
These control names feel a bit icky but given that they have board specific functions I don't see a way to sensibly rewrite them. However I do wonder if we might be better off having this as an IIO driver and having a binding that lets us import IIO outputs into sound cards - I'm guessing there are other non-audio applications for this hardware?
PATCH 3/3 MAINTAINERS: add the Renesas X9250 ASoC entry
In reply to Herve CodinaAfter contributing the driver, add myself as the maintainer for the Renesas X9250 ASoC driver.
--- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -17905,6 +17905,13 @@ S: Maintained F: Documentation/devicetree/bindings/clock/renesas,versaclock7.yaml F: drivers/clk/clk-versaclock7.c +RENESAS X9250 ASoC DRIVER +M: Herve Codina <[email protected]> +L: [email protected] (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/sound/renesas,x9250.yaml +F: sound/soc/codecs/x9250.c + RESET CONTROLLER FRAMEWORK M: Philipp Zabel <[email protected]> S: Maintained
Signature · 1 line
2.39.0