changes from v1 to v2: Replace original patch [4] with generic leds-gpio driver.
Patch add new LCD panels with which was board produced. Also add touchscreen
support. Enabling LCD backlight during early booting stage also added.
Some code parts are collected or inspired from other code (authors are in CC).
Marek Belisko (4):
s3c2440: mini2440: Add support for new LCD panels.
s3c2440: mini2440: Add touchscreen support for mini2440.
s3c2440: mini2440: Select touchscreen by default.
s3c2440: mini2440: Use leds-gpio driver for board leds handling.
arch/arm/mach-s3c2440/Kconfig | 1 +
arch/arm/mach-s3c2440/mach-mini2440.c | 176 ++++++++++++++++++++-------------
2 files changed, 107 insertions(+), 70 deletions(-)
This patch add support for new mini2440 board LCD's:
3.5" TFT + TS (TD035STED4)
5.6" TFT (Innolux AT056TN52).
3.5" TFT + TS (SONY X35)
Values overtaken from mini2440 kernel:
git://repo.or.cz/linux-2.6/mini2440.git
and https://github.com/a1ien/mini2440-linux-kernel
Signed-off-by: Marek Belisko <[email protected]>
---
arch/arm/mach-s3c2440/mach-mini2440.c | 37 +++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index dfedc9c..ce152b4 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -167,6 +167,43 @@ static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
.lcdcon5 = (S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_HWSWP),
},
+ [3] = { /* mini2440 + 3.5" TFT + TS -- New model as Nov 2009 "T35" */
+ _LCD_DECLARE(
+ 7, /* The 3.5 is quite fast */
+ 240, 21, 25, 6, /* x timing */
+ 320, 2, 4, 2, /* y timing */
+ 40), /* refresh rate */
+ .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
+ S3C2410_LCDCON5_INVVLINE |
+ S3C2410_LCDCON5_INVVFRAME |
+ S3C2410_LCDCON5_INVVDEN |
+ S3C2410_LCDCON5_PWREN),
+ },
+ [4] = { /* mini2440 + 5.6" TFT + touchscreen -- Innolux AT056TN52 */
+ /* be sure the "power" jumper is set accordingly ! */
+ _LCD_DECLARE(
+ 10, /* the 5.3" runs slower */
+ 640, 41, 68, 22, /* x timing */
+ 480, 26, 6, 2, /* y timing */
+ 40), /* refresh rate */
+ .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
+ S3C2410_LCDCON5_INVVLINE |
+ S3C2410_LCDCON5_INVVFRAME |
+ S3C2410_LCDCON5_PWREN),
+ },
+ [5] = { /* mini2440 + 3,5" TFT + touchscreen -- SONY X35 */
+ _LCD_DECLARE(
+ 7,
+ 240, 1, 26, 5, /* x timing */
+ 320, 1, 5, 9, /* y timing */
+ 60), /* refresh rate */
+ .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
+ S3C2410_LCDCON5_INVVDEN |
+ S3C2410_LCDCON5_INVVFRAME |
+ S3C2410_LCDCON5_INVVLINE |
+ S3C2410_LCDCON5_INVVCLK |
+ S3C2410_LCDCON5_HWSWP),
+ },
};
/* todo - put into gpio header */
--
1.7.1
Signed-off-by: Marek Belisko <[email protected]>
---
arch/arm/mach-s3c2440/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 50825a3..e713eea 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -186,6 +186,7 @@ config MACH_MINI2440
select LEDS_TRIGGER_BACKLIGHT
select S3C_DEV_NAND
select S3C_DEV_USB_HOST
+ select TOUCHSCREEN_S3C2410
help
Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
available via various sources. It can come with a 3.5" or 7" touch LCD.
--
1.7.1
Intention of this patch is convert existing usage of leds-s3c24xx driver
to use generic gpio-leds driver. Leds are separated to 2 devices.
First device handle 4 available leds. Second device is used to drive
LCD backlight. Backlight can be controlled via parameter b so we need
separate device which is registered or not depending on parameter.
Signed-off-by: Marek Belisko <[email protected]>
---
arch/arm/mach-s3c2440/mach-mini2440.c | 122 +++++++++++++++------------------
1 files changed, 54 insertions(+), 68 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 163d318..2ebd70f 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -39,7 +39,6 @@
#include <plat/regs-serial.h>
#include <mach/regs-gpio.h>
-#include <mach/leds-gpio.h>
#include <mach/regs-mem.h>
#include <mach/regs-lcd.h>
#include <mach/irqs.h>
@@ -419,81 +418,71 @@ static struct platform_device mini2440_button_device = {
};
/* LEDS */
-
-static struct s3c24xx_led_platdata mini2440_led1_pdata = {
- .name = "led1",
- .gpio = S3C2410_GPB(5),
- .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
- .def_trigger = "heartbeat",
-};
-
-static struct s3c24xx_led_platdata mini2440_led2_pdata = {
- .name = "led2",
- .gpio = S3C2410_GPB(6),
- .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
- .def_trigger = "nand-disk",
-};
-
-static struct s3c24xx_led_platdata mini2440_led3_pdata = {
- .name = "led3",
- .gpio = S3C2410_GPB(7),
- .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
- .def_trigger = "mmc0",
-};
-
-static struct s3c24xx_led_platdata mini2440_led4_pdata = {
- .name = "led4",
- .gpio = S3C2410_GPB(8),
- .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
- .def_trigger = "",
-};
-
-static struct s3c24xx_led_platdata mini2440_led_backlight_pdata = {
- .name = "backlight",
- .gpio = S3C2410_GPG(4),
- .def_trigger = "backlight",
+static struct gpio_led gpio_leds[] = {
+ {
+ .name = "led1",
+ .gpio = S3C2410_GPB(5),
+ .active_low = 1,
+ .default_trigger = "heartbeat",
+ },
+ {
+ .name = "led2",
+ .gpio = S3C2410_GPB(6),
+ .active_low = 1,
+ .default_trigger = "nand-disk",
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "led3",
+ .gpio = S3C2410_GPB(7),
+ .active_low = 1,
+ .default_trigger = "mmc0",
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "led4",
+ .gpio = S3C2410_GPB(8),
+ .active_low = 1,
+ .default_trigger = "none",
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ }
};
-static struct platform_device mini2440_led1 = {
- .name = "s3c24xx_led",
- .id = 1,
- .dev = {
- .platform_data = &mini2440_led1_pdata,
- },
+static struct gpio_led backlight_led[] = {
+ {
+ .name = "backlight",
+ .gpio = S3C2410_GPG(4),
+ .active_low = 0,
+ .default_trigger = "backlight",
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }
};
-static struct platform_device mini2440_led2 = {
- .name = "s3c24xx_led",
- .id = 2,
- .dev = {
- .platform_data = &mini2440_led2_pdata,
- },
+static struct gpio_led_platform_data gpio_led_info = {
+ .leds = gpio_leds,
+ .num_leds = ARRAY_SIZE(gpio_leds),
};
-static struct platform_device mini2440_led3 = {
- .name = "s3c24xx_led",
- .id = 3,
- .dev = {
- .platform_data = &mini2440_led3_pdata,
- },
+static struct gpio_led_platform_data backlight_info = {
+ .leds = backlight_led,
+ .num_leds = ARRAY_SIZE(backlight_led),
};
-static struct platform_device mini2440_led4 = {
- .name = "s3c24xx_led",
- .id = 4,
- .dev = {
- .platform_data = &mini2440_led4_pdata,
- },
+static struct platform_device mini2440_leds = {
+ .name = "leds-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &gpio_led_info,
+ }
};
static struct platform_device mini2440_led_backlight = {
- .name = "s3c24xx_led",
- .id = 5,
- .dev = {
- .platform_data = &mini2440_led_backlight_pdata,
- },
+ .name = "leds-gpio",
+ .id = 1,
+ .dev = {
+ .platform_data = &backlight_info,
+ }
};
-
/* AUDIO */
static struct s3c24xx_uda134x_platform_data mini2440_audio_pins = {
@@ -543,10 +532,7 @@ static struct platform_device *mini2440_devices[] __initdata = {
&s3c_device_rtc,
&s3c_device_usbgadget,
&mini2440_device_eth,
- &mini2440_led1,
- &mini2440_led2,
- &mini2440_led3,
- &mini2440_led4,
+ &mini2440_leds,
&mini2440_button_device,
&s3c_device_nand,
&s3c_device_sdi,
--
1.7.1
Patch add support for mini2440 touchscreen.
Some code borrowed from:
git://repo.or.cz/linux-2.6/mini2440.git
Signed-off-by: Marek Belisko <[email protected]>
---
arch/arm/mach-s3c2440/mach-mini2440.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index ce152b4..163d318 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -47,6 +47,7 @@
#include <plat/iic.h>
#include <plat/mci.h>
#include <plat/udc.h>
+#include <plat/ts.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -530,6 +531,11 @@ static struct platform_device uda1340_codec = {
.id = -1,
};
+static struct s3c2410_ts_mach_info mini2440_ts_cfg __initdata = {
+ .delay = 10000,
+ .presc = 0xff, /* slow as we can go */
+};
+
static struct platform_device *mini2440_devices[] __initdata = {
&s3c_device_ohci,
&s3c_device_wdt,
@@ -548,6 +554,7 @@ static struct platform_device *mini2440_devices[] __initdata = {
&uda1340_codec,
&mini2440_audio,
&samsung_asoc_dma,
+ &s3c_device_adc,
};
static void __init mini2440_map_io(void)
@@ -631,8 +638,13 @@ static void mini2440_parse_features(
features->done |= FEATURE_BACKLIGHT;
break;
case 't':
- printk(KERN_INFO "MINI2440: '%c' ignored, "
- "touchscreen not compiled in\n", f);
+ if (features->done & FEATURE_TOUCH)
+ printk(KERN_INFO "MINI2440: '%c' ignored, "
+ "touchscreen already set\n", f);
+ else
+ features->optional[features->count++] =
+ &s3c_device_ts;
+ features->done |= FEATURE_TOUCH;
break;
case 'c':
if (features->done & FEATURE_CAMERA)
@@ -699,6 +711,7 @@ static void __init mini2440_init(void)
s3c24xx_mci_set_platdata(&mini2440_mmc_cfg);
s3c_nand_set_platdata(&mini2440_nand_info);
s3c_i2c0_set_platdata(NULL);
+ s3c24xx_ts_set_platdata(&mini2440_ts_cfg);
i2c_register_board_info(0, mini2440_i2c_devs,
ARRAY_SIZE(mini2440_i2c_devs));
--
1.7.1
On Wed, Apr 6, 2011 at 3:01 PM, Marek Belisko
<[email protected]> wrote:
> changes from v1 to v2: Replace original patch [4] with generic leds-gpio driver.
>
> Patch add new LCD panels with which was board produced. Also add touchscreen
> support. Enabling LCD backlight during early booting stage also added.
>
> Some code parts are collected or inspired from other code (authors are in CC).
>
> Marek Belisko (4):
> s3c2440: mini2440: Add support for new LCD panels.
> s3c2440: mini2440: Add touchscreen support for mini2440.
> s3c2440: mini2440: Select touchscreen by default.
> s3c2440: mini2440: Use leds-gpio driver for board leds handling.
>
> arch/arm/mach-s3c2440/Kconfig | 1 +
> arch/arm/mach-s3c2440/mach-mini2440.c | 176 ++++++++++++++++++++-------------
> 2 files changed, 107 insertions(+), 70 deletions(-)
Sorry but I received no objections on this patches (no objections for
any patch previously send to mach-mini2440).
Ben could you please apply this serie to get full mini2440 support
mainstream or?
>
>
thanks,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com