ARM: mvebu: add audio support to Armada 370 DB
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 12 Feb 2014 17:21:00 +0000 (18:21 +0100)
committerJason Cooper <jason@lakedaemon.net>
Mon, 17 Feb 2014 02:42:39 +0000 (02:42 +0000)
This commit adds the necessary Device Tree informations to enable
audio support on the Armada 370 DB platform. In details it:

 * Instantiates the CS42L51 audio codec on the I2C0 bus, and
   configures this bus with the appropriate pin-muxing configuration.

 * Enables the I2S audio controller, and configures it with the
   appropriate pin-muxing configuration.

 * Through hog pins, ensures that the other pins possibly used for I2S
   are muxed with another function than I2S.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/boot/dts/armada-370-db.dts

index 08a56bcfc7248704b34ad1789418308819b3bcbf..7df18660939b5b2fd8c151197a913619671706d5 100644 (file)
                                phy-mode = "rgmii-id";
                        };
 
+                       i2c@11000 {
+                               pinctrl-0 = <&i2c0_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               audio_codec: audio-codec@4a {
+                                       compatible = "cirrus,cs42l51";
+                                       reg = <0x4a>;
+                               };
+                       };
+
+                       audio-controller@30000 {
+                               pinctrl-0 = <&i2s_pins2>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                       };
+
                        mvsdio@d4000 {
                                pinctrl-0 = <&sdio_pins1>;
                                pinctrl-names = "default";
                                broken-cd;
                        };
 
+                       pinctrl {
+                               /*
+                                * These pins might be muxed as I2S by
+                                * the bootloader, but it conflicts
+                                * with the real I2S pins that are
+                                * muxed using i2s_pins. We must mux
+                                * those pins to a function other than
+                                * I2S.
+                                */
+                               pinctrl-0 = <&hog_pins1 &hog_pins2>;
+                               pinctrl-names = "default";
+
+                               hog_pins1: hog-pins1 {
+                                       marvell,pins = "mpp6",  "mpp8", "mpp10",
+                                                      "mpp12", "mpp13";
+                                       marvell,function = "gpio";
+                               };
+
+                               hog_pins2: hog-pins2 {
+                                       marvell,pins = "mpp5", "mpp7", "mpp9";
+                                       marvell,function = "gpo";
+                               };
+                       };
+
                        usb@50000 {
                                status = "okay";
                        };
                                /* Port 0, Lane 0 */
                                status = "okay";
                        };
+
                        pcie@2,0 {
                                /* Port 1, Lane 0 */
                                status = "okay";
                        };
                };
        };
+
+       sound {
+             compatible = "marvell,a370db-audio";
+             marvell,audio-controller = <&audio_controller>;
+             marvell,audio-codec = <&audio_codec>;
+             status = "okay";
+       };
 };