Signed-off-by: Marek Belisko <marek....@open-nandra.com>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Use flag that allows s3c24xx LED to start in the "on" state.
This is necesary to enable LCD backlight during early boot stage.
Signed-off-by: Marek Belisko <marek....@open-nandra.com>
Signed-off-by: Michel Pollet <buse...@gmail.com>
---
arch/arm/mach-s3c2410/include/mach/leds-gpio.h | 1 +
arch/arm/mach-s3c2440/mach-mini2440.c | 1 +
drivers/leds/leds-s3c24xx.c | 6 +++++-
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h b/arch/arm/mach-s3c2410/include/mach/leds-gpio.h
index d8a7672..c3ae81f 100644
--- a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/leds-gpio.h
@@ -16,6 +16,7 @@
#define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */
#define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */
+#define S3C24XX_LEDF_STARTON (1<<2) /* Initialise 'on' */
struct s3c24xx_led_platdata {
unsigned int gpio;
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 163d318..46f2034 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -451,6 +451,7 @@ static struct s3c24xx_led_platdata mini2440_led4_pdata = {
static struct s3c24xx_led_platdata mini2440_led_backlight_pdata = {
.name = "backlight",
.gpio = S3C2410_GPG(4),
+ .flags = S3C24XX_LEDF_STARTON,
.def_trigger = "backlight",
};
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index a77771d..42d0a08 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -95,7 +95,11 @@ static int s3c24xx_led_probe(struct platform_device *dev)
s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_INPUT);
} else {
s3c2410_gpio_pullup(pdata->gpio, 0);
- s3c2410_gpio_setpin(pdata->gpio, 0);
+
+ if (pdata->flags & S3C24XX_LEDF_STARTON)
+ s3c2410_gpio_setpin(pdata->gpio, 1);
+ else
+ s3c2410_gpio_setpin(pdata->gpio, 0);
s3c2410_gpio_cfgpin(pdata->gpio, S3C2410_GPIO_OUTPUT);
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: Enable the backlight LED earlier at boot time.
arch/arm/mach-s3c2410/include/mach/leds-gpio.h | 1 +
arch/arm/mach-s3c2440/Kconfig | 1 +
arch/arm/mach-s3c2440/mach-mini2440.c | 55 +++++++++++++++++++++++-
drivers/leds/leds-s3c24xx.c | 6 ++-
4 files changed, 60 insertions(+), 3 deletions(-)
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 <marek....@open-nandra.com>
---
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
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
Actually, I'm not in CC, and most of this was from my own mini2440
tree on repo.or.cz, I'm also listed as maintainer at the bottom of the
mach-mini2440.c file.
Michael
regards,
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
regards,
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
Why are you still using leds-s3c24xx driver? mini2440 should work OK with
leds-gpio. Anyway, looks like patch should be splitted into 2 patches: first
adds flag to leds-s3c24xx driver, second enables this flag for mini2440.
Regards
Vasily
> Signed-off-by: Marek Belisko <marek....@open-nandra.com>
> Signed-off-by: Michel Pollet <buse...@gmail.com>
> ---
> arch/arm/mach-s3c2410/include/mach/leds-gpio.h | 1 +
> arch/arm/mach-s3c2440/mach-mini2440.c | 1 +
> drivers/leds/leds-s3c24xx.c | 6 +++++-
> 3 files changed, 7 insertions(+), 1 deletions(-)
Signed-off-by: Marek Belisko <marek....@open-nandra.com>
---
arch/arm/mach-s3c2440/mach-mini2440.c | 121 +++++++++++++++------------------
1 files changed, 54 insertions(+), 67 deletions(-)
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 163d318..28ef6eb 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -419,81 +419,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 +533,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
You also need to remove mach/leds-gpio.h include, you don't need it anymore,
right? Rest part looks good for me.
Regards
Vasily
Signed-off-by: Marek Belisko <marek....@open-nandra.com>
---
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 = {
@@ -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 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(-)
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 <marek....@open-nandra.com>
---
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
--
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
--
Signed-off-by: Marek Belisko <marek....@open-nandra.com>
---
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 = {
--
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