linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] Enable Acer n35 architecture if Acer n30 is selected
@ 2010-05-05 22:06 Pinkava J.
  2010-05-05 22:12 ` [PATCH 2/9] fix: suspended wrong USB port on Acer n35 Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:06 UTC (permalink / raw)
  To: linux-arm-kernel

All code already present for Acer n35 is useless unless MACH_N35 is defined.

Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/Kconfig |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 5547318..2b5a33f 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 2/9] fix: suspended wrong USB port on Acer n35
  2010-05-05 22:06 [PATCH 1/9] Enable Acer n35 architecture if Acer n30 is selected Pinkava J.
@ 2010-05-05 22:12 ` Pinkava J.
  2010-05-05 22:13   ` [PATCH 3/9] Add RTC platform device for Acer n30 / " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:12 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 684710f..1b635fd 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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));
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 3/9] Add RTC platform device for Acer n30 / Acer n35
  2010-05-05 22:12 ` [PATCH 2/9] fix: suspended wrong USB port on Acer n35 Pinkava J.
@ 2010-05-05 22:13   ` Pinkava J.
  2010-05-05 22:17     ` [PATCH 4/9] Add support for blue LED on " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:13 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 1b635fd..ce1172e 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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,
 };
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 4/9] Add support for blue LED on Acer n35
  2010-05-05 22:13   ` [PATCH 3/9] Add RTC platform device for Acer n30 / " Pinkava J.
@ 2010-05-05 22:17     ` Pinkava J.
  2010-05-05 22:17       ` [PATCH 5/9] Add support for red flashing " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:17 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index ce1172e..aeabbff 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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 = {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 5/9] Add support for red flashing LED on Acer n35
  2010-05-05 22:17     ` [PATCH 4/9] Add support for blue LED on " Pinkava J.
@ 2010-05-05 22:17       ` Pinkava J.
  2010-05-05 22:18         ` [PATCH 6/9] Enable wake-up by Power button " Pinkava J.
  2010-05-06  1:22         ` [PATCH 5/9] Add support for red flashing LED on " Ben Dooks
  0 siblings, 2 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:17 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index aeabbff..b83eabd 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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 = {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 6/9] Enable wake-up by Power button on Acer n35
  2010-05-05 22:17       ` [PATCH 5/9] Add support for red flashing " Pinkava J.
@ 2010-05-05 22:18         ` Pinkava J.
  2010-05-05 22:20           ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / " Pinkava J.
  2010-05-06  1:22         ` [PATCH 5/9] Add support for red flashing LED on " Ben Dooks
  1 sibling, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:18 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index b83eabd..d63b48f 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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),
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 7/9] Add support for MMC card reader on Acer n30 / Acer n35
  2010-05-05 22:18         ` [PATCH 6/9] Enable wake-up by Power button " Pinkava J.
@ 2010-05-05 22:20           ` Pinkava J.
  2010-05-05 22:22             ` [PATCH 8/9] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
  2010-05-06  1:23             ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / Acer n35 Ben Dooks
  0 siblings, 2 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:20 UTC (permalink / raw)
  To: linux-arm-kernel

There is MMC (SD) card reader. Works fine.


Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index d63b48f..389b9f2 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 8/9] Add support for power on/off on Acer n30 / Acer n35 MMC card reader
  2010-05-05 22:20           ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / " Pinkava J.
@ 2010-05-05 22:22             ` Pinkava J.
  2010-05-06  1:23             ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / Acer n35 Ben Dooks
  1 sibling, 0 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-05 22:22 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 389b9f2..4b2a708 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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,
 };

-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 5/9] Add support for red flashing LED on Acer n35
  2010-05-05 22:17       ` [PATCH 5/9] Add support for red flashing " Pinkava J.
  2010-05-05 22:18         ` [PATCH 6/9] Enable wake-up by Power button " Pinkava J.
@ 2010-05-06  1:22         ` Ben Dooks
  2010-05-06 13:18           ` [PATCH 1/8] Enable Acer n35 architecture if Acer n30 is selected Pinkava J.
  1 sibling, 1 reply; 23+ messages in thread
From: Ben Dooks @ 2010-05-06  1:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 06, 2010 at 12:17:48AM +0200, Pinkava J. wrote:
> 

how about one patch for all the leds?
 
> Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
> ---
>  arch/arm/mach-s3c2410/mach-n30.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
> index aeabbff..b83eabd 100644
> --- a/arch/arm/mach-s3c2410/mach-n30.c
> +++ b/arch/arm/mach-s3c2410/mach-n30.c
> @@ -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 = {
> -- 
> 1.7.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 7/9] Add support for MMC card reader on Acer n30 / Acer n35
  2010-05-05 22:20           ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / " Pinkava J.
  2010-05-05 22:22             ` [PATCH 8/9] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
@ 2010-05-06  1:23             ` Ben Dooks
  1 sibling, 0 replies; 23+ messages in thread
From: Ben Dooks @ 2010-05-06  1:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 06, 2010 at 12:20:55AM +0200, Pinkava J. wrote:
> There is MMC (SD) card reader. Works fine.
> 
> 
> Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
> ---
>  arch/arm/mach-s3c2410/mach-n30.c |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
> index d63b48f..389b9f2 100644
> --- a/arch/arm/mach-s3c2410/mach-n30.c
> +++ b/arch/arm/mach-s3c2410/mach-n30.c
> @@ -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,

no need for '0' initialisers here.

> +	.gpio_detect	= S3C2410_GPF(1),
> +	.gpio_wprotect  = S3C2410_GPG(10),
> +	.set_power	= NULL,

no need to have 'NULL' here.

> +	.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
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1/8] Enable Acer n35 architecture if Acer n30 is selected
  2010-05-06  1:22         ` [PATCH 5/9] Add support for red flashing LED on " Ben Dooks
@ 2010-05-06 13:18           ` Pinkava J.
  2010-05-06 13:19             ` [PATCH 2/8] fix: suspended wrong USB port on Acer n35 Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

All code already present for Acer n35 is useless unless MACH_N35 is defined.


Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/Kconfig |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 5547318..2b5a33f 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 2/8] fix: suspended wrong USB port on Acer n35
  2010-05-06 13:18           ` [PATCH 1/8] Enable Acer n35 architecture if Acer n30 is selected Pinkava J.
@ 2010-05-06 13:19             ` Pinkava J.
  2010-05-06 13:20               ` [PATCH 3/8] Add RTC platform device for Acer n30 / " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

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.


Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 684710f..1b635fd 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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));
 	}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 3/8] Add RTC platform device for Acer n30 / Acer n35
  2010-05-06 13:19             ` [PATCH 2/8] fix: suspended wrong USB port on Acer n35 Pinkava J.
@ 2010-05-06 13:20               ` Pinkava J.
  2010-05-06 13:21                 ` [PATCH 4/8] Add support for LEDs on " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:20 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 1b635fd..ce1172e 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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,
 };
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 4/8] Add support for LEDs on Acer n35
  2010-05-06 13:20               ` [PATCH 3/8] Add RTC platform device for Acer n30 / " Pinkava J.
@ 2010-05-06 13:21                 ` Pinkava J.
  2010-05-06 13:21                   ` [PATCH 5/8] Enable wake-up by Power button " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:21 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index ce1172e..b83eabd 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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 = {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 5/8] Enable wake-up by Power button on Acer n35
  2010-05-06 13:21                 ` [PATCH 4/8] Add support for LEDs on " Pinkava J.
@ 2010-05-06 13:21                   ` Pinkava J.
  2010-05-06 13:22                     ` [PATCH 6/8] Add support for MMC card reader on Acer n30 / " Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:21 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index b83eabd..d63b48f 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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),
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 6/8] Add support for MMC card reader on Acer n30 / Acer n35
  2010-05-06 13:21                   ` [PATCH 5/8] Enable wake-up by Power button " Pinkava J.
@ 2010-05-06 13:22                     ` Pinkava J.
  2010-05-06 13:23                       ` [PATCH 7/8] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:22 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index d63b48f..81973aa 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 7/8] Add support for power on/off on Acer n30 / Acer n35 MMC card reader
  2010-05-06 13:22                     ` [PATCH 6/8] Add support for MMC card reader on Acer n30 / " Pinkava J.
@ 2010-05-06 13:23                       ` Pinkava J.
  2010-05-06 13:24                         ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:23 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 81973aa..f25275e 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -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 = {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 8/8] Add support for backlight regulation on Acer n35
  2010-05-06 13:23                       ` [PATCH 7/8] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
@ 2010-05-06 13:24                         ` Pinkava J.
  2010-05-06 13:39                           ` Acer n35 patches Pinkava J.
  2010-05-07  0:35                           ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Ben Dooks
  0 siblings, 2 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:24 UTC (permalink / raw)
  To: linux-arm-kernel



Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
---
 arch/arm/mach-s3c2410/mach-n30.c |   57 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index f25275e..4c37c71 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>
@@ -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,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Acer n35 patches
  2010-05-06 13:24                         ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Pinkava J.
@ 2010-05-06 13:39                           ` Pinkava J.
  2010-05-07  0:37                             ` Ben Dooks
  2010-05-07  0:35                           ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Ben Dooks
  1 sibling, 1 reply; 23+ messages in thread
From: Pinkava J. @ 2010-05-06 13:39 UTC (permalink / raw)
  To: linux-arm-kernel

All chenges are taken against 2.6.34-r6 kernel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 8/8] Add support for backlight regulation on Acer n35
  2010-05-06 13:24                         ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Pinkava J.
  2010-05-06 13:39                           ` Acer n35 patches Pinkava J.
@ 2010-05-07  0:35                           ` Ben Dooks
  2010-05-12 13:18                             ` Pinkava J.
  1 sibling, 1 reply; 23+ messages in thread
From: Ben Dooks @ 2010-05-07  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 06, 2010 at 03:24:15PM +0200, Pinkava J. wrote:
> 

would a description here hurt?

 
> Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz>
> ---
>  arch/arm/mach-s3c2410/mach-n30.c |   57 ++++++++++++++++++++++++++++++++++++++
>  1 files changed, 57 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
> index f25275e..4c37c71 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>
> @@ -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);

I'm going to hold this one pending the merge of the gpio updates, since
these calls are going away.

> +	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.

> +static void n35_backlight_exit(struct device *dev)
> +{
> +	s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/);
we have constants for generic output...

> +	s3c2410_gpio_setpin(S3C2410_GPB(1), 0); /* co stim */
gpio_set_value().

> +	/* 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,

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Acer n35 patches
  2010-05-06 13:39                           ` Acer n35 patches Pinkava J.
@ 2010-05-07  0:37                             ` Ben Dooks
  2010-05-12 13:26                               ` Pinkava J.
  0 siblings, 1 reply; 23+ messages in thread
From: Ben Dooks @ 2010-05-07  0:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 06, 2010 at 03:39:20PM +0200, Pinkava J. wrote:
> 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.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 8/8] Add support for backlight regulation on Acer n35
  2010-05-07  0:35                           ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Ben Dooks
@ 2010-05-12 13:18                             ` Pinkava J.
  0 siblings, 0 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-12 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for backlight regulation on Acer n35 using generic PWM driver.

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 f25275e..efa7fa8 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>
@@ -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,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Acer n35 patches
  2010-05-07  0:37                             ` Ben Dooks
@ 2010-05-12 13:26                               ` Pinkava J.
  0 siblings, 0 replies; 23+ messages in thread
From: Pinkava J. @ 2010-05-12 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

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):
> On Thu, May 06, 2010 at 03:39:20PM +0200, Pinkava J. wrote:
>> 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.
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2010-05-12 13:26 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05 22:06 [PATCH 1/9] Enable Acer n35 architecture if Acer n30 is selected Pinkava J.
2010-05-05 22:12 ` [PATCH 2/9] fix: suspended wrong USB port on Acer n35 Pinkava J.
2010-05-05 22:13   ` [PATCH 3/9] Add RTC platform device for Acer n30 / " Pinkava J.
2010-05-05 22:17     ` [PATCH 4/9] Add support for blue LED on " Pinkava J.
2010-05-05 22:17       ` [PATCH 5/9] Add support for red flashing " Pinkava J.
2010-05-05 22:18         ` [PATCH 6/9] Enable wake-up by Power button " Pinkava J.
2010-05-05 22:20           ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / " Pinkava J.
2010-05-05 22:22             ` [PATCH 8/9] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
2010-05-06  1:23             ` [PATCH 7/9] Add support for MMC card reader on Acer n30 / Acer n35 Ben Dooks
2010-05-06  1:22         ` [PATCH 5/9] Add support for red flashing LED on " Ben Dooks
2010-05-06 13:18           ` [PATCH 1/8] Enable Acer n35 architecture if Acer n30 is selected Pinkava J.
2010-05-06 13:19             ` [PATCH 2/8] fix: suspended wrong USB port on Acer n35 Pinkava J.
2010-05-06 13:20               ` [PATCH 3/8] Add RTC platform device for Acer n30 / " Pinkava J.
2010-05-06 13:21                 ` [PATCH 4/8] Add support for LEDs on " Pinkava J.
2010-05-06 13:21                   ` [PATCH 5/8] Enable wake-up by Power button " Pinkava J.
2010-05-06 13:22                     ` [PATCH 6/8] Add support for MMC card reader on Acer n30 / " Pinkava J.
2010-05-06 13:23                       ` [PATCH 7/8] Add support for power on/off on Acer n30 / Acer n35 MMC card reader Pinkava J.
2010-05-06 13:24                         ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Pinkava J.
2010-05-06 13:39                           ` Acer n35 patches Pinkava J.
2010-05-07  0:37                             ` Ben Dooks
2010-05-12 13:26                               ` Pinkava J.
2010-05-07  0:35                           ` [PATCH 8/8] Add support for backlight regulation on Acer n35 Ben Dooks
2010-05-12 13:18                             ` Pinkava J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).