ASoC: Add Rockchip rk817 audio CODEC support
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v6 2/3 ASoC: Add Rockchip rk817 audio CODEC support
Add support for the Rockchip rk817 audio codec integrated into the rk817 PMIC. This is based on the sources provided by Rockchip from their BSP kernel.
---
Changes in v6:
- Included additional project maintainers for correct subsystems.
- Removed unneeded compatible from DT documentation.
- Removed binding update for Odroid Go Advance (will do in seperate series).
Changes in v5:
- Move register definitions from rk817_codec.h to main rk808.h register definitions.
- Add volatile register for codec bits.
- Add default values for codec bits.
- Removed of_compatible from mtd driver (not necessary).
- Switched to using parent regmap instead of private regmap for codec.
Changes in v4:
- Created set_pll() call.
- Created user visible gain control in mic.
- Check for return value of clk_prepare_enable().
- Removed duplicate clk_prepare_enable().
- Split DT documentation to separate commit.
Changes in v3:
- Use DAPM macros to set audio path.
- Updated devicetree binding (as every rk817 has this codec chip).
- Changed documentation to yaml format.
- Split MFD changes to separate commit.
Changes in v2:
- Fixed audio path registers to solve some bugs.
sound/soc/codecs/Kconfig | 6 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/rk817_codec.c | 560 +++++++++++++++++++++++++++++++++ 3 files changed, 568 insertions(+) create mode 100644 sound/soc/codecs/rk817_codec.c
sound/soc/codecs/Kconfig +6 -0
@@ -155,6 +155,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_PCM512x_I2C imply SND_SOC_PCM512x_SPI imply SND_SOC_RK3328 + imply SND_SOC_RK817 imply SND_SOC_RT274 imply SND_SOC_RT286 imply SND_SOC_RT298
@@ -1058,6 +1059,11 @@ config SND_SOC_RK3328 tristate "Rockchip RK3328 audio CODEC" select REGMAP_MMIO +config SND_SOC_RK817 + tristate "Rockchip RK817 audio CODEC" + depends on MFD_RK808 + select REGMAP_I2C + config SND_SOC_RL6231 tristate default y if SND_SOC_RT5514=y
sound/soc/codecs/Makefile +2 -0
@@ -165,6 +165,7 @@ snd-soc-pcm512x-objs := pcm512x.o snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o snd-soc-pcm512x-spi-objs := pcm512x-spi.o snd-soc-rk3328-objs := rk3328_codec.o +snd-soc-rk817-objs := rk817_codec.o snd-soc-rl6231-objs := rl6231.o snd-soc-rl6347a-objs := rl6347a.o snd-soc-rt1011-objs := rt1011.o
@@ -479,6 +480,7 @@ obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o obj-$(CONFIG_SND_SOC_RK3328) += snd-soc-rk3328.o +obj-$(CONFIG_SND_SOC_RK817) += snd-soc-rk817.o obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o obj-$(CONFIG_SND_SOC_RT1011) += snd-soc-rt1011.o
sound/soc/codecs/rk817_codec.c new file +560 -0
560 lines not on this page · raw message
Signature · 7 lines
2.25.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Quoted 3 lines · Chris Morgan
Add support for the Rockchip rk817 audio codec integrated into the rk817 PMIC. This is based on the sources provided by Rockchip from their BSP kernel.
PATCH v6 3/3 dt-bindings: Add Rockchip rk817 audio CODEC support
In reply to a message not in the archiveCreate dt-binding documentation to document rk817 codec.
---
Changes in v6:
- Included additional project maintainers for correct subsystems.
- Removed unneeded compatible from DT documentation.
- Removed binding update for Odroid Go Advance (will do in seperate series).
Changes in v5:
- Move register definitions from rk817_codec.h to main rk808.h register definitions.
- Add volatile register for codec bits.
- Add default values for codec bits.
- Removed of_compatible from mtd driver (not necessary).
- Switched to using parent regmap instead of private regmap for codec.
Changes in v4:
- Created set_pll() call.
- Created user visible gain control in mic.
- Check for return value of clk_prepare_enable().
- Removed duplicate clk_prepare_enable().
- Split DT documentation to separate commit.
Changes in v3:
- Use DAPM macros to set audio path.
- Updated devicetree binding (as every rk817 has this codec chip).
- Changed documentation to yaml format.
- Split MFD changes to separate commit.
Changes in v2:
- Fixed audio path registers to solve some bugs.
.../bindings/sound/rockchip,rk817-codec.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +57 -0
@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/rockchip-rk817.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip rk817 audio codec + +description: + The rk817 codec is an I2C codec integrated with every Rockchip + rk817 PMIC MFD. + +properties: + + "#sound-dai-cells": + const: 1 + + clocks: + maxItems: 1 + + clock-names: + const: "mclk" + + mic-in-differential: + description: the microphone is in differential mode. + $ref: /schemas/types.yaml#/definitions/flag + +required: + - compatible + - clocks + - clock-names + +additionalProperties: false + +examples: + - | +rk817: pmic@20 { + compatible = "rockchip,rk817"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int>, <&i2s_8ch_mclk>; + #sound-dai-cells = <0>; + clocks = <&cru SCLK_I2S_8CH_OUT>; + clock-names = "mclk"; + + ........ + + rk817_codec: codec { + mic-in-differential; + status = "okay"; + }; + + ........ + +};
Signature · 7 lines
2.25.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [v6 3/3] dt-bindings: Add Rockchip rk817 audio CODEC support
Hi Chris,
Never use hotmail.com for sending patches. They corrupt Message-ID, so use for example Gmail.
X-Microsoft-Original-Message-ID:
<[email protected]>
Message-ID:
<SN6PR06MB53420A0E831C17342A73188BA5499@SN6PR06MB5342.namprd06.prod.outlook.com>
====
If you like rk817.txt should be converted to YAML, which is beyond your serie, so move these changes to rk817.txt instead for now if rob+dt agrees. ;)
====
Include the dts patch back in, so we can compare it with the documentation changes.
Quoted 40 lines · Chris Morgan
Create dt-binding documentation to document rk817 codec.
Signed-off-by Chris Morgan <[email protected]>---
Changes in v6:
- Included additional project maintainers for correct subsystems.
- Removed unneeded compatible from DT documentation.
- Removed binding update for Odroid Go Advance (will do in seperate series).
Changes in v5:
- Move register definitions fromrk817_codec.hto mainrk808.hregister definitions.
- Add volatile register for codec bits.
- Add default values for codec bits.
- Removedof_compatiblefrom mtd driver (not necessary).
- Switched to using parent regmap instead of private regmap for codec.
Changes in v4:
- Createdset_pll()call.
- Created user visible gain control in mic.
- Check for return value ofclk_prepare_enable().
- Removed duplicateclk_prepare_enable().
- Split DT documentation to separate commit.
Changes in v3:
- Use DAPM macros to set audio path.
- Updated devicetree binding (as every rk817 has this codec chip).
- Changed documentation to yaml format.
- Split MFD changes to separate commit.
Changes in v2:
- Fixed audio path registers to solve some bugs..../bindings/sound/rockchip,rk817-codec.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yamlDocumentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 11
Quoted 10 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +10
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/rockchip-rk817.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip rk817 audio codec + +description: + The rk817 codec is an I2C codec integrated with every Rockchip + rk817 PMIC MFD.
If you want to convert rk817.txt to rockchip,rk817.yaml then add
maintainers:
- Heiko Stuebner <[email protected]>
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 16
Quoted 6 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +5
-0+ +properties: + + "#sound-dai-cells": + const: 1
Move things with "#" below as much as possible.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 26
Quoted 11 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +10
-0+ + clocks: + maxItems: 1 + + clock-names: + const: "mclk" + + mic-in-differential: + description: the microphone is in differential mode. + $ref: /schemas/types.yaml#/definitions/flag
This is part of a sub node now.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 29
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ +required: + - compatible
Add compatible "rockchip,rk817" to properties
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 38
Quoted 10 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +9
-0+ - clocks + - clock-names + +additionalProperties: false + +examples: + - | +rk817: pmic@20 { + compatible = "rockchip,rk817";
Without rockchip,rk817.yaml this example will generate notifications.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 41
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
add include for IRQ_TYPE_LEVEL_LOW
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 44
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pmic_int>, <&i2s_8ch_mclk>; + #sound-dai-cells = <0>;
Move things with "#" down below the list in possible.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 45
Quoted 1 line
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0+ clocks = <&cru SCLK_I2S_8CH_OUT>;
add include for SCLK_I2S_8CH_OUT
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 46
Quoted 1 line
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0+ clock-names = "mclk";
----
Heiko's sort rules:
compatible
reg
interrupts
[alphabetical]
status [if needed]
----
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 48
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ + ........
remove
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 50
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ + rk817_codec: codec {
Move to rk817.txt example.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 52
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ mic-in-differential; + status = "okay";
Never use status in examples.
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 55
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ }; + + ........
remove
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ +};
Re: [v6 3/3] dt-bindings: Add Rockchip rk817 audio CODEC support
Quoted 4 lines · Johan Jonker
Hi Chris,
Never use hotmail.com for sending patches. They corrupt Message-ID, so use for example Gmail.
Understood. I'll get a gmail set up as soon as possible. Sorry if this message comes through funky (still on Hotmail, been using it since 96).
Quoted 4 lines
X-Microsoft-Original-Message-ID:
<[email protected]>
Quoted 8 lines
Message-ID:
<SN6PR06MB53420A0E831C17342A73188BA5499@SN6PR06MB5342.namprd06.prod.outlook.com>====
If you like rk817.txt should be converted to YAML, which is beyond your serie, so move these changes to rk817.txt instead for now if rob+dt agrees. ;)
Will do, assuming everyone agrees.
Quoted 6 lines
====
Include the dts patch back in, so we can compare it with the documentation changes.
Acknowledged.
Quoted 54 lines · Chris Morgan
Quoted 40 lines
Create dt-binding documentation to document rk817 codec.
Signed-off-by Chris Morgan <[email protected]>---
Changes in v6:
- Included additional project maintainers for correct subsystems.
- Removed unneeded compatible from DT documentation.
- Removed binding update for Odroid Go Advance (will do in seperate series).
Changes in v5:
- Move register definitions fromrk817_codec.hto mainrk808.hregister definitions.
- Add volatile register for codec bits.
- Add default values for codec bits.
- Removedof_compatiblefrom mtd driver (not necessary).
- Switched to using parent regmap instead of private regmap for codec.
Changes in v4:
- Createdset_pll()call.
- Created user visible gain control in mic.
- Check for return value ofclk_prepare_enable().
- Removed duplicateclk_prepare_enable().
- Split DT documentation to separate commit.
Changes in v3:
- Use DAPM macros to set audio path.
- Updated devicetree binding (as every rk817 has this codec chip).
- Changed documentation to yaml format.
- Split MFD changes to separate commit.
Changes in v2:
- Fixed audio path registers to solve some bugs..../bindings/sound/rockchip,rk817-codec.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yamlDocumentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 11
Quoted 10 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +10
-0+%YAML 1.2 +--- +$id: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fschemas%2Fsound%2Frockchip-rk817.yaml%23&data=04%7C01%7C%7C7f2c986dc85e4a835aae08d9036242b2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637544542817084121%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Dlh0Gn0DH%2FLwLWGr%2BxqAmVU7mUVwzMrsX2LYiIyGDtU%3D&reserved=0 +$schema: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23&data=04%7C01%7C%7C7f2c986dc85e4a835aae08d9036242b2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637544542817084121%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=82MFRpHilkJCkQKT1Esi6UX1F4WZJEE4%2BOOZL0bFQpg%3D&reserved=0 + +title: Rockchip rk817 audio codec + +description: + The rk817 codec is an I2C codec integrated with every Rockchip + rk817 PMIC MFD.If you want to convert rk817.txt to rockchip,rk817.yaml then add
Quoted 2 lines
maintainers:
- Heiko Stuebner <[email protected]>
Heiko is on here anyway as I believe he has one of these devices to test and asked previously that I include him as I upstream things for the Odroid Go Advance.
Quoted 10 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 16
Quoted 7 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +5
-0+ +properties: + + "#sound-dai-cells": + const: 1Move things with "#" below as much as possible.
Ack
Quoted 8 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 23
Quoted 7 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +7
-0+ + clocks: + maxItems: 1 + + clock-names: + const: "mclk" +
Ack
Quoted 6 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 26
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ mic-in-differential: + description: the microphone is in differential mode. + $ref: /schemas/types.yaml#/definitions/flagThis is part of a sub node now.
Correct, will update this when I move it to the rk808 documentation.
Quoted 7 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 29
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ +required: + - compatibleAdd compatible "rockchip,rk817" to properties
Will make sure I note these updates as "optional for the rk817" in the MFD devicetree bindings. The "compatible" is listed there.
Quoted 9 lines
Quoted 8 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +8
-0+ - clocks + - clock-names + +additionalProperties: false + +examples: + - | +rk817: pmic@20 {
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 38
Quoted 1 line
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0+ compatible = "rockchip,rk817";Without rockchip,rk817.yaml this example will generate notifications.
I'm afraid I don't understand. I'll update the rk808 documentation to show the correct bindings, if it's still incorrect please let me know.
Quoted 6 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 41
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>;add include for
IRQ_TYPE_LEVEL_LOW
I do not understand, I'll update the rk808, if it's still wrong please let me know.
Quoted 8 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 44
Quoted 5 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ pinctrl-names = "default"; + pinctrl-0 = <&pmic_int>, <&i2s_8ch_mclk>; + #sound-dai-cells = <0>;Move things with "#" down below the list in possible.
Acknowledged.
Quoted 31 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 45
Quoted 1 line
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0+ clocks = <&cru SCLK_I2S_8CH_OUT>;add include for
SCLK_I2S_8CH_OUTDocumentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 46
Quoted 1 line
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +1
-0+ clock-names = "mclk";----
Heiko's sort rules:compatible
reg
interrupts
[alphabetical]
status [if needed]----
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 48
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ + ........remove
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 50
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ + rk817_codec: codec {Move to rk817.txt example.
Quoted 6 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 52
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ mic-in-differential; + status = "okay";Never use status in examples.
Acknowledged.
Quoted 11 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml line 55
Quoted 4 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +3
-0+ }; + + ........remove
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
Quoted 3 lines
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml new file +2
-0+ +};
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip