Skip to content

Commit 1e1ac98

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
bcm2835-audio: Create the platform device if the DT node is disabled
For backwards compatibility, allow the built-in ALSA driver to be enabled either by loading the module from /etc/modules or by enabling the "/audio" node in DT.
1 parent cc96dc4 commit 1e1ac98

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

arch/arm/boot/dts/bcm2708-rpi-b-plus.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
status = "okay";
5454
};
5555

56-
&audio {
57-
status = "okay";
58-
};
59-
6056
&spi0 {
6157
pinctrl-names = "default";
6258
pinctrl-0 = <&spi0_pins>;

arch/arm/boot/dts/bcm2708-rpi-b.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
status = "okay";
5454
};
5555

56-
&audio {
57-
status = "okay";
58-
};
59-
6056
&spi0 {
6157
pinctrl-names = "default";
6258
pinctrl-0 = <&spi0_pins>;

arch/arm/boot/dts/bcm2709-rpi-2-b.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@
5353
status = "okay";
5454
};
5555

56-
&audio {
57-
status = "okay";
58-
};
59-
6056
&spi0 {
6157
pinctrl-names = "default";
6258
pinctrl-0 = <&spi0_pins>;

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,14 @@ void __init bcm2708_init(void)
963963
bcm_register_device_dt(&bcm2835_emmc_device);
964964
#endif
965965
bcm2708_init_led();
966-
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
967-
bcm_register_device_dt(&bcm2708_alsa_devices[i]);
966+
967+
/* Only create the platform devices for the ALSA driver in the
968+
absence of an enabled "audio" DT node */
969+
if (!use_dt ||
970+
!of_device_is_available(of_find_node_by_path("/audio"))) {
971+
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
972+
bcm_register_device(&bcm2708_alsa_devices[i]);
973+
}
968974

969975
bcm_register_device_dt(&bcm2708_spi_device);
970976

arch/arm/mach-bcm2709/bcm2709.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,14 @@ void __init bcm2709_init(void)
986986
bcm_register_device_dt(&bcm2835_emmc_device);
987987
#endif
988988
bcm2709_init_led();
989-
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
990-
bcm_register_device_dt(&bcm2708_alsa_devices[i]);
989+
990+
/* Only create the platform devices for the ALSA driver in the
991+
absence of an enabled "audio" DT node */
992+
if (!use_dt ||
993+
!of_device_is_available(of_find_node_by_path("/audio"))) {
994+
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
995+
bcm_register_device(&bcm2708_alsa_devices[i]);
996+
}
991997

992998
bcm_register_device_dt(&bcm2708_spi_device);
993999

0 commit comments

Comments
 (0)