* [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support
@ 2011-09-09 18:01 Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata Ajay Kumar
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
The patches are created against "for-next" branch of Kukjin Kim's tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
Changes since V1:
- Remove mach/regs-fb.h, instead use plat/regs-fb.h.
- Add common pdata for FB and LCD in SMDK6440 and SMDK6450.
- Modify names(s5p-->smdk), max_bpp and refresh rate.
- Modify variable name(cfg-->chipid).
- Use __raw_readl, __raw_writel instead of readl and writel.
Changes since V2:
-Change name of the config-COMMON_FB to SMDK64X0_COMMON_FB.
-Change filename common-fb.h to smdk64x0-common-fb.h.
-Change filename common-fb.c to smdk64x0-common-fb.c.
Changes since V3:
-Add FB and LCD plat-data in corresponding machine files
instead of creating common file smdk64x0-common-fb.c.
-Modify name S5P64X0_SETUP_FB to S5P64X0_SETUP_FB_24BPP.
-Modify file name setup-fb.c to setup-fb-24bpp.c.
-Move SPCON settings to machine file.
-Use soc_is_s5p6440()/soc_is_s5p6450() to check CPU ID.
These patches have dependency on the patch
"ARM: S5P64X0: Fix mask value for S5P64X0 CPU IDs"
at http://www.spinics.net/lists/arm-kernel/msg138990.html
o To Florian,
[PATCH RESEND V4 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata
o To Kukjin,
[PATCH RESEND V4 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer
[PATCH RESEND V4 3/6] ARM: S5P64X0: Set s3c_device_fb name
[PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD
[PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support
[PATCH V4 6/6] ARM: S5P6450: Add LCD-LTE480 and enable Framebuffer support
arch/arm/mach-s5p64x0/Kconfig | 10 +++
arch/arm/mach-s5p64x0/Makefile | 1 +
arch/arm/mach-s5p64x0/cpu.c | 3 +
arch/arm/mach-s5p64x0/include/mach/irqs.h | 4 +
arch/arm/mach-s5p64x0/include/mach/map.h | 3 +
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 +
arch/arm/mach-s5p64x0/mach-smdk6440.c | 75 +++++++++++++++++++++++
arch/arm/mach-s5p64x0/mach-smdk6450.c | 76 ++++++++++++++++++++++++
arch/arm/mach-s5p64x0/setup-fb-24bpp.c | 29 +++++++++
arch/arm/plat-samsung/include/plat/fb.h | 7 ++
drivers/video/s3c-fb.c | 27 ++++++++
11 files changed, 239 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s5p64x0/setup-fb-24bpp.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V4 RESEND 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer Ajay Kumar
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
This patch:
-- Adds s3c_fb_driverdata for S5P64X0, which supports 3 windows.
-- Also, register "s5p64x0-fb" type driver_data.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
---
drivers/video/s3c-fb.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 4aecf21..0fda252 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1859,6 +1859,30 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
},
};
+static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = {
+ .variant = {
+ .nr_windows = 3,
+ .vidtcon = VIDTCON0,
+ .wincon = WINCON(0),
+ .winmap = WINxMAP(0),
+ .keycon = WKEYCON,
+ .osd = VIDOSD_BASE,
+ .osd_stride = 16,
+ .buf_start = VIDW_BUF_START(0),
+ .buf_size = VIDW_BUF_SIZE(0),
+ .buf_end = VIDW_BUF_END(0),
+
+ .palette = {
+ [0] = 0x2400,
+ [1] = 0x2800,
+ [2] = 0x2c00,
+ },
+ },
+ .win[0] = &s3c_fb_data_s5p_wins[0],
+ .win[1] = &s3c_fb_data_s5p_wins[1],
+ .win[2] = &s3c_fb_data_s5p_wins[2],
+};
+
static struct platform_device_id s3c_fb_driver_ids[] = {
{
.name = "s3c-fb",
@@ -1872,6 +1896,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
}, {
.name = "s3c2443-fb",
.driver_data = (unsigned long)&s3c_fb_data_s3c2443,
+ }, {
+ .name = "s5p64x0-fb",
+ .driver_data = (unsigned long)&s3c_fb_data_s5p64x0,
},
{},
};
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 RESEND 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 3/6] ARM: S5P64X0: Set s3c_device_fb name Ajay Kumar
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds:
-- Framebuffer related register mappings and bit fields.
-- IRQ number being used.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
arch/arm/mach-s5p64x0/include/mach/irqs.h | 4 ++++
arch/arm/mach-s5p64x0/include/mach/map.h | 3 +++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-s5p64x0/include/mach/irqs.h
index 5837a36..53982db 100644
--- a/arch/arm/mach-s5p64x0/include/mach/irqs.h
+++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h
@@ -87,6 +87,10 @@
#define IRQ_I2S0 IRQ_I2SV40
+#define IRQ_LCD_FIFO IRQ_DISPCON0
+#define IRQ_LCD_VSYNC IRQ_DISPCON1
+#define IRQ_LCD_SYSTEM IRQ_DISPCON2
+
/* S5P6450 EINT feature will be added */
/*
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h
index 95c9125..c5ef50c 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -47,6 +47,8 @@
#define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
+#define S5P64X0_PA_FB 0xEE000000
+
#define S5P64X0_PA_I2S 0xF2000000
#define S5P6450_PA_I2S1 0xF2800000
#define S5P6450_PA_I2S2 0xF2900000
@@ -64,6 +66,7 @@
#define S3C_PA_IIC1 S5P6440_PA_IIC1
#define S3C_PA_RTC S5P64X0_PA_RTC
#define S3C_PA_WDT S5P64X0_PA_WDT
+#define S3C_PA_FB S5P64X0_PA_FB
#define S5P_PA_CHIPID S5P64X0_PA_CHIPID
#define S5P_PA_SROMC S5P64X0_PA_SROMC
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 RESEND 3/6] ARM: S5P64X0: Set s3c_device_fb name
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD Ajay Kumar
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
Set s3c_device_fb name as "s5p64x0-fb" for S5P6440 and S5P6450.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
arch/arm/mach-s5p64x0/cpu.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
index a5c0095..617da3b 100644
--- a/arch/arm/mach-s5p64x0/cpu.c
+++ b/arch/arm/mach-s5p64x0/cpu.c
@@ -38,6 +38,7 @@
#include <plat/s5p6440.h>
#include <plat/s5p6450.h>
#include <plat/adc-core.h>
+#include <plat/fb-core.h>
/* Initial IO mappings */
@@ -108,6 +109,7 @@ void __init s5p6440_map_io(void)
{
/* initialize any device information early */
s3c_adc_setname("s3c64xx-adc");
+ s3c_fb_setname("s5p64x0-fb");
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
@@ -117,6 +119,7 @@ void __init s5p6450_map_io(void)
{
/* initialize any device information early */
s3c_adc_setname("s3c64xx-adc");
+ s3c_fb_setname("s5p64x0-fb");
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
` (2 preceding siblings ...)
2011-09-09 18:01 ` [PATCH V4 RESEND 3/6] ARM: S5P64X0: Set s3c_device_fb name Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 6/6] ARM: S5P6450: " Ajay Kumar
5 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
arch/arm/mach-s5p64x0/Kconfig | 6 ++++++
arch/arm/mach-s5p64x0/Makefile | 1 +
arch/arm/mach-s5p64x0/setup-fb-24bpp.c | 29 +++++++++++++++++++++++++++++
arch/arm/plat-samsung/include/plat/fb.h | 7 +++++++
4 files changed, 43 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s5p64x0/setup-fb-24bpp.c
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 65c7518..7bec400 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -21,6 +21,12 @@ config CPU_S5P6450
help
Enable S5P6450 CPU support
+config S5P64X0_SETUP_FB_24BPP
+ bool
+ help
+ Common setup code for S5P64X0 based boards with a LCD display
+ through RGB interface.
+
config S5P64X0_SETUP_I2C1
bool
help
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index 5f6afdf..1bf54b2 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -28,3 +28,4 @@ obj-y += dev-audio.o
obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o
+obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
diff --git a/arch/arm/mach-s5p64x0/setup-fb-24bpp.c b/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
new file mode 100644
index 0000000..f346ee4
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
@@ -0,0 +1,29 @@
+/* linux/arch/arm/mach-s5p64x0/setup-fb-24bpp.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * Base S5P64X0 GPIO setup information for LCD framebuffer
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <linux/fb.h>
+#include <linux/gpio.h>
+
+#include <plat/cpu.h>
+#include <plat/fb.h>
+#include <plat/gpio-cfg.h>
+
+void s5p64x0_fb_gpio_setup_24bpp(void)
+{
+ if (soc_is_s5p6440()) {
+ s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12, S3C_GPIO_SFN(2));
+ } else if (soc_is_s5p6450()) {
+ s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16, S3C_GPIO_SFN(2));
+ s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12, S3C_GPIO_SFN(2));
+ }
+}
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index 01f10e4..0fedf47 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -109,4 +109,11 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);
*/
extern void exynos4_fimd0_gpio_setup_24bpp(void);
+/**
+ * s5p64x0_fb_gpio_setup_24bpp() - S5P6440/S5P6450 setup function for 24bpp LCD
+ *
+ * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
+ */
+extern void s5p64x0_fb_gpio_setup_24bpp(void);
+
#endif /* __PLAT_S3C_FB_H */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
` (3 preceding siblings ...)
2011-09-09 18:01 ` [PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
2011-09-14 13:06 ` Kukjin Kim
2011-09-09 18:01 ` [PATCH V4 6/6] ARM: S5P6450: " Ajay Kumar
5 siblings, 1 reply; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
This patch:
-- Adds platform device support for LCD-LTE480.
-- Adds platform data for FB with win_mode and default_bpp.
-- Enables FB device support and platform-lcd support.
-- Adds SPCON settings for LCD.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
arch/arm/mach-s5p64x0/Kconfig | 2 +
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 +
arch/arm/mach-s5p64x0/mach-smdk6440.c | 75 ++++++++++++++++++++++++
3 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 7bec400..3adc4b8 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -37,6 +37,7 @@ config S5P64X0_SETUP_I2C1
config MACH_SMDK6440
bool "SMDK6440"
select CPU_S5P6440
+ select S3C_DEV_FB
select S3C_DEV_I2C1
select S3C_DEV_RTC
select S3C_DEV_WDT
@@ -45,6 +46,7 @@ config MACH_SMDK6440
select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
+ select S5P64X0_SETUP_FB_24BPP
select S5P64X0_SETUP_I2C1
help
Machine support for the Samsung SMDK6440
diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
index 6ce2547..88269ec 100644
--- a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
@@ -34,6 +34,10 @@
#define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180)
#define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300)
+#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0)
+#define S5P64X0_SPCON0_LCD_SEL_MASK (0x3 << 0)
+#define S5P64X0_SPCON0_LCD_SEL_RGB (0x1 << 0)
+
/* External interrupt control registers for group0 */
#define EINT0CON0_OFFSET (0x900)
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 340f30f..03933d7 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -23,6 +23,9 @@
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/pwm_backlight.h>
+#include <linux/fb.h>
+
+#include <video/platform_lcd.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -47,6 +50,8 @@
#include <plat/ts.h>
#include <plat/s5p-time.h>
#include <plat/backlight.h>
+#include <plat/fb.h>
+#include <plat/regs-fb.h>
#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
S3C2410_UCON_RXILEVEL | \
@@ -92,6 +97,60 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
},
};
+/* Frame Buffer */
+static struct s3c_fb_pd_win smdk6440_fb_win0 = {
+ .win_mode = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+ .refresh = 60,
+ },
+ .max_bpp = 32,
+ .default_bpp = 24,
+};
+
+static struct s3c_fb_platdata smdk6440_lcd_pdata __initdata = {
+ .win[0] = &smdk6440_fb_win0,
+ .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+ .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
+ .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
+};
+
+/* LCD power controller */
+static void smdk6440_lte480_reset_power(struct plat_lcd_data *pd,
+ unsigned int power)
+{
+ int err;
+
+ if (power) {
+ err = gpio_request(S5P6440_GPN(5), "GPN");
+ if (err) {
+ printk(KERN_ERR "failed to request GPN for lcd reset\n");
+ return;
+ }
+
+ gpio_direction_output(S5P6440_GPN(5), 1);
+ gpio_set_value(S5P6440_GPN(5), 0);
+ gpio_set_value(S5P6440_GPN(5), 1);
+ gpio_free(S5P6440_GPN(5));
+ }
+}
+
+static struct plat_lcd_data smdk6440_lcd_power_data = {
+ .set_power = smdk6440_lte480_reset_power,
+};
+
+static struct platform_device smdk6440_lcd_lte480wv = {
+ .name = "platform-lcd",
+ .dev.parent = &s3c_device_fb.dev,
+ .dev.platform_data = &smdk6440_lcd_power_data,
+};
+
static struct platform_device *smdk6440_devices[] __initdata = {
&s3c_device_adc,
&s3c_device_rtc,
@@ -101,6 +160,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
&s3c_device_wdt,
&samsung_asoc_dma,
&s5p6440_device_iis,
+ &s3c_device_fb,
+ &smdk6440_lcd_lte480wv,
};
static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -147,6 +208,17 @@ static void __init smdk6440_map_io(void)
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
}
+static void s5p6440_set_lcd_interface()
+{
+ unsigned int cfg;
+
+ /* select TFT LCD type (RGB I/F) */
+ cfg = __raw_readl(S5P64X0_SPCON0);
+ cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
+ cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
+ __raw_writel(cfg, S5P64X0_SPCON0);
+}
+
static void __init smdk6440_machine_init(void)
{
s3c24xx_ts_set_platdata(NULL);
@@ -160,6 +232,9 @@ static void __init smdk6440_machine_init(void)
samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
+ s5p6440_set_lcd_interface();
+ s3c_fb_set_platdata(&smdk6440_lcd_pdata);
+
platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 6/6] ARM: S5P6450: Add LCD-LTE480 and enable Framebuffer support
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
` (4 preceding siblings ...)
2011-09-09 18:01 ` [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support Ajay Kumar
@ 2011-09-09 18:01 ` Ajay Kumar
5 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar @ 2011-09-09 18:01 UTC (permalink / raw)
To: linux-arm-kernel
This patch:
-- Adds platform device support for LCD-LTE480.
-- Adds platform data for FB with win_mode and default_bpp.
-- Enables FB device support and platform-lcd support.
-- Adds SPCON settings for LCD.
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
arch/arm/mach-s5p64x0/Kconfig | 2 +
arch/arm/mach-s5p64x0/mach-smdk6450.c | 76 +++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 3adc4b8..ecb4e44 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -54,6 +54,7 @@ config MACH_SMDK6440
config MACH_SMDK6450
bool "SMDK6450"
select CPU_S5P6450
+ select S3C_DEV_FB
select S3C_DEV_I2C1
select S3C_DEV_RTC
select S3C_DEV_WDT
@@ -62,6 +63,7 @@ config MACH_SMDK6450
select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
+ select S5P64X0_SETUP_FB_24BPP
select S5P64X0_SETUP_I2C1
help
Machine support for the Samsung SMDK6450
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index ee0da14..fea249e 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -23,6 +23,9 @@
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/pwm_backlight.h>
+#include <linux/fb.h>
+
+#include <video/platform_lcd.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -47,6 +50,8 @@
#include <plat/ts.h>
#include <plat/s5p-time.h>
#include <plat/backlight.h>
+#include <plat/fb.h>
+#include <plat/regs-fb.h>
#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
S3C2410_UCON_RXILEVEL | \
@@ -110,6 +115,60 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
#endif
};
+/* Frame Buffer */
+static struct s3c_fb_pd_win smdk6450_fb_win0 = {
+ .win_mode = {
+ .left_margin = 8,
+ .right_margin = 13,
+ .upper_margin = 7,
+ .lower_margin = 5,
+ .hsync_len = 3,
+ .vsync_len = 1,
+ .xres = 800,
+ .yres = 480,
+ .refresh = 60,
+ },
+ .max_bpp = 32,
+ .default_bpp = 24,
+};
+
+static struct s3c_fb_platdata smdk6450_lcd_pdata __initdata = {
+ .win[0] = &smdk6450_fb_win0,
+ .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+ .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
+ .setup_gpio = s5p64x0_fb_gpio_setup_24bpp,
+};
+
+/* LCD power controller */
+static void smdk6450_lte480_reset_power(struct plat_lcd_data *pd,
+ unsigned int power)
+{
+ int err;
+
+ if (power) {
+ err = gpio_request(S5P6450_GPN(5), "GPN");
+ if (err) {
+ printk(KERN_ERR "failed to request GPN for lcd reset\n");
+ return;
+ }
+
+ gpio_direction_output(S5P6450_GPN(5), 1);
+ gpio_set_value(S5P6450_GPN(5), 0);
+ gpio_set_value(S5P6450_GPN(5), 1);
+ gpio_free(S5P6450_GPN(5));
+ }
+}
+
+static struct plat_lcd_data smdk6450_lcd_power_data = {
+ .set_power = smdk6450_lte480_reset_power,
+};
+
+static struct platform_device smdk6450_lcd_lte480wv = {
+ .name = "platform-lcd",
+ .dev.parent = &s3c_device_fb.dev,
+ .dev.platform_data = &smdk6450_lcd_power_data,
+};
+
static struct platform_device *smdk6450_devices[] __initdata = {
&s3c_device_adc,
&s3c_device_rtc,
@@ -119,6 +178,9 @@ static struct platform_device *smdk6450_devices[] __initdata = {
&s3c_device_wdt,
&samsung_asoc_dma,
&s5p6450_device_iis0,
+ &s3c_device_fb,
+ &smdk6450_lcd_lte480wv,
+
/* s5p6450_device_spi0 will be added */
};
@@ -166,6 +228,17 @@ static void __init smdk6450_map_io(void)
s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
}
+static void s5p6450_set_lcd_interface()
+{
+ unsigned int cfg;
+
+ /* select TFT LCD type (RGB I/F) */
+ cfg = __raw_readl(S5P64X0_SPCON0);
+ cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
+ cfg |= S5P64X0_SPCON0_LCD_SEL_RGB;
+ __raw_writel(cfg, S5P64X0_SPCON0);
+}
+
static void __init smdk6450_machine_init(void)
{
s3c24xx_ts_set_platdata(NULL);
@@ -179,6 +252,9 @@ static void __init smdk6450_machine_init(void)
samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
+ s5p6450_set_lcd_interface();
+ s3c_fb_set_platdata(&smdk6450_lcd_pdata);
+
platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support
2011-09-09 18:01 ` [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support Ajay Kumar
@ 2011-09-14 13:06 ` Kukjin Kim
0 siblings, 0 replies; 8+ messages in thread
From: Kukjin Kim @ 2011-09-14 13:06 UTC (permalink / raw)
To: linux-arm-kernel
Ajay Kumar wrote:
>
> This patch:
> -- Adds platform device support for LCD-LTE480.
> -- Adds platform data for FB with win_mode and default_bpp.
> -- Enables FB device support and platform-lcd support.
> -- Adds SPCON settings for LCD.
>
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> ---
> arch/arm/mach-s5p64x0/Kconfig | 2 +
> arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 +
> arch/arm/mach-s5p64x0/mach-smdk6440.c | 75
> ++++++++++++++++++++++++
> 3 files changed, 81 insertions(+), 0 deletions(-)
>
(snip)
> +#include <plat/regs-fb.h>
Should be <plat/regs-fb-v4.h>?
(snip)
> +/* Frame Buffer */
> +static struct s3c_fb_pd_win smdk6440_fb_win0 = {
> + .win_mode = {
> + .left_margin = 8,
> + .right_margin = 13,
> + .upper_margin = 7,
> + .lower_margin = 5,
> + .hsync_len = 3,
> + .vsync_len = 1,
> + .xres = 800,
> + .yres = 480,
> + .refresh = 60,
if its value is 60, we don't need .refresh here.
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-09-14 13:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 18:01 [PATCH V4 0/6] ARM: S5P64X0: Add Framebuffer support Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 1/6] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 2/6] ARM: S5P64X0: Add register base and IRQ for Framebuffer Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 RESEND 3/6] ARM: S5P64X0: Set s3c_device_fb name Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 4/6] ARM: S5P64X0: Add GPIO setup for LCD Ajay Kumar
2011-09-09 18:01 ` [PATCH V4 5/6] ARM: S5P6440: Add LCD-LTE480 and enable Framebuffer support Ajay Kumar
2011-09-14 13:06 ` Kukjin Kim
2011-09-09 18:01 ` [PATCH V4 6/6] ARM: S5P6450: " Ajay Kumar
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).