summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen2/recipes-kernel/linux/linux-renesas
diff options
context:
space:
mode:
authorStephen Lawrence <stephen.lawrence@renesas.com>2015-04-08 22:43:42 +0100
committerStephen Lawrence <stephen.lawrence@renesas.com>2015-04-08 22:43:42 +0100
commit6e829fe6e422793bbb05ec563c8544154c0e9bd8 (patch)
tree4c095f95070c20ddee6fea8cb0f02133551b916f /meta-rcar-gen2/recipes-kernel/linux/linux-renesas
parent17b2653eefb8659a9c594f56e20cd8249295464f (diff)
porter: kernel: migrate porter board audio from platform data to DTS
Kernel BSP v1.9.0 contained a backported ASoC and dma descriptor mode driver for AUDIO-DMAC from the upstream kernel. This patch series migrates the R-Car M2 Porter board audio from platform data to DTS to make use of this driver and restore audio on the board.
Diffstat (limited to 'meta-rcar-gen2/recipes-kernel/linux/linux-renesas')
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ARM-shmobile-porter-board-Remove-Audio-platform-code.patch122
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0002-ARM-shmobile-porter-Sound-PIO-support-on-DTS.patch104
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0003-ARM-shmobile-porter-Sound-DMA-support-on-DTS.patch40
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0004-ARM-shmobile-porter-Sound-DMA-support-via-BUSIF-on-D.patch40
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0005-ARM-shmobile-porter-Sound-DMA-support-via-SRC-on-DTS.patch44
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0006-ARM-shmobile-porter-Sound-DMA-support-via-DVC-on-DTS.patch54
-rw-r--r--meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0007-ARM-shmobile-porter-Fix-audio-clk-master-to-SSI-and-.patch29
7 files changed, 433 insertions, 0 deletions
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ARM-shmobile-porter-board-Remove-Audio-platform-code.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ARM-shmobile-porter-board-Remove-Audio-platform-code.patch
new file mode 100644
index 0000000..c66ae98
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0001-ARM-shmobile-porter-board-Remove-Audio-platform-code.patch
@@ -0,0 +1,122 @@
+From 9c921b9515ad55583535bcca389dc98f4070c6b1 Mon Sep 17 00:00:00 2001
+From: "Signed-off-by: Biju Das" <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 11:42:52 +0100
+Subject: [PATCH 1/7] ARM: shmobile: porter board: Remove Audio platform code
+
+No longer used as audio setup is done via Device Tree.
+
+This change is identical to the koelsch patch "ARM: shmobile: Koelsch board: Remove Audio platform code"
+from Phil Edworthy
+
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/mach-shmobile/board-porter-reference.c | 79 -----------------------
+ 1 file changed, 79 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-porter-reference.c b/arch/arm/mach-shmobile/board-porter-reference.c
+index 43c262e..ae06151 100644
+--- a/arch/arm/mach-shmobile/board-porter-reference.c
++++ b/arch/arm/mach-shmobile/board-porter-reference.c
+@@ -126,78 +126,6 @@ static void __init porter_add_du_device(void)
+ platform_device_register_full(&info);
+ }
+
+-/* Sound */
+-static struct rsnd_ssi_platform_info rsnd_ssi[] = {
+- RSND_SSI(AUDIOPP_DMAC_SLAVE_CMD0_TO_SSI0, gic_spi(370), 0),
+- RSND_SSI(AUDIOPP_DMAC_SLAVE_SSI1_TO_SCU1, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
+-};
+-
+-static struct rsnd_src_platform_info rsnd_src[2] = {
+- RSND_SRC(0, AUDIO_DMAC_SLAVE_SCU0_TX, gic_spi(352)),
+- RSND_SRC(0, AUDIO_DMAC_SLAVE_CMD1_TO_MEM, gic_spi(353)),
+-};
+-
+-static struct rsnd_dvc_platform_info rsnd_dvc[2] = {
+-};
+-
+-static struct rsnd_dai_platform_info rsnd_dai = {
+- .playback = { .ssi = &rsnd_ssi[0], .src = &rsnd_src[0], .dvc = &rsnd_dvc[0], },
+- .capture = { .ssi = &rsnd_ssi[1], .src = &rsnd_src[1], .dvc = &rsnd_dvc[1], },
+-};
+-
+-static struct rcar_snd_info rsnd_info = {
+- .flags = RSND_GEN2,
+- .ssi_info = rsnd_ssi,
+- .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
+- .src_info = rsnd_src,
+- .src_info_nr = ARRAY_SIZE(rsnd_src),
+- .dvc_info = rsnd_dvc,
+- .dvc_info_nr = ARRAY_SIZE(rsnd_dvc),
+- .dai_info = &rsnd_dai,
+- .dai_info_nr = 1,
+-};
+-
+-static struct asoc_simple_card_info rsnd_card_info = {
+- .name = "SSI01-AK4643",
+- .codec = "ak4642-codec.2-0012",
+- .platform = "rcar_sound",
+- .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,
+- .cpu_dai = {
+- .name = "rcar_sound",
+- },
+- .codec_dai = {
+- .name = "ak4642-hifi",
+- .sysclk = 11289600,
+- },
+-};
+-
+-static void __init porter_add_rsnd_device(void)
+-{
+- struct resource rsnd_resources[] = {
+- [RSND_GEN2_SCU] = DEFINE_RES_MEM(0xec500000, 0x1000),
+- [RSND_GEN2_ADG] = DEFINE_RES_MEM(0xec5a0000, 0x100),
+- [RSND_GEN2_SSIU] = DEFINE_RES_MEM(0xec540000, 0x1000),
+- [RSND_GEN2_SSI] = DEFINE_RES_MEM(0xec541000, 0x1280),
+- };
+-
+- struct platform_device_info cardinfo = {
+- .parent = &platform_bus,
+- .name = "asoc-simple-card",
+- .id = -1,
+- .data = &rsnd_card_info,
+- .size_data = sizeof(struct asoc_simple_card_info),
+- .dma_mask = DMA_BIT_MASK(32),
+- };
+-
+- platform_device_register_resndata(
+- &platform_bus, "rcar_sound", -1,
+- rsnd_resources, ARRAY_SIZE(rsnd_resources),
+- &rsnd_info, sizeof(rsnd_info));
+-
+- platform_device_register_full(&cardinfo);
+-}
+-
+-
+ /*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+@@ -209,12 +137,6 @@ static const struct clk_name clk_names[] __initconst = {
+ { "du1", "du.1", "rcar-du-r8a7791" },
+ { "lvds0", "lvds.0", "rcar-du-r8a7791" },
+ { "hsusb", NULL, "usb_phy_rcar_gen2" },
+- { "ssi0", "ssi.0", "rcar_sound" },
+- { "ssi1", "ssi.1", "rcar_sound" },
+- { "src0", "src.0", "rcar_sound" },
+- { "src1", "src.1", "rcar_sound" },
+- { "dvc0", "dvc.0", "rcar_sound" },
+- { "dvc1", "dvc.1", "rcar_sound" },
+ { "vin0", NULL, "r8a7791-vin.0" },
+ { "vsps", NULL, NULL },
+ #if IS_ENABLED(CONFIG_VIDEO_RENESAS_VSP1)
+@@ -927,7 +849,6 @@ static void __init porter_add_standard_devices(void)
+
+ porter_add_du_device();
+ porter_add_usb_devices();
+- porter_add_rsnd_device();
+ porter_add_camera0_device();
+ #if IS_ENABLED(CONFIG_VIDEO_RENESAS_VSP1)
+ porter_add_vsp1_devices();
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0002-ARM-shmobile-porter-Sound-PIO-support-on-DTS.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0002-ARM-shmobile-porter-Sound-PIO-support-on-DTS.patch
new file mode 100644
index 0000000..2d46e32
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0002-ARM-shmobile-porter-Sound-PIO-support-on-DTS.patch
@@ -0,0 +1,104 @@
+From cf4fa13cdad142f1d1bdf1485cc941140062e1ce Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 13:46:13 +0100
+Subject: [PATCH 2/7] ARM: shmobile: porter: Sound PIO support on DTS
+
+This change is identical to the koelsch patch "ARM: shmobile: koelsch: Sound PIO support on DTS"
+from Kuninori Morimoto and backported to 3.10
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 52 ++++++++++++++++++++++++++++++----
+ 1 file changed, 46 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index 4fb5cd5..b39dc6a 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -12,11 +12,9 @@
+ /*
+ * SSI-AK4643
+ *
+- * these commands are required when playback.
++ * This command is required when Playback/Capture
+ *
+- * # amixer set "LINEOUT Mixer DACL" on
+- * # amixer set "Digital" 200
+- * # amixer set "DVC Out" 50
++ * amixer set "LINEOUT Mixer DACL" on
+ */
+
+ /dts-v1/;
+@@ -102,6 +100,23 @@
+ 1800000 0>;
+ };
+
++ sound {
++ compatible = "simple-audio-card";
++
++ simple-audio-card,format = "left_j";
++ simple-audio-card,bitclock-master = <&sndcodec>;
++ simple-audio-card,frame-master = <&sndcodec>;
++
++ sndcpu: simple-audio-card,cpu {
++ sound-dai = <&rcar_sound>;
++ };
++
++ sndcodec: simple-audio-card,codec {
++ sound-dai = <&ak4643>;
++ system-clock-frequency = <11289600>;
++ };
++ };
++
+ hdmi_transmitter: adv7511 {
+ compatible = "adi,adv7511";
+ gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
+@@ -128,7 +143,7 @@
+ };
+
+ &pfc {
+- pinctrl-0 = <&du_pins &usb0_pins &usb1_pins &sound_pins &sound_clk_pins &vin0_pins>;
++ pinctrl-0 = <&du_pins &usb0_pins &usb1_pins &vin0_pins>;
+ pinctrl-names = "default";
+
+ du_pins: du {
+@@ -337,7 +352,7 @@
+ pagesize = <16>;
+ };
+
+- snd_codec: ak4643 {
++ ak4643: sound-codec@12 {
+ #sound-dai-cells = <0>;
+ compatible = "asahi-kasei,ak4643";
+ reg = <0x12>;
+@@ -395,3 +410,28 @@
+ &cpu0 {
+ cpu0-supply = <&vdd_dvfs>;
+ };
++
++&rcar_sound {
++ pinctrl-0 = <&sound_pins &sound_clk_pins>;
++ pinctrl-names = "default";
++
++ #sound-dai-cells = <0>;
++
++ status = "okay";
++
++ rcar_sound,dai {
++ dai0 {
++ playback = <&ssi0>;
++ capture = <&ssi1>;
++ };
++ };
++};
++
++&ssi0 {
++ pio-transfer;
++};
++
++&ssi1 {
++ pio-transfer;
++ shared-pin;
++};
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0003-ARM-shmobile-porter-Sound-DMA-support-on-DTS.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0003-ARM-shmobile-porter-Sound-DMA-support-on-DTS.patch
new file mode 100644
index 0000000..5cefa93
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0003-ARM-shmobile-porter-Sound-DMA-support-on-DTS.patch
@@ -0,0 +1,40 @@
+From 6f4cf4739dc96d8b35975179845e1f255ae4be04 Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 13:02:31 +0100
+Subject: [PATCH 3/7] ARM: shmobile: porter: Sound DMA support on DTS
+
+DMA transfer to/from SSI
+
+ DMA
+[MEM] -> [SSI]
+
+ DMA
+[MEM] <- [SSI]
+
+This change is identical to the koelsch patch "ARM: shmobile: koelsch: Sound DMA support on DTS"
+from Kuninori Morimoto and backported to 3.10
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index b39dc6a..4e3239e 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -428,10 +428,10 @@
+ };
+
+ &ssi0 {
+- pio-transfer;
++ no-busif;
+ };
+
+ &ssi1 {
+- pio-transfer;
++ no-busif;
+ shared-pin;
+ };
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0004-ARM-shmobile-porter-Sound-DMA-support-via-BUSIF-on-D.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0004-ARM-shmobile-porter-Sound-DMA-support-via-BUSIF-on-D.patch
new file mode 100644
index 0000000..f1c3f35
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0004-ARM-shmobile-porter-Sound-DMA-support-via-BUSIF-on-D.patch
@@ -0,0 +1,40 @@
+From ae784cb963b195bb19ce06623c156ddc673ecbe2 Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 13:11:29 +0100
+Subject: [PATCH 4/7] ARM: shmobile: porter: Sound DMA support via BUSIF on
+ DTS
+
+DMA transfer to/from SSIU
+
+ DMA
+[MEM] -> [SSIU] -> [SSI]
+
+ DMA
+[MEM] <- [SSIU] <- [SSI]
+
+This change is identical to the koelsch patch "ARM: shmobile: koelsch: Sound DMA support via BUSIF on DTS"
+from Kuninori Morimoto and backported to 3.10
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index 4e3239e..10549ac 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -427,11 +427,6 @@
+ };
+ };
+
+-&ssi0 {
+- no-busif;
+-};
+-
+ &ssi1 {
+- no-busif;
+ shared-pin;
+ };
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0005-ARM-shmobile-porter-Sound-DMA-support-via-SRC-on-DTS.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0005-ARM-shmobile-porter-Sound-DMA-support-via-SRC-on-DTS.patch
new file mode 100644
index 0000000..bb6a9d7
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0005-ARM-shmobile-porter-Sound-DMA-support-via-SRC-on-DTS.patch
@@ -0,0 +1,44 @@
+From e902b2b063a67517922bf4e154258ed27db34b8b Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 13:16:44 +0100
+Subject: [PATCH 5/7] ARM: shmobile: porter: Sound DMA support via SRC on DTS
+
+DMA transfer to/from SRC
+
+ DMA DMApp
+[MEM] -> [SRC] -> [SSIU] -> [SSI]
+
+ DMA DMApp
+[MEM] <- [SRC] <- [SSIU] <- [SSI]
+
+Current sound driver is supporting
+SSI/SRC random connection.
+So, this patch is tring
+SSI0 -> SRC0
+SSI1 <- SRC1
+
+This change is identical to the koelsch patch "ARM: shmobile: koelsch: Sound DMA support via SRC on DTS"
+from Kuninori Morimoto and backported to 3.10
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index 10549ac..f35cc33 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -421,8 +421,8 @@
+
+ rcar_sound,dai {
+ dai0 {
+- playback = <&ssi0>;
+- capture = <&ssi1>;
++ playback = <&ssi0 &src0>;
++ capture = <&ssi1 &src1>;
+ };
+ };
+ };
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0006-ARM-shmobile-porter-Sound-DMA-support-via-DVC-on-DTS.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0006-ARM-shmobile-porter-Sound-DMA-support-via-DVC-on-DTS.patch
new file mode 100644
index 0000000..e9242d9
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0006-ARM-shmobile-porter-Sound-DMA-support-via-DVC-on-DTS.patch
@@ -0,0 +1,54 @@
+From cff2d1cef1b620c0bafeefd127c8d11a6579aced Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 14:04:22 +0100
+Subject: [PATCH 6/7] ARM: shmobile: porter: Sound DMA support via DVC on DTS
+
+DMA transfer uses DVC
+
+ DMA DMApp
+[MEM] -> [SRC] -> [DVC] -> [SSIU] -> [SSI]
+
+ DMA DMApp
+[MEM] <- [DVC] <- [SRC] <- [SSIU] <- [SSI]
+
+This change is identical to the koelsch patch "ARM: shmobile: koelsch: Sound DMA support via DVC on DTS"
+from Kuninori Morimoto and backported to 3.10
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index f35cc33..fcb9edd 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -14,7 +14,14 @@
+ *
+ * This command is required when Playback/Capture
+ *
+- * amixer set "LINEOUT Mixer DACL" on
++ * amixer set "LINEOUT Mixer DACL" on
++ * amixer set "DVC Out" 100%
++ * amixer set "DVC In" 100%
++ *
++ * You can use Mute
++ *
++ * amixer set "DVC Out Mute" on
++ * amixer set "DVC In Mute" on
+ */
+
+ /dts-v1/;
+@@ -421,8 +428,8 @@
+
+ rcar_sound,dai {
+ dai0 {
+- playback = <&ssi0 &src0>;
+- capture = <&ssi1 &src1>;
++ playback = <&ssi0 &src0 &dvc0>;
++ capture = <&ssi1 &src1 &dvc1>;
+ };
+ };
+ };
+--
+1.7.9.5
+
diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0007-ARM-shmobile-porter-Fix-audio-clk-master-to-SSI-and-.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0007-ARM-shmobile-porter-Fix-audio-clk-master-to-SSI-and-.patch
new file mode 100644
index 0000000..ff0b6e2
--- /dev/null
+++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/0007-ARM-shmobile-porter-Fix-audio-clk-master-to-SSI-and-.patch
@@ -0,0 +1,29 @@
+From f8b7e8b563d9cc20926141a0876c20ef2ace53c0 Mon Sep 17 00:00:00 2001
+From: Biju Das <biju.das@bp.renesas.com>
+Date: Thu, 2 Apr 2015 13:31:46 +0100
+Subject: [PATCH 7/7] ARM: shmobile: porter: Fix audio clk master to SSI and
+ change audio data interface format type
+
+Signed-off-by: Biju Das <biju.das@bp.renesas.com>
+---
+ arch/arm/boot/dts/r8a7791-porter.dts | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
+index fcb9edd..b1acf4a 100644
+--- a/arch/arm/boot/dts/r8a7791-porter.dts
++++ b/arch/arm/boot/dts/r8a7791-porter.dts
+@@ -110,9 +110,7 @@
+ sound {
+ compatible = "simple-audio-card";
+
+- simple-audio-card,format = "left_j";
+- simple-audio-card,bitclock-master = <&sndcodec>;
+- simple-audio-card,frame-master = <&sndcodec>;
++ simple-audio-card,format = "i2s";
+
+ sndcpu: simple-audio-card,cpu {
+ sound-dai = <&rcar_sound>;
+--
+1.7.9.5
+