Enable Acer n35 architecture if Acer n30 is selected
Subsystems (2)
PATCH 1/9 Enable Acer n35 architecture if Acer n30 is selected
All code already present for Acer n35 is useless unless MACH_N35 is defined.
--- arch/arm/mach-s3c2410/Kconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/Kconfig +7 -0
@@ -95,12 +95,19 @@ config PM_H1940 config MACH_N30 bool "Acer N30 family" select CPU_S3C2410 + select MACH_N35 select S3C_DEV_USB_HOST select S3C_DEV_NAND help Say Y here if you want suppt for the Acer N30, Acer N35, Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. +config MACH_N35 + bool + help + Internal node in order to enable support for Acer N35 if Acer N30 is + selected. + config ARCH_BAST bool "Simtec Electronics BAST (EB2410ITX)" select CPU_S3C2410
Signature · 1 line
1.7.1
PATCH 2/9 fix: suspended wrong USB port on Acer n35
There is bug in USB setup code for Acer n35 (it is related directly to s3c2410, see doc). We want suspend host port (is not connected) but device port should be active.
--- arch/arm/mach-s3c2410/mach-n30.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +1 -1
@@ -532,7 +532,7 @@ static void __init n30_init(void)s3c2410_modify_misccr (S3C2410_MISCCR_USBHOST |S3C2410_MISCCR_USBSUSPND0 |S3C2410_MISCCR_USBSUSPND1 , -S3C2410_MISCCR_USBSUSPND1 ); +S3C2410_MISCCR_USBSUSPND0 );platform_add_devices (n35_devices,ARRAY_SIZE (n35_devices)); }
Signature · 1 line
1.7.1
PATCH 3/9 Add RTC platform device for Acer n30 / Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +2 -0
@@ -323,6 +323,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_i2c0, &s3c_device_iis, &s3c_device_ohci, + &s3c_device_rtc, &s3c_device_usbgadget, &n30_button_device, &n30_blue_led,
@@ -334,6 +335,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_wdt, &s3c_device_i2c0, &s3c_device_iis, + &s3c_device_rtc, &s3c_device_usbgadget, &n35_button_device, };
Signature · 1 line
1.7.1
PATCH 4/9 Add support for blue LED on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +17 -0
@@ -264,6 +264,14 @@ static struct s3c24xx_led_platdata n30_blue_led_pdata = { .def_trigger = "", }; +/* This is the blue LED on the device. Originaly used to indicate GPS activity +* by flashing. */ +static struct s3c24xx_led_platdata n35_blue_led_pdata = { + .name ="blue_led" , + .gpio =S3C2410_GPD (8 ), + .def_trigger ="" , +}; +/* This LED is driven by the battery microcontroller, and is blinking * red, blinking green or solid green when the battery is low, * charging or full respectively. By driving GPD9 low, it's possible
@@ -283,6 +291,14 @@ static struct platform_device n30_blue_led = { }, }; +static struct platform_device n35_blue_led = { + .name ="s3c24xx_led" , + .id =1 , + .dev = { + .platform_data = &n35_blue_led_pdata, + }, +}; +static struct platform_device n30_warning_led = { .name ="s3c24xx_led" , .id =2 ,
@@ -338,6 +354,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_rtc, &s3c_device_usbgadget, &n35_button_device, + &n35_blue_led, }; static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
Signature · 1 line
1.7.1
PATCH 5/9 Add support for red flashing LED on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +16 -0
@@ -283,6 +283,13 @@ static struct s3c24xx_led_platdata n30_warning_led_pdata = { .def_trigger = "", }; +static struct s3c24xx_led_platdata n35_warning_led_pdata = { + .name ="warning_led" , + .flags =S3C24XX_LEDF_ACTLOW |S3C24XX_LEDF_TRISTATE , + .gpio =S3C2410_GPD (9 ), + .def_trigger ="" , +}; +static struct platform_device n30_blue_led = { .name ="s3c24xx_led" , .id =1 ,
@@ -307,6 +314,14 @@ static struct platform_device n30_warning_led = { }, }; +static struct platform_device n35_warning_led = { + .name ="s3c24xx_led" , + .id =2 , + .dev = { + .platform_data = &n35_warning_led_pdata, + }, +}; +static struct s3c2410fb_display n30_display__initdata = { .type =S3C2410_LCDCON1_TFT , .width =240 ,
@@ -355,6 +370,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_usbgadget, &n35_button_device, &n35_blue_led, + &n35_warning_led, }; static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
Signature · 1 line
1.7.1
PATCH 6/9 Enable wake-up by Power button on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +2 -0
@@ -172,8 +172,10 @@ static struct gpio_keys_button n35_buttons[] = { { .gpio = S3C2410_GPF(0), .code = KEY_POWER, + .type = EV_PWR, .desc = "Power", .active_low = 0, + .wakeup = 1, }, { .gpio = S3C2410_GPG(9),
Signature · 1 line
1.7.1
PATCH 7/9 Add support for MMC card reader on Acer n30 / Acer n35
There is MMC (SD) card reader. Works fine.
--- arch/arm/mach-s3c2410/mach-n30.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +14 -0
@@ -26,6 +26,7 @@#include <linux/serial_core.h> #include <linux/timer.h> #include <linux/io.h> +#include <linux/mmc/host.h> #include <mach/hardware.h> #include <asm/irq.h>
@@ -46,6 +47,7 @@#include <plat/clock.h> #include <plat/cpu.h> #include <plat/devs.h> +#include <plat/mci.h> #include <plat/s3c2410.h> #include <plat/udc.h>
@@ -350,6 +352,15 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static struct s3c24xx_mci_pdata n30_mci_cfg__initdata = { + .wprotect_invert =0 , + .detect_invert =0 , + .gpio_detect =S3C2410_GPF (1 ), + .gpio_wprotect =S3C2410_GPG (10 ), + .set_power =NULL , + .ocr_avail =MMC_VDD_32_33 , +}; +static struct platform_device *n30_devices[]__initdata = { &s3c_device_lcd, &s3c_device_wdt,
@@ -358,6 +369,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_ohci, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n30_button_device, &n30_blue_led, &n30_warning_led,
@@ -370,6 +382,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_iis, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n35_button_device, &n35_blue_led, &n35_warning_led,
@@ -538,6 +551,7 @@ static void __init n30_init(void) {s3c24xx_fb_set_platdata (&n30_fb_info);s3c24xx_udc_set_platdata (&n30_udc_cfg); +s3c24xx_mci_set_platdata (&n30_mci_cfg);s3c_i2c0_set_platdata (&n30_i2ccfg);/* Turn off suspend on both USB ports, and switch the
Signature · 1 line
1.7.1
PATCH 8/9 Add support for power on/off on Acer n30 / Acer n35 MMC card reader
--- arch/arm/mach-s3c2410/mach-n30.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +15 -1
@@ -352,12 +352,26 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static void n30_sdi_set_power (unsigned char power_mode,unsigned short vdd) +{ +switch (power_mode) { +case MMC_POWER_ON : +case MMC_POWER_UP : +s3c2410_gpio_setpin (S3C2410_GPG (4 ),1 ); +break ; +case MMC_POWER_OFF : +default : +s3c2410_gpio_setpin (S3C2410_GPG (4 ),0 ); +break ; + } +} +static struct s3c24xx_mci_pdata n30_mci_cfg__initdata = { .wprotect_invert =0 , .detect_invert =0 , .gpio_detect =S3C2410_GPF (1 ), .gpio_wprotect =S3C2410_GPG (10 ), - .set_power =NULL , + .set_power = n30_sdi_set_power, .ocr_avail =MMC_VDD_32_33 , };
Signature · 1 line
1.7.1
PATCH 7/9 Add support for MMC card reader on Acer n30 / Acer n35
In reply to Pinkava J.Quoted 29 lines · Pinkava J.
There is MMC (SD) card reader. Works fine.
Signed-off-by Jiri Pinkava <[email protected]>--- arch/arm/mach-s3c2410/mach-n30.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)arch/arm/mach-s3c2410/mach-n30.c +2
-0@@ -26,6 +26,7 @@#include <linux/serial_core.h> #include <linux/timer.h> #include <linux/io.h> +#include <linux/mmc/host.h> #include <mach/hardware.h> #include <asm/irq.h> @@ -46,6 +47,7 @@#include <plat/clock.h> #include <plat/cpu.h> #include <plat/devs.h> +#include <plat/mci.h> #include <plat/s3c2410.h> #include <plat/udc.h>
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 357
Quoted 6 lines
arch/arm/mach-s3c2410/mach-n30.c +3
-0@@ -350,6 +352,15 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static struct s3c24xx_mci_pdata n30_mci_cfg__initdata = { + .wprotect_invert =0 , + .detect_invert =0 ,
no need for '0' initialisers here.
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 360
Quoted 3 lines
arch/arm/mach-s3c2410/mach-n30.c +3
-0+ .gpio_detect = S3C2410_GPF(1), + .gpio_wprotect = S3C2410_GPG(10), + .set_power = NULL,
no need to have 'NULL' here.
Quoted 38 lines
arch/arm/mach-s3c2410/mach-n30.c +6
-0+ .ocr_avail = MMC_VDD_32_33, +}; +static struct platform_device *n30_devices[]__initdata = { &s3c_device_lcd, &s3c_device_wdt,@@ -358,6 +369,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_ohci, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n30_button_device, &n30_blue_led, &n30_warning_led,@@ -370,6 +382,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_iis, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n35_button_device, &n35_blue_led, &n35_warning_led,@@ -538,6 +551,7 @@ static void __init n30_init(void) {s3c24xx_fb_set_platdata (&n30_fb_info);s3c24xx_udc_set_platdata (&n30_udc_cfg); +s3c24xx_mci_set_platdata (&n30_mci_cfg);s3c_i2c0_set_platdata (&n30_i2ccfg);/* Turn off suspend on both USB ports, and switch the Signature · 7 lines
1.7.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 5/9 Add support for red flashing LED on Acer n35
In reply to Pinkava J.Quoted 1 line · Pinkava J.
how about one patch for all the leds?
Quoted 55 lines
Signed-off-by Jiri Pinkava <[email protected]>--- arch/arm/mach-s3c2410/mach-n30.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)arch/arm/mach-s3c2410/mach-n30.c +16
-0@@ -283,6 +283,13 @@ static struct s3c24xx_led_platdata n30_warning_led_pdata = { .def_trigger = "", }; +static struct s3c24xx_led_platdata n35_warning_led_pdata = { + .name ="warning_led" , + .flags =S3C24XX_LEDF_ACTLOW |S3C24XX_LEDF_TRISTATE , + .gpio =S3C2410_GPD (9 ), + .def_trigger ="" , +}; +static struct platform_device n30_blue_led = { .name ="s3c24xx_led" , .id =1 ,@@ -307,6 +314,14 @@ static struct platform_device n30_warning_led = { }, }; +static struct platform_device n35_warning_led = { + .name ="s3c24xx_led" , + .id =2 , + .dev = { + .platform_data = &n35_warning_led_pdata, + }, +}; +static struct s3c2410fb_display n30_display__initdata = { .type =S3C2410_LCDCON1_TFT , .width =240 ,@@ -355,6 +370,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_usbgadget, &n35_button_device, &n35_blue_led, + &n35_warning_led, }; static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {Signature · 8 lines
1.7.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 1/8 Enable Acer n35 architecture if Acer n30 is selected
All code already present for Acer n35 is useless unless MACH_N35 is defined.
--- arch/arm/mach-s3c2410/Kconfig | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/Kconfig +7 -0
@@ -95,12 +95,19 @@ config PM_H1940 config MACH_N30 bool "Acer N30 family" select CPU_S3C2410 + select MACH_N35 select S3C_DEV_USB_HOST select S3C_DEV_NAND help Say Y here if you want suppt for the Acer N30, Acer N35, Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. +config MACH_N35 + bool + help + Internal node in order to enable support for Acer N35 if Acer N30 is + selected. + config ARCH_BAST bool "Simtec Electronics BAST (EB2410ITX)" select CPU_S3C2410
Signature · 1 line
1.7.1
PATCH 2/8 fix: suspended wrong USB port on Acer n35
There is bug in USB setup code for Acer n35 (it is related directly to s3c2410, see doc). We want suspend host port (is not connected) but device port should be active.
--- arch/arm/mach-s3c2410/mach-n30.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +1 -1
@@ -532,7 +532,7 @@ static void __init n30_init(void)s3c2410_modify_misccr (S3C2410_MISCCR_USBHOST |S3C2410_MISCCR_USBSUSPND0 |S3C2410_MISCCR_USBSUSPND1 , -S3C2410_MISCCR_USBSUSPND1 ); +S3C2410_MISCCR_USBSUSPND0 );platform_add_devices (n35_devices,ARRAY_SIZE (n35_devices)); }
Signature · 1 line
1.7.1
PATCH 3/8 Add RTC platform device for Acer n30 / Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +2 -0
@@ -323,6 +323,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_i2c0, &s3c_device_iis, &s3c_device_ohci, + &s3c_device_rtc, &s3c_device_usbgadget, &n30_button_device, &n30_blue_led,
@@ -334,6 +335,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_wdt, &s3c_device_i2c0, &s3c_device_iis, + &s3c_device_rtc, &s3c_device_usbgadget, &n35_button_device, };
Signature · 1 line
1.7.1
PATCH 4/8 Add support for LEDs on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +33 -0
@@ -264,6 +264,14 @@ static struct s3c24xx_led_platdata n30_blue_led_pdata = { .def_trigger = "", }; +/* This is the blue LED on the device. Originaly used to indicate GPS activity +* by flashing. */ +static struct s3c24xx_led_platdata n35_blue_led_pdata = { + .name ="blue_led" , + .gpio =S3C2410_GPD (8 ), + .def_trigger ="" , +}; +/* This LED is driven by the battery microcontroller, and is blinking * red, blinking green or solid green when the battery is low, * charging or full respectively. By driving GPD9 low, it's possible
@@ -275,6 +283,13 @@ static struct s3c24xx_led_platdata n30_warning_led_pdata = { .def_trigger = "", }; +static struct s3c24xx_led_platdata n35_warning_led_pdata = { + .name ="warning_led" , + .flags =S3C24XX_LEDF_ACTLOW |S3C24XX_LEDF_TRISTATE , + .gpio =S3C2410_GPD (9 ), + .def_trigger ="" , +}; +static struct platform_device n30_blue_led = { .name ="s3c24xx_led" , .id =1 ,
@@ -283,6 +298,14 @@ static struct platform_device n30_blue_led = { }, }; +static struct platform_device n35_blue_led = { + .name ="s3c24xx_led" , + .id =1 , + .dev = { + .platform_data = &n35_blue_led_pdata, + }, +}; +static struct platform_device n30_warning_led = { .name ="s3c24xx_led" , .id =2 ,
@@ -291,6 +314,14 @@ static struct platform_device n30_warning_led = { }, }; +static struct platform_device n35_warning_led = { + .name ="s3c24xx_led" , + .id =2 , + .dev = { + .platform_data = &n35_warning_led_pdata, + }, +}; +static struct s3c2410fb_display n30_display__initdata = { .type =S3C2410_LCDCON1_TFT , .width =240 ,
@@ -338,6 +369,8 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_rtc, &s3c_device_usbgadget, &n35_button_device, + &n35_blue_led, + &n35_warning_led, }; static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
Signature · 1 line
1.7.1
PATCH 5/8 Enable wake-up by Power button on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +2 -0
@@ -172,8 +172,10 @@ static struct gpio_keys_button n35_buttons[] = { { .gpio = S3C2410_GPF(0), .code = KEY_POWER, + .type = EV_PWR, .desc = "Power", .active_low = 0, + .wakeup = 1, }, { .gpio = S3C2410_GPG(9),
Signature · 1 line
1.7.1
PATCH 6/8 Add support for MMC card reader on Acer n30 / Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +11 -0
@@ -26,6 +26,7 @@#include <linux/serial_core.h> #include <linux/timer.h> #include <linux/io.h> +#include <linux/mmc/host.h> #include <mach/hardware.h> #include <asm/irq.h>
@@ -46,6 +47,7 @@#include <plat/clock.h> #include <plat/cpu.h> #include <plat/devs.h> +#include <plat/mci.h> #include <plat/s3c2410.h> #include <plat/udc.h>
@@ -350,6 +352,12 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static struct s3c24xx_mci_pdata n30_mci_cfg__initdata = { + .gpio_detect =S3C2410_GPF (1 ), + .gpio_wprotect =S3C2410_GPG (10 ), + .ocr_avail =MMC_VDD_32_33 , +}; +static struct platform_device *n30_devices[]__initdata = { &s3c_device_lcd, &s3c_device_wdt,
@@ -358,6 +366,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_ohci, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n30_button_device, &n30_blue_led, &n30_warning_led,
@@ -370,6 +379,7 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_iis, &s3c_device_rtc, &s3c_device_usbgadget, + &s3c_device_sdi, &n35_button_device, &n35_blue_led, &n35_warning_led,
@@ -538,6 +548,7 @@ static void __init n30_init(void) {s3c24xx_fb_set_platdata (&n30_fb_info);s3c24xx_udc_set_platdata (&n30_udc_cfg); +s3c24xx_mci_set_platdata (&n30_mci_cfg);s3c_i2c0_set_platdata (&n30_i2ccfg);/* Turn off suspend on both USB ports, and switch the
Signature · 1 line
1.7.1
PATCH 7/8 Add support for power on/off on Acer n30 / Acer n35 MMC card reader
--- arch/arm/mach-s3c2410/mach-n30.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +15 -0
@@ -352,10 +352,25 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static void n30_sdi_set_power (unsigned char power_mode,unsigned short vdd) +{ +switch (power_mode) { +case MMC_POWER_ON : +case MMC_POWER_UP : +s3c2410_gpio_setpin (S3C2410_GPG (4 ),1 ); +break ; +case MMC_POWER_OFF : +default : +s3c2410_gpio_setpin (S3C2410_GPG (4 ),0 ); +break ; + } +} +static struct s3c24xx_mci_pdata n30_mci_cfg__initdata = { .gpio_detect =S3C2410_GPF (1 ), .gpio_wprotect =S3C2410_GPG (10 ), .ocr_avail =MMC_VDD_32_33 , + .set_power = n30_sdi_set_power, };static struct platform_device *n30_devices[]__initdata = {
Signature · 1 line
1.7.1
PATCH 8/8 Add support for backlight regulation on Acer n35
--- arch/arm/mach-s3c2410/mach-n30.c | 57 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +57 -0
@@ -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>
@@ -352,6 +353,60 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static int n35_backlight_init (struct device *dev) +{ +gpio_request (S3C2410_GPB (0 ),"Backlight PWM" ); +gpio_request (S3C2410_GPB (1 ),"Backlight power driver" ); + +/* set GPIO as output for timer */ +s3c2410_gpio_setpin (S3C2410_GPB (0 ),0 ); +s3c2410_gpio_pullup (S3C2410_GPB (0 ),0 ); +s3c2410_gpio_cfgpin (S3C2410_GPB (0 ),S3C2410_GPB0_TOUT0 ); + +/* setup backlight power driving GPIO */ +s3c2410_gpio_pullup (S3C2410_GPB (1 ),1 ); +s3c2410_gpio_cfgpin (S3C2410_GPB (1 ),S3C2410_GPIO_OUTPUT ); + +return 0 ; +} + +static int n35_backlight_notify (struct device *dev,int brightness) +{ +/* power off backlight, values less than 12 ar useless */ +s3c2410_gpio_setpin (S3C2410_GPB (1 ), brightness >12 ?1 :0 ); +return (brightness >12 ? brightness :0 ); +} + +static void n35_backlight_exit (struct device *dev) +{ +s3c2410_gpio_cfgpin (S3C2410_GPB (0 ),1 /*S3C2410_GPB0_OUTP*/ ); +s3c2410_gpio_setpin (S3C2410_GPB (1 ),0 );/* co stim */ +/* power off backlight */ +s3c2410_gpio_pullup (S3C2410_GPB (1 ),0 ); +gpio_free (S3C2410_GPB (1 )); +gpio_free (S3C2410_GPB (0 )); +} + +static struct platform_pwm_backlight_data backlight_data = { + .pwm_id =0 , + .max_brightness =100 , + .dft_brightness =50 , +/* tcnt = 0x31, FIXME: compute some nicer value */ + .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) {
@@ -395,6 +450,8 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_rtc, &s3c_device_usbgadget, &s3c_device_sdi, + &s3c_device_timer[0 ], + &n35_backlight, &n35_button_device, &n35_blue_led, &n35_warning_led,
Signature · 1 line
1.7.1
Acer n35 patches
All chenges are taken against 2.6.34-r6 kernel
Acer n35 patches
Quoted 1 line · Pinkava J.
All chenges are taken against 2.6.34-r6 kernel
2.6.34-rc6 should still have working gpio_set_value/gpio_direction_output calls in it, please update patch 8 to at-least use these.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
Acer n35 patches
I might update patches to use new GPIO infrastructure for S3C already in samsung-next (genecit s3c calls instead of s3c2410 GPIO calls)
Dne 7.5.2010 02:37, Ben Dooks napsal(a):
Quoted 6 lines · Pinkava J.
Quoted 1 line
All chenges are taken against 2.6.34-r6 kernel
2.6.34-rc6 should still have working gpio_set_value/gpio_direction_output calls in it, please update patch 8 to at-least use these.
PATCH 8/8 Add support for backlight regulation on Acer n35
In reply to Pinkava J.Quoted 1 line · Pinkava J.
would a description here hurt?
Quoted 24 lines
Signed-off-by Jiri Pinkava <[email protected]>--- arch/arm/mach-s3c2410/mach-n30.c | 57 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-)arch/arm/mach-s3c2410/mach-n30.c +4
-0@@ -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> @@ -352,6 +353,60 @@ static struct s3c2410fb_mach_info n30_fb_info __initdata = { .lpcsel = 0x06, }; +static int n35_backlight_init (struct device *dev) +{ +gpio_request (S3C2410_GPB (0 ),"Backlight PWM" );
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 368
Quoted 10 lines
arch/arm/mach-s3c2410/mach-n30.c +10
-0+gpio_request (S3C2410_GPB (1 ),"Backlight power driver" ); + +/* set GPIO as output for timer */ +s3c2410_gpio_setpin (S3C2410_GPB (0 ),0 ); +s3c2410_gpio_pullup (S3C2410_GPB (0 ),0 ); +s3c2410_gpio_cfgpin (S3C2410_GPB (0 ),S3C2410_GPB0_TOUT0 ); + +/* setup backlight power driving GPIO */ +s3c2410_gpio_pullup (S3C2410_GPB (1 ),1 ); +s3c2410_gpio_cfgpin (S3C2410_GPB (1 ),S3C2410_GPIO_OUTPUT );
I'm going to hold this one pending the merge of the gpio updates, since these calls are going away.
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 378
Quoted 9 lines
arch/arm/mach-s3c2410/mach-n30.c +9
-0+return 0 ; +} + +static int n35_backlight_notify (struct device *dev,int brightness) +{ +/* power off backlight, values less than 12 ar useless */ +s3c2410_gpio_setpin (S3C2410_GPB (1 ), brightness >12 ?1 :0 ); +return (brightness >12 ? brightness :0 ); +}
gpiolib calls here please.
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 382
Quoted 3 lines
arch/arm/mach-s3c2410/mach-n30.c +3
-0+static void n35_backlight_exit (struct device *dev) +{ +s3c2410_gpio_cfgpin (S3C2410_GPB (0 ),1 /*S3C2410_GPB0_OUTP*/ );
we have constants for generic output...
arch/arm/mach-s3c2410/mach-n30.c static struct s3c2410fb_mach_info n30_fb_info __initdata = { · line 383
Quoted 1 line
arch/arm/mach-s3c2410/mach-n30.c +1
-0+s3c2410_gpio_setpin (S3C2410_GPB (1 ),0 );/* co stim */
gpio_set_value().
Quoted 37 lines
arch/arm/mach-s3c2410/mach-n30.c +28
-0+/* power off backlight */ +s3c2410_gpio_pullup (S3C2410_GPB (1 ),0 ); +gpio_free (S3C2410_GPB (1 )); +gpio_free (S3C2410_GPB (0 )); +} + +static struct platform_pwm_backlight_data backlight_data = { + .pwm_id =0 , + .max_brightness =100 , + .dft_brightness =50 , +/* tcnt = 0x31, FIXME: compute some nicer value */ + .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) {@@ -395,6 +450,8 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_rtc, &s3c_device_usbgadget, &s3c_device_sdi, + &s3c_device_timer[0 ], + &n35_backlight, &n35_button_device, &n35_blue_led,
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 8/8 Add support for backlight regulation on Acer n35
Add support for backlight regulation on Acer n35 using generic PWM driver.
--- arch/arm/mach-s3c2410/mach-n30.c | 71 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2410/mach-n30.c +71 -0
@@ -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>
@@ -352,6 +353,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 ); +s3c2410_gpio_pullup (S3C2410_GPB (0 ),0 ); +s3c2410_gpio_cfgpin (S3C2410_GPB (0 ),S3C2410_GPB0_TOUT0 ); + +/* backlight power */ + ret =gpio_direction_output (S3C2410_GPB (1 ),1 ); +if (ret) + goto direction_gpb1_fail; +s3c2410_gpio_pullup (S3C2410_GPB (1 ),1 ); + +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 12 are useless */ +gpio_set_value (S3C2410_GPB (1 ), brightness >12 ?1 :0 ); +return (brightness >12 ? 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 ); +s3c2410_gpio_pullup (S3C2410_GPB (1 ),0 ); +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) {
@@ -395,6 +464,8 @@ static struct platform_device *n35_devices[] __initdata = { &s3c_device_rtc, &s3c_device_usbgadget, &s3c_device_sdi, + &s3c_device_timer[0 ], + &n35_backlight, &n35_button_device, &n35_blue_led, &n35_warning_led,
Signature · 1 line
1.7.1