123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578 |
- From 7ad6d43eb9631ca8f4bb51f920b6fd2664d1b214 Mon Sep 17 00:00:00 2001
- From: Phil Elwell <phil@raspberrypi.org>
- Date: Tue, 26 Apr 2016 10:44:59 +0100
- Subject: [PATCH 308/381] BCM270X_DT: Sound DT adjustments for Dynamic DT
- There are a number of issues when loading and unloading overlays for
- sound cards:
- 1) The "sound" and "audio" nodes must be children of a bus node, such
- as "/soc", otherwise the DT changes don't result in platform devices
- being created and deleted.
- 2) The "/sound" node must have a "disabled" status property, otherwise
- setting the status to "okay" won't be detected.
- 3) ALSA doesn't like having components unloaded under its feet, and it
- is easy to deadlock or crash. Ordering the overlay fragments so that
- the sound card appears last avoids this problem.
- Signed-off-by: Phil Elwell <phil@raspberrypi.org>
- ---
- arch/arm/boot/dts/bcm2708_common.dtsi | 23 +++++++++---------
- .../dts/overlays/akkordion-iqdacplus-overlay.dts | 28 +++++++++++-----------
- .../boot/dts/overlays/boomberry-dac-overlay.dts | 22 ++++++++---------
- .../boot/dts/overlays/boomberry-digi-overlay.dts | 20 ++++++++--------
- .../boot/dts/overlays/hifiberry-amp-overlay.dts | 20 ++++++++--------
- .../boot/dts/overlays/hifiberry-dac-overlay.dts | 22 ++++++++---------
- .../dts/overlays/hifiberry-dacplus-overlay.dts | 22 ++++++++---------
- .../boot/dts/overlays/hifiberry-digi-overlay.dts | 20 ++++++++--------
- arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts | 20 ++++++++--------
- .../boot/dts/overlays/iqaudio-dacplus-overlay.dts | 22 ++++++++---------
- arch/arm/boot/dts/overlays/raspidac3-overlay.dts | 20 ++++++++--------
- arch/arm/boot/dts/overlays/rpi-dac-overlay.dts | 22 ++++++++---------
- arch/arm/boot/dts/overlays/rpi-proto-overlay.dts | 20 ++++++++--------
- 13 files changed, 141 insertions(+), 140 deletions(-)
- --- a/arch/arm/boot/dts/bcm2708_common.dtsi
- +++ b/arch/arm/boot/dts/bcm2708_common.dtsi
- @@ -34,17 +34,6 @@
- clocks = &clocks;
- };
-
- - /* Onboard audio */
- - audio: audio {
- - compatible = "brcm,bcm2835-audio";
- - brcm,pwm-channels = <8>;
- - status = "disabled";
- - };
- -
- - /* External sound card */
- - sound: sound {
- - };
- -
- soc: soc {
- compatible = "simple-bus";
- #address-cells = <1>;
- @@ -313,6 +302,18 @@
- compatible = "brcm,bcm2835-thermal";
- firmware = <&firmware>;
- };
- +
- + /* Onboard audio */
- + audio: audio {
- + compatible = "brcm,bcm2835-audio";
- + brcm,pwm-channels = <8>;
- + status = "disabled";
- + };
- +
- + /* External sound card */
- + sound: sound {
- + status = "disabled";
- + };
- };
-
- clocks: clocks {
- --- a/arch/arm/boot/dts/overlays/akkordion-iqdacplus-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/akkordion-iqdacplus-overlay.dts
- @@ -6,25 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - frag0: __overlay__ {
- - compatible = "iqaudio,iqaudio-dac";
- - card_name = "Akkordion";
- - dai_name = "IQaudIO DAC";
- - dai_stream_name = "IQaudIO DAC HiFi";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -40,7 +28,19 @@
- };
- };
-
- + fragment@2 {
- + target = <&sound>;
- + frag2: __overlay__ {
- + compatible = "iqaudio,iqaudio-dac";
- + card_name = "Akkordion";
- + dai_name = "IQaudIO DAC";
- + dai_stream_name = "IQaudIO DAC HiFi";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- +
- __overrides__ {
- - 24db_digital_gain = <&frag0>,"iqaudio,24db_digital_gain?";
- + 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?";
- };
- };
- --- a/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - frag0: __overlay__ {
- - compatible = "boomberry,boomberry-dac";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -37,7 +28,16 @@
- };
- };
-
- + fragment@2 {
- + target = <&sound>;
- + frag2: __overlay__ {
- + compatible = "boomberry,boomberry-dac";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- +
- __overrides__ {
- - 24db_digital_gain = <&frag0>,"boomberry,24db_digital_gain?";
- + 24db_digital_gain = <&frag2>,"boomberry,24db_digital_gain?";
- };
- };
- --- a/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - __overlay__ {
- - compatible = "boomberry,boomberry-digi";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -36,4 +27,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "boomberry,boomberry-digi";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - __overlay__ {
- - compatible = "hifiberry,hifiberry-amp";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -36,4 +27,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "hifiberry,hifiberry-amp";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
- @@ -6,23 +6,14 @@
- 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 = "/";
- + fragment@1 {
- + target = <&soc>;
- __overlay__ {
- pcm5102a-codec {
- #sound-dai-cells = <0>;
- @@ -31,4 +22,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "hifiberry,hifiberry-dac";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
- @@ -16,22 +16,13 @@
- };
-
- fragment@1 {
- - target = <&sound>;
- - frag1: __overlay__ {
- - compatible = "hifiberry,hifiberry-dacplus";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@2 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@3 {
- + fragment@2 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -48,7 +39,16 @@
- };
- };
-
- + fragment@3 {
- + target = <&sound>;
- + frag3: __overlay__ {
- + compatible = "hifiberry,hifiberry-dacplus";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- +
- __overrides__ {
- - 24db_digital_gain = <&frag1>,"hifiberry,24db_digital_gain?";
- + 24db_digital_gain = <&frag3>,"hifiberry,24db_digital_gain?";
- };
- };
- --- a/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
- @@ -6,22 +6,13 @@
- 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 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -36,4 +27,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "hifiberry,hifiberry-digi";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
- @@ -6,22 +6,13 @@
- 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 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -36,4 +27,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "iqaudio,iqaudio-dac";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - frag0: __overlay__ {
- - compatible = "iqaudio,iqaudio-dac";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -37,7 +28,16 @@
- };
- };
-
- + fragment@2 {
- + target = <&sound>;
- + frag2: __overlay__ {
- + compatible = "iqaudio,iqaudio-dac";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- +
- __overrides__ {
- - 24db_digital_gain = <&frag0>,"iqaudio,24db_digital_gain?";
- + 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?";
- };
- };
- --- a/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - __overlay__ {
- - compatible = "jg,raspidacv3";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -42,4 +33,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "jg,raspidacv3";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
- @@ -6,23 +6,14 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - __overlay__ {
- - compatible = "rpi,rpi-dac";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- - target-path = "/";
- + fragment@1 {
- + target = <&soc>;
- __overlay__ {
- pcm1794a-codec {
- #sound-dai-cells = <0>;
- @@ -31,4 +22,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "rpi,rpi-dac";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
- --- a/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
- +++ b/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
- @@ -6,22 +6,13 @@
- compatible = "brcm,bcm2708";
-
- fragment@0 {
- - target = <&sound>;
- - __overlay__ {
- - compatible = "rpi,rpi-proto";
- - i2s-controller = <&i2s>;
- - status = "okay";
- - };
- - };
- -
- - fragment@1 {
- target = <&i2s>;
- __overlay__ {
- status = "okay";
- };
- };
-
- - fragment@2 {
- + fragment@1 {
- target = <&i2c1>;
- __overlay__ {
- #address-cells = <1>;
- @@ -36,4 +27,13 @@
- };
- };
- };
- +
- + fragment@2 {
- + target = <&sound>;
- + __overlay__ {
- + compatible = "rpi,rpi-proto";
- + i2s-controller = <&i2s>;
- + status = "okay";
- + };
- + };
- };
|