BCM2835: Add I2S driver to device tree
Subsystems (3)
PATCH 2/2 BCM2835: Add I2S driver to device tree
This adds the definitions for the BCM2835 I2S driver to the device tree. Some GPIO settings are needed for the correct pin functions.
--- arch/arm/boot/dts/bcm2835-rpi-b.dts | 12 +++++++++++- arch/arm/boot/dts/bcm2835.dtsi | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
(quoted diff) +0 -0
b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 2a3b1c1..e83ed2f 100644
arch/arm/boot/dts/bcm2835-rpi-b.dts +11 -1
@@ -23,7 +23,7 @@ &gpio { pinctrl-names = "default"; - pinctrl-0 = <&gpioout &alt0 &alt3>; + pinctrl-0 = <&gpioout &alt0 &alt2 &alt3>; gpioout: gpioout { brcm,pins = <6>;
@@ -39,6 +39,16 @@ brcm,pins = <48 49 50 51 52 53>; brcm,function = <7>; /* alt3 */ }; + + /* I2S interface */ + alt2: alt2 { + brcm,pins = <28 29 30 31>; + brcm,function = <6>; /* alt2 */ + }; +}; + +&bcm2835_i2s { + status = "okay"; }; &i2c0 {
arch/arm/boot/dts/bcm2835.dtsi +10 -0
@@ -134,6 +134,16 @@ #dma-cells = <1>; brcm,dma-channel-mask = <0x7f35>; }; + + bcm2835_i2s: i2s at 7e203000 { + compatible = "brcm,bcm2835-i2s"; + reg = <0x7e203000 0x20>, + <0x7e101098 0x02>; + + dmas = <&dma 2>, + <&dma 3>; + dma-names = "tx", "rx"; + }; }; clocks {
Signature · 1 line
1.8.3.2
PATCH 2/2 BCM2835: Add I2S driver to device tree
This adds the definitions for the BCM2835 I2S driver to the device tree. Some GPIO settings are needed for the correct pin functions.
---
Sorry, I forgot to disable word-wrap again....
arch/arm/boot/dts/bcm2835-rpi-b.dts | 12 +++++++++++- arch/arm/boot/dts/bcm2835.dtsi | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
arch/arm/boot/dts/bcm2835-rpi-b.dts +11 -1
@@ -23,7 +23,7 @@ &gpio { pinctrl-names = "default"; - pinctrl-0 = <&gpioout &alt0 &alt3>; + pinctrl-0 = <&gpioout &alt0 &alt2 &alt3>; gpioout: gpioout { brcm,pins = <6>;
@@ -39,6 +39,16 @@ brcm,pins = <48 49 50 51 52 53>; brcm,function = <7>; /* alt3 */ }; + + /* I2S interface */ + alt2: alt2 { + brcm,pins = <28 29 30 31>; + brcm,function = <6>; /* alt2 */ + }; +}; + +&bcm2835_i2s { + status = "okay"; }; &i2c0 {
arch/arm/boot/dts/bcm2835.dtsi +10 -0
@@ -134,6 +134,16 @@ #dma-cells = <1>; brcm,dma-channel-mask = <0x7f35>; }; + + bcm2835_i2s: i2s at 7e203000 { + compatible = "brcm,bcm2835-i2s"; + reg = <0x7e203000 0x20>, + <0x7e101098 0x02>; + + dmas = <&dma 2>, + <&dma 3>; + dma-names = "tx", "rx"; + }; }; clocks {
Signature · 1 line
1.8.3.2
Quoted 3 lines · Florian Meier
This adds the definitions for the BCM2835 I2S driver to the device tree. Some GPIO settings are needed for the correct pin functions.
Patch 1/1 and the .dtsi portion of patch 2/2 look fine; I can apply those after 3.14's merge window closes.
However, I don't think I can apply the change to bcm2835-rpi-b.dts in this patch; those pins are used for the board ID strapping on rev 1 boards, and even on rev 2 boards, they're simply routed to a generic header, rather than being dedicated for I2S usage. That part of the patch would be better kept locally in your own kernel tree. Perhaps if DT overlays ever take off, we can publish it as part of an I2S-specific overlay.
Quoted 11 lines · Stephen Warren
Quoted 3 lines · Florian Meier
This adds the definitions for the BCM2835 I2S driver to the device tree. Some GPIO settings are needed for the correct pin functions.
Patch 1/1 and the .dtsi portion of patch 2/2 look fine; I can apply those after 3.14's merge window closes.
However, I don't think I can apply the change to
bcm2835-rpi-b.dtsin this patch; those pins are used for the board ID strapping on rev 1 boards,
Yes, but I thought the board ID is never utilized. However, I have not tested that.
Quoted 5 lines
and even on rev 2 boards, they're simply routed to a generic header, rather than being dedicated for I2S usage. That part of the patch would be better kept locally in your own kernel tree. Perhaps if DT overlays ever take off, we can publish it as part of an I2S-specific overlay.
You are right. That might be a problem. Someone might want to use the pins for another functionality. I personally think the I2S functionality will be the most used functionality for those pins, but I accept it when you say that they better should be set as second I2C channel and generic GPIO pins (as it is by default).
However, for an end user it doesn't seem to be a convenient solution to have a kernel tree for each possible combination of pin assignments.
The "old way" would be to set the pin functionality while loading the i2s driver, but I assume that is not the right way to go, right?