2017-11-22 11:45:27

by Katsuhiro Suzuki

[permalink] [raw]
Subject: [PATCH 0/8] add UniPhier audio system support

This series adds support for Socionext audio system for
UniPhier LD11/LD20 SoCs. This driver supports I2S output
for Line-In, Line-Out and S/PDIF output.

UniPhier AIO DAI driver provides sound devices such as I2S, S/PDIF.
Since the AIO has mixed register map for those I/Os, it is hard to
split register areas for each sound devices.

UniPhier EVEA is a codec core for Line-In, Line-Out. Since this core
is only in internal of UniPhier series SoC, this driver works
independently but only UniPhier SoC can use it.

Katsuhiro Suzuki (8):
ASoC: spdif: Add S32_LE support for S/PDIF dummy codec drivers
ASoC: uniphier: add DT bindings documentation for UniPhier EVEA
ASoC: uniphier: add DT bindings documentation for UniPhier AIO
ASoC: uniphier: add support for UniPhier EVEA codec
ASoC: uniphier: add support for UniPhier AIO driver
ASoC: uniphier: add support for UniPhier LD11/LD20 AIO driver
MAINTAINERS: add entries for UniPhier ASoC sound drivers
arm64: dts: uniphier: add sound node for UniPhier

.../devicetree/bindings/sound/uniphier,aio.txt | 36 ++
.../devicetree/bindings/sound/uniphier,evea.txt | 26 +
MAINTAINERS | 6 +
.../boot/dts/socionext/uniphier-ld11-global.dts | 72 +++
arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi | 31 +
.../boot/dts/socionext/uniphier-ld20-global.dts | 72 +++
arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi | 35 ++
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 1 +
sound/soc/codecs/spdif_receiver.c | 5 +-
sound/soc/codecs/spdif_transmitter.c | 5 +-
sound/soc/uniphier/Kconfig | 34 +
sound/soc/uniphier/Makefile | 8 +
sound/soc/uniphier/aio-core.c | 368 +++++++++++
sound/soc/uniphier/aio-dma.c | 266 ++++++++
sound/soc/uniphier/aio-ld11.c | 343 ++++++++++
sound/soc/uniphier/aio-regctrl.c | 699 +++++++++++++++++++++
sound/soc/uniphier/aio-regctrl.h | 495 +++++++++++++++
sound/soc/uniphier/aio.h | 261 ++++++++
sound/soc/uniphier/evea.c | 567 +++++++++++++++++
20 files changed, 3327 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/uniphier,aio.txt
create mode 100644 Documentation/devicetree/bindings/sound/uniphier,evea.txt
create mode 100644 sound/soc/uniphier/Kconfig
create mode 100644 sound/soc/uniphier/Makefile
create mode 100644 sound/soc/uniphier/aio-core.c
create mode 100644 sound/soc/uniphier/aio-dma.c
create mode 100644 sound/soc/uniphier/aio-ld11.c
create mode 100644 sound/soc/uniphier/aio-regctrl.c
create mode 100644 sound/soc/uniphier/aio-regctrl.h
create mode 100644 sound/soc/uniphier/aio.h
create mode 100644 sound/soc/uniphier/evea.c

--
2.15.0


From 1584969486811769033@xxx Fri Nov 24 17:31:31 +0000 2017
X-GM-THRID: 1584938780262443329
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-22 11:46:22

by Katsuhiro Suzuki

[permalink] [raw]
Subject: [PATCH 8/8] arm64: dts: uniphier: add sound node for UniPhier

This patch adds audio controller, codec and simple card node of
UniPhier AIO sound system for LD11/20 SoCs.

Signed-off-by: Katsuhiro Suzuki <[email protected]>
---
.../boot/dts/socionext/uniphier-ld11-global.dts | 72 ++++++++++++++++++++++
arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi | 31 ++++++++++
.../boot/dts/socionext/uniphier-ld20-global.dts | 72 ++++++++++++++++++++++
arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi | 35 +++++++++++
4 files changed, 210 insertions(+)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
index 2452b2243f42..4eb8d00a8c02 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts
@@ -37,6 +37,29 @@
device_type = "memory";
reg = <0 0x80000000 0 0x40000000>;
};
+
+ soc@0 {
+ sound {
+ compatible = "audio-graph-card";
+ label = "UniPhier LD11";
+ widgets = "Headphone", "Headphone Jack";
+
+ dais = <&i2s_port2
+ &i2s_port4
+ &spdif_port0>;
+ };
+
+ spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+
+ port@0 {
+ spdif_tx: endpoint {
+ remote-endpoint = <&spdif_hiecout1>;
+ };
+ };
+ };
+ };
};

&serial0 {
@@ -72,3 +95,52 @@
&nand {
status = "okay";
};
+
+&audio {
+ i2s_port0: port@0 {
+ i2s_hdmi: endpoint {
+ };
+ };
+
+ i2s_port1: port@1 {
+ i2s_pcmin2: endpoint {
+ };
+ };
+
+ i2s_port2: port@2 {
+ i2s_line: endpoint {
+ remote-endpoint = <&evea_line>;
+ };
+ };
+
+ i2s_port3: port@3 {
+ i2s_hpcmout1: endpoint {
+ };
+ };
+
+ i2s_port4: port@4 {
+ i2s_pcmout3: endpoint {
+ remote-endpoint = <&evea_hp>;
+ };
+ };
+
+ spdif_port0: port@5 {
+ spdif_hiecout1: endpoint {
+ remote-endpoint = <&spdif_tx>;
+ };
+ };
+};
+
+&evea {
+ port@0 {
+ evea_line: endpoint {
+ remote-endpoint = <&i2s_line>;
+ };
+ };
+
+ port@1 {
+ evea_hp: endpoint {
+ remote-endpoint = <&i2s_pcmout3>;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
index 1c63d0ab8a58..875e3d832090 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
@@ -186,6 +186,29 @@
<21 217 3>;
};

+ audio: audio@56000000 {
+ compatible = "socionext,uniphier-ld11-aio";
+ reg = <0x56000000 0x80000>;
+ interrupts = <0 144 4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_aout>;
+ clock-names = "aio";
+ clocks = <&sys_clk 40>;
+ reset-names = "aio";
+ resets = <&sys_rst 40>;
+ #sound-dai-cells = <1>;
+ };
+
+ evea: codec@57900000 {
+ compatible = "socionext,uniphier-evea";
+ reg = <0x57900000 0x1000>;
+ clock-names = "evea", "exiv";
+ clocks = <&sys_clk 41>, <&sys_clk 42>;
+ reset-names = "evea", "exiv", "adamv";
+ resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
+ #sound-dai-cells = <1>;
+ };
+
adamv@57920000 {
compatible = "socionext,uniphier-ld11-adamv",
"simple-mfd", "syscon";
@@ -471,3 +494,11 @@
};

#include "uniphier-pinctrl.dtsi"
+
+&pinctrl_aout {
+ drive-strength = <4>; /* default: 4mA */
+ group_1 {
+ pins = "AO1ARC";
+ drive-strength = <8>; /* 8mA */
+ };
+};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
index fc2bc9d75d35..ebcd65631bca 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts
@@ -37,6 +37,29 @@
device_type = "memory";
reg = <0 0x80000000 0 0xc0000000>;
};
+
+ soc@0 {
+ sound {
+ compatible = "audio-graph-card";
+ label = "UniPhier LD20";
+ widgets = "Headphone", "Headphone Jack";
+
+ dais = <&i2s_port2
+ &i2s_port4
+ &spdif_port0>;
+ };
+
+ spdif-out {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+
+ port@0 {
+ spdif_tx: endpoint {
+ remote-endpoint = <&spdif_hiecout1>;
+ };
+ };
+ };
+ };
};

&serial0 {
@@ -54,3 +77,52 @@
&nand {
status = "okay";
};
+
+&audio {
+ i2s_port0: port@0 {
+ i2s_hdmi: endpoint {
+ };
+ };
+
+ i2s_port1: port@1 {
+ i2s_pcmin2: endpoint {
+ };
+ };
+
+ i2s_port2: port@2 {
+ i2s_line: endpoint {
+ remote-endpoint = <&evea_line>;
+ };
+ };
+
+ i2s_port3: port@3 {
+ i2s_hpcmout1: endpoint {
+ };
+ };
+
+ i2s_port4: port@4 {
+ i2s_pcmout3: endpoint {
+ remote-endpoint = <&evea_hp>;
+ };
+ };
+
+ spdif_port0: port@5 {
+ spdif_hiecout1: endpoint {
+ remote-endpoint = <&spdif_tx>;
+ };
+ };
+};
+
+&evea {
+ port@0 {
+ evea_line: endpoint {
+ remote-endpoint = <&i2s_line>;
+ };
+ };
+
+ port@1 {
+ evea_hp: endpoint {
+ remote-endpoint = <&i2s_pcmout3>;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
index 5c81070944cc..d42bb1be1137 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
@@ -286,6 +286,29 @@
<21 217 3>;
};

+ audio: audio@56000000 {
+ compatible = "socionext,uniphier-ld20-aio";
+ reg = <0x56000000 0x80000>;
+ interrupts = <0 144 4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_aout>;
+ clock-names = "aio";
+ clocks = <&sys_clk 40>;
+ reset-names = "aio";
+ resets = <&sys_rst 40>;
+ #sound-dai-cells = <1>;
+ };
+
+ evea: codec@57900000 {
+ compatible = "socionext,uniphier-evea";
+ reg = <0x57900000 0x1000>;
+ clock-names = "evea", "exiv";
+ clocks = <&sys_clk 41>, <&sys_clk 42>;
+ reset-names = "evea", "exiv", "adamv";
+ resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
+ #sound-dai-cells = <1>;
+ };
+
adamv@57920000 {
compatible = "socionext,uniphier-ld20-adamv",
"simple-mfd", "syscon";
@@ -527,3 +550,15 @@
};

#include "uniphier-pinctrl.dtsi"
+
+&pinctrl_aout {
+ drive-strength = <4>; /* default: 3.5mA */
+ group_1 {
+ pins = "AO1DACCK";
+ drive-strength = <5>; /* 5mA */
+ };
+ group_2 {
+ pins = "AO1ARC";
+ drive-strength = <11>; /* 11mA */
+ };
+};
--
2.15.0


From 1585467693787344548@xxx Thu Nov 30 05:30:19 +0000 2017
X-GM-THRID: 1585283607714561760
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-22 11:45:52

by Katsuhiro Suzuki

[permalink] [raw]
Subject: [PATCH 3/8] ASoC: uniphier: add DT bindings documentation for UniPhier AIO

This patch adds DT binding documentation for UniPhier
AIO audio subsystem.

Signed-off-by: Katsuhiro Suzuki <[email protected]>
---
.../devicetree/bindings/sound/uniphier,aio.txt | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/uniphier,aio.txt

diff --git a/Documentation/devicetree/bindings/sound/uniphier,aio.txt b/Documentation/devicetree/bindings/sound/uniphier,aio.txt
new file mode 100644
index 000000000000..73f6c27ae4f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/uniphier,aio.txt
@@ -0,0 +1,36 @@
+Socionext UniPhier SoC audio driver
+
+The Socionext UniPhier audio subsystem consists of I2S and S/PDIF blocks in
+the same register space.
+
+Required properties:
+- compatible : should be one of the following:
+ "socionext,uniphier-ld11-aio"
+ "socionext,uniphier-ld20-aio"
+- reg : offset and length of the register set for the device.
+- interrupts : should contain I2S or S/PDIF interrupt.
+- pinctrl-names : should be "default".
+- pinctrl-0 : defined I2S signal pins for an external codec chip.
+- clock-names : should include following entries:
+ "aio"
+- clocks : a list of phandle, should contain an entry for each
+ entry in clock-names.
+- reset-names : should include following entries:
+ "aio"
+- resets : a list of phandle, should contain an entry for each
+ entry in reset-names.
+- #sound-dai-cells: should be 1.
+
+Example:
+ audio {
+ compatible = "socionext,uniphier-ld20-aio";
+ reg = <0x56000000 0x80000>;
+ interrupts = <0 144 4>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_aout>;
+ clock-names = "aio";
+ clocks = <&sys_clk 40>;
+ reset-names = "aio";
+ resets = <&sys_rst 40>;
+ #sound-dai-cells = <1>;
+ };
--
2.15.0


From 1583586825137635213@xxx Thu Nov 09 11:14:42 +0000 2017
X-GM-THRID: 1583352165790595618
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-22 11:44:37

by Katsuhiro Suzuki

[permalink] [raw]
Subject: [PATCH 7/8] MAINTAINERS: add entries for UniPhier ASoC sound drivers

Signed-off-by: Katsuhiro Suzuki <[email protected]>
---
MAINTAINERS | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b05bc2c5e85c..0959fd951f80 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12579,6 +12579,12 @@ F: include/media/soc*
F: drivers/media/i2c/soc_camera/
F: drivers/media/platform/soc_camera/

+SOCIONEXT UNIPHIER SOUND DRIVER
+M: Katsuhiro Suzuki <[email protected]>
+L: [email protected] (moderated for non-subscribers)
+S: Maintained
+F: sound/soc/uniphier/
+
SOEKRIS NET48XX LED SUPPORT
M: Chris Boot <[email protected]>
S: Maintained
--
2.15.0


From 1584055125506090118@xxx Tue Nov 14 15:18:08 +0000 2017
X-GM-THRID: 1584050079290446267
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-22 11:46:27

by Katsuhiro Suzuki

[permalink] [raw]
Subject: [PATCH 1/8] ASoC: spdif: Add S32_LE support for S/PDIF dummy codec drivers

AIO on UniPhier can output S/PDIF where no codec is needed.
This patch adds S32_LE support for dummy codec drivers.

If one S/PDIF controller has its own limitation, its CPU DAI driver should
set the supported format by its own circumstance, since the soc-pcm driver
will use the intersection of cpu_dai's formats and codec_dai's formats.

Signed-off-by: Katsuhiro Suzuki <[email protected]>
---
sound/soc/codecs/spdif_receiver.c | 5 +++--
sound/soc/codecs/spdif_transmitter.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/spdif_receiver.c b/sound/soc/codecs/spdif_receiver.c
index 7acd05140a81..c8fd6367f6c0 100644
--- a/sound/soc/codecs/spdif_receiver.c
+++ b/sound/soc/codecs/spdif_receiver.c
@@ -34,10 +34,11 @@ static const struct snd_soc_dapm_route dir_routes[] = {
#define STUB_RATES SNDRV_PCM_RATE_8000_192000
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S20_3LE | \
- SNDRV_PCM_FMTBIT_S24_LE | \
+ SNDRV_PCM_FMTBIT_S24_LE | \
+ SNDRV_PCM_FMTBIT_S32_LE | \
SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)

-static const struct snd_soc_codec_driver soc_codec_spdif_dir = {
+static struct snd_soc_codec_driver soc_codec_spdif_dir = {
.component_driver = {
.dapm_widgets = dir_widgets,
.num_dapm_widgets = ARRAY_SIZE(dir_widgets),
diff --git a/sound/soc/codecs/spdif_transmitter.c b/sound/soc/codecs/spdif_transmitter.c
index 063a64ff82d3..037aa1d45559 100644
--- a/sound/soc/codecs/spdif_transmitter.c
+++ b/sound/soc/codecs/spdif_transmitter.c
@@ -27,7 +27,8 @@
#define STUB_RATES SNDRV_PCM_RATE_8000_192000
#define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S20_3LE | \
- SNDRV_PCM_FMTBIT_S24_LE)
+ SNDRV_PCM_FMTBIT_S24_LE | \
+ SNDRV_PCM_FMTBIT_S32_LE)

static const struct snd_soc_dapm_widget dit_widgets[] = {
SND_SOC_DAPM_OUTPUT("spdif-out"),
@@ -37,7 +38,7 @@ static const struct snd_soc_dapm_route dit_routes[] = {
{ "spdif-out", NULL, "Playback" },
};

-static const struct snd_soc_codec_driver soc_codec_spdif_dit = {
+static struct snd_soc_codec_driver soc_codec_spdif_dit = {
.component_driver = {
.dapm_widgets = dit_widgets,
.num_dapm_widgets = ARRAY_SIZE(dit_widgets),
--
2.15.0


From 1585870202582408491@xxx Mon Dec 04 16:08:01 +0000 2017
X-GM-THRID: 1585870202582408491
X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread