From 91e51701b30a09790b1420a3a5298221e6eb4384 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 31 Dec 2011 16:25:21 +0100 Subject: Import patches from Jiri Pinkava --- linux/3.1.6/0001-n35-fix-key-codes.patch | 42 +++++ ...35-Update-GPIO-documentation-for-Acer-n35.patch | 36 ++++ ...p-UARTs-configuration-replace-numeric-con.patch | 84 +++++++++ ...-Fix-MMC-power-management-on-Acer-n30-n35.patch | 31 ++++ ...-Add-touchscreen-support-for-Acer-n30-n35.patch | 78 ++++++++ ...-Add-LCD-backlight-regulation-on-Acer-n35.patch | 109 +++++++++++ ...p-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch | 33 ++++ ...08-n35-Support-for-NAND-Flash-on-Acer-n35.patch | 122 ++++++++++++ ...9-n30-Add-battery-status-for-Acer-n30-n35.patch | 197 ++++++++++++++++++++ ...d-PDA-power-supply-status-on-Acer-n30-n35.patch | 98 ++++++++++ ...management-for-some-LCD-stuff-on-Acer-n35.patch | 92 +++++++++ ...n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch | 187 +++++++++++++++++++ .../0013-n35-Acer-n35-GPS-power-management.patch | 206 +++++++++++++++++++++ ...ts-HACK-for-tslib-add-fake-pressure-value.patch | 52 ++++++ 14 files changed, 1367 insertions(+) create mode 100644 linux/3.1.6/0001-n35-fix-key-codes.patch create mode 100644 linux/3.1.6/0002-n35-Update-GPIO-documentation-for-Acer-n35.patch create mode 100644 linux/3.1.6/0003-n30-Clean-up-UARTs-configuration-replace-numeric-con.patch create mode 100644 linux/3.1.6/0004-n30-Fix-MMC-power-management-on-Acer-n30-n35.patch create mode 100644 linux/3.1.6/0005-n30-Add-touchscreen-support-for-Acer-n30-n35.patch create mode 100644 linux/3.1.6/0006-n35-Add-LCD-backlight-regulation-on-Acer-n35.patch create mode 100644 linux/3.1.6/0007-n30-Clean-up-LCD-conf.-moved-to-LCD-conf.-from-hardc.patch create mode 100644 linux/3.1.6/0008-n35-Support-for-NAND-Flash-on-Acer-n35.patch create mode 100644 linux/3.1.6/0009-n30-Add-battery-status-for-Acer-n30-n35.patch create mode 100644 linux/3.1.6/0010-n30-Add-PDA-power-supply-status-on-Acer-n30-n35.patch create mode 100644 linux/3.1.6/0011-n35-Powermanagement-for-some-LCD-stuff-on-Acer-n35.patch create mode 100644 linux/3.1.6/0012-n30-Basic-suspend-to-ram-for-Acer-n30-n35.patch create mode 100644 linux/3.1.6/0013-n35-Acer-n35-GPS-power-management.patch create mode 100644 linux/3.1.6/0014-s3c2410_ts-HACK-for-tslib-add-fake-pressure-value.patch 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 +Date: Wed, 23 Jun 2010 20:33:53 +0200 +Subject: [PATCH 01/14] n35: fix key codes + + +Signed-off-by: Jiri Pinkava +--- + 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 +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 +--- + 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 +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 +--- + 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 +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 +--- + 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 +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 +--- + 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 + #include + #include ++#include + #include + + 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 +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 +--- + 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 + #include + #include ++#include + #include + #include + #include +@@ -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 +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 +--- + 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 +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 +--- + 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 + #include + ++#include + #include + #include + #include +@@ -49,10 +50,69 @@ + #include + #include + #include ++#include + #include + #include + #include + ++#ifdef CONFIG_MTD_PARTITIONS ++#include ++#include ++#include ++#include ++ ++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 +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 +--- + 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 ++ * ++ * 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 ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++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 "); ++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 +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 +--- + 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 + #include + #include ++#include + #include + #include + #include +@@ -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 +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 +--- + 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 + #include + ++#include