0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. From 18530eb2ce1219fb8e11c7ffbeb0a8ff73a7cabf Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Tue, 26 Apr 2016 10:44:59 +0100
  4. Subject: [PATCH] BCM270X_DT: Sound DT adjustments for Dynamic DT
  5. There are a number of issues when loading and unloading overlays for
  6. sound cards:
  7. 1) The "sound" and "audio" nodes must be children of a bus node, such
  8. as "/soc", otherwise the DT changes don't result in platform devices
  9. being created and deleted.
  10. 2) The "/sound" node must have a "disabled" status property, otherwise
  11. setting the status to "okay" won't be detected.
  12. 3) ALSA doesn't like having components unloaded under its feet, and it
  13. is easy to deadlock or crash. Ordering the overlay fragments so that
  14. the sound card appears last avoids this problem.
  15. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  16. ---
  17. arch/arm/boot/dts/bcm2708_common.dtsi | 23 +++++++++---------
  18. .../dts/overlays/akkordion-iqdacplus-overlay.dts | 28 +++++++++++-----------
  19. .../boot/dts/overlays/boomberry-dac-overlay.dts | 22 ++++++++---------
  20. .../boot/dts/overlays/boomberry-digi-overlay.dts | 20 ++++++++--------
  21. .../boot/dts/overlays/hifiberry-amp-overlay.dts | 20 ++++++++--------
  22. .../boot/dts/overlays/hifiberry-dac-overlay.dts | 22 ++++++++---------
  23. .../dts/overlays/hifiberry-dacplus-overlay.dts | 22 ++++++++---------
  24. .../boot/dts/overlays/hifiberry-digi-overlay.dts | 20 ++++++++--------
  25. arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts | 20 ++++++++--------
  26. .../boot/dts/overlays/iqaudio-dacplus-overlay.dts | 22 ++++++++---------
  27. arch/arm/boot/dts/overlays/raspidac3-overlay.dts | 20 ++++++++--------
  28. arch/arm/boot/dts/overlays/rpi-dac-overlay.dts | 22 ++++++++---------
  29. arch/arm/boot/dts/overlays/rpi-proto-overlay.dts | 20 ++++++++--------
  30. 13 files changed, 141 insertions(+), 140 deletions(-)
  31. --- a/arch/arm/boot/dts/bcm2708_common.dtsi
  32. +++ b/arch/arm/boot/dts/bcm2708_common.dtsi
  33. @@ -34,17 +34,6 @@
  34. clocks = &clocks;
  35. };
  36. - /* Onboard audio */
  37. - audio: audio {
  38. - compatible = "brcm,bcm2835-audio";
  39. - brcm,pwm-channels = <8>;
  40. - status = "disabled";
  41. - };
  42. -
  43. - /* External sound card */
  44. - sound: sound {
  45. - };
  46. -
  47. soc: soc {
  48. compatible = "simple-bus";
  49. #address-cells = <1>;
  50. @@ -313,6 +302,18 @@
  51. compatible = "brcm,bcm2835-thermal";
  52. firmware = <&firmware>;
  53. };
  54. +
  55. + /* Onboard audio */
  56. + audio: audio {
  57. + compatible = "brcm,bcm2835-audio";
  58. + brcm,pwm-channels = <8>;
  59. + status = "disabled";
  60. + };
  61. +
  62. + /* External sound card */
  63. + sound: sound {
  64. + status = "disabled";
  65. + };
  66. };
  67. clocks: clocks {
  68. --- a/arch/arm/boot/dts/overlays/akkordion-iqdacplus-overlay.dts
  69. +++ b/arch/arm/boot/dts/overlays/akkordion-iqdacplus-overlay.dts
  70. @@ -6,25 +6,13 @@
  71. compatible = "brcm,bcm2708";
  72. fragment@0 {
  73. - target = <&sound>;
  74. - frag0: __overlay__ {
  75. - compatible = "iqaudio,iqaudio-dac";
  76. - card_name = "Akkordion";
  77. - dai_name = "IQaudIO DAC";
  78. - dai_stream_name = "IQaudIO DAC HiFi";
  79. - i2s-controller = <&i2s>;
  80. - status = "okay";
  81. - };
  82. - };
  83. -
  84. - fragment@1 {
  85. target = <&i2s>;
  86. __overlay__ {
  87. status = "okay";
  88. };
  89. };
  90. - fragment@2 {
  91. + fragment@1 {
  92. target = <&i2c1>;
  93. __overlay__ {
  94. #address-cells = <1>;
  95. @@ -40,7 +28,19 @@
  96. };
  97. };
  98. + fragment@2 {
  99. + target = <&sound>;
  100. + frag2: __overlay__ {
  101. + compatible = "iqaudio,iqaudio-dac";
  102. + card_name = "Akkordion";
  103. + dai_name = "IQaudIO DAC";
  104. + dai_stream_name = "IQaudIO DAC HiFi";
  105. + i2s-controller = <&i2s>;
  106. + status = "okay";
  107. + };
  108. + };
  109. +
  110. __overrides__ {
  111. - 24db_digital_gain = <&frag0>,"iqaudio,24db_digital_gain?";
  112. + 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?";
  113. };
  114. };
  115. --- a/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
  116. +++ b/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts
  117. @@ -6,22 +6,13 @@
  118. compatible = "brcm,bcm2708";
  119. fragment@0 {
  120. - target = <&sound>;
  121. - frag0: __overlay__ {
  122. - compatible = "boomberry,boomberry-dac";
  123. - i2s-controller = <&i2s>;
  124. - status = "okay";
  125. - };
  126. - };
  127. -
  128. - fragment@1 {
  129. target = <&i2s>;
  130. __overlay__ {
  131. status = "okay";
  132. };
  133. };
  134. - fragment@2 {
  135. + fragment@1 {
  136. target = <&i2c1>;
  137. __overlay__ {
  138. #address-cells = <1>;
  139. @@ -37,7 +28,16 @@
  140. };
  141. };
  142. + fragment@2 {
  143. + target = <&sound>;
  144. + frag2: __overlay__ {
  145. + compatible = "boomberry,boomberry-dac";
  146. + i2s-controller = <&i2s>;
  147. + status = "okay";
  148. + };
  149. + };
  150. +
  151. __overrides__ {
  152. - 24db_digital_gain = <&frag0>,"boomberry,24db_digital_gain?";
  153. + 24db_digital_gain = <&frag2>,"boomberry,24db_digital_gain?";
  154. };
  155. };
  156. --- a/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
  157. +++ b/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts
  158. @@ -6,22 +6,13 @@
  159. compatible = "brcm,bcm2708";
  160. fragment@0 {
  161. - target = <&sound>;
  162. - __overlay__ {
  163. - compatible = "boomberry,boomberry-digi";
  164. - i2s-controller = <&i2s>;
  165. - status = "okay";
  166. - };
  167. - };
  168. -
  169. - fragment@1 {
  170. target = <&i2s>;
  171. __overlay__ {
  172. status = "okay";
  173. };
  174. };
  175. - fragment@2 {
  176. + fragment@1 {
  177. target = <&i2c1>;
  178. __overlay__ {
  179. #address-cells = <1>;
  180. @@ -36,4 +27,13 @@
  181. };
  182. };
  183. };
  184. +
  185. + fragment@2 {
  186. + target = <&sound>;
  187. + __overlay__ {
  188. + compatible = "boomberry,boomberry-digi";
  189. + i2s-controller = <&i2s>;
  190. + status = "okay";
  191. + };
  192. + };
  193. };
  194. --- a/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
  195. +++ b/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
  196. @@ -6,22 +6,13 @@
  197. compatible = "brcm,bcm2708";
  198. fragment@0 {
  199. - target = <&sound>;
  200. - __overlay__ {
  201. - compatible = "hifiberry,hifiberry-amp";
  202. - i2s-controller = <&i2s>;
  203. - status = "okay";
  204. - };
  205. - };
  206. -
  207. - fragment@1 {
  208. target = <&i2s>;
  209. __overlay__ {
  210. status = "okay";
  211. };
  212. };
  213. - fragment@2 {
  214. + fragment@1 {
  215. target = <&i2c1>;
  216. __overlay__ {
  217. #address-cells = <1>;
  218. @@ -36,4 +27,13 @@
  219. };
  220. };
  221. };
  222. +
  223. + fragment@2 {
  224. + target = <&sound>;
  225. + __overlay__ {
  226. + compatible = "hifiberry,hifiberry-amp";
  227. + i2s-controller = <&i2s>;
  228. + status = "okay";
  229. + };
  230. + };
  231. };
  232. --- a/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
  233. +++ b/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
  234. @@ -6,23 +6,14 @@
  235. compatible = "brcm,bcm2708";
  236. fragment@0 {
  237. - target = <&sound>;
  238. - __overlay__ {
  239. - compatible = "hifiberry,hifiberry-dac";
  240. - i2s-controller = <&i2s>;
  241. - status = "okay";
  242. - };
  243. - };
  244. -
  245. - fragment@1 {
  246. target = <&i2s>;
  247. __overlay__ {
  248. status = "okay";
  249. };
  250. };
  251. - fragment@2 {
  252. - target-path = "/";
  253. + fragment@1 {
  254. + target = <&soc>;
  255. __overlay__ {
  256. pcm5102a-codec {
  257. #sound-dai-cells = <0>;
  258. @@ -31,4 +22,13 @@
  259. };
  260. };
  261. };
  262. +
  263. + fragment@2 {
  264. + target = <&sound>;
  265. + __overlay__ {
  266. + compatible = "hifiberry,hifiberry-dac";
  267. + i2s-controller = <&i2s>;
  268. + status = "okay";
  269. + };
  270. + };
  271. };
  272. --- a/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
  273. +++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
  274. @@ -16,22 +16,13 @@
  275. };
  276. fragment@1 {
  277. - target = <&sound>;
  278. - frag1: __overlay__ {
  279. - compatible = "hifiberry,hifiberry-dacplus";
  280. - i2s-controller = <&i2s>;
  281. - status = "okay";
  282. - };
  283. - };
  284. -
  285. - fragment@2 {
  286. target = <&i2s>;
  287. __overlay__ {
  288. status = "okay";
  289. };
  290. };
  291. - fragment@3 {
  292. + fragment@2 {
  293. target = <&i2c1>;
  294. __overlay__ {
  295. #address-cells = <1>;
  296. @@ -48,7 +39,16 @@
  297. };
  298. };
  299. + fragment@3 {
  300. + target = <&sound>;
  301. + frag3: __overlay__ {
  302. + compatible = "hifiberry,hifiberry-dacplus";
  303. + i2s-controller = <&i2s>;
  304. + status = "okay";
  305. + };
  306. + };
  307. +
  308. __overrides__ {
  309. - 24db_digital_gain = <&frag1>,"hifiberry,24db_digital_gain?";
  310. + 24db_digital_gain = <&frag3>,"hifiberry,24db_digital_gain?";
  311. };
  312. };
  313. --- a/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
  314. +++ b/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
  315. @@ -6,22 +6,13 @@
  316. compatible = "brcm,bcm2708";
  317. fragment@0 {
  318. - target = <&sound>;
  319. - __overlay__ {
  320. - compatible = "hifiberry,hifiberry-digi";
  321. - i2s-controller = <&i2s>;
  322. - status = "okay";
  323. - };
  324. - };
  325. -
  326. - fragment@1 {
  327. target = <&i2s>;
  328. __overlay__ {
  329. status = "okay";
  330. };
  331. };
  332. - fragment@2 {
  333. + fragment@1 {
  334. target = <&i2c1>;
  335. __overlay__ {
  336. #address-cells = <1>;
  337. @@ -36,4 +27,13 @@
  338. };
  339. };
  340. };
  341. +
  342. + fragment@2 {
  343. + target = <&sound>;
  344. + __overlay__ {
  345. + compatible = "hifiberry,hifiberry-digi";
  346. + i2s-controller = <&i2s>;
  347. + status = "okay";
  348. + };
  349. + };
  350. };
  351. --- a/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
  352. +++ b/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
  353. @@ -6,22 +6,13 @@
  354. compatible = "brcm,bcm2708";
  355. fragment@0 {
  356. - target = <&sound>;
  357. - __overlay__ {
  358. - compatible = "iqaudio,iqaudio-dac";
  359. - i2s-controller = <&i2s>;
  360. - status = "okay";
  361. - };
  362. - };
  363. -
  364. - fragment@1 {
  365. target = <&i2s>;
  366. __overlay__ {
  367. status = "okay";
  368. };
  369. };
  370. - fragment@2 {
  371. + fragment@1 {
  372. target = <&i2c1>;
  373. __overlay__ {
  374. #address-cells = <1>;
  375. @@ -36,4 +27,13 @@
  376. };
  377. };
  378. };
  379. +
  380. + fragment@2 {
  381. + target = <&sound>;
  382. + __overlay__ {
  383. + compatible = "iqaudio,iqaudio-dac";
  384. + i2s-controller = <&i2s>;
  385. + status = "okay";
  386. + };
  387. + };
  388. };
  389. --- a/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
  390. +++ b/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
  391. @@ -6,22 +6,13 @@
  392. compatible = "brcm,bcm2708";
  393. fragment@0 {
  394. - target = <&sound>;
  395. - frag0: __overlay__ {
  396. - compatible = "iqaudio,iqaudio-dac";
  397. - i2s-controller = <&i2s>;
  398. - status = "okay";
  399. - };
  400. - };
  401. -
  402. - fragment@1 {
  403. target = <&i2s>;
  404. __overlay__ {
  405. status = "okay";
  406. };
  407. };
  408. - fragment@2 {
  409. + fragment@1 {
  410. target = <&i2c1>;
  411. __overlay__ {
  412. #address-cells = <1>;
  413. @@ -37,7 +28,16 @@
  414. };
  415. };
  416. + fragment@2 {
  417. + target = <&sound>;
  418. + frag2: __overlay__ {
  419. + compatible = "iqaudio,iqaudio-dac";
  420. + i2s-controller = <&i2s>;
  421. + status = "okay";
  422. + };
  423. + };
  424. +
  425. __overrides__ {
  426. - 24db_digital_gain = <&frag0>,"iqaudio,24db_digital_gain?";
  427. + 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?";
  428. };
  429. };
  430. --- a/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
  431. +++ b/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
  432. @@ -6,22 +6,13 @@
  433. compatible = "brcm,bcm2708";
  434. fragment@0 {
  435. - target = <&sound>;
  436. - __overlay__ {
  437. - compatible = "jg,raspidacv3";
  438. - i2s-controller = <&i2s>;
  439. - status = "okay";
  440. - };
  441. - };
  442. -
  443. - fragment@1 {
  444. target = <&i2s>;
  445. __overlay__ {
  446. status = "okay";
  447. };
  448. };
  449. - fragment@2 {
  450. + fragment@1 {
  451. target = <&i2c1>;
  452. __overlay__ {
  453. #address-cells = <1>;
  454. @@ -42,4 +33,13 @@
  455. };
  456. };
  457. };
  458. +
  459. + fragment@2 {
  460. + target = <&sound>;
  461. + __overlay__ {
  462. + compatible = "jg,raspidacv3";
  463. + i2s-controller = <&i2s>;
  464. + status = "okay";
  465. + };
  466. + };
  467. };
  468. --- a/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
  469. +++ b/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
  470. @@ -6,23 +6,14 @@
  471. compatible = "brcm,bcm2708";
  472. fragment@0 {
  473. - target = <&sound>;
  474. - __overlay__ {
  475. - compatible = "rpi,rpi-dac";
  476. - i2s-controller = <&i2s>;
  477. - status = "okay";
  478. - };
  479. - };
  480. -
  481. - fragment@1 {
  482. target = <&i2s>;
  483. __overlay__ {
  484. status = "okay";
  485. };
  486. };
  487. - fragment@2 {
  488. - target-path = "/";
  489. + fragment@1 {
  490. + target = <&soc>;
  491. __overlay__ {
  492. pcm1794a-codec {
  493. #sound-dai-cells = <0>;
  494. @@ -31,4 +22,13 @@
  495. };
  496. };
  497. };
  498. +
  499. + fragment@2 {
  500. + target = <&sound>;
  501. + __overlay__ {
  502. + compatible = "rpi,rpi-dac";
  503. + i2s-controller = <&i2s>;
  504. + status = "okay";
  505. + };
  506. + };
  507. };
  508. --- a/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
  509. +++ b/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
  510. @@ -6,22 +6,13 @@
  511. compatible = "brcm,bcm2708";
  512. fragment@0 {
  513. - target = <&sound>;
  514. - __overlay__ {
  515. - compatible = "rpi,rpi-proto";
  516. - i2s-controller = <&i2s>;
  517. - status = "okay";
  518. - };
  519. - };
  520. -
  521. - fragment@1 {
  522. target = <&i2s>;
  523. __overlay__ {
  524. status = "okay";
  525. };
  526. };
  527. - fragment@2 {
  528. + fragment@1 {
  529. target = <&i2c1>;
  530. __overlay__ {
  531. #address-cells = <1>;
  532. @@ -36,4 +27,13 @@
  533. };
  534. };
  535. };
  536. +
  537. + fragment@2 {
  538. + target = <&sound>;
  539. + __overlay__ {
  540. + compatible = "rpi,rpi-proto";
  541. + i2s-controller = <&i2s>;
  542. + status = "okay";
  543. + };
  544. + };
  545. };