aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-01-17 19:35:29 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-17 19:35:29 -0500
commit0084f27a21d36ac846cd4366289c229a7cce511b (patch)
treeb151540007af3aa260418c1519a5c69b56450025 /arch
parentbcedfa98d97e02e95bb023ab93675dbe63c508ef (diff)
parent71269364a8d5ea42ecc6cbc7b687e5d45cbabe0e (diff)
ARM: Merge next-s3c64xx
Merge branch 'next-s3c64xx' into next-samsung Conflicts: arch/arm/mach-s3c6400/include/mach/map.h ( ADC and RTC PA merge fixed)
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h1
-rw-r--r--arch/arm/plat-s3c64xx/Makefile1
-rw-r--r--arch/arm/plat-s3c64xx/dev-audio.c91
-rw-r--r--arch/arm/plat-s3c64xx/dev-rtc.c43
4 files changed, 135 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index 5a35f24fcb80..c33810ed21b3 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -42,6 +42,7 @@
42#define S3C64XX_PA_FB (0x77100000) 42#define S3C64XX_PA_FB (0x77100000)
43#define S3C64XX_PA_USB_HSOTG (0x7C000000) 43#define S3C64XX_PA_USB_HSOTG (0x7C000000)
44#define S3C64XX_PA_WATCHDOG (0x7E004000) 44#define S3C64XX_PA_WATCHDOG (0x7E004000)
45#define S3C64XX_PA_RTC (0x7E005000)
45#define S3C64XX_PA_ADC (0x7E00B000) 46#define S3C64XX_PA_ADC (0x7E00B000)
46#define S3C64XX_PA_SYSCON (0x7E00F000) 47#define S3C64XX_PA_SYSCON (0x7E00F000)
47#define S3C64XX_PA_AC97 (0x7F001000) 48#define S3C64XX_PA_AC97 (0x7F001000)
diff --git a/arch/arm/plat-s3c64xx/Makefile b/arch/arm/plat-s3c64xx/Makefile
index 80600176cf2a..b241f3695560 100644
--- a/arch/arm/plat-s3c64xx/Makefile
+++ b/arch/arm/plat-s3c64xx/Makefile
@@ -13,6 +13,7 @@ obj- :=
13# Core files 13# Core files
14 14
15obj-y += dev-uart.o 15obj-y += dev-uart.o
16obj-y += dev-rtc.o
16obj-y += cpu.o 17obj-y += cpu.o
17obj-y += irq.o 18obj-y += irq.o
18obj-y += irq-eint.o 19obj-y += irq-eint.o
diff --git a/arch/arm/plat-s3c64xx/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c
index a21a88fbb7e3..cdba3a77ea19 100644
--- a/arch/arm/plat-s3c64xx/dev-audio.c
+++ b/arch/arm/plat-s3c64xx/dev-audio.c
@@ -3,7 +3,6 @@
3 * Copyright 2009 Wolfson Microelectronics 3 * Copyright 2009 Wolfson Microelectronics
4 * Mark Brown <broonie@opensource.wolfsonmicro.com> 4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 * 5 *
6
7 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
@@ -20,16 +19,69 @@
20 19
21#include <plat/devs.h> 20#include <plat/devs.h>
22#include <plat/audio.h> 21#include <plat/audio.h>
22#include <plat/gpio-bank-c.h>
23#include <plat/gpio-bank-d.h> 23#include <plat/gpio-bank-d.h>
24#include <plat/gpio-bank-e.h> 24#include <plat/gpio-bank-e.h>
25#include <plat/gpio-bank-h.h>
25#include <plat/gpio-cfg.h> 26#include <plat/gpio-cfg.h>
26 27
28static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
29{
30 switch (pdev->id) {
31 case 0:
32 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_I2S0_CLK);
33 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_I2S0_CDCLK);
34 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_I2S0_LRCLK);
35 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_I2S0_DI);
36 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_I2S0_D0);
37 break;
38 case 1:
39 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_I2S1_CLK);
40 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_I2S1_CDCLK);
41 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_I2S1_LRCLK);
42 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_I2S1_DI);
43 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_I2S1_D0);
44 default:
45 printk(KERN_DEBUG "Invalid I2S Controller number!");
46 return -EINVAL;
47 }
48
49 return 0;
50}
51
52static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
53{
54 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S0_V40_DO);
55 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S1_V40_DO);
56 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S2_V40_DO);
57 s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
58 s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
59 s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
60 s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
61
62 return 0;
63}
64
27static struct resource s3c64xx_iis0_resource[] = { 65static struct resource s3c64xx_iis0_resource[] = {
28 [0] = { 66 [0] = {
29 .start = S3C64XX_PA_IIS0, 67 .start = S3C64XX_PA_IIS0,
30 .end = S3C64XX_PA_IIS0 + 0x100 - 1, 68 .end = S3C64XX_PA_IIS0 + 0x100 - 1,
31 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
32 }, 70 },
71 [1] = {
72 .start = DMACH_I2S0_OUT,
73 .end = DMACH_I2S0_OUT,
74 .flags = IORESOURCE_DMA,
75 },
76 [2] = {
77 .start = DMACH_I2S0_IN,
78 .end = DMACH_I2S0_IN,
79 .flags = IORESOURCE_DMA,
80 },
81};
82
83struct s3c_audio_pdata s3c_i2s0_pdata = {
84 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
33}; 85};
34 86
35struct platform_device s3c64xx_device_iis0 = { 87struct platform_device s3c64xx_device_iis0 = {
@@ -37,6 +89,9 @@ struct platform_device s3c64xx_device_iis0 = {
37 .id = 0, 89 .id = 0,
38 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource), 90 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
39 .resource = s3c64xx_iis0_resource, 91 .resource = s3c64xx_iis0_resource,
92 .dev = {
93 .platform_data = &s3c_i2s0_pdata,
94 },
40}; 95};
41EXPORT_SYMBOL(s3c64xx_device_iis0); 96EXPORT_SYMBOL(s3c64xx_device_iis0);
42 97
@@ -46,6 +101,20 @@ static struct resource s3c64xx_iis1_resource[] = {
46 .end = S3C64XX_PA_IIS1 + 0x100 - 1, 101 .end = S3C64XX_PA_IIS1 + 0x100 - 1,
47 .flags = IORESOURCE_MEM, 102 .flags = IORESOURCE_MEM,
48 }, 103 },
104 [1] = {
105 .start = DMACH_I2S1_OUT,
106 .end = DMACH_I2S1_OUT,
107 .flags = IORESOURCE_DMA,
108 },
109 [2] = {
110 .start = DMACH_I2S1_IN,
111 .end = DMACH_I2S1_IN,
112 .flags = IORESOURCE_DMA,
113 },
114};
115
116struct s3c_audio_pdata s3c_i2s1_pdata = {
117 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
49}; 118};
50 119
51struct platform_device s3c64xx_device_iis1 = { 120struct platform_device s3c64xx_device_iis1 = {
@@ -53,6 +122,9 @@ struct platform_device s3c64xx_device_iis1 = {
53 .id = 1, 122 .id = 1,
54 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource), 123 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
55 .resource = s3c64xx_iis1_resource, 124 .resource = s3c64xx_iis1_resource,
125 .dev = {
126 .platform_data = &s3c_i2s1_pdata,
127 },
56}; 128};
57EXPORT_SYMBOL(s3c64xx_device_iis1); 129EXPORT_SYMBOL(s3c64xx_device_iis1);
58 130
@@ -62,6 +134,20 @@ static struct resource s3c64xx_iisv4_resource[] = {
62 .end = S3C64XX_PA_IISV4 + 0x100 - 1, 134 .end = S3C64XX_PA_IISV4 + 0x100 - 1,
63 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
64 }, 136 },
137 [1] = {
138 .start = DMACH_HSI_I2SV40_TX,
139 .end = DMACH_HSI_I2SV40_TX,
140 .flags = IORESOURCE_DMA,
141 },
142 [2] = {
143 .start = DMACH_HSI_I2SV40_RX,
144 .end = DMACH_HSI_I2SV40_RX,
145 .flags = IORESOURCE_DMA,
146 },
147};
148
149struct s3c_audio_pdata s3c_i2sv4_pdata = {
150 .cfg_gpio = s3c64xx_i2sv4_cfg_gpio,
65}; 151};
66 152
67struct platform_device s3c64xx_device_iisv4 = { 153struct platform_device s3c64xx_device_iisv4 = {
@@ -69,6 +155,9 @@ struct platform_device s3c64xx_device_iisv4 = {
69 .id = -1, 155 .id = -1,
70 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource), 156 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
71 .resource = s3c64xx_iisv4_resource, 157 .resource = s3c64xx_iisv4_resource,
158 .dev = {
159 .platform_data = &s3c_i2sv4_pdata,
160 },
72}; 161};
73EXPORT_SYMBOL(s3c64xx_device_iisv4); 162EXPORT_SYMBOL(s3c64xx_device_iisv4);
74 163
diff --git a/arch/arm/plat-s3c64xx/dev-rtc.c b/arch/arm/plat-s3c64xx/dev-rtc.c
new file mode 100644
index 000000000000..b9e7a05f0129
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/dev-rtc.c
@@ -0,0 +1,43 @@
1/* linux/arch/arm/plat-s3c64xx/dev-rtc.c
2 *
3 * Copyright 2009 by Maurus Cuelenaere <mcuelenaere@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/string.h>
12#include <linux/platform_device.h>
13
14#include <mach/irqs.h>
15#include <mach/map.h>
16
17#include <plat/devs.h>
18
19static struct resource s3c_rtc_resource[] = {
20 [0] = {
21 .start = S3C64XX_PA_RTC,
22 .end = S3C64XX_PA_RTC + 0xff,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_RTC_ALARM,
27 .end = IRQ_RTC_ALARM,
28 .flags = IORESOURCE_IRQ,
29 },
30 [2] = {
31 .start = IRQ_RTC_TIC,
32 .end = IRQ_RTC_TIC,
33 .flags = IORESOURCE_IRQ
34 }
35};
36
37struct platform_device s3c_device_rtc = {
38 .name = "s3c64xx-rtc",
39 .id = -1,
40 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
41 .resource = s3c_rtc_resource,
42};
43EXPORT_SYMBOL(s3c_device_rtc);