aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/3.1.6/0001-n35-fix-key-codes.patch42
-rw-r--r--linux/3.1.6/0002-n35-Update-GPIO-documentation-for-Acer-n35.patch36
-rw-r--r--linux/3.1.6/0003-n30-Clean-up-UARTs-configuration-replace-numeric-con.patch84
-rw-r--r--linux/3.1.6/0004-n30-Fix-MMC-power-management-on-Acer-n30-n35.patch31
-rw-r--r--linux/3.1.6/0005-n30-Add-touchscreen-support-for-Acer-n30-n35.patch78
-rw-r--r--linux/3.1.6/0006-n35-Add-LCD-backlight-regulation-on-Acer-n35.patch109
-rw-r--r--linux/3.1.6/0007-n30-Clean-up-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch33
-rw-r--r--linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch122
-rw-r--r--linux/3.1.6/0009-n30-Add-battery-status-for-Acer-n30-n35.patch197
-rw-r--r--linux/3.1.6/0010-n30-Add-PDA-power-supply-status-on-Acer-n30-n35.patch98
-rw-r--r--linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch92
-rw-r--r--linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch187
-rw-r--r--linux/3.1.6/0013-n35-Acer-n35-GPS-power-management.patch206
-rw-r--r--linux/3.1.6/0014-s3c2410_ts-HACK-for-tslib-add-fake-pressure-value.patch52
14 files changed, 1367 insertions, 0 deletions
diff --git a/linux/3.1.6/0001-n35-fix-key-codes.patch b/linux/3.1.6/0001-n35-fix-key-codes.patch
new file mode 100644
index 0000000..25cc732
--- /dev/null
+++ b/linux/3.1.6/0001-n35-fix-key-codes.patch
@@ -0,0 +1,42 @@
+From 3c43052284796659aeda8ae262d27525e7cdf948 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Wed, 23 Jun 2010 20:33:53 +0200
+Subject: [PATCH 01/14] n35: fix key codes
+
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 41f299d..e732619 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -174,7 +174,6 @@ static struct gpio_keys_button n35_buttons[] = {
+ {
+ .gpio = S3C2410_GPF(0),
+ .code = KEY_POWER,
+- .type = EV_PWR,
+ .desc = "Power",
+ .active_low = 0,
+ .wakeup = 1,
+@@ -193,13 +192,13 @@ static struct gpio_keys_button n35_buttons[] = {
+ },
+ {
+ .gpio = S3C2410_GPG(6),
+- .code = KEY_DOWN,
++ .code = KEY_LEFT,
+ .desc = "Joystick Left",
+ .active_low = 0,
+ },
+ {
+ .gpio = S3C2410_GPG(5),
+- .code = KEY_DOWN,
++ .code = KEY_RIGHT,
+ .desc = "Joystick Right",
+ .active_low = 0,
+ },
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0002-n35-Update-GPIO-documentation-for-Acer-n35.patch b/linux/3.1.6/0002-n35-Update-GPIO-documentation-for-Acer-n35.patch
new file mode 100644
index 0000000..2d2fdb6
--- /dev/null
+++ b/linux/3.1.6/0002-n35-Update-GPIO-documentation-for-Acer-n35.patch
@@ -0,0 +1,36 @@
+From d09acdd4292db1c10fb63f2f7247dd7ac800ead6 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Sat, 29 May 2010 17:11:10 +0200
+Subject: [PATCH 02/14] n35: Update GPIO documentation for Acer n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 12 +++++-------
+ 1 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index e732619..abbb9b5 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -410,13 +410,11 @@ static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
+ static void __init n30_hwinit(void)
+ {
+ /* GPA0-11 special functions -- unknown what they do
+- * GPA12 N30 special function -- unknown what it does
+- * N35/PiN output -- unknown what it does
+- *
+- * A12 is nGCS1 on the N30 and an output on the N35/PiN. I
+- * don't think it does anything useful on the N30, so I ought
+- * to make it an output there too since it always driven to 0
+- * as far as I can tell. */
++ * GPA12 N30 special function (nGCS1) -- unknown what it does
++ * PiN output -- unknown function
++ * N35 output -- turn on/off red led, 0 = normal operation,
++ * 1 = turn off red led at all. Note: GPD9 must be input or
++ * output with value set to 1 before setting GPA12 to 0. */
+ if (machine_is_n30())
+ __raw_writel(0x007fffff, S3C2410_GPACON);
+ if (machine_is_n35())
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0003-n30-Clean-up-UARTs-configuration-replace-numeric-con.patch b/linux/3.1.6/0003-n30-Clean-up-UARTs-configuration-replace-numeric-con.patch
new file mode 100644
index 0000000..ef66723
--- /dev/null
+++ b/linux/3.1.6/0003-n30-Clean-up-UARTs-configuration-replace-numeric-con.patch
@@ -0,0 +1,84 @@
+From 01eb4ac8cc0ca178786d01bd696dc2092716e466 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 10:29:46 +0200
+Subject: [PATCH 03/14] n30: Clean up UARTs configuration (replace numeric constants)
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 28 +++++++++++++++-------
+ arch/arm/plat-samsung/include/plat/regs-serial.h | 3 ++
+ 2 files changed, 22 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index abbb9b5..895e1e9a 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -55,32 +55,42 @@ static struct map_desc n30_iodesc[] __initdata = {
+ /* nothing here yet */
+ };
+
++#define UCON (S3C2410_UCON_DEFAULT | \
++ S3C2443_UCON_RXERR_IRQEN)
++
++#define ULCON (S3C2410_LCON_CS8 | \
++ S3C2410_LCON_PNONE)
++
++#define UFCON (S3C2410_UFCON_FIFOMODE | \
++ S3C2410_UFCON_RXTRIG8 | \
++ S3C2410_UFCON_TXTRIG4)
++
+ static struct s3c2410_uartcfg n30_uartcfgs[] = {
+ /* Normal serial port */
+ [0] = {
+ .hwport = 0,
+ .flags = 0,
+- .ucon = 0x2c5,
+- .ulcon = 0x03,
+- .ufcon = 0x51,
++ .ucon = UCON,
++ .ulcon = ULCON,
++ .ufcon = UFCON,
+ },
+ /* IR port */
+ [1] = {
+ .hwport = 1,
+ .flags = 0,
+ .uart_flags = UPF_CONS_FLOW,
+- .ucon = 0x2c5,
+- .ulcon = 0x43,
+- .ufcon = 0x51,
++ .ucon = UCON,
++ .ulcon = ULCON | S3C2410_LCON_IRM,
++ .ufcon = UFCON,
+ },
+ /* On the N30 the bluetooth controller is connected here.
+ * On the N35 and variants the GPS receiver is connected here. */
+ [2] = {
+ .hwport = 2,
+ .flags = 0,
+- .ucon = 0x2c5,
+- .ulcon = 0x03,
+- .ufcon = 0x51,
++ .ucon = UCON,
++ .ulcon = ULCON,
++ .ufcon = UFCON,
+ },
+ };
+
+diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
+index 788837e..c64beca 100644
+--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
++++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
+@@ -114,6 +114,9 @@
+
+ #define S3C2410_UFCON_FIFOMODE (1<<0)
+ #define S3C2410_UFCON_TXTRIG0 (0<<6)
++#define S3C2410_UFCON_TXTRIG4 (1<<6)
++#define S3C2410_UFCON_TXTRIG8 (2<<6)
++#define S3C2410_UFCON_TXTRIG12 (3<<6)
+ #define S3C2410_UFCON_RXTRIG8 (1<<4)
+ #define S3C2410_UFCON_RXTRIG12 (2<<4)
+
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0004-n30-Fix-MMC-power-management-on-Acer-n30-n35.patch b/linux/3.1.6/0004-n30-Fix-MMC-power-management-on-Acer-n30-n35.patch
new file mode 100644
index 0000000..e8b94e0
--- /dev/null
+++ b/linux/3.1.6/0004-n30-Fix-MMC-power-management-on-Acer-n30-n35.patch
@@ -0,0 +1,31 @@
+From 157e2a1dbbcb9a7144ad9d776db45a15769406f9 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 10:04:57 +0200
+Subject: [PATCH 04/14] n30: Fix MMC power management on Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 895e1e9a..ecc039a 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -366,11 +366,11 @@ static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
+ switch (power_mode) {
+ case MMC_POWER_ON:
+ case MMC_POWER_UP:
+- gpio_set_value(S3C2410_GPG(4), 1);
++ gpio_set_value(S3C2410_GPG(4), 0);
+ break;
+ case MMC_POWER_OFF:
+ default:
+- gpio_set_value(S3C2410_GPG(4), 0);
++ gpio_set_value(S3C2410_GPG(4), 1);
+ break;
+ }
+ }
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0005-n30-Add-touchscreen-support-for-Acer-n30-n35.patch b/linux/3.1.6/0005-n30-Add-touchscreen-support-for-Acer-n30-n35.patch
new file mode 100644
index 0000000..27b4470
--- /dev/null
+++ b/linux/3.1.6/0005-n30-Add-touchscreen-support-for-Acer-n30-n35.patch
@@ -0,0 +1,78 @@
+From 1a03b4d877299c1cef4b2ef2228da6a067986095 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Thu, 27 May 2010 15:47:40 +0200
+Subject: [PATCH 05/14] n30: Add touchscreen support for Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/Kconfig | 1 +
+ arch/arm/mach-s3c2410/mach-n30.c | 13 +++++++++++++
+ 2 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
+index 7245a55..1d55349 100644
+--- a/arch/arm/mach-s3c2410/Kconfig
++++ b/arch/arm/mach-s3c2410/Kconfig
+@@ -100,6 +100,7 @@ config MACH_N30
+ select MACH_N35
+ select S3C_DEV_USB_HOST
+ select S3C_DEV_NAND
++ select S3C2410_SETUP_TS
+ help
+ Say Y here if you want suppt for the Acer N30, Acer N35,
+ Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index ecc039a..be5235d 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -49,6 +49,7 @@
+ #include <plat/devs.h>
+ #include <plat/mci.h>
+ #include <plat/s3c2410.h>
++#include <plat/ts.h>
+ #include <plat/udc.h>
+
+ static struct map_desc n30_iodesc[] __initdata = {
+@@ -116,6 +117,13 @@ static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = {
+ .vbus_pin_inverted = 0,
+ };
+
++static struct s3c2410_ts_mach_info n30_ts_cfg __initdata = {
++ .delay = 16383,
++ .presc = 49,
++ .oversampling_shift = 3,
++ .cfg_gpio = s3c24xx_ts_cfg_gpio,
++};
++
+ static struct gpio_keys_button n30_buttons[] = {
+ {
+ .gpio = S3C2410_GPF(0),
+@@ -391,6 +399,8 @@ static struct platform_device *n30_devices[] __initdata = {
+ &s3c_device_rtc,
+ &s3c_device_usbgadget,
+ &s3c_device_sdi,
++ &s3c_device_adc,
++ &s3c_device_ts,
+ &n30_button_device,
+ &n30_blue_led,
+ &n30_warning_led,
+@@ -404,6 +414,8 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_rtc,
+ &s3c_device_usbgadget,
+ &s3c_device_sdi,
++ &s3c_device_adc,
++ &s3c_device_ts,
+ &n35_button_device,
+ &n35_blue_led,
+ &n35_warning_led,
+@@ -566,6 +578,7 @@ static void __init n30_init(void)
+ WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power"));
+
+ s3c24xx_fb_set_platdata(&n30_fb_info);
++ s3c24xx_ts_set_platdata(&n30_ts_cfg);
+ s3c24xx_udc_set_platdata(&n30_udc_cfg);
+ s3c24xx_mci_set_platdata(&n30_mci_cfg);
+ s3c_i2c0_set_platdata(&n30_i2ccfg);
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0006-n35-Add-LCD-backlight-regulation-on-Acer-n35.patch b/linux/3.1.6/0006-n35-Add-LCD-backlight-regulation-on-Acer-n35.patch
new file mode 100644
index 0000000..21169d8
--- /dev/null
+++ b/linux/3.1.6/0006-n35-Add-LCD-backlight-regulation-on-Acer-n35.patch
@@ -0,0 +1,109 @@
+From d31ea8b61f04341c8ea4b19105ca5772e655518f Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 10:38:19 +0200
+Subject: [PATCH 06/14] n35: Add LCD backlight regulation on Acer n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 71 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 71 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index be5235d..4199143 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -23,6 +23,7 @@
+ #include <linux/input.h>
+ #include <linux/interrupt.h>
+ #include <linux/platform_device.h>
++#include <linux/pwm_backlight.h>
+ #include <linux/serial_core.h>
+ #include <linux/timer.h>
+ #include <linux/io.h>
+@@ -369,6 +370,74 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = {
+ .lpcsel = 0x06,
+ };
+
++static int n35_backlight_init(struct device *dev)
++{
++ int ret;
++
++ ret = gpio_request(S3C2410_GPB(0), "Backlight PWM output");
++ if (ret)
++ goto request_gpb0_fail;
++ ret = gpio_request(S3C2410_GPB(1), "Backlight power");
++ if (ret)
++ goto request_gpb1_fail;
++
++ /* set GPB0 as output of PWM timer */
++ gpio_set_value(S3C2410_GPB(0), 0);
++ s3c_gpio_setpull(S3C2410_GPB(0), S3C_GPIO_PULL_DOWN);
++ s3c_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
++
++ /* backlight power */
++ ret = gpio_direction_output(S3C2410_GPB(1), 1);
++ if (ret)
++ goto direction_gpb1_fail;
++ s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP);
++
++ return 0;
++
++direction_gpb1_fail:
++ gpio_free(S3C2410_GPB(1));
++request_gpb1_fail:
++ gpio_free(S3C2410_GPB(0));
++request_gpb0_fail:
++ return ret;
++}
++
++static int n35_backlight_notify(struct device *dev, int brightness)
++{
++ /* power off backlight, values less than 14 are useless */
++ gpio_set_value(S3C2410_GPB(1), brightness > 14 ? 1 : 0);
++ return (brightness > 14 ? brightness : 0);
++}
++
++static void n35_backlight_exit(struct device *dev)
++{
++ gpio_direction_output(S3C2410_GPB(0), 0);
++ gpio_free(S3C2410_GPB(0));
++
++ gpio_set_value(S3C2410_GPB(1), 0);
++ s3c_gpio_setpull(S3C2410_GPB(1), S3C_GPIO_PULL_UP);
++ gpio_free(S3C2410_GPB(1));
++}
++
++static struct platform_pwm_backlight_data backlight_data = {
++ .pwm_id = 0,
++ .max_brightness = 100,
++ .dft_brightness = 50,
++ .pwm_period_ns = 3*1000*1000,
++ .init = n35_backlight_init,
++ .notify = n35_backlight_notify,
++ .exit = n35_backlight_exit,
++};
++
++static struct platform_device n35_backlight = {
++ .name = "pwm-backlight",
++ .dev = {
++ .parent = &s3c_device_timer[0].dev,
++ .platform_data = &backlight_data,
++ },
++ .id = -1,
++};
++
+ static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
+ {
+ switch (power_mode) {
+@@ -416,6 +485,8 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_sdi,
+ &s3c_device_adc,
+ &s3c_device_ts,
++ &s3c_device_timer[0],
++ &n35_backlight,
+ &n35_button_device,
+ &n35_blue_led,
+ &n35_warning_led,
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0007-n30-Clean-up-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch b/linux/3.1.6/0007-n30-Clean-up-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch
new file mode 100644
index 0000000..526d45e
--- /dev/null
+++ b/linux/3.1.6/0007-n30-Clean-up-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch
@@ -0,0 +1,33 @@
+From 8086748ebb12eaec8c7c0ad89f6a52f99f777d87 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 11:00:25 +0200
+Subject: [PATCH 07/14] n30: Clean up LCD conf. (moved to LCD conf. from hardcoded section)
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 4199143..3158165 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -368,6 +368,15 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = {
+ .num_displays = 1,
+ .default_display = 0,
+ .lpcsel = 0x06,
++
++ .gpccon = 0xaaa80208,
++ .gpccon_mask = 0xfffc030c,
++ .gpcup = 0x0000fe12,
++ .gpcup_mask = 0xfffffe12,
++ .gpdcon = 0xaa80aaa4,
++ .gpdcon_mask = 0xffc0fffc,
++ .gpdup = 0x0000f8fe,
++ .gpdup_mask = 0xfffff8fe,
+ };
+
+ static int n35_backlight_init(struct device *dev)
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch b/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
new file mode 100644
index 0000000..3a72c6a
--- /dev/null
+++ b/linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch
@@ -0,0 +1,122 @@
+From c8955e56555dae6e308b3fa3ea91c8d823402bd5 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Sat, 22 May 2010 05:01:39 +0200
+Subject: [PATCH 08/14] n35: Support for NAND Flash on Acer n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 73 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 73 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 3158165..c492f5d 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -17,6 +17,7 @@
+ #include <linux/kernel.h>
+ #include <linux/types.h>
+
++#include <linux/delay.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/init.h>
+ #include <linux/gpio.h>
+@@ -49,10 +50,69 @@
+ #include <plat/cpu.h>
+ #include <plat/devs.h>
+ #include <plat/mci.h>
++#include <plat/nand.h>
+ #include <plat/s3c2410.h>
+ #include <plat/ts.h>
+ #include <plat/udc.h>
+
++#ifdef CONFIG_MTD_PARTITIONS
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/nand_ecc.h>
++#include <linux/mtd/partitions.h>
++
++struct mtd_partition n35_default_nand_part[] = {
++ /* Original partitioning by manufacturer
++ *
++ * 0x0 - 0x3fff NBoot
++ * 0x4000 - 0x4fff TOC
++ * 0x8000 - 0x27fff Eboot
++ * 0x28000 - 0x2bfff partition table
++ * 0x2c000 - data ...
++ * FIXME: incomplete
++ * */
++ {
++ .name = "bootloader",
++ .offset = 0,
++ .size = 0x28000,
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "partition",
++ .offset = MTDPART_OFS_APPEND,
++ .size = 0x4000,
++ },
++ {
++ .name = "kernel",
++ .offset = MTDPART_OFS_APPEND,
++ .size = 0x180000,
++ },
++ {
++ .name = "rootfs",
++ .offset = MTDPART_OFS_APPEND,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++static struct s3c2410_nand_set n35_nand_sets[] = {
++ {
++ .name = "chip0",
++ .nr_chips = 1,
++ .nr_partitions = ARRAY_SIZE(n35_default_nand_part),
++ .partitions = n35_default_nand_part,
++ },
++};
++
++static struct s3c2410_platform_nand n35_nand_info = {
++ .tacls = 20,
++ .twrph0 = 35,
++ .twrph1 = 20,
++ .nr_sets = ARRAY_SIZE(n35_nand_sets),
++ .sets = n35_nand_sets,
++ .ignore_unset_ecc = 1,
++};
++#endif
++
+ static struct map_desc n30_iodesc[] __initdata = {
+ /* nothing here yet */
+ };
+@@ -492,6 +552,9 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_rtc,
+ &s3c_device_usbgadget,
+ &s3c_device_sdi,
++#ifdef CONFIG_MTD_PARTITIONS
++ &s3c_device_nand,
++#endif
+ &s3c_device_adc,
+ &s3c_device_ts,
+ &s3c_device_timer[0],
+@@ -681,6 +744,16 @@ static void __init n30_init(void)
+ }
+
+ if (machine_is_n35()) {
++ s3c_nand_set_platdata(&n35_nand_info);
++
++ /* Clear any locks and write protects on the flash. */
++ WARN_ON(gpio_request(S3C2410_GPC(5), "NAND write protection"));
++ gpio_set_value(S3C2410_GPC(5), 1);
++ udelay(1);
++ gpio_set_value(S3C2410_GPC(5), 0);
++ udelay(1);
++ gpio_set_value(S3C2410_GPC(5), 1);
++
+ /* Turn off suspend and switch the selectable USB port
+ * to USB device mode. Turn on suspend for the host
+ * port since it is not connected on the N35.
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0009-n30-Add-battery-status-for-Acer-n30-n35.patch b/linux/3.1.6/0009-n30-Add-battery-status-for-Acer-n30-n35.patch
new file mode 100644
index 0000000..d9ac7e5
--- /dev/null
+++ b/linux/3.1.6/0009-n30-Add-battery-status-for-Acer-n30-n35.patch
@@ -0,0 +1,197 @@
+From f28776d590b9f75bde803a37ae63de66b3069c56 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 10:48:10 +0200
+Subject: [PATCH 09/14] n30: Add battery status for Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 7 ++
+ drivers/power/Kconfig | 6 ++
+ drivers/power/Makefile | 1 +
+ drivers/power/n30_battery.c | 116 ++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 130 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/power/n30_battery.c
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index c492f5d..36ed810 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -185,6 +185,11 @@ static struct s3c2410_ts_mach_info n30_ts_cfg __initdata = {
+ .cfg_gpio = s3c24xx_ts_cfg_gpio,
+ };
+
++static struct platform_device n30_battery = {
++ .name = "n30-battery",
++ .id = -1,
++};
++
+ static struct gpio_keys_button n30_buttons[] = {
+ {
+ .gpio = S3C2410_GPF(0),
+@@ -539,6 +544,7 @@ static struct platform_device *n30_devices[] __initdata = {
+ &s3c_device_sdi,
+ &s3c_device_adc,
+ &s3c_device_ts,
++ &n30_battery,
+ &n30_button_device,
+ &n30_blue_led,
+ &n30_warning_led,
+@@ -559,6 +565,7 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_ts,
+ &s3c_device_timer[0],
+ &n35_backlight,
++ &n30_battery,
+ &n35_button_device,
+ &n35_blue_led,
+ &n35_warning_led,
+diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
+index 0734356..0f4559c 100644
+--- a/drivers/power/Kconfig
++++ b/drivers/power/Kconfig
+@@ -76,6 +76,12 @@ config BATTERY_DS2782
+ Say Y here to enable support for the DS2782/DS2786 standalone battery
+ gas-gauge.
+
++config BATTERY_N30
++ tristate "Acer n30/n35 battery driver"
++ depends on (MACH_N30 || MACH_N35) && I2C
++ help
++ Say Y here to enable support for batteries on the Acer n30 family.
++
+ config BATTERY_PMU
+ tristate "Apple PMU battery"
+ depends on PPC32 && ADB_PMU
+diff --git a/drivers/power/Makefile b/drivers/power/Makefile
+index 10143aa..ee8dad2 100644
+--- a/drivers/power/Makefile
++++ b/drivers/power/Makefile
+@@ -37,3 +37,4 @@ obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o
+ obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
+ obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o
+ obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o
++obj-$(CONFIG_BATTERY_N30) += n30_battery.o
+diff --git a/drivers/power/n30_battery.c b/drivers/power/n30_battery.c
+new file mode 100644
+index 0000000..c7d34aa
+--- /dev/null
++++ b/drivers/power/n30_battery.c
+@@ -0,0 +1,116 @@
++/* Acer n30 battery driver.
++ *
++ * The Acer n30 family has a battery controller which sits on the I2C
++ * bus and which can report the battery charge in percent. Two GPIO
++ * pins tells if the PDA is being powered from a charger or via USB.
++ *
++ * Copyright (c) 2008 Christer Weinigel <christer@weinigel.se>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/types.h>
++#include <linux/i2c.h>
++#include <linux/platform_device.h>
++#include <linux/power_supply.h>
++
++#include <mach/hardware.h>
++#include <mach/regs-gpio.h>
++
++#include <asm/mach-types.h>
++
++static int n30_battery_get_capacity(struct device *dev)
++{
++ u8 value;
++ struct i2c_adapter *adap;
++ struct i2c_msg msg[] = {
++ { .addr = 0x0b, .flags = I2C_M_RD, .buf = &value, .len = 1 }
++ };
++ int capacity = -EIO;
++
++ adap = i2c_get_adapter(0);
++ if (adap != NULL) {
++ if (i2c_transfer(adap, msg, 1) == 1)
++ capacity = value;
++ else
++ dev_err(dev, "failed to read capacity\n");
++ i2c_put_adapter(adap);
++ } else
++ dev_err(dev, "failed to get i2c adapter\n");
++
++ return capacity;
++}
++
++static int n30_battery_get_property(struct power_supply *psy,
++ enum power_supply_property psp,
++ union power_supply_propval *val)
++{
++ switch (psp) {
++ case POWER_SUPPLY_PROP_CAPACITY:
++ val->intval = n30_battery_get_capacity(psy->dev);
++ return 0;
++ default:
++ return -EINVAL;
++ }
++ return 0;
++}
++
++static enum power_supply_property n30_battery_props[] = {
++ POWER_SUPPLY_PROP_CAPACITY,
++};
++
++static struct power_supply n30_battery = {
++ .name = "battery",
++ .type = POWER_SUPPLY_TYPE_BATTERY,
++ .properties = n30_battery_props,
++ .num_properties = ARRAY_SIZE(n30_battery_props),
++ .get_property = n30_battery_get_property,
++ .use_for_apm = 1,
++};
++
++static int __devinit n30_battery_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ dev_info(&pdev->dev, "Acer n30 battery driver\n");
++
++ ret = power_supply_register(&pdev->dev, &n30_battery);
++ if (ret)
++ return ret;
++
++ return 0;
++}
++
++static int n30_battery_remove(struct platform_device *pdev)
++{
++ power_supply_unregister(&n30_battery);
++ return 0;
++}
++
++static struct platform_driver n30_battery_driver = {
++ .driver = {
++ .name = "n30-battery",
++ },
++ .probe = n30_battery_probe,
++ .remove = n30_battery_remove,
++};
++
++static int __init n30_battery_init(void)
++{
++ return platform_driver_register(&n30_battery_driver);
++}
++
++static void __exit n30_battery_exit(void)
++{
++ platform_driver_unregister(&n30_battery_driver);
++}
++
++module_init(n30_battery_init);
++module_exit(n30_battery_exit);
++
++MODULE_AUTHOR("Christer Weinigel <christer@weinigel.se>");
++MODULE_DESCRIPTION("Acer n30 battery driver");
++MODULE_LICENSE("GPL");
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0010-n30-Add-PDA-power-supply-status-on-Acer-n30-n35.patch b/linux/3.1.6/0010-n30-Add-PDA-power-supply-status-on-Acer-n30-n35.patch
new file mode 100644
index 0000000..7388140
--- /dev/null
+++ b/linux/3.1.6/0010-n30-Add-PDA-power-supply-status-on-Acer-n30-n35.patch
@@ -0,0 +1,98 @@
+From e98e470136f0910a64bed8a77c067e6976dd23de Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 10:08:47 +0200
+Subject: [PATCH 10/14] n30: Add PDA power supply status on Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 53 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 53 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 36ed810..9c0e5b8 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -23,6 +23,7 @@
+ #include <linux/gpio.h>
+ #include <linux/input.h>
+ #include <linux/interrupt.h>
++#include <linux/pda_power.h>
+ #include <linux/platform_device.h>
+ #include <linux/pwm_backlight.h>
+ #include <linux/serial_core.h>
+@@ -185,6 +186,56 @@ static struct s3c2410_ts_mach_info n30_ts_cfg __initdata = {
+ .cfg_gpio = s3c24xx_ts_cfg_gpio,
+ };
+
++/* It would be possible to register GPG1 as interrupt resource EINT9
++ * with the pda_power code, but since GPC7 cannot have an interrupt
++ * connected to it, the pda_power driver will use polling anyway. In
++ * addition to that, since the USB driver already requests EINT9, the
++ * request_irq in pda_power fails. So don't do that. */
++
++/*
++static struct resource n30_power_resource[] = {
++ {
++ .name = "usb",
++ .start = IRQ_EINT9,
++ .end = IRQ_EINT9,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++*/
++
++static int n30_is_ac_online(void)
++{
++ return gpio_get_value(S3C2410_GPC(7));
++}
++
++static int n30_is_usb_online(void)
++{
++ return gpio_get_value(S3C2410_GPG(1));
++}
++
++static char *n30_power_supplied_to[] = {
++ "battery",
++};
++
++static struct pda_power_pdata n30_power_pdata = {
++ .is_ac_online = n30_is_ac_online,
++ .is_usb_online = n30_is_usb_online,
++ .supplied_to = n30_power_supplied_to,
++ .num_supplicants = ARRAY_SIZE(n30_power_supplied_to),
++};
++
++static struct platform_device n30_power = {
++ .name = "pda-power",
++ .id = -1,
++ .dev = {
++ .platform_data = &n30_power_pdata,
++ },
++/*
++ .num_resources = ARRAY_SIZE(n30_power_resource),
++ .resource = n30_power_resource,
++*/
++};
++
+ static struct platform_device n30_battery = {
+ .name = "n30-battery",
+ .id = -1,
+@@ -545,6 +596,7 @@ static struct platform_device *n30_devices[] __initdata = {
+ &s3c_device_adc,
+ &s3c_device_ts,
+ &n30_battery,
++ &n30_power,
+ &n30_button_device,
+ &n30_blue_led,
+ &n30_warning_led,
+@@ -569,6 +621,7 @@ static struct platform_device *n35_devices[] __initdata = {
+ &n35_button_device,
+ &n35_blue_led,
+ &n35_warning_led,
++ &n30_power,
+ };
+
+ static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch b/linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch
new file mode 100644
index 0000000..68e7ed4
--- /dev/null
+++ b/linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch
@@ -0,0 +1,92 @@
+From 3dad22d3a6e269ea7387c756592fd831fbd7810e Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Mon, 24 May 2010 11:03:52 +0200
+Subject: [PATCH 11/14] n35: Powermanagement for some LCD stuff on Acer n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/mach-n30.c | 47 ++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 47 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 9c0e5b8..3c784e4 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -56,6 +56,8 @@
+ #include <plat/ts.h>
+ #include <plat/udc.h>
+
++#include <video/platform_lcd.h>
++
+ #ifdef CONFIG_MTD_PARTITIONS
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nand.h>
+@@ -563,6 +565,45 @@ static struct platform_device n35_backlight = {
+ .id = -1,
+ };
+
++static void n35_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
++{
++ if (power) {
++ gpio_set_value(S3C2410_GPB(8), 1);
++ s3c_gpio_setpull(S3C2410_GPB(8), S3C_GPIO_PULL_UP);
++
++ s3c_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT);
++ gpio_set_value(S3C2410_GPB(9), 1);
++ s3c_gpio_setpull(S3C2410_GPB(9), S3C_GPIO_PULL_UP);
++
++ s3c_gpio_cfgpin(S3C2410_GPB(10), S3C2410_GPIO_OUTPUT);
++ gpio_set_value(S3C2410_GPB(10), 1);
++ s3c_gpio_setpull(S3C2410_GPB(10), S3C_GPIO_PULL_UP);
++ } else {
++ gpio_set_value(S3C2410_GPB(8), 0);
++ s3c_gpio_setpull(S3C2410_GPB(8), S3C_GPIO_PULL_DOWN);
++
++ s3c_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_INPUT);
++ s3c_gpio_setpull(S3C2410_GPB(9), S3C_GPIO_PULL_DOWN);
++
++ s3c_gpio_cfgpin(S3C2410_GPB(10), S3C2410_GPIO_INPUT);
++ s3c_gpio_setpull(S3C2410_GPB(10), S3C_GPIO_PULL_DOWN);
++ }
++}
++
++
++static struct plat_lcd_data n35_lcd_power_data = {
++ .set_power = n35_lcd_set_power,
++};
++
++static struct platform_device n35_lcd_powerdev = {
++ .name = "platform-lcd",
++ .id = -1,
++ .dev = {
++ .parent = &s3c_device_lcd.dev,
++ .platform_data = &n35_lcd_power_data,
++ },
++};
++
+ static void n30_sdi_set_power(unsigned char power_mode, unsigned short vdd)
+ {
+ switch (power_mode) {
+@@ -617,6 +658,7 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_ts,
+ &s3c_device_timer[0],
+ &n35_backlight,
++ &n35_lcd_powerdev,
+ &n30_battery,
+ &n35_button_device,
+ &n35_blue_led,
+@@ -806,6 +848,11 @@ static void __init n30_init(void)
+ if (machine_is_n35()) {
+ s3c_nand_set_platdata(&n35_nand_info);
+
++ WARN_ON(gpio_request(S3C2410_GPB(8), "LCD driver"));
++ WARN_ON(gpio_request(S3C2410_GPB(9), "LCD HSYNC"));
++ WARN_ON(gpio_request(S3C2410_GPB(10), "LCD VSYNC"));
++ s3c_gpio_cfgpin(S3C2410_GPB(8), S3C2410_GPIO_OUTPUT);
++
+ /* Clear any locks and write protects on the flash. */
+ WARN_ON(gpio_request(S3C2410_GPC(5), "NAND write protection"));
+ gpio_set_value(S3C2410_GPC(5), 1);
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch b/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
new file mode 100644
index 0000000..b00ddcd
--- /dev/null
+++ b/linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch
@@ -0,0 +1,187 @@
+From e73ac678d32e5748c73902591922b0e9b5b6c182 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Thu, 27 May 2010 15:53:03 +0200
+Subject: [PATCH 12/14] n30: Basic suspend to ram for Acer n30 / n35
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/Makefile | 1 +
+ arch/arm/mach-s3c2410/Kconfig | 1 +
+ arch/arm/mach-s3c2410/Makefile.boot | 11 +++++++----
+ arch/arm/mach-s3c2410/include/mach/h1940.h | 1 +
+ arch/arm/mach-s3c2410/mach-n30.c | 22 ++++++++++++++++++++++
+ arch/arm/mach-s3c2410/pm-h1940.S | 2 ++
+ arch/arm/mach-s3c2410/sleep.S | 3 +++
+ 7 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/Makefile b/arch/arm/Makefile
+index 59c1ce8..40ec8d4 100644
+--- a/arch/arm/Makefile
++++ b/arch/arm/Makefile
+@@ -119,6 +119,7 @@ textofs-y := 0x00008000
+ textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
+ # We don't want the htc bootloader to corrupt kernel during resume
+ textofs-$(CONFIG_PM_H1940) := 0x00108000
++textofs-$(CONFIG_MACH_N35) := 0x00208000
+ # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
+ ifeq ($(CONFIG_ARCH_SA1100),y)
+ textofs-$(CONFIG_SA1111) := 0x00208000
+diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
+index 1d55349..bcb7061 100644
+--- a/arch/arm/mach-s3c2410/Kconfig
++++ b/arch/arm/mach-s3c2410/Kconfig
+@@ -98,6 +98,7 @@ config MACH_N30
+ bool "Acer N30 family"
+ select CPU_S3C2410
+ select MACH_N35
++ select PM_H1940 if PM
+ select S3C_DEV_USB_HOST
+ select S3C_DEV_NAND
+ select S3C2410_SETUP_TS
+diff --git a/arch/arm/mach-s3c2410/Makefile.boot b/arch/arm/mach-s3c2410/Makefile.boot
+index 58c1dd7..aaf5bdc 100644
+--- a/arch/arm/mach-s3c2410/Makefile.boot
++++ b/arch/arm/mach-s3c2410/Makefile.boot
+@@ -1,7 +1,10 @@
++zreladdr-y := 0x30008000
++params_phys-y := 0x30000100
+ ifeq ($(CONFIG_PM_H1940),y)
+- zreladdr-y := 0x30108000
++ zreladdr-y := 0x30108000
+ params_phys-y := 0x30100100
+-else
+- zreladdr-y := 0x30008000
+- params_phys-y := 0x30000100
++endif
++ifeq ($(CONFIG_MACH_N35),y)
++ zreladdr-y := 0x30208000
++ params_phys-y := 0x30200100
+ endif
+diff --git a/arch/arm/mach-s3c2410/include/mach/h1940.h b/arch/arm/mach-s3c2410/include/mach/h1940.h
+index 4559784..be48128 100644
+--- a/arch/arm/mach-s3c2410/include/mach/h1940.h
++++ b/arch/arm/mach-s3c2410/include/mach/h1940.h
+@@ -17,5 +17,6 @@
+ #define H1940_SUSPEND_CHECK (0x30080000)
+
+ extern void h1940_pm_return(void);
++extern void h1940_pm_return_end(void);
+
+ #endif /* __ASM_ARCH_H1940_H */
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 3c784e4..34a7e9e 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -19,6 +19,7 @@
+
+ #include <linux/delay.h>
+ #include <linux/gpio_keys.h>
++#include <linux/memblock.h>
+ #include <linux/init.h>
+ #include <linux/gpio.h>
+ #include <linux/input.h>
+@@ -27,6 +28,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/pwm_backlight.h>
+ #include <linux/serial_core.h>
++#include <linux/sysdev.h>
+ #include <linux/timer.h>
+ #include <linux/io.h>
+ #include <linux/mmc/host.h>
+@@ -36,6 +38,7 @@
+ #include <asm/mach-types.h>
+
+ #include <mach/fb.h>
++#include <mach/h1940.h>
+ #include <mach/leds-gpio.h>
+ #include <mach/regs-gpio.h>
+ #include <mach/regs-lcd.h>
+@@ -49,6 +52,7 @@
+
+ #include <plat/clock.h>
+ #include <plat/cpu.h>
++#include <plat/pm.h>
+ #include <plat/devs.h>
+ #include <plat/mci.h>
+ #include <plat/nand.h>
+@@ -58,6 +62,8 @@
+
+ #include <video/platform_lcd.h>
+
++#define N35_SUSPEND_RESUMEAT (S3C2410_SDRAM_PA + 0x201000)
++
+ #ifdef CONFIG_MTD_PARTITIONS
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nand.h>
+@@ -816,12 +822,26 @@ static void __init n30_map_io(void)
+ s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
+ }
+
++/* Acer N30/N35 need to reserve this memory to suspend */
++static void __init n30_reserve(void)
++{
++ memblock_reserve(0x30201000, 0x1000);
++}
++
+ /* GPB3 is the line that controls the pull-up for the USB D+ line */
+
+ static void __init n30_init(void)
+ {
+ WARN_ON(gpio_request(S3C2410_GPG(4), "mmc power"));
+
++ /* setup PM */
++
++#ifdef CONFIG_PM_H1940
++ memcpy(phys_to_virt(N35_SUSPEND_RESUMEAT), h1940_pm_return,
++ h1940_pm_return_end - h1940_pm_return);
++#endif
++ s3c_pm_init();
++
+ s3c24xx_fb_set_platdata(&n30_fb_info);
+ s3c24xx_ts_set_platdata(&n30_ts_cfg);
+ s3c24xx_udc_set_platdata(&n30_udc_cfg);
+@@ -892,6 +912,7 @@ MACHINE_START(N30, "Acer-N30")
+ .init_machine = n30_init,
+ .init_irq = s3c24xx_init_irq,
+ .map_io = n30_map_io,
++ .reserve = n30_reserve,
+ MACHINE_END
+
+ MACHINE_START(N35, "Acer-N35")
+@@ -904,4 +925,5 @@ MACHINE_START(N35, "Acer-N35")
+ .init_machine = n30_init,
+ .init_irq = s3c24xx_init_irq,
+ .map_io = n30_map_io,
++ .reserve = n30_reserve,
+ MACHINE_END
+diff --git a/arch/arm/mach-s3c2410/pm-h1940.S b/arch/arm/mach-s3c2410/pm-h1940.S
+index c93bf2d..020ed0c 100644
+--- a/arch/arm/mach-s3c2410/pm-h1940.S
++++ b/arch/arm/mach-s3c2410/pm-h1940.S
+@@ -27,7 +27,9 @@
+
+ .text
+ .global h1940_pm_return
++ .global h1940_pm_return_end
+
+ h1940_pm_return:
+ mov r0, #S3C2410_PA_GPIO
+ ldr pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ]
++h1940_pm_return_end:
+diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S
+index dd5b638..84ecef3 100644
+--- a/arch/arm/mach-s3c2410/sleep.S
++++ b/arch/arm/mach-s3c2410/sleep.S
+@@ -51,6 +51,9 @@ ENTRY(s3c2410_cpu_suspend)
+
+ orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
+ orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
++ @ turn off data port pull ups
++ orr r8, r8, #S3C2410_MISCCR_SPUCR_HDIS
++ orr r8, r8, #S3C2410_MISCCR_SPUCR_LDIS
+ orr r9, r9, #S3C2410_CLKCON_POWER @ power down command
+
+ teq pc, #0 @ first as a trial-run to load cache
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0013-n35-Acer-n35-GPS-power-management.patch b/linux/3.1.6/0013-n35-Acer-n35-GPS-power-management.patch
new file mode 100644
index 0000000..9193ce6
--- /dev/null
+++ b/linux/3.1.6/0013-n35-Acer-n35-GPS-power-management.patch
@@ -0,0 +1,206 @@
+From 2dac0b9383e3939ce69b07aff70e8eae3b7fa561 Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Wed, 26 May 2010 23:00:56 +0200
+Subject: [PATCH 13/14] n35: Acer n35 GPS power management
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ arch/arm/mach-s3c2410/Makefile | 1 +
+ arch/arm/mach-s3c2410/mach-n30.c | 6 ++
+ arch/arm/mach-s3c2410/n35_gps.c | 148 ++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 155 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/mach-s3c2410/n35_gps.c
+
+diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
+index 0d468e9..896baa4 100644
+--- a/arch/arm/mach-s3c2410/Makefile
++++ b/arch/arm/mach-s3c2410/Makefile
+@@ -25,6 +25,7 @@ obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
+ obj-$(CONFIG_H1940BT) += h1940-bluetooth.o
+ obj-$(CONFIG_PM_H1940) += pm-h1940.o
+ obj-$(CONFIG_MACH_N30) += mach-n30.o
++obj-$(CONFIG_MACH_N35) += n35_gps.o
+ obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
+ obj-$(CONFIG_MACH_OTOM) += mach-otom.o
+ obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o
+diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
+index 34a7e9e..010d5aa 100644
+--- a/arch/arm/mach-s3c2410/mach-n30.c
++++ b/arch/arm/mach-s3c2410/mach-n30.c
+@@ -631,6 +631,11 @@ static struct s3c24xx_mci_pdata n30_mci_cfg __initdata = {
+ .set_power = n30_sdi_set_power,
+ };
+
++static struct platform_device n35_device_gps = {
++ .name = "n35-gps",
++ .id = -1,
++};
++
+ static struct platform_device *n30_devices[] __initdata = {
+ &s3c_device_lcd,
+ &s3c_device_wdt,
+@@ -664,6 +669,7 @@ static struct platform_device *n35_devices[] __initdata = {
+ &s3c_device_ts,
+ &s3c_device_timer[0],
+ &n35_backlight,
++ &n35_device_gps,
+ &n35_lcd_powerdev,
+ &n30_battery,
+ &n35_button_device,
+diff --git a/arch/arm/mach-s3c2410/n35_gps.c b/arch/arm/mach-s3c2410/n35_gps.c
+new file mode 100644
+index 0000000..41506e9
+--- /dev/null
++++ b/arch/arm/mach-s3c2410/n35_gps.c
+@@ -0,0 +1,148 @@
++/*
++ * arch/arm/mach-s3c2410/n35-gps.c
++ * Copyright (c) Arnaud Patard <arnaud.patard@rtp-net.org>
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file COPYING in the main directory of this archive for
++ * more details.
++ *
++ * Acer n35 GPS "driver"
++ * FIXME: Do proper up/down handling, now it only ses power on/off.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/platform_device.h>
++//#include <linux/delay.h>
++#include <linux/string.h>
++#include <linux/ctype.h>
++#include <linux/gpio.h>
++
++#include <mach/regs-gpio.h>
++#include <mach/hardware.h>
++
++#define DRV_NAME "n35-gps"
++
++struct n35_gps_data {
++ int suspend_power_state;
++};
++
++static struct n35_gps_data n35_gps;
++
++static int gps_power_get(void)
++{
++ return !(gpio_get_value(S3C2410_GPB(4)) || \
++ gpio_get_value(S3C2410_GPG(11)));
++}
++
++static void gps_power_set(int power)
++{
++ gpio_set_value(S3C2410_GPB(4), power ? 0 : 1);
++ gpio_set_value(S3C2410_GPG(11), power ? 0 : 1);
++}
++
++static ssize_t gps_power_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ if (gps_power_get())
++ return sprintf(buf, "1\n");
++ return sprintf(buf, "0\n");
++}
++
++static ssize_t gps_power_store(struct device *pdev,
++ struct device_attribute *attr, const char *buf, size_t size)
++{
++ int power;
++
++ power = simple_strtoul(buf, NULL, 0);
++ gps_power_set(power);
++
++ return size;
++}
++
++static DEVICE_ATTR(gps_power, 0664, gps_power_show, gps_power_store);
++
++static int __devinit n35_gps_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ ret = gpio_request(S3C2410_GPB(4), "Acer n35 GPS module power");
++ if (ret)
++ goto ret_err;
++
++ ret = gpio_request(S3C2410_GPG(11), "Acer n35 GPS antena power");
++ if (ret)
++ goto ret_err_gpg4;
++
++ s3c_gpio_cfgpin(S3C2410_GPB(4), S3C2410_GPIO_OUTPUT);
++ s3c_gpio_cfgpin(S3C2410_GPG(11), S3C2410_GPIO_OUTPUT);
++
++ gps_power_set(0);
++
++ ret = device_create_file(&pdev->dev, &dev_attr_gps_power);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to create GPS sysfs device\n");
++ goto ret_err_gpg11;
++ }
++
++ return 0;
++ret_err_gpg11:
++ gpio_free(S3C2410_GPG(11));
++ret_err_gpg4:
++ gpio_free(S3C2410_GPB(4));
++ret_err:
++ return ret;
++}
++
++static int n35_gps_remove(struct platform_device *pdev)
++{
++ gps_power_set(0);
++
++ gpio_free(S3C2410_GPG(11));
++ gpio_free(S3C2410_GPB(4));
++
++ device_remove_file(&pdev->dev, &dev_attr_gps_power);
++
++ return 0;
++}
++
++static int n35_gps_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ n35_gps.suspend_power_state = gps_power_get();
++ gps_power_set(0);
++ return 0;
++}
++
++static int n35_gps_resume(struct platform_device *pdev)
++{
++ gps_power_set(n35_gps.suspend_power_state);
++ return 0;
++}
++
++static struct platform_driver n35_gps_driver = {
++ .driver = {
++ .name = DRV_NAME,
++ },
++ .probe = n35_gps_probe,
++ .remove = n35_gps_remove,
++ .resume = n35_gps_resume,
++ .suspend = n35_gps_suspend,
++};
++
++
++static int __init n35_gps_init(void)
++{
++ return platform_driver_register(&n35_gps_driver);
++}
++
++static void __exit n35_gps_exit(void)
++{
++ platform_driver_unregister(&n35_gps_driver);
++}
++
++module_init(n35_gps_init);
++module_exit(n35_gps_exit);
++
++MODULE_AUTHOR("Jiri Pinkava <jiri.pinkava@vscht.cz>");
++MODULE_DESCRIPTION("Driver for the Acer n35 GPS");
++MODULE_LICENSE("GPL");
+--
+1.7.3.1
+
diff --git a/linux/3.1.6/0014-s3c2410_ts-HACK-for-tslib-add-fake-pressure-value.patch b/linux/3.1.6/0014-s3c2410_ts-HACK-for-tslib-add-fake-pressure-value.patch
new file mode 100644
index 0000000..d259355
--- /dev/null
+++ b/linux/3.1.6/0014-s3c2410_ts-HACK-for-tslib-add-fake-pressure-value.patch
@@ -0,0 +1,52 @@
+From dee39d8e29e6de3759acc733588bbc691e69114b Mon Sep 17 00:00:00 2001
+From: Jiri Pinkava <jiri.pinkava@vscht.cz>
+Date: Sat, 5 Jun 2010 12:35:55 +0200
+Subject: [PATCH 14/14] s3c2410_ts: HACK for tslib, add fake pressure value
+
+Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
+---
+ drivers/input/touchscreen/s3c2410_ts.c | 12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
+index 6085d12..13f8c04 100644
+--- a/drivers/input/touchscreen/s3c2410_ts.c
++++ b/drivers/input/touchscreen/s3c2410_ts.c
+@@ -124,6 +124,7 @@ static void touch_timer_fire(unsigned long data)
+
+ input_report_abs(ts.input, ABS_X, ts.xp);
+ input_report_abs(ts.input, ABS_Y, ts.yp);
++ input_report_abs(ts.input, ABS_PRESSURE, 1);
+
+ input_report_key(ts.input, BTN_TOUCH, 1);
+ input_sync(ts.input);
+@@ -140,6 +141,7 @@ static void touch_timer_fire(unsigned long data)
+ ts.count = 0;
+
+ input_report_key(ts.input, BTN_TOUCH, 0);
++ input_report_abs(ts.input, ABS_PRESSURE, 0);
+ input_sync(ts.input);
+
+ writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC);
+@@ -314,10 +316,16 @@ static int __devinit s3c2410ts_probe(struct platform_device *pdev)
+ }
+
+ ts.input = input_dev;
+- ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+- ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
++ __set_bit(EV_ABS, ts.input->evbit);
++ __set_bit(ABS_X, ts.input->absbit);
++ __set_bit(ABS_Y, ts.input->absbit);
++ __set_bit(ABS_PRESSURE, ts.input->absbit);
++ __set_bit(EV_SYN, ts.input->evbit);
++ __set_bit(EV_KEY, ts.input->evbit);
++ __set_bit(BTN_TOUCH, ts.input->keybit);
+ input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0);
+ input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0);
++ input_set_abs_params(ts.input, ABS_PRESSURE, 0, 1, 0, 0);
+
+ ts.input->name = "S3C24XX TouchScreen";
+ ts.input->id.bustype = BUS_HOST;
+--
+1.7.3.1
+