1 From 628dbab26b97ba2ea43791e2f1587115dc4e224b Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Wed, 27 May 2015 17:22:15 +0100
4 Subject: [PATCH 071/148] bcm2835-audio: Create the platform device if the DT
7 For backwards compatibility, allow the built-in ALSA driver to be enabled
8 either by loading the module from /etc/modules or by enabling the "/audio"
11 arch/arm/mach-bcm2708/bcm2708.c | 10 ++++++++--
12 arch/arm/mach-bcm2709/bcm2709.c | 10 ++++++++--
13 2 files changed, 16 insertions(+), 4 deletions(-)
15 --- a/arch/arm/mach-bcm2708/bcm2708.c
16 +++ b/arch/arm/mach-bcm2708/bcm2708.c
17 @@ -898,8 +898,14 @@ void __init bcm2708_init(void)
21 - for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
22 - bcm_register_device_dt(&bcm2708_alsa_devices[i]);
24 + /* Only create the platform devices for the ALSA driver in the
25 + absence of an enabled "audio" DT node */
27 + !of_device_is_available(of_find_node_by_path("/audio"))) {
28 + for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
29 + bcm_register_device(&bcm2708_alsa_devices[i]);
32 bcm_register_device_dt(&bcm2708_spi_device);
34 --- a/arch/arm/mach-bcm2709/bcm2709.c
35 +++ b/arch/arm/mach-bcm2709/bcm2709.c
36 @@ -918,8 +918,14 @@ void __init bcm2709_init(void)
40 - for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
41 - bcm_register_device_dt(&bcm2708_alsa_devices[i]);
43 + /* Only create the platform devices for the ALSA driver in the
44 + absence of an enabled "audio" DT node */
46 + !of_device_is_available(of_find_node_by_path("/audio"))) {
47 + for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
48 + bcm_register_device(&bcm2708_alsa_devices[i]);
51 bcm_register_device_dt(&bcm2708_spi_device);