Skip to contentSkip to conversation

Add I2S/ADV7511 audio support for ARC AXS10x boards

PATCH RESEND In review Jose Abreu 3 participants 7 messages Feb 23, 2016 – Feb 26, 2016 2 messages not in the archive

Subsystems (5)
lore
Share & tools
lore

Jose Abreu

author
#0 lore raw

cover Add I2S/ADV7511 audio support for ARC AXS10x boards

ARC AXS10x platforms consist of a mainboard with several peripherals. One of those peripherals is an HDMI output port controlled by ADV7511 transmitter.

This patch set adds audio for the ADV7511 transmitter and I2S audio for the AXS10x platform.

Jose Abreu (4):
[adv7511] Add audio support
[adv7511] Update defconfigs so that audio is enabled [dwc] Add I2S HDMI audio support using custom platform driver [dwc] Update defconfigs so that I2S is enabled

 arch/arc/boot/dts/axs10x_mb.dtsi      |   20 +-
 arch/arc/configs/axs101_defconfig     |    4 +
 arch/arc/configs/axs103_defconfig     |    6 +
 arch/arc/configs/axs103_smp_defconfig |    6 +
 drivers/gpu/drm/i2c/Kconfig           |    8 +
 drivers/gpu/drm/i2c/Makefile          |    2 +
 drivers/gpu/drm/i2c/adv7511.c         | 1024 ---------------------------------
 drivers/gpu/drm/i2c/adv7511.h         |   41 ++
 drivers/gpu/drm/i2c/adv7511_audio.c   |  310 ++++++++++
 drivers/gpu/drm/i2c/adv7511_core.c    | 1005 ++++++++++++++++++++++++++++++++
 include/sound/soc-dai.h               |    1 +
 sound/soc/dwc/Kconfig                 |    1 +
 sound/soc/dwc/Makefile                |    4 +-
 sound/soc/dwc/designware_i2s.c        |  139 ++++-
 sound/soc/dwc/designware_pcm.c        |  264 +++++++++
 sound/soc/dwc/designware_pcm.h        |   21 +
 16 files changed, 1813 insertions(+), 1043 deletions(-)
 delete mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511_audio.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511_core.c
 create mode 100644 sound/soc/dwc/designware_pcm.c
 create mode 100644 sound/soc/dwc/designware_pcm.h
Signature · 7 lines
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): cover.1456234503.git.joabreu-HKixBCOQz3hWk0Htik3J/[email protected]

author
#2 lore raw

PATCH RESEND 2/4 ARC: axs10x: Update defconfigs so that audio is enabled

The defconfigs for the AXS boards were updated so that ALSA SoC is enabled and also the audio for the ADV7511 HDMI transmitter.

---
 arch/arc/configs/axs101_defconfig     | 3 +++
 arch/arc/configs/axs103_defconfig     | 5 +++++
 arch/arc/configs/axs103_smp_defconfig | 5 +++++
 3 files changed, 13 insertions(+)
arch/arc/configs/axs101_defconfig +3 -0
index e359099..7c22163 100644
@@ -113,3 +113,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
arch/arc/configs/axs103_defconfig +5 -0
index 323486d..d63aef0 100644
@@ -76,12 +76,14 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_DRM=y
 # CONFIG_HWMON is not set
 CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_LOGO=y
+CONFIG_DRM_I2C_ADV7511=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
@@ -114,3 +116,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
arch/arc/configs/axs103_smp_defconfig +5 -0
index 66191cd..f4b51ce 100644
@@ -77,12 +77,14 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_DRM=y
 # CONFIG_HWMON is not set
 CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_LOGO=y
+CONFIG_DRM_I2C_ADV7511=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
@@ -115,3 +117,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
Signature · 7 lines
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Re: [PATCH 2/4 RESEND] ARC: axs10x: Update defconfigs so that audio is enabled

Quoted 9 lines · Jose Abreu

The defconfigs for the AXS boards were updated so that ALSA SoC is enabled and also the audio for the ADV7511 HDMI transmitter.

---
 arch/arc/configs/axs101_defconfig     | 3 +++
 arch/arc/configs/axs103_defconfig     | 5 +++++
 arch/arc/configs/axs103_smp_defconfig | 5 +++++

@Alexey, has this been tested on AXS103. Do we have the right PLL / clocks to get the audio rates - given the lower master clk.
Further per out off-list discussion - let us have a seperate config for ARC HS SDP which supports the shipping single hardware configuration and add these fancy things there as well as bumping the clk rate to 100 MHz . Current axs103* configs are more of developer configs and I don't want to bloat their code with things we don't build / download 10 times a day !

Quoted 59 lines
 3 files changed, 13 insertions(+)
arch/arc/configs/axs101_defconfig +3 -0
index e359099..7c22163 100644
@@ -113,3 +113,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
arch/arc/configs/axs103_defconfig +5 -0
index 323486d..d63aef0 100644
@@ -76,12 +76,14 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_DRM=y
 # CONFIG_HWMON is not set
 CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_LOGO=y
+CONFIG_DRM_I2C_ADV7511=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
@@ -114,3 +116,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
arch/arc/configs/axs103_smp_defconfig +2 -0
index 66191cd..f4b51ce 100644
@@ -77,12 +77,14 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_DRM=y
 # CONFIG_HWMON is not set
 CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_LOGO=y
+CONFIG_DRM_I2C_ADV7511=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set

arch/arc/configs/axs103_smp_defconfig CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10 · line 122

Quoted 6 lines
arch/arc/configs/axs103_smp_defconfig +3 -0
@@ -115,3 +117,6 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): C2D7FE5348E1B147BCA15975FBA23075F4E8BD53-cALIpNOex2c3t6iM5Z/[email protected]

#5 lore raw

Re: [PATCH 2/4 RESEND] ARC: axs10x: Update defconfigs so that audio is enabled

Hi Vineet,

Quoted 5 lines · Vineet Gupta
Quoted 4 lines · Jose Abreu

The defconfigs for the AXS boards were updated so that ALSA SoC is enabled and also the audio for the ADV7511 HDMI transmitter.

Quoted 8 lines
Quoted 5 lines

---
 arch/arc/configs/axs101_defconfig     | 3 +-+-+- arch/arc/configs/axs103_defconfig     | 5 +-+-+-+-+- arch/arc/configs/axs103_smp_defconfig | 5 +-+-+-+-+-

@Alexey, has this been tested on AXS103. Do we have the right PLL / clocks to get the audio rates - given the lower master clk.

I think I tried first version of these patches on axs103 as well. But may assume Jose have no access to axs103 and so this particular implementation may lack tests on axs103 platform. Still this is easy to fix - I'll try it myself now.

Quoted 5 lines

Further per out off-list discussion - let us have a seperate config for ARC HS SDP which supports the shipping single hardware configuration and add these fancy things there as well as bumping the clk rate to 100 MHz . Current axs103* configs are more of developer configs and I don't want to bloat their code with things we don't build / download 10 times a day !

Agree but first we need to introduce those additional configs. Let me draft those.

In the meantime it would be helpful if you take a look at existing axs10x_defconfigs and check which option you do want to keep and what are those extra once that should go to new configs with all bells and whistles.

-Alexey--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Re: [PATCH 2/4 RESEND] ARC: axs10x: Update defconfigs so that audio is enabled

Quoted 7 lines · Alexey Brodkin
Quoted 5 lines

Further per out off-list discussion - let us have a seperate config for ARC HS SDP which supports the shipping single hardware configuration and add these fancy things there as well as bumping the clk rate to 100 MHz . Current axs103* configs are more of developer configs and I don't want to bloat their code with things we don't build / download 10 times a day !

Agree but first we need to introduce those additional configs. Let me draft those.

s/configs/config
We only need one !

Quoted 3 lines

In the meantime it would be helpful if you take a look at existing axs10x_defconfigs and check which option you do want to keep and what are those extra once that should go to new configs with all bells and whistles.

I'd say leave current axs103* defconfigs as to what they are - we can trim them at leisure / seperately.
Introduce a new config item which matches the shipping axs product (NR_CPU = 2 etc) and a pairing defconfig
and add all the fancy stuff there ! They can continue to share the DTs The other purpose of this config item is to elide the hack we have for setting clk for SMP (so it remains 90 or 100)

-Vineet
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#7 lore raw

PATCH RESEND 3/4 ASoC: dwc: Add I2S HDMI audio support using custom platform driver

In reply to a message not in the archive

HDMI audio support was added to the AXS board using an I2S cpu driver and a custom platform driver.

The platform driver supports two channels @ 16 bits with rates 32k, 44.1k and 48k. ALSA Simple audio card is used to glue the cpu, platform and codec driver (adv7511).

---
 arch/arc/boot/dts/axs10x_mb.dtsi |  20 ++-
 sound/soc/dwc/Kconfig            |   1 +
 sound/soc/dwc/Makefile           |   4 +-
 sound/soc/dwc/designware_i2s.c   | 139 +++++++++++++++++++--
 sound/soc/dwc/designware_pcm.c   | 264 +++++++++++++++++++++++++++++++++++++++
 sound/soc/dwc/designware_pcm.h   |  21 ++++
 6 files changed, 430 insertions(+), 19 deletions(-)
 create mode 100644 sound/soc/dwc/designware_pcm.c
 create mode 100644 sound/soc/dwc/designware_pcm.h
arch/arc/boot/dts/axs10x_mb.dtsi +16 -4
index e00e5bb..c137376 100644
@@ -130,12 +130,23 @@
 			interrupts = <14>;
 		};
 
-		i2c@0x1e000 {
-			compatible = "snps,designware-i2c";
+		i2s: i2s@0x1e000 {
+			compatible = "snps,designware-i2s";
 			reg = <0x1e000 0x100>;
-			clock-frequency = <400000>;
-			clocks = <&i2cclk>;
 			interrupts = <15>;
+			#sound-dai-cells = <0>;
+		};
+
+		sound {
+			compatible = "simple-audio-card";
+			simple-audio-card,name = "AXS10X HDMI Audio";
+			simple-audio-card,format = "i2s";
+			simple-audio-card,cpu {
+				sound-dai = <&i2s>;
+			};
+			simple-audio-card,codec {
+				sound-dai = <&adv7511>;
+			};
 		};
 
 		i2c@0x1f000 {
@@ -155,6 +166,7 @@
 				adi,input-colorspace = "rgb";
 				adi,input-clock = "1x";
 				adi,clock-delay = <0x03>;
+				#sound-dai-cells = <0>;
 
 				ports {
 					#address-cells = <1>;
sound/soc/dwc/Kconfig +1 -0
index d50e085..bc3fae7 100644
@@ -2,6 +2,7 @@ config SND_DESIGNWARE_I2S
 	tristate "Synopsys I2S Device Driver"
 	depends on CLKDEV_LOOKUP
 	select SND_SOC_GENERIC_DMAENGINE_PCM
+	select SND_SIMPLE_CARD
 	help
 	 Say Y or M if you want to add support for I2S driver for
 	 Synopsys desigwnware I2S device. The device supports upto
sound/soc/dwc/Makefile +2 -2
index 319371f..4d8f869 100644
@@ -1,3 +1,3 @@
 # SYNOPSYS Platform Support
-obj-$(CONFIG_SND_DESIGNWARE_I2S) += designware_i2s.o
-
+obj-$(CONFIG_SND_DESIGNWARE_I2S) += dwc_i2s.o
+dwc_i2s-y := designware_i2s.o designware_pcm.o
sound/soc/dwc/designware_i2s.c +126 -13

246 lines not on this page · raw message

sound/soc/dwc/designware_pcm.c new file +264 -0

265 lines not on this page · raw message

sound/soc/dwc/designware_pcm.h new file +21 -0
new file mode 100644
index 0000000..20bf65b
@@ -0,0 +1,21 @@
+/*
+ * ALSA Platform Synopsys Audio Layer
+ *
+ * sound/soc/dwc/designware_pcm.h
+ *
+ * Copyright (C) 2016 Synopsys
+ * Jose Abreu <joabreu-HKixBCOQz3hWk0Htik3J/[email protected]>, Tiago Duarte
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __DW_PCM_H
+#define __DW_PCM_H
+
+int dw_pcm_platform_get(u32 *lsample, u32 *rsample, int bytes, int buf_size);
+int dw_pcm_platform_register(struct platform_device *pdev);
+int dw_pcm_platform_unregister(struct platform_device *pdev);
+
+#endif /* __DW_PCM_H */
\ No newline at end of file
Signature · 7 lines
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#8 lore raw

PATCH RESEND 4/4 ARC: axs10x: Update defconfigs so that I2S is enabled

In reply to a message not in the archive

The defconfigs for the AXS boards were updated to
enable Designware I2S driver.

---
 arch/arc/configs/axs101_defconfig     | 1 +
 arch/arc/configs/axs103_defconfig     | 1 +
 arch/arc/configs/axs103_smp_defconfig | 1 +
 3 files changed, 3 insertions(+)
arch/arc/configs/axs101_defconfig +1 -0
index 7c22163..dd38d03 100644
@@ -116,3 +116,4 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
+CONFIG_SND_DESIGNWARE_I2S=y
arch/arc/configs/axs103_defconfig +1 -0
index d63aef0..ff7162e 100644
@@ -119,3 +119,4 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
+CONFIG_SND_DESIGNWARE_I2S=y
arch/arc/configs/axs103_smp_defconfig +1 -0
index f4b51ce..b9f4671 100644
@@ -120,3 +120,4 @@ CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
+CONFIG_SND_DESIGNWARE_I2S=y
Signature · 7 lines
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html