5dccabb2463639784c6fe8e4f8c71c69150d6f18
[openwrt.git] / target / linux / brcm2708 / patches-3.14 / 0037-BCM2708-Add-I2S-support-to-board-file.patch
1 From 575806f9f3c40e16ac377c9d7d076fb87773968a Mon Sep 17 00:00:00 2001
2 From: Florian Meier <florian.meier@koalo.de>
3 Date: Fri, 22 Nov 2013 19:04:54 +0100
4 Subject: [PATCH 37/54] BCM2708: Add I2S support to board file
5
6 Adds the required initializations for I2S
7 to the board file of mach-bcm2708.
8
9 Signed-off-by: Florian Meier <florian.meier@koalo.de>
10 ---
11  arch/arm/mach-bcm2708/bcm2708.c | 26 ++++++++++++++++++++++++++
12  1 file changed, 26 insertions(+)
13
14 diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
15 index 89d0824..07da1fd 100644
16 --- a/arch/arm/mach-bcm2708/bcm2708.c
17 +++ b/arch/arm/mach-bcm2708/bcm2708.c
18 @@ -615,6 +615,28 @@ static struct platform_device bcm2835_thermal_device = {
19         .name = "bcm2835_thermal",
20  };
21  
22 +#ifdef CONFIG_SND_BCM2708_SOC_I2S_MODULE
23 +static struct resource bcm2708_i2s_resources[] = {
24 +       {
25 +               .start = I2S_BASE,
26 +               .end = I2S_BASE + 0x20,
27 +               .flags = IORESOURCE_MEM,
28 +       },
29 +        {
30 +               .start = PCM_CLOCK_BASE,
31 +               .end = PCM_CLOCK_BASE + 0x02,
32 +               .flags = IORESOURCE_MEM,
33 +       }
34 +};
35 +
36 +static struct platform_device bcm2708_i2s_device = {
37 +       .name = "bcm2708-i2s",
38 +       .id = 0,
39 +       .num_resources = ARRAY_SIZE(bcm2708_i2s_resources),
40 +       .resource = bcm2708_i2s_resources,
41 +};
42 +#endif
43 +
44  int __init bcm_register_device(struct platform_device *pdev)
45  {
46         int ret;
47 @@ -738,6 +760,10 @@ void __init bcm2708_init(void)
48         bcm_register_device(&bcm2835_hwmon_device);
49         bcm_register_device(&bcm2835_thermal_device);
50  
51 +#ifdef CONFIG_SND_BCM2708_SOC_I2S_MODULE
52 +       bcm_register_device(&bcm2708_i2s_device);
53 +#endif
54 +
55         for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
56                 struct amba_device *d = amba_devs[i];
57                 amba_device_register(d, &iomem_resource);
58 -- 
59 1.9.1
60