Add Chameleon v3 ASoC audio
Subsystems (4)
v2 cover Add Chameleon v3 ASoC audio
The Google Chameleon v3 is a device made for testing audio and video paths of other devices. This patchset adds support for ASoC audio on this device. It has two audio sources: HDMI audio from the it68051 chip (RX only), and analog audio from the ssm2603 chip (RX and TX).
The patchset adds the ASoC platform and codec drivers, as well as some changes to the existing ssm2602 codec driver.
v2 changes:
* Replace chv3-audio machine driver with simple-audio-card
* Use regmap_register_patch() in ssm2602 workaround
* Remove ssm2602 mute gpio patch, add a gpio hog instead
* Simplify hw_pointer logic in chv3-i2s
* Commit splits & other misc changes
Paweł Anikiel (7):
ASoC: Add Google Chameleon v3 i2s driver
ASoC: Add Google Chameleon v3 codec driver
ASoC: dt-bindings: Add Google Chameleon v3 i2s device
ASoC: dt-bindings: Add Google Chameleon v3 audio codec
ARM: dts: chameleonv3: Add mute gpio hog
ARM: dts: chameleonv3: Add Chameleon v3 audio
ASoC: ssm2602: Add workaround for playback distortions
.../bindings/sound/google,chv3-codec.yaml | 31 ++ .../bindings/sound/google,chv3-i2s.yaml | 44 +++ .../boot/dts/socfpga_arria10_chameleonv3.dts | 62 ++++ sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/codecs/Kconfig | 8 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/chv3-codec.c | 41 +++ sound/soc/codecs/ssm2602.c | 15 + sound/soc/google/Kconfig | 6 + sound/soc/google/Makefile | 2 + sound/soc/google/chv3-i2s.c | 338 ++++++++++++++++++ 12 files changed, 551 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-codec.yaml create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml create mode 100644 sound/soc/codecs/chv3-codec.c create mode 100644 sound/soc/google/Kconfig create mode 100644 sound/soc/google/Makefile create mode 100644 sound/soc/google/chv3-i2s.c
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 1/7 ASoC: Add Google Chameleon v3 i2s driver
Add driver for the i2s IP present on Google Chameleon v3
--- sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/google/Kconfig | 6 + sound/soc/google/Makefile | 2 + sound/soc/google/chv3-i2s.c | 338 ++++++++++++++++++++++++++++++++++++ 5 files changed, 348 insertions(+) create mode 100644 sound/soc/google/Kconfig create mode 100644 sound/soc/google/Makefile create mode 100644 sound/soc/google/chv3-i2s.c
sound/soc/Kconfig +1 -0
@@ -75,6 +75,7 @@ source "sound/soc/bcm/Kconfig" source "sound/soc/cirrus/Kconfig" source "sound/soc/dwc/Kconfig" source "sound/soc/fsl/Kconfig" +source "sound/soc/google/Kconfig" source "sound/soc/hisilicon/Kconfig" source "sound/soc/jz4740/Kconfig" source "sound/soc/kirkwood/Kconfig"
sound/soc/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_SND_SOC) += bcm/ obj-$(CONFIG_SND_SOC) += cirrus/ obj-$(CONFIG_SND_SOC) += dwc/ obj-$(CONFIG_SND_SOC) += fsl/ +obj-$(CONFIG_SND_SOC) += google/ obj-$(CONFIG_SND_SOC) += hisilicon/ obj-$(CONFIG_SND_SOC) += jz4740/ obj-$(CONFIG_SND_SOC) += img/
sound/soc/google/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config SND_SOC_CHV3_I2S + tristate "Google Chameleon v3 I2S device" + help + Enable support for the Google Chameleon v3 I2S device.
sound/soc/google/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SND_SOC_CHV3_I2S) += chv3-i2s.o
sound/soc/google/chv3-i2s.c new file +338 -0
338 lines not on this page · raw message
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 2/7 ASoC: Add Google Chameleon v3 codec driver
In reply to Paweł AnikielAdd driver for the codec IP present on Google Chameleon v3
--- sound/soc/codecs/Kconfig | 8 +++++++ sound/soc/codecs/Makefile | 2 ++ sound/soc/codecs/chv3-codec.c | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 sound/soc/codecs/chv3-codec.c
sound/soc/codecs/Kconfig +8 -0
@@ -57,6 +57,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_AW88395 imply SND_SOC_BT_SCO imply SND_SOC_BD28623 + imply SND_SOC_CHV3_CODEC imply SND_SOC_CQ0093VC imply SND_SOC_CROS_EC_CODEC imply SND_SOC_CS35L32
@@ -643,6 +644,13 @@ config SND_SOC_BD28623 config SND_SOC_BT_SCO tristate "Dummy BT SCO codec driver" +config SND_SOC_CHV3_CODEC + tristate "Google Chameleon v3 codec driver" + help + Enable support for the Google Chameleon v3 audio codec. + This codec does not have a control interface, it always outputs + 8 channel S32_LE audio. + config SND_SOC_CPCAP tristate "Motorola CPCAP codec" depends on MFD_CPCAP || COMPILE_TEST
sound/soc/codecs/Makefile +2 -0
@@ -51,6 +51,7 @@ snd-soc-aw88395-objs := aw88395/aw88395.o \ aw88395/aw88395_device.o snd-soc-bd28623-objs := bd28623.o snd-soc-bt-sco-objs := bt-sco.o +snd-soc-chv3-codec-objs := chv3-codec.o snd-soc-cpcap-objs := cpcap.o snd-soc-cq93vc-objs := cq93vc.o snd-soc-cros-ec-codec-objs := cros_ec_codec.o
@@ -425,6 +426,7 @@ obj-$(CONFIG_SND_SOC_AW88395_LIB) += snd-soc-aw88395-lib.o obj-$(CONFIG_SND_SOC_AW88395) +=snd-soc-aw88395.o obj-$(CONFIG_SND_SOC_BD28623) += snd-soc-bd28623.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o +obj-$(CONFIG_SND_SOC_CHV3_CODEC) += snd-soc-chv3-codec.o obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o obj-$(CONFIG_SND_SOC_CPCAP) += snd-soc-cpcap.o obj-$(CONFIG_SND_SOC_CROS_EC_CODEC) += snd-soc-cros-ec-codec.o
sound/soc/codecs/chv3-codec.c new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 3/7 ASoC: dt-bindings: Add Google Chameleon v3 i2s device
In reply to Paweł AnikielAdd binding for google,chv3-i2s device.
--- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml
Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file +44 -0
@@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 I2S device + +maintainers: + - Paweł Anikiel <[email protected]> + +description: | + I2S device for the Google Chameleon v3. The device handles both RX + and TX using a producer/consumer ring buffer design. + +properties: + compatible: + const: google,chv3-i2s + + reg: + items: + - description: core registers + - description: irq registers + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
Rob Herring
maintainerRe: [PATCH v2 3/7] ASoC: dt-bindings: Add Google Chameleon v3 i2s device
Quoted 8 lines · Paweł Anikiel
Add binding for google,chv3-i2s device.
Signed-off-by Paweł Anikiel <[email protected]>--- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.example.dtb: camera-sensor@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/rockchip-isp1.example.dtb: camera@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.example.dtb: pcie-ep@33800000: Unevaluated properties are not allowed ('assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
doc reference errors (make refcheckdocs):Documentation/usb/gadget_uvc.rst: Documentation/userspace-api/media/v4l/pixfmt-packed.yuv.rstMAINTAINERS: Documentation/devicetree/bindings/pwm/pwm-apple.yaml
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v2 3/7] ASoC: dt-bindings: Add Google Chameleon v3 i2s device
Quoted 24 lines · Rob Herring
Quoted 8 lines · Paweł Anikiel
Add binding for google,chv3-i2s device.
Signed-off-by Paweł Anikiel <[email protected]>--- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.example.dtb: camera-sensor@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/rockchip-isp1.example.dtb: camera@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.example.dtb: pcie-ep@33800000: Unevaluated properties are not allowed ('assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
Quoted 3 lines
doc reference errors (make refcheckdocs):
Documentation/usb/gadget_uvc.rst:Documentation/userspace-api/media/v4l/pixfmt-packed.yuv.rstMAINTAINERS:Documentation/devicetree/bindings/pwm/pwm-apple.yaml
These errors can be ignored.
Best regards,
Krzysztof
Re: [PATCH v2 3/7] ASoC: dt-bindings: Add Google Chameleon v3 i2s device
In reply to Paweł AnikielQuoted 16 lines · Paweł Anikiel
Add binding for google,chv3-i2s device.
Signed-off-by Paweł Anikiel <[email protected]>--- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yamlDocumentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file +2
-0@@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2
Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml line 12
Quoted 10 lines
Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/sound/google,chv3-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 I2S device + +maintainers: + - Paweł Anikiel <[email protected]> + +description: |
If there is going to be resend:
Do not need '|' unless you need to preserve formatting.
Anyway:
Best regards,
Krzysztof
PATCH v2 4/7 ASoC: dt-bindings: Add Google Chameleon v3 audio codec
In reply to Paweł AnikielAdd binding for google,chv3-codec device.
--- .../bindings/sound/google,chv3-codec.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-codec.yaml
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +31 -0
@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-codec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 audio codec + +maintainers: + - Paweł Anikiel <[email protected]> + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + const: google,chv3-codec + + "#sound-dai-cells": + const: 0 + +required: + - compatible + +additionalProperties: false + +examples: + - | + audio-codec { + compatible = "google,chv3-codec"; + };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
Rob Herring
maintainerRe: [PATCH v2 4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
Quoted 8 lines · Paweł Anikiel
Add binding for google,chv3-codec device.
Signed-off-by Paweł Anikiel <[email protected]>--- .../bindings/sound/google,chv3-codec.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-codec.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.example.dtb: camera-sensor@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/rockchip-isp1.example.dtb: camera@3c: port:endpoint:data-lanes: [[1]] is too short
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.example.dtb: pcie-ep@33800000: Unevaluated properties are not allowed ('assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
doc reference errors (make refcheckdocs):Documentation/usb/gadget_uvc.rst: Documentation/userspace-api/media/v4l/pixfmt-packed.yuv.rstMAINTAINERS: Documentation/devicetree/bindings/pwm/pwm-apple.yaml
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v2 4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
In reply to Paweł AnikielQuoted 24 lines · Paweł Anikiel
Add binding for google,chv3-codec device.
Signed-off-by Paweł Anikiel <[email protected]>--- .../bindings/sound/google,chv3-codec.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-codec.yamlDocumentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +10
-0@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-codec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 audio codec + +maintainers: + - Paweł Anikiel <[email protected]>
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 20
Quoted 10 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +10
-0+ +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + const: google,chv3-codec + + "#sound-dai-cells": + const: 0
No supplies? How do you get power?
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 25
Quoted 5 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +5
-0+ +required: + - compatible + +additionalProperties: false
unevaluatedProperties: false, because you might want to use name-prefix.
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 30
Quoted 5 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +5
-0+ +examples: + - | + audio-codec { + compatible = "google,chv3-codec";
Extend the example with dai-cells.
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 31
Quoted 1 line
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +1
-0+ };
Best regards,
Krzysztof
Mark Brown
maintainerRe: [PATCH v2 4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
Quoted 6 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 20
Quoted 2 lines · Paweł Anikiel
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +2
-0+ "#sound-dai-cells": + const: 0No supplies? How do you get power?
My understanding is that this is deployed to a FPGA so the power would be going into the FPGA. In general a memory mapped I2S controller like this will be part of a larger SoC of some kind.
Re: [PATCH v2 4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
Quoted 4 lines · Mark Brown
Quoted 1 line · Krzysztof Kozlowski
On 08/05/2023 13:30, Paweł Anikiel wrote:
Quoted 8 lines
Quoted 4 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 20
Quoted 2 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +2
-0+ "#sound-dai-cells": + const: 0No supplies? How do you get power?
My understanding is that this is deployed to a FPGA so the power would be going into the FPGA. In general a memory mapped I2S controller like this will be part of a larger SoC of some kind.
Yes, both the codec and i2s controller are implemented in the FPGA part of the Arria 10 SoC.
Regards,
Paweł
Re: [PATCH v2 4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
In reply to Mark BrownQuoted 4 lines · Mark Brown
Quoted 1 line · Krzysztof Kozlowski
On 08/05/2023 13:30, Paweł Anikiel wrote:
Quoted 8 lines
Quoted 4 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml line 20
Quoted 2 lines
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +2
-0+ "#sound-dai-cells": + const: 0No supplies? How do you get power?
My understanding is that this is deployed to a FPGA so the power would be going into the FPGA. In general a memory mapped I2S controller like this will be part of a larger SoC of some kind.
Yes, both the codec and i2s controller are implemented in the FPGA part of the Arria 10 SoC.
Regards,
Paweł
PATCH v2 5/7 ARM: dts: chameleonv3: Add mute gpio hog
In reply to Paweł AnikielAdd an output-high gpio hog for the mute pin.
--- arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +6 -0
@@ -69,6 +69,12 @@ u80: gpio@21 { "TP122", "TP123", "TP124"; + + mute { + gpio-hog; + gpios = <0 0>; + output-high; + }; }; };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 6/7 ARM: dts: chameleonv3: Add Chameleon v3 audio
In reply to Paweł AnikielAdd dts nodes for i2s, audio codec, and simple-audio-card devices.
--- .../boot/dts/socfpga_arria10_chameleonv3.dts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +56 -0
@@ -15,6 +15,61 @@ aliases { i2c0 = &i2c0; i2c1 = &i2c1; }; + + soc { + i2s0: i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + #sound-dai-cells = <0>; + }; + + i2s1: i2s@c0060400 { + compatible = "google,chv3-i2s"; + reg = <0xc0060400 0x100>, + <0xc0060f10 0x10>; + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + #sound-dai-cells = <0>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "chv3-audio"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,dai-link@0 { + reg = <0>; + cpu { + sound-dai = <&i2s0>; + }; + codec { + sound-dai = <&chv3_codec>; + }; + }; + + simple-audio-card,dai-link@1 { + reg = <1>; + format = "i2s"; + cpu { + sound-dai = <&i2s1>; + }; + codec { + sound-dai = <&ssm2603>; + bitclock-master; + frame-master; + system-clock-frequency = <22579200>; + mclk-fs = <512>; + }; + }; + }; + + chv3_codec: audio-codec { + compatible = "google,chv3-codec"; + #sound-dai-cells = <0>; + }; }; &gmac0 {
@@ -39,6 +94,7 @@ &i2c0 { ssm2603: audio-codec@1a { compatible = "adi,ssm2603"; reg = <0x1a>; + #sound-dai-cells = <0>; }; };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 7/7 ASoC: ssm2602: Add workaround for playback distortions
In reply to Paweł AnikielApply a workaround for what appears to be a hardware quirk.
The problem seems to happen when enabling "whole chip power" (bit D7 register R6) for the very first time after the chip receives power. If either "output" (D4) or "DAC" (D3) aren't powered on at that time, playback becomes very distorted later on.
This happens on the Google Chameleon v3, as well as on a ZYBO Z7-10:
https://ez.analog.com/audio/f/q-a/543726/solved-ssm2603-right-output-offset-issue/480229
I suspect this happens only when using an external MCLK signal (which is the case for both of these boards).
Here are some experiments run on a Google Chameleon v3. These were run in userspace using a wrapper around the i2cset utility:
ssmset() {
i2cset -y 0 0x1a $(($1*2)) $2
}For each of the following sequences, we apply power to the ssm2603 chip, set the configuration registers R0-R5 and R7-R8, run the selected sequence, and check for distortions on playback.
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x87 # out, dac
ssmset 0x06 0x07 # chip
OK
(disable MCLK)
ssmset 0x09 0x01 # core
ssmset 0x06 0x1f # chip
ssmset 0x06 0x07 # out, dac
(enable MCLK)
OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x1f # chip
ssmset 0x06 0x07 # out, dac
NOT OK
ssmset 0x06 0x1f # chip
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # out, dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x0f # chip, out
ssmset 0x06 0x07 # dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x17 # chip, dac
ssmset 0x06 0x07 # out
NOT OK
For each of the following sequences, we apply power to the ssm2603 chip, run the selected sequence, issue a reset with R15, configure R0-R5 and R7-R8, run one of the NOT OK sequences from above, and check for distortions.
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
OK
(disable MCLK)
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
(enable MCLK after reset)
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x17 # chip, dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x0f # chip, out
NOT OK
ssmset 0x06 0x07 # chip, out, dac
NOT OK
--- sound/soc/codecs/ssm2602.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/codecs/ssm2602.c +15 -0
@@ -53,6 +53,18 @@ static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] = { { .reg = 0x09, .def = 0x0000 } }; +/* +* ssm2602 register patch +* Workaround for playback distortions after power up: activates digital +* core, and then powers on output, DAC, and whole chip at the same time +*/ + +static const struct reg_sequence ssm2602_patch[] = { + {SSM2602_ACTIVE ,0x01 }, + {SSM2602_PWR ,0x07 }, + {SSM2602_RESET ,0x00 }, +}; +/*Appending several "None"s just for OSS mixer use*/ static const char *ssm2602_input_select[] = {
@@ -598,6 +610,9 @@ static int ssm260x_component_probe(struct snd_soc_component *component)return ret; } +regmap_register_patch (ssm2602->regmap, ssm2602_patch, +ARRAY_SIZE (ssm2602_patch)); +/* set the update bits */ regmap_update_bits (ssm2602->regmap,SSM2602_LINVOL ,LINVOL_LRIN_BOTH ,LINVOL_LRIN_BOTH );
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 1/7 ASoC: Add Google Chameleon v3 i2s driver
In reply to Paweł AnikielAdd driver for the i2s IP present on Google Chameleon v3
--- sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/google/Kconfig | 6 + sound/soc/google/Makefile | 2 + sound/soc/google/chv3-i2s.c | 338 ++++++++++++++++++++++++++++++++++++ 5 files changed, 348 insertions(+) create mode 100644 sound/soc/google/Kconfig create mode 100644 sound/soc/google/Makefile create mode 100644 sound/soc/google/chv3-i2s.c
sound/soc/Kconfig +1 -0
@@ -75,6 +75,7 @@ source "sound/soc/bcm/Kconfig" source "sound/soc/cirrus/Kconfig" source "sound/soc/dwc/Kconfig" source "sound/soc/fsl/Kconfig" +source "sound/soc/google/Kconfig" source "sound/soc/hisilicon/Kconfig" source "sound/soc/jz4740/Kconfig" source "sound/soc/kirkwood/Kconfig"
sound/soc/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-$(CONFIG_SND_SOC) += bcm/ obj-$(CONFIG_SND_SOC) += cirrus/ obj-$(CONFIG_SND_SOC) += dwc/ obj-$(CONFIG_SND_SOC) += fsl/ +obj-$(CONFIG_SND_SOC) += google/ obj-$(CONFIG_SND_SOC) += hisilicon/ obj-$(CONFIG_SND_SOC) += jz4740/ obj-$(CONFIG_SND_SOC) += img/
sound/soc/google/Kconfig new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config SND_SOC_CHV3_I2S + tristate "Google Chameleon v3 I2S device" + help + Enable support for the Google Chameleon v3 I2S device.
sound/soc/google/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_SND_SOC_CHV3_I2S) += chv3-i2s.o
sound/soc/google/chv3-i2s.c new file +338 -0
338 lines not on this page · raw message
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 2/7 ASoC: Add Google Chameleon v3 codec driver
In reply to Paweł AnikielAdd driver for the codec IP present on Google Chameleon v3
--- sound/soc/codecs/Kconfig | 8 +++++++ sound/soc/codecs/Makefile | 2 ++ sound/soc/codecs/chv3-codec.c | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 sound/soc/codecs/chv3-codec.c
sound/soc/codecs/Kconfig +8 -0
@@ -57,6 +57,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_AW88395 imply SND_SOC_BT_SCO imply SND_SOC_BD28623 + imply SND_SOC_CHV3_CODEC imply SND_SOC_CQ0093VC imply SND_SOC_CROS_EC_CODEC imply SND_SOC_CS35L32
@@ -643,6 +644,13 @@ config SND_SOC_BD28623 config SND_SOC_BT_SCO tristate "Dummy BT SCO codec driver" +config SND_SOC_CHV3_CODEC + tristate "Google Chameleon v3 codec driver" + help + Enable support for the Google Chameleon v3 audio codec. + This codec does not have a control interface, it always outputs + 8 channel S32_LE audio. + config SND_SOC_CPCAP tristate "Motorola CPCAP codec" depends on MFD_CPCAP || COMPILE_TEST
sound/soc/codecs/Makefile +2 -0
@@ -51,6 +51,7 @@ snd-soc-aw88395-objs := aw88395/aw88395.o \ aw88395/aw88395_device.o snd-soc-bd28623-objs := bd28623.o snd-soc-bt-sco-objs := bt-sco.o +snd-soc-chv3-codec-objs := chv3-codec.o snd-soc-cpcap-objs := cpcap.o snd-soc-cq93vc-objs := cq93vc.o snd-soc-cros-ec-codec-objs := cros_ec_codec.o
@@ -425,6 +426,7 @@ obj-$(CONFIG_SND_SOC_AW88395_LIB) += snd-soc-aw88395-lib.o obj-$(CONFIG_SND_SOC_AW88395) +=snd-soc-aw88395.o obj-$(CONFIG_SND_SOC_BD28623) += snd-soc-bd28623.o obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o +obj-$(CONFIG_SND_SOC_CHV3_CODEC) += snd-soc-chv3-codec.o obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o obj-$(CONFIG_SND_SOC_CPCAP) += snd-soc-cpcap.o obj-$(CONFIG_SND_SOC_CROS_EC_CODEC) += snd-soc-cros-ec-codec.o
sound/soc/codecs/chv3-codec.c new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 3/7 ASoC: dt-bindings: Add Google Chameleon v3 i2s device
In reply to Paweł AnikielAdd binding for google,chv3-i2s device.
--- .../bindings/sound/google,chv3-i2s.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml
Documentation/devicetree/bindings/sound/google,chv3-i2s.yaml new file +44 -0
@@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-i2s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 I2S device + +maintainers: + - Paweł Anikiel <[email protected]> + +description: | + I2S device for the Google Chameleon v3. The device handles both RX + and TX using a producer/consumer ring buffer design. + +properties: + compatible: + const: google,chv3-i2s + + reg: + items: + - description: core registers + - description: irq registers + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 4/7 ASoC: dt-bindings: Add Google Chameleon v3 audio codec
In reply to Paweł AnikielAdd binding for google,chv3-codec device.
--- .../bindings/sound/google,chv3-codec.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/google,chv3-codec.yaml
Documentation/devicetree/bindings/sound/google,chv3-codec.yaml new file +31 -0
@@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/google,chv3-codec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google Chameleon v3 audio codec + +maintainers: + - Paweł Anikiel <[email protected]> + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + const: google,chv3-codec + + "#sound-dai-cells": + const: 0 + +required: + - compatible + +additionalProperties: false + +examples: + - | + audio-codec { + compatible = "google,chv3-codec"; + };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 5/7 ARM: dts: chameleonv3: Add mute gpio hog
In reply to Paweł AnikielAdd an output-high gpio hog for the mute pin.
--- arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +6 -0
@@ -69,6 +69,12 @@ u80: gpio@21 { "TP122", "TP123", "TP124"; + + mute { + gpio-hog; + gpios = <0 0>; + output-high; + }; }; };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 6/7 ARM: dts: chameleonv3: Add Chameleon v3 audio
In reply to Paweł AnikielAdd dts nodes for i2s, audio codec, and simple-audio-card devices.
--- .../boot/dts/socfpga_arria10_chameleonv3.dts | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts +56 -0
@@ -15,6 +15,61 @@ aliases { i2c0 = &i2c0; i2c1 = &i2c1; }; + + soc { + i2s0: i2s@c0060300 { + compatible = "google,chv3-i2s"; + reg = <0xc0060300 0x100>, + <0xc0060f00 0x10>; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; + #sound-dai-cells = <0>; + }; + + i2s1: i2s@c0060400 { + compatible = "google,chv3-i2s"; + reg = <0xc0060400 0x100>, + <0xc0060f10 0x10>; + interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>; + #sound-dai-cells = <0>; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "chv3-audio"; + #address-cells = <1>; + #size-cells = <0>; + + simple-audio-card,dai-link@0 { + reg = <0>; + cpu { + sound-dai = <&i2s0>; + }; + codec { + sound-dai = <&chv3_codec>; + }; + }; + + simple-audio-card,dai-link@1 { + reg = <1>; + format = "i2s"; + cpu { + sound-dai = <&i2s1>; + }; + codec { + sound-dai = <&ssm2603>; + bitclock-master; + frame-master; + system-clock-frequency = <22579200>; + mclk-fs = <512>; + }; + }; + }; + + chv3_codec: audio-codec { + compatible = "google,chv3-codec"; + #sound-dai-cells = <0>; + }; }; &gmac0 {
@@ -39,6 +94,7 @@ &i2c0 { ssm2603: audio-codec@1a { compatible = "adi,ssm2603"; reg = <0x1a>; + #sound-dai-cells = <0>; }; };
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
PATCH v2 7/7 ASoC: ssm2602: Add workaround for playback distortions
In reply to Paweł AnikielApply a workaround for what appears to be a hardware quirk.
The problem seems to happen when enabling "whole chip power" (bit D7 register R6) for the very first time after the chip receives power. If either "output" (D4) or "DAC" (D3) aren't powered on at that time, playback becomes very distorted later on.
This happens on the Google Chameleon v3, as well as on a ZYBO Z7-10:
https://ez.analog.com/audio/f/q-a/543726/solved-ssm2603-right-output-offset-issue/480229
I suspect this happens only when using an external MCLK signal (which is the case for both of these boards).
Here are some experiments run on a Google Chameleon v3. These were run in userspace using a wrapper around the i2cset utility:
ssmset() {
i2cset -y 0 0x1a $(($1*2)) $2
}For each of the following sequences, we apply power to the ssm2603 chip, set the configuration registers R0-R5 and R7-R8, run the selected sequence, and check for distortions on playback.
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x87 # out, dac
ssmset 0x06 0x07 # chip
OK
(disable MCLK)
ssmset 0x09 0x01 # core
ssmset 0x06 0x1f # chip
ssmset 0x06 0x07 # out, dac
(enable MCLK)
OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x1f # chip
ssmset 0x06 0x07 # out, dac
NOT OK
ssmset 0x06 0x1f # chip
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # out, dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x0f # chip, out
ssmset 0x06 0x07 # dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x17 # chip, dac
ssmset 0x06 0x07 # out
NOT OK
For each of the following sequences, we apply power to the ssm2603 chip, run the selected sequence, issue a reset with R15, configure R0-R5 and R7-R8, run one of the NOT OK sequences from above, and check for distortions.
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
OK
(disable MCLK)
ssmset 0x09 0x01 # core
ssmset 0x06 0x07 # chip, out, dac
(enable MCLK after reset)
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x17 # chip, dac
NOT OK
ssmset 0x09 0x01 # core
ssmset 0x06 0x0f # chip, out
NOT OK
ssmset 0x06 0x07 # chip, out, dac
NOT OK
--- sound/soc/codecs/ssm2602.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/codecs/ssm2602.c +15 -0
@@ -53,6 +53,18 @@ static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] = { { .reg = 0x09, .def = 0x0000 } }; +/* +* ssm2602 register patch +* Workaround for playback distortions after power up: activates digital +* core, and then powers on output, DAC, and whole chip at the same time +*/ + +static const struct reg_sequence ssm2602_patch[] = { + {SSM2602_ACTIVE ,0x01 }, + {SSM2602_PWR ,0x07 }, + {SSM2602_RESET ,0x00 }, +}; +/*Appending several "None"s just for OSS mixer use*/ static const char *ssm2602_input_select[] = {
@@ -598,6 +610,9 @@ static int ssm260x_component_probe(struct snd_soc_component *component)return ret; } +regmap_register_patch (ssm2602->regmap, ssm2602_patch, +ARRAY_SIZE (ssm2602_patch)); +/* set the update bits */ regmap_update_bits (ssm2602->regmap,SSM2602_LINVOL ,LINVOL_LRIN_BOTH ,LINVOL_LRIN_BOTH );
Signature · 1 line
2.40.1.521.gf1e218fcd8-goog
Mark Brown
maintainerRe: (subset) [PATCH v2 0/7] Add Chameleon v3 ASoC audio
In reply to Paweł AnikielQuoted 9 lines · Paweł Anikiel
The Google Chameleon v3 is a device made for testing audio and video paths of other devices. This patchset adds support for ASoC audio on this device. It has two audio sources: HDMI audio from the it68051 chip (RX only), and analog audio from the ssm2603 chip (RX and TX).
The patchset adds the ASoC platform and codec drivers, as well as some changes to the existing ssm2602 codec driver.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[7/7] ASoC: ssm2602: Add workaround for playback distortions
commit: f63550e2b165208a2f382afcaf5551df9569e1d4
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
Mark Brown
maintainerRe: (subset) [PATCH v2 0/7] Add Chameleon v3 ASoC audio
In reply to Paweł AnikielQuoted 9 lines · Paweł Anikiel
The Google Chameleon v3 is a device made for testing audio and video paths of other devices. This patchset adds support for ASoC audio on this device. It has two audio sources: HDMI audio from the it68051 chip (RX only), and analog audio from the ssm2603 chip (RX and TX).
The patchset adds the ASoC platform and codec drivers, as well as some changes to the existing ssm2602 codec driver.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/7] ASoC: Add Google Chameleon v3 i2s driver
commit: 702648721db590b3425c31ade294000e18808345
[2/7] ASoC: Add Google Chameleon v3 codec driver
commit: 61ed303496eb7e18491ee617dec2403f75d5168c
[3/7] ASoC: dt-bindings: Add Google Chameleon v3 i2s device
commit: 6f2c1e7c2546f9eab0031843fb7346e49ba69102
[4/7] ASoC: dt-bindings: Add Google Chameleon v3 audio codec
commit: 580bac2a2c6f7d106be6d0ee0f0f310be49368b3All 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