Skip to content

Commit

Permalink
Adding Device Tree support for some RPi audio cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elwell authored and popcornmix committed Dec 2, 2014
1 parent bc8aed4 commit 355d567
Show file tree
Hide file tree
Showing 14 changed files with 393 additions and 6 deletions.
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/Makefile
Expand Up @@ -52,6 +52,7 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb
dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
dtb-$(CONFIG_ARCH_AXXIA) += axm5516-amarillo.dtb
dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb
dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b-plus.dtb
dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \
Expand Down Expand Up @@ -495,6 +496,7 @@ dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \

targets += dtbs dtbs_install
targets += $(dtb-y)

endif

# *.dtb used to be generated in the directory above. Clean out the
Expand Down
81 changes: 81 additions & 0 deletions arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
@@ -0,0 +1,81 @@
/dts-v1/;

/include/ "bcm2708.dtsi"

/ {
compatible = "brcm,bcm2708";
model = "Raspberry Pi Model B+";

aliases {
spi0 = &spi0;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2s = &i2s;
gpio = &gpio;
sound = &sound;
};

sound: sound {
};
};

&gpio {
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
};

i2c0_pins: i2c0 {
brcm,pins = <0 1>;
brcm,function = <4>;
};

i2c1_pins: i2c1 {
brcm,pins = <2 3>;
brcm,function = <4>;
};

i2s_pins: i2s {
brcm,pins = <18 19 20 21>;
brcm,function = <4>; /* alt0 */
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins>;

spidev@0{
compatible = "spidev";
reg = <0>; /* CE0 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};

spidev@1{
compatible = "spidev";
reg = <1>; /* CE1 */
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <500000>;
};
};

&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
clock-frequency = <100000>;
};

&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <100000>;
};

&i2s {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s_pins>;
};
19 changes: 18 additions & 1 deletion arch/arm/boot/dts/bcm2708-rpi-b.dts
Expand Up @@ -4,12 +4,18 @@

/ {
compatible = "brcm,bcm2708";
model = "Raspberry Pi";
model = "Raspberry Pi Model B";

aliases {
spi0 = &spi0;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2s = &i2s;
gpio = &gpio;
sound = &sound;
};

sound: sound {
};
};

Expand All @@ -28,6 +34,11 @@
brcm,pins = <2 3>;
brcm,function = <4>;
};

i2s_pins: i2s {
brcm,pins = <28 29 30 31>;
brcm,function = <4>; /* alt0 */
};
};

&spi0 {
Expand Down Expand Up @@ -62,3 +73,9 @@
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <100000>;
};

&i2s {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s_pins>;
};
18 changes: 13 additions & 5 deletions arch/arm/boot/dts/bcm2708.dtsi
Expand Up @@ -7,11 +7,8 @@
interrupt-parent = <&intc>;

chosen {
/*
bootargs must be 1024 characters long because the
VC bootloader can't expand it
*/
bootargs = "console=ttyAMA0 ";
/* No padding required - the boot loader can do that. */
bootargs = "console=ttyAMA0";
};

soc {
Expand All @@ -34,6 +31,17 @@
#gpio-cells = <2>;
};

i2s: i2s@7e203000 {
compatible = "brcm,bcm2708-i2s";
reg = <0x7e203000 0x20>,
<0x7e101098 0x02>;

//dmas = <&dma 2>,
// <&dma 3>;
dma-names = "tx", "rx";
status = "disabled";
};

spi0: spi@7e204000 {
compatible = "brcm,bcm2708-spi";
reg = <0x7e204000 0x1000>;
Expand Down
34 changes: 34 additions & 0 deletions arch/arm/boot/dts/hifiberry-dac-overlay.dts
@@ -0,0 +1,34 @@
// Definitions for HiFiBerry DAC
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "hifiberry,hifiberry-dac";
i2s-controller = <&i2s>;
status = "okay";
};
};

fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target-path = "/";
__overlay__ {
pcm5102a-codec {
#sound-dai-cells = <0>;
compatible = "ti,pcm5102a";
status = "okay";
};
};
};
};
39 changes: 39 additions & 0 deletions arch/arm/boot/dts/hifiberry-dacplus-overlay.dts
@@ -0,0 +1,39 @@
// Definitions for HiFiBerry DAC+
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "hifiberry,hifiberry-dacplus";
i2s-controller = <&i2s>;
status = "okay";
};
};

fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

pcm5122@4d {
#sound-dai-cells = <0>;
compatible = "ti,pcm5122";
reg = <0x4d>;
status = "okay";
};
};
};
};
39 changes: 39 additions & 0 deletions arch/arm/boot/dts/hifiberry-digi-overlay.dts
@@ -0,0 +1,39 @@
// Definitions for HiFiBerry Digi
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "hifiberry,hifiberry-digi";
i2s-controller = <&i2s>;
status = "okay";
};
};

fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

wm8804@3b {
#sound-dai-cells = <0>;
compatible = "wlf,wm8804";
reg = <0x3b>;
status = "okay";
};
};
};
};
39 changes: 39 additions & 0 deletions arch/arm/boot/dts/iqaudio-dac-overlay.dts
@@ -0,0 +1,39 @@
// Definitions for IQaudIO DAC
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "iqaudio,iqaudio-dac";
i2s-controller = <&i2s>;
status = "okay";
};
};

fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

pcm5122@4c {
#sound-dai-cells = <0>;
compatible = "ti,pcm5122";
reg = <0x4c>;
status = "okay";
};
};
};
};
39 changes: 39 additions & 0 deletions arch/arm/boot/dts/iqaudio-dacplus-overlay.dts
@@ -0,0 +1,39 @@
// Definitions for IQaudIO DAC+
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";

fragment@0 {
target = <&sound>;
__overlay__ {
compatible = "iqaudio,iqaudio-dac";
i2s-controller = <&i2s>;
status = "okay";
};
};

fragment@1 {
target = <&i2s>;
__overlay__ {
status = "okay";
};
};

fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

pcm5122@4c {
#sound-dai-cells = <0>;
compatible = "ti,pcm5122";
reg = <0x4c>;
status = "okay";
};
};
};
};

0 comments on commit 355d567

Please sign in to comment.