diff mbox

[3/3,v3] ARM: shmobile: lager: add sound support on DT

Message ID 87a99kj5q2.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State RFC
Headers show

Commit Message

Kuninori Morimoto June 11, 2014, 6:54 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

It supports PIO transfer at this point

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v2 -> v3

 - rename ak4643 -> snd_codec
 - used existing i2c2

 arch/arm/boot/dts/r8a7790-lager.dts |   67 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/Kconfig      |    1 +
 2 files changed, 68 insertions(+)

Comments

Geert Uytterhoeven June 11, 2014, 7:30 a.m. UTC | #1
Hi Morimoto-san,

On Wed, Jun 11, 2014 at 8:54 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> +               compatible = "asahi-kasei,ak4643";

As Sergei already commented,
Documentation/devicetree/bindings/vendor-prefixes.txt
says

        ak      Asahi Kasei Corp.

Gr{oetje,eeting}s,


                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kuninori Morimoto June 11, 2014, 7:40 a.m. UTC | #2
Hi Geert

> On Wed, Jun 11, 2014 at 8:54 AM, Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> > +               compatible = "asahi-kasei,ak4643";
> 
> As Sergei already commented,
> Documentation/devicetree/bindings/vendor-prefixes.txt
> says
> 
>         ak      Asahi Kasei Corp.

I know, but,

grep asahi-kasei sound/soc/codecs/*
sound/soc/codecs/ak4104.c:      { .compatible = "asahi-kasei,ak4104", },
sound/soc/codecs/ak4554.c:      { .compatible = "asahi-kasei,ak4554" },
sound/soc/codecs/ak4642.c:      { .compatible = "asahi-kasei,ak4642",   .data = &ak4642_drvdata},
sound/soc/codecs/ak4642.c:      { .compatible = "asahi-kasei,ak4643",   .data = &ak4643_drvdata},
sound/soc/codecs/ak4642.c:      { .compatible = "asahi-kasei,ak4648",   .data = &ak4648_drvdata},
sound/soc/codecs/ak5386.c:      { .compatible = "asahi-kasei,ak5386", },

ak4642 driver can't probe by "ak";
My code is based on "code", not "document"

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 295a60e..e6bb303 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -9,6 +9,18 @@ 
  * kind, whether express or implied.
  */
 
+/*
+ * SSI-AK4643
+ *
+ * SW1: 1: AK4643
+ *      2: CN22
+ *      3: ADV7511
+ *
+ * this command is required when playback.
+ *
+ * # amixer set "LINEOUT Mixer DACL" on
+ */
+
 /dts-v1/;
 #include "r8a7790.dtsi"
 #include <dt-bindings/gpio/gpio.h>
@@ -144,6 +156,22 @@ 
 		states = <3300000 1
 			  1800000 0>;
 	};
+
+	sound {
+		compatible = "simple-audio-card";
+
+		simple-audio-card,format = "left_j";
+		simple-audio-card,cpu {
+			sound-dai = <&rcar_sound 0>;
+		};
+
+		simple-audio-card,codec {
+			bitclock-master;
+			frame-master;
+			sound-dai = <&snd_codec>;
+			system-clock-frequency = <11289600>;
+		};
+	};
 };
 
 &extal_clk {
@@ -219,6 +247,16 @@ 
 		renesas,groups = "i2c3";
 		renesas,function = "i2c3";
 	};
+
+	sound_pins: sound {
+		renesas,groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
+		renesas,function = "ssi";
+	};
+
+	sound_clk_pins: sound_clk {
+		renesas,groups = "audio_clk_a";
+		renesas,function = "audio_clk";
+	};
 };
 
 &ether {
@@ -367,8 +405,37 @@ 
 	status = "ok";
 	pinctrl-0 = <&i2c2_pins>;
 	pinctrl-names = "default";
+
+	snd_codec: snd_codec {
+		compatible = "asahi-kasei,ak4643";
+		#sound-dai-cells = <0>;
+		reg = <0x12>;
+	};
 };
 
 &i2c3	{
 	status = "ok";
 };
+
+&rcar_sound {
+	pinctrl-0 = <&sound_pins &sound_clk_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	rcar_sound,dai {
+		dai0 {
+			playback = <&ssi0>;
+			capture  = <&ssi1>;
+		};
+	};
+};
+
+&ssi0 {
+	pio-transfer;
+};
+
+&ssi1 {
+	pio-transfer;
+	shared-pin;
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 3b28bd8..6fc352a 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -58,6 +58,7 @@  config MACH_LAGER
 	bool "Lager board"
 	depends on ARCH_R8A7790
 	select MICREL_PHY if SH_ETH
+	select SND_SOC_AK4642 if SND_SIMPLE_CARD
 
 config MACH_MARZEN
 	bool "MARZEN board"