diff mbox

[3/3] ARM: dts: omap4-droid4: add soundcard

Message ID 20170707164229.5868-4-sebastian.reichel@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Reichel July 7, 2017, 4:42 p.m. UTC
Add sound support to Motorola Droid 4 using simple-soundcard
and CPCAP's audio codec. This does not yet correctly represent
the whole audio routing, since McBSP3 is also connected to
Bluetooth and MDM6600 modem (and probably also 4G modem).
These extra DAI links are not yet supported and have not been
tested.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 arch/arm/boot/dts/omap4-droid4-xt894.dts | 76 ++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

Comments

Mark Brown July 10, 2017, 12:26 p.m. UTC | #1
On Fri, Jul 07, 2017 at 06:42:29PM +0200, Sebastian Reichel wrote:

> +	soundcard {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "Droid 4 Audio";

New systems should be using the of-graph card which is more flexible and
extensible than simple-card.
Pavel Machek July 24, 2017, 7:19 p.m. UTC | #2
On Mon 2017-07-10 13:26:02, Mark Brown wrote:
> On Fri, Jul 07, 2017 at 06:42:29PM +0200, Sebastian Reichel wrote:
> 
> > +	soundcard {
> > +		compatible = "simple-audio-card";
> > +		simple-audio-card,name = "Droid 4 Audio";
> 
> New systems should be using the of-graph card which is more flexible and
> extensible than simple-card.

Well, if simple-card does what is needed here, and dts looks
reasonable, is there reason for anything more complex?

Anyway, congratulations for getting the sound to work!

									Pavel
Sebastian Reichel July 25, 2017, 9:08 a.m. UTC | #3
Hi,

On Mon, Jul 24, 2017 at 09:19:54PM +0200, Pavel Machek wrote:
> On Mon 2017-07-10 13:26:02, Mark Brown wrote:
> > On Fri, Jul 07, 2017 at 06:42:29PM +0200, Sebastian Reichel wrote:
> > 
> > > +	soundcard {
> > > +		compatible = "simple-audio-card";
> > > +		simple-audio-card,name = "Droid 4 Audio";
> > 
> > New systems should be using the of-graph card which is more flexible and
> > extensible than simple-card.
> 
> Well, if simple-card does what is needed here, and dts looks
> reasonable, is there reason for anything more complex?

There is already a PATCHv2 for this patchset, that switched to
the graph based card.

> Anyway, congratulations for getting the sound to work!

Thanks.

-- Sebastian
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap4-droid4-xt894.dts b/arch/arm/boot/dts/omap4-droid4-xt894.dts
index 10ca1c174995..642b7ed1713b 100644
--- a/arch/arm/boot/dts/omap4-droid4-xt894.dts
+++ b/arch/arm/boot/dts/omap4-droid4-xt894.dts
@@ -116,6 +116,50 @@ 
 
 		};
 	};
+
+	soundcard {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "Droid 4 Audio";
+
+		simple-audio-card,widgets =
+			"Speaker", "Earpiece",
+			"Speaker", "Loudspeaker",
+			"Headphone", "Headphone Jack",
+			"Microphone", "Internal Mic";
+
+		simple-audio-card,routing =
+			"Earpiece", "EP",
+			"Loudspeaker", "SPKR",
+			"Headphone Jack", "HSL",
+			"Headphone Jack", "HSR",
+			"MICR", "Internal Mic";
+
+		simple-audio-card,dai-link@0 {
+			format = "i2s";
+			frame-master = <&codec0>;
+			bitclock-master = <&codec0>;
+			cpu {
+				sound-dai = <&mcbsp2>;
+			};
+			codec0: codec {
+				sound-dai = <&cpcap_audio 0>;
+			};
+		};
+
+		simple-audio-card,dai-link@1 {
+			format = "dsp_a";
+			frame-master = <&codec1>;
+			bitclock-master = <&codec1>;
+			bitclock-inversion;
+
+			cpu {
+				sound-dai = <&mcbsp3>;
+			};
+			codec1: codec {
+				sound-dai = <&cpcap_audio 1>;
+			};
+		};
+	};
 };
 
 &dss {
@@ -479,6 +523,24 @@ 
 		OMAP4_IOPAD(0x112, PIN_OUTPUT_PULLUP | MUX_MODE5)	/* uart4_rts */
 		>;
 	};
+
+	mcbsp2_pins: pinmux_mcbsp2_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x0f6, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_clkx */
+		OMAP4_IOPAD(0x0f8, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_dr */
+		OMAP4_IOPAD(0x0fa, PIN_OUTPUT | MUX_MODE0)	/* abe_mcbsp2_dx */
+		OMAP4_IOPAD(0x0fc, PIN_INPUT | MUX_MODE0)	/* abe_mcbsp2_fsx */
+		>;
+	};
+
+	mcbsp3_pins: pinmux_mcbsp3_pins {
+		pinctrl-single,pins = <
+		OMAP4_IOPAD(0x106, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_dr */
+		OMAP4_IOPAD(0x108, PIN_OUTPUT | MUX_MODE1)	/* abe_mcbsp3_dx */
+		OMAP4_IOPAD(0x10a, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_clkx */
+		OMAP4_IOPAD(0x10c, PIN_INPUT | MUX_MODE1)	/* abe_mcbsp3_fsx */
+		>;
+	};
 };
 
 &omap4_pmx_wkup {
@@ -552,3 +614,17 @@ 
 				  "0", "0", "1";
 	};
 };
+
+&mcbsp2 {
+	#sound-dai-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mcbsp2_pins>;
+	status = "okay";
+};
+
+&mcbsp3 {
+	#sound-dai-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mcbsp3_pins>;
+	status = "okay";
+};