aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2410
diff options
context:
space:
mode:
authorChrister Weinigel <christer@weinigel.se>2008-07-07 13:12:45 -0400
committerBen Dooks <ben-linux@fluff.org>2008-07-07 13:13:04 -0400
commit9579087331ee0cd220d29aa5bda79ff55b33c228 (patch)
tree3bff2b20fa3851134582aefec5417f1bec0fa161 /arch/arm/mach-s3c2410
parent865cc639a636b58612becfb6a337945c022596ac (diff)
[ARM] Acer n30: Add support for n35 and related devices.
Add support for the Acer N35 and related devices. Signed-off-by: Christer Weinigel <christer@weinigel.se> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r--arch/arm/mach-s3c2410/Kconfig5
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c145
2 files changed, 144 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 1a7d01b47440..99fdc736698c 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -72,10 +72,11 @@ config PM_H1940
72 Internal node for H1940 and related PM 72 Internal node for H1940 and related PM
73 73
74config MACH_N30 74config MACH_N30
75 bool "Acer N30" 75 bool "Acer N30 family"
76 select CPU_S3C2410 76 select CPU_S3C2410
77 help 77 help
78 Say Y here if you are using the Acer N30 78 Say Y here if you want suppt for the Acer N30, Acer N35,
79 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
79 80
80config ARCH_BAST 81config ARCH_BAST
81 bool "Simtec Electronics BAST (EB2410ITX)" 82 bool "Simtec Electronics BAST (EB2410ITX)"
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index e1351a7b40ee..621b343adbed 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -1,4 +1,5 @@
1/* Machine specific code for the Acer n30 PDA. 1/* Machine specific code for the Acer n30, Acer N35, Navman PiN 570,
2 * Yakumo AlphaX and Airis NC05 PDAs.
2 * 3 *
3 * Copyright (c) 2003-2005 Simtec Electronics 4 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
@@ -11,7 +12,7 @@
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
14*/ 15 */
15 16
16#include <linux/kernel.h> 17#include <linux/kernel.h>
17#include <linux/types.h> 18#include <linux/types.h>
@@ -68,7 +69,8 @@ static struct s3c2410_uartcfg n30_uartcfgs[] = {
68 .ulcon = 0x43, 69 .ulcon = 0x43,
69 .ufcon = 0x51, 70 .ufcon = 0x51,
70 }, 71 },
71 /* The BlueTooth controller is connected to port 2 */ 72 /* On the N30 the bluetooth controller is connected here.
73 * On the N35 and variants the GPS receiver is connected here. */
72 [2] = { 74 [2] = {
73 .hwport = 2, 75 .hwport = 2,
74 .flags = 0, 76 .flags = 0,
@@ -165,6 +167,95 @@ static struct platform_device n30_button_device = {
165 } 167 }
166}; 168};
167 169
170static struct gpio_keys_button n35_buttons[] = {
171 {
172 .gpio = S3C2410_GPF0,
173 .code = KEY_POWER,
174 .desc = "Power",
175 .active_low = 0,
176 },
177 {
178 .gpio = S3C2410_GPG9,
179 .code = KEY_UP,
180 .desc = "Joystick Up",
181 .active_low = 0,
182 },
183 {
184 .gpio = S3C2410_GPG8,
185 .code = KEY_DOWN,
186 .desc = "Joystick Down",
187 .active_low = 0,
188 },
189 {
190 .gpio = S3C2410_GPG6,
191 .code = KEY_DOWN,
192 .desc = "Joystick Left",
193 .active_low = 0,
194 },
195 {
196 .gpio = S3C2410_GPG5,
197 .code = KEY_DOWN,
198 .desc = "Joystick Right",
199 .active_low = 0,
200 },
201 {
202 .gpio = S3C2410_GPG7,
203 .code = KEY_ENTER,
204 .desc = "Joystick Press",
205 .active_low = 0,
206 },
207 {
208 .gpio = S3C2410_GPF7,
209 .code = KEY_HOMEPAGE,
210 .desc = "Home",
211 .active_low = 0,
212 },
213 {
214 .gpio = S3C2410_GPF6,
215 .code = KEY_CALENDAR,
216 .desc = "Calendar",
217 .active_low = 0,
218 },
219 {
220 .gpio = S3C2410_GPF5,
221 .code = KEY_ADDRESSBOOK,
222 .desc = "Contacts",
223 .active_low = 0,
224 },
225 {
226 .gpio = S3C2410_GPF4,
227 .code = KEY_MAIL,
228 .desc = "Mail",
229 .active_low = 0,
230 },
231 {
232 .gpio = S3C2410_GPF3,
233 .code = SW_RADIO,
234 .desc = "GPS Antenna",
235 .active_low = 0,
236 },
237 {
238 .gpio = S3C2410_GPG2,
239 .code = SW_HEADPHONE_INSERT,
240 .desc = "Headphone",
241 .active_low = 0,
242 },
243};
244
245static struct gpio_keys_platform_data n35_button_data = {
246 .buttons = n35_buttons,
247 .nbuttons = ARRAY_SIZE(n35_buttons),
248};
249
250static struct platform_device n35_button_device = {
251 .name = "gpio-keys",
252 .id = -1,
253 .num_resources = 0,
254 .dev = {
255 .platform_data = &n35_button_data,
256 }
257};
258
168/* This is the bluetooth LED on the device. */ 259/* This is the bluetooth LED on the device. */
169static struct s3c24xx_led_platdata n30_blue_led_pdata = { 260static struct s3c24xx_led_platdata n30_blue_led_pdata = {
170 .name = "blue_led", 261 .name = "blue_led",
@@ -211,6 +302,15 @@ static struct platform_device *n30_devices[] __initdata = {
211 &n30_warning_led, 302 &n30_warning_led,
212}; 303};
213 304
305static struct platform_device *n35_devices[] __initdata = {
306 &s3c_device_lcd,
307 &s3c_device_wdt,
308 &s3c_device_i2c,
309 &s3c_device_iis,
310 &s3c_device_usbgadget,
311 &n35_button_device,
312};
313
214static struct s3c2410_platform_i2c n30_i2ccfg = { 314static struct s3c2410_platform_i2c n30_i2ccfg = {
215 .flags = 0, 315 .flags = 0,
216 .slave_addr = 0x10, 316 .slave_addr = 0x10,
@@ -244,7 +344,32 @@ static void __init n30_init(void)
244 S3C2410_MISCCR_USBSUSPND0 | 344 S3C2410_MISCCR_USBSUSPND0 |
245 S3C2410_MISCCR_USBSUSPND1, 0x0); 345 S3C2410_MISCCR_USBSUSPND1, 0x0);
246 346
247 platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices)); 347 if (machine_is_n30()) {
348 /* Turn off suspend on both USB ports, and switch the
349 * selectable USB port to USB device mode. */
350 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
351 S3C2410_MISCCR_USBSUSPND0 |
352 S3C2410_MISCCR_USBSUSPND1, 0x0);
353
354 platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices));
355 }
356
357 if (machine_is_n35()) {
358 /* Turn off suspend and switch the selectable USB port
359 * to USB device mode. Turn on suspend for the host
360 * port since it is not connected on the N35.
361 *
362 * Actually, the host port is available at some pads
363 * on the back of the device, so it would actually be
364 * possible to add a USB device inside the N35 if you
365 * are willing to do some hardware modifications. */
366 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
367 S3C2410_MISCCR_USBSUSPND0 |
368 S3C2410_MISCCR_USBSUSPND1,
369 S3C2410_MISCCR_USBSUSPND1);
370
371 platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices));
372 }
248} 373}
249 374
250MACHINE_START(N30, "Acer-N30") 375MACHINE_START(N30, "Acer-N30")
@@ -259,3 +384,15 @@ MACHINE_START(N30, "Acer-N30")
259 .init_irq = n30_init_irq, 384 .init_irq = n30_init_irq,
260 .map_io = n30_map_io, 385 .map_io = n30_map_io,
261MACHINE_END 386MACHINE_END
387
388MACHINE_START(N35, "Acer-N35")
389 /* Maintainer: Christer Weinigel <christer@weinigel.se>
390 */
391 .phys_io = S3C2410_PA_UART,
392 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
393 .boot_params = S3C2410_SDRAM_PA + 0x100,
394 .timer = &s3c24xx_timer,
395 .init_machine = n30_init,
396 .init_irq = n30_init_irq,
397 .map_io = n30_map_io,
398MACHINE_END