Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
smi.dtbo \
smi-dev.dtbo \
smi-nand.dtbo \
spdif-gpio21.dtbo \
spi-gpio35-39.dtbo \
spi-gpio40-45.dtbo \
spi-rtc.dtbo \
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -5115,6 +5115,18 @@ Load: dtoverlay=smi-nand
Params: <None>


Name: spdif-gpio21
Info: Sound card that drives an S/PDIF transmitter (TOSLINK module or coaxial
driver) directly from GPIO21 (PCM_DOUT, 40-pin header pin 40), without
a transceiver chip. The I2S block is the bit and frame clock producer
and sends 2 x 32-bit slots per frame; userspace has to supply the
biphase-mark coded S/PDIF line signal as S32_LE at twice the audio
sample rate (e.g. through an ALSA plugin) - plain PCM does not produce
audio. Only GPIO21 is claimed, GPIOs 18-20 stay free.
Load: dtoverlay=spdif-gpio21
Params: <None>


Name: spi-gpio35-39
Info: Move SPI function block to GPIO 35 to 39
Load: dtoverlay=spi-gpio35-39
Expand Down
62 changes: 62 additions & 0 deletions arch/arm/boot/dts/overlays/spdif-gpio21-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// SPDX-License-Identifier: GPL-2.0
// S/PDIF transmitter on GPIO21 (PCM_DOUT) without a transceiver: the I2S block is the clock
// producer; software supplies the biphase-mark coded bitstream. Only GPIO21 is claimed.
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2835";

fragment@0 {
target = <&gpio>;
__overlay__ {
spdif_gpio21_pins: spdif_gpio21_pins {
brcm,pins = <21>;
brcm,function = <4>; /* ALT0: PCM_DOUT, on RP1 i2s0 */
};
};
};

fragment@1 {
target = <&i2s_clk_producer>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&spdif_gpio21_pins>;
status = "okay";
};
};

fragment@2 {
target-path = "/";
__overlay__ {
spdif_gpio21_codec: spdif-gpio21-codec {
compatible = "linux,spdif-dit";
#sound-dai-cells = <0>;
status = "okay";
};
};
};

fragment@3 {
target = <&sound>;
__overlay__ {
compatible = "simple-audio-card";
status = "okay";

simple-audio-card,name = "spdif-gpio21";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_cpu>;
simple-audio-card,frame-master = <&dailink0_cpu>;

dailink0_cpu: simple-audio-card,cpu {
sound-dai = <&i2s_clk_producer>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};

simple-audio-card,codec {
sound-dai = <&spdif_gpio21_codec>;
};
};
};
};
Loading