Skip to contentSkip to conversation

ARM: S5P64X0: Add Framebuffer support

PATCH Superseded Ajay Kumar 2 participants 11 messages Jul 27, 2011 – Sep 7, 2011

Subsystems (4)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Ajay Kumar

author
#0 lore raw

v3 cover ARM: S5P64X0: Add Framebuffer support

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.

[Patch RESEND V3 1/7]
- Add "s5p64x0-fb" type driver_data(s3c_fb_driverdata).
- Display controller in S5P64X0 supports 3 windows.

[Patch RESEND V3 2/7]
- Resource definitions(_MEM, _IRQ).

[Patch RESEND V3 3/7]
- Set s3c_device_fb name as "s5p64x0-fb".

[Patch RESEND V3 4/7]
- GPIO settings for LCD in S5P6440 and S5P6450.
- Select LCD interface (RGB/i80).

[Patch V3 5/7]
- Creates a file to hold common FB and LCD code.
- Add Basic FB window definition with default_bpp=24.
- Add platform data for FB and LCD.
- platform_device support for LCD.

[Patch V3 6/7]
- Enables FB support and platform-lcd support for SMDK6440.

[Patch V3 7/7]
- Enables FB support and platform-lcd support for SMDK6450.

o To Paul Mundt, Jingoo han
[Patch RESEND V3 1/7] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata

o To Kukjin Kim
[Patch RESEND V3 2/7] ARM: S5P64X0: Add register base and IRQ for Framebuffer [Patch RESEND V3 3/7] ARM: S5P64X0: Set s3c_device_fb name [Patch RESEND V3 4/7] ARM: S5P64X0: Add GPIO and SPCON settings for LCD [Patch V3 5/7] ARM: S5P64X0: Add file to hold common Framebuffer and LCD code [Patch V3 6/7] ARM: S5P6440: Enable LCD-LTE480 and Framebuffer support [Patch V3 7/7] ARM: S5P6450: Enable LCD-LTE480 and Framebuffer support

 arch/arm/mach-s5p64x0/Kconfig                      |   17 ++++
 arch/arm/mach-s5p64x0/Makefile                     |    4 +
 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 +
 .../mach-s5p64x0/include/mach/smdk64x0-common-fb.h |   26 ++++++
 arch/arm/mach-s5p64x0/mach-smdk6440.c              |    5 +
 arch/arm/mach-s5p64x0/mach-smdk6450.c              |    5 +
 arch/arm/mach-s5p64x0/setup-fb.c                   |   48 ++++++++++
 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c         |   92 ++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fb.h            |   14 +++
 drivers/video/s3c-fb.c                             |   27 ++++++
 13 files changed, 252 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h
 create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c
 create mode 100644 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c
author
#1 lore raw

PATCH v3 1/7 video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata

This patch:
Adds s3c_fb_driverdata for S5P64X0, which supports 3 windows. Also, register "s5p64x0-fb" type driver_data. Existing s3c_fb_driverdata definitions in s3c-fb.c supports 5 or 2 windows.

---
 drivers/video/s3c-fb.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
drivers/video/s3c-fb.c +27 -0
index 4aecf21..0fda252 100644
@@ -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,
 	},
 	{},
 };
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v3 1/7 video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata

Quoted 7 lines · Ajay Kumar

This patch:
Adds s3c_fb_driverdata for S5P64X0, which supports 3 windows. Also, register "s5p64x0-fb" type driver_data. Existing s3c_fb_driverdata definitions in s3c-fb.c supports 5 or 2 windows.

Hi Ajay,

(Cc'ed Florian Tobias Schandina)

Quoted 2 lines

Should be "Acked-by"...

Florian,
This is required for supporting FB on Samsung S5P64X0 SoC. If you're ok, please apply this into your tree...

And if you need original patch, let us know. Ajay will send again.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

drivers/video/s3c-fb.c static struct s3c_fb_driverdata s3c_fb_data_s3c2443

Quoted 9 lines
---
 drivers/video/s3c-fb.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
drivers/video/s3c-fb.c +0 -0
index 4aecf21..0fda252 100644
@@ -1859,6 +1859,30 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443

=

drivers/video/s3c-fb.c static struct platform_device_id s3c_fb_driver_ids[]

Quoted 32 lines
drivers/video/s3c-fb.c +24 -0
 {
 	},
 };
 
+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[] = {
 	{
drivers/video/s3c-fb.c +0 -0
 		.name		= "s3c-fb",
@@ -1872,6 +1896,9 @@ static struct platform_device_id s3c_fb_driver_ids[]

= {

Quoted 11 lines
drivers/video/s3c-fb.c +3 -1
 	}, {
 		.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

author
#3 lore raw

PATCH v3 2/7 ARM: S5P64X0: Add register base and IRQ for Framebuffer

In reply to Ajay Kumar

This patch adds:
-- Framebuffer register mappings.
-- IRQ number being used.

---
 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(-)
arch/arm/mach-s5p64x0/include/mach/irqs.h +4 -0
index 5837a36..53982db 100644
@@ -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 */
 
 /*
arch/arm/mach-s5p64x0/include/mach/map.h +3 -0
index 95c9125..c5ef50c 100644
@@ -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
Signature · 1 line
1.7.0.4
author
#4 lore raw

PATCH v3 3/7 ARM: S5P64X0: Set s3c_device_fb name

In reply to Ajay Kumar

Set s3c_device_fb name as "s5p64x0-fb" for S5P6440 and S5P6450.

---
 arch/arm/mach-s5p64x0/cpu.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/cpu.c +3 -0
index a5c0095..617da3b 100644
@@ -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));
Signature · 1 line
1.7.0.4
author
#5 lore raw

PATCH v3 4/7 ARM: S5P64X0: Add GPIO and SPCON settings for LCD

In reply to Ajay Kumar

This patch adds:
-- GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD. -- Function to select LCD interface (RGB/i80)

---
 arch/arm/mach-s5p64x0/Kconfig                  |    6 +++
 arch/arm/mach-s5p64x0/Makefile                 |    1 +
 arch/arm/mach-s5p64x0/include/mach/regs-gpio.h |    4 ++
 arch/arm/mach-s5p64x0/setup-fb.c               |   48 ++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fb.h        |   14 +++++++
 5 files changed, 73 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c
arch/arm/mach-s5p64x0/Kconfig +6 -0
index 65c7518..4fee745 100644
@@ -21,6 +21,12 @@ config CPU_S5P6450
 	help
 	  Enable S5P6450 CPU support
 
+config S5P64X0_SETUP_FB
+	bool
+	help
+	  Common setup code for S5P64X0 based boards with a LCD display
+	  through RGB interface.
+
 config S5P64X0_SETUP_I2C1
 	bool
 	help
arch/arm/mach-s5p64x0/Makefile +1 -0
index 5f6afdf..487d179 100644
@@ -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)		+= setup-fb.o
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +4 -0
index 6ce2547..34d4412 100644
@@ -44,4 +44,8 @@
 #define S5P64X0_EINT0MASK		(S5P_VA_GPIO + EINT0MASK_OFFSET)
 #define S5P64X0_EINT0PEND		(S5P_VA_GPIO + EINT0PEND_OFFSET)
 
+#define S5P64X0_SPCON0			(S5P_VA_GPIO + 0x1A0)
+#define S5P64X0_SPCON0_LCD_SEL_MASK	(0x3 << 0)
+#define S5P64X0_SPCON0_LCD_SEL_RGB	(0x1 << 0)
+
 #endif /* __ASM_ARCH_REGS_GPIO_H */
arch/arm/mach-s5p64x0/setup-fb.c new file +48 -0

48 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/fb.h +14 -0
index 01f10e4..bd79c0a 100644
@@ -109,4 +109,18 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);
  */
 extern void exynos4_fimd0_gpio_setup_24bpp(void);
 
+/**
+ * s5p64x0_fb_init() - Common setup function for LCD
+ *
+ * Select LCD I/F configuration-RGB style or i80 style
+ */
+extern void s5p64x0_fb_init(int lcd_interface_type);
+
+/**
+ * s5p64x0_fb_gpio_setup_24bpp() - Common GPIO setup function for LCD
+ *
+ * Initialise the GPIO for a LCD display on the RGB interface.
+ */
+extern void s5p64x0_fb_gpio_setup_24bpp(void);
+
 #endif /* __PLAT_S3C_FB_H */
Signature · 1 line
1.7.0.4
#6 lore raw

PATCH v3 4/7 ARM: S5P64X0: Add GPIO and SPCON settings for LCD

Quoted 21 lines · Ajay Kumar

This patch adds:
-- GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD. -- Function to select LCD interface (RGB/i80)

---
 arch/arm/mach-s5p64x0/Kconfig                  |    6 +++
 arch/arm/mach-s5p64x0/Makefile                 |    1 +
 arch/arm/mach-s5p64x0/include/mach/regs-gpio.h |    4 ++
 arch/arm/mach-s5p64x0/setup-fb.c               |   48
++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fb.h        |   14 +++++++
 5 files changed, 73 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c
arch/arm/mach-s5p64x0/Kconfig +0 -0
index 65c7518..4fee745 100644

arch/arm/mach-s5p64x0/Kconfig config CPU_S5P6450 · line 24

Quoted 4 lines
arch/arm/mach-s5p64x0/Kconfig +1 -0
@@ -21,6 +21,12 @@ config CPU_S5P6450
 	help
 	  Enable S5P6450 CPU support
 
+config S5P64X0_SETUP_FB

How about to use S5P64X0_SETUP_FB_24BPP like others?

Review

Quoted 9 lines
arch/arm/mach-s5p64x0/Kconfig +5 -0
+	bool
+	help
+	  Common setup code for S5P64X0 based boards with a LCD display
+	  through RGB interface.
+
 config S5P64X0_SETUP_I2C1
 	bool
 	help
(quoted diff) +0 -0

b/arch/arm/mach-s5p64x0/Makefile

Review

Quoted 9 lines

index 5f6afdf..487d179 100644

arch/arm/mach-s5p64x0/Makefile +1 -0
@@ -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)		+= setup-fb.o
(quoted diff) +0 -0

b/arch/arm/mach-

arch/arm/mach-s5p64x0/include/mach/regs-gpio.h line 49

Quoted 13 lines

s5p64x0/include/mach/regs-gpio.h
index 6ce2547..34d4412 100644

arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +3 -0
@@ -44,4 +44,8 @@
 #define S5P64X0_EINT0MASK		(S5P_VA_GPIO +
 EINT0MASK_OFFSET)
 #define S5P64X0_EINT0PEND		(S5P_VA_GPIO +
 EINT0PEND_OFFSET)
 
+#define S5P64X0_SPCON0			(S5P_VA_GPIO + 0x1A0)
+#define S5P64X0_SPCON0_LCD_SEL_MASK	(0x3 << 0)
+#define S5P64X0_SPCON0_LCD_SEL_RGB	(0x1 << 0)

I can't find where 'xxx_LCD_SEL_RGB' is used...of course, it can be used later.
But please don't add definition which is not used now.

Review

Quoted 3 lines
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +1 -0
+
 #endif /* __ASM_ARCH_REGS_GPIO_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5p64x0/setup-fb.c

arch/arm/mach-s5p64x0/setup-fb.c

Quoted 4 lines

new file mode 100644
index 0000000..0d9903a

arch/arm/mach-s5p64x0/setup-fb.c new file +0 -0

arch/arm/mach-s5p64x0/setup-fb-24bpp.c?

And if required, we can change it later with others next time...

Quoted 24 lines
arch/arm/mach-s5p64x0/setup-fb.c new file +23 -0
@@ -0,0 +1,48 @@
+/* linux/arch/arm/mach-s5p64x0/setup-fb.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *         http://www.samsung.com/
+ *
+ * Base S5P64X0 GPIO setup information for LCD framebuffer
+ *
+ * GPIO settings for LCD on any other board based on s5p64x0
+ * should go in this file.
+ *
+ * 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/fb.h>
+#include <plat/gpio-cfg.h>
+
+#include <mach/regs-clock.h>
+#include <mach/regs-gpio.h>

arch/arm/mach-s5p64x0/setup-fb.c line 33

Quoted 10 lines
arch/arm/mach-s5p64x0/setup-fb.c new file +10 -0
+
+void s5p64x0_fb_init(int lcd_interface_type)
+{
+	unsigned int cfg;
+
+	/* select TFT LCD type (RGB I/F) */
+	cfg = __raw_readl(S5P64X0_SPCON0);
+	cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK;
+	cfg |= lcd_interface_type;
+	__raw_writel(cfg, S5P64X0_SPCON0);

Hmm...how about to move above into its board file? So we don't need to get the argument, lcd_interface_type...

arch/arm/mach-s5p64x0/setup-fb.c line 40

Quoted 7 lines
arch/arm/mach-s5p64x0/setup-fb.c new file +7 -0
+}
+
+void s5p64x0_fb_gpio_setup_24bpp(void)
+{
+	unsigned int chipid;
+
+	chipid = __raw_readl(S5P64X0_SYS_ID) & 0xf0000;

You can use soc_is_xxx() here instead of checking of CPUID directly.

Quoted 37 lines
arch/arm/mach-s5p64x0/setup-fb.c new file +2 -0
+	if (chipid == 0x40000) {
+		s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16,

S3C_GPIO_SFN(2));

arch/arm/mach-s5p64x0/setup-fb.c new file +1 -0
+		s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12,

S3C_GPIO_SFN(2));

arch/arm/mach-s5p64x0/setup-fb.c new file +2 -0
+	} else if (chipid == 0x50000) {
+		s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16,

S3C_GPIO_SFN(2));

arch/arm/mach-s5p64x0/setup-fb.c new file +1 -0
+		s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12,

S3C_GPIO_SFN(2));

arch/arm/mach-s5p64x0/setup-fb.c new file +2 -0
+	}
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/fb.h +0 -0

samsung/include/plat/fb.h
index 01f10e4..bd79c0a 100644

arch/arm/plat-samsung/include/plat/fb.h +14 -1
@@ -109,4 +109,18 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);
  */
 extern void exynos4_fimd0_gpio_setup_24bpp(void);
 
+/**
+ * s5p64x0_fb_init() - Common setup function for LCD
+ *
+ * Select LCD I/F configuration-RGB style or i80 style
+ */
+extern void s5p64x0_fb_init(int lcd_interface_type);
+
+/**
+ * s5p64x0_fb_gpio_setup_24bpp() - Common GPIO setup function for LCD
+ *
+ * Initialise the GPIO for a LCD display on the RGB interface.
+ */
+extern void s5p64x0_fb_gpio_setup_24bpp(void);
+
 #endif /* __PLAT_S3C_FB_H */
--
Quoted 1 line

1.7.0.4

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#7 lore raw

PATCH v3 5/7 ARM: S5P64X0: Add file to hold common Framebuffer and LCD code

In reply to Ajay Kumar

This patch creates a file which holds the framebuffer and LCD code which is common for SMDK6440 and SMDK6450. It mainly includes:
-- Basic FB window definition.
-- platform data for FB and LCD.
-- platform_device support for LCD.

---
 arch/arm/mach-s5p64x0/Kconfig                      |    5 +
 arch/arm/mach-s5p64x0/Makefile                     |    3 +
 .../mach-s5p64x0/include/mach/smdk64x0-common-fb.h |   26 ++++++
 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c         |   92 ++++++++++++++++++++
 4 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h
 create mode 100644 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c
arch/arm/mach-s5p64x0/Kconfig +5 -0
index 4fee745..00d5873 100644
@@ -32,6 +32,11 @@ config S5P64X0_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config SMDK64X0_COMMON_FB
+	bool
+	help
+	Common framebuffer and LCD code which can be shared across SMDKs.
+
 # machine support
 
 config MACH_SMDK6440
arch/arm/mach-s5p64x0/Makefile +3 -0
index 487d179..d09d81b 100644
@@ -22,6 +22,9 @@ obj-$(CONFIG_CPU_S5P6450)	+= clock-s5p6450.o
 obj-$(CONFIG_MACH_SMDK6440)	+= mach-smdk6440.o
 obj-$(CONFIG_MACH_SMDK6450)	+= mach-smdk6450.o
 
+#common code
+obj-$(CONFIG_SMDK64X0_COMMON_FB)   += smdk64x0-common-fb.o
+
 # device support
 
 obj-y				+= dev-audio.o
arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h new file +26 -0
new file mode 100644
index 0000000..e3b87b9
@@ -0,0 +1,26 @@
+/* linux/arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *         http://www.samsung.com/
+ *
+ * Includes declarations for variables and functions
+ * needed in order to support 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/platform_device.h>
+
+#include <video/platform_lcd.h>
+
+#include <plat/fb.h>
+
+extern struct	s3c_fb_pd_win		smdk64x0_fb_win0;
+extern struct	s3c_fb_platdata		smdk64x0_lcd_pdata;
+extern struct	plat_lcd_data		smdk64x0_lcd_power_data;
+extern struct	platform_device		smdk64x0_lcd_lte480wv;
+extern void	smdk64x0_lte480_reset_power(struct plat_lcd_data *pd,
+					    unsigned int power);
arch/arm/mach-s5p64x0/smdk64x0-common-fb.c new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#8 lore raw

PATCH v3 5/7 ARM: S5P64X0: Add file to hold common Framebuffer and LCD code

Review

Quoted 37 lines · Ajay Kumar

This patch creates a file which holds the framebuffer and LCD code which is common for SMDK6440 and SMDK6450. It mainly includes:
-- Basic FB window definition.
-- platform data for FB and LCD.
-- platform_device support for LCD.

---
 arch/arm/mach-s5p64x0/Kconfig                      |    5 +
 arch/arm/mach-s5p64x0/Makefile                     |    3 +
 .../mach-s5p64x0/include/mach/smdk64x0-common-fb.h |   26 ++++++
 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c         |   92
++++++++++++++++++++
 4 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-
fb.h
 create mode 100644 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c
arch/arm/mach-s5p64x0/Kconfig +5 -0
index 4fee745..00d5873 100644
@@ -32,6 +32,11 @@ config S5P64X0_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config SMDK64X0_COMMON_FB
+	bool
+	help
+	Common framebuffer and LCD code which can be shared across SMDKs.
+
 # machine support
 
 config MACH_SMDK6440
(quoted diff) +0 -0

b/arch/arm/mach-s5p64x0/Makefile

Quoted 148 lines

index 487d179..d09d81b 100644

arch/arm/mach-s5p64x0/Makefile +3 -0
@@ -22,6 +22,9 @@ obj-$(CONFIG_CPU_S5P6450)	+= clock-s5p6450.o
 obj-$(CONFIG_MACH_SMDK6440)	+= mach-smdk6440.o
 obj-$(CONFIG_MACH_SMDK6450)	+= mach-smdk6450.o
 
+#common code
+obj-$(CONFIG_SMDK64X0_COMMON_FB)   += smdk64x0-common-fb.o
+
 # device support
 
 obj-y				+= dev-audio.o
arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h new file +26 -0
new file mode 100644
index 0000000..e3b87b9
@@ -0,0 +1,26 @@
+/* linux/arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *         http://www.samsung.com/
+ *
+ * Includes declarations for variables and functions
+ * needed in order to support 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/platform_device.h>
+
+#include <video/platform_lcd.h>
+
+#include <plat/fb.h>
+
+extern struct	s3c_fb_pd_win		smdk64x0_fb_win0;
+extern struct	s3c_fb_platdata		smdk64x0_lcd_pdata;
+extern struct	plat_lcd_data		smdk64x0_lcd_power_data;
+extern struct	platform_device		smdk64x0_lcd_lte480wv;
+extern void	smdk64x0_lte480_reset_power(struct plat_lcd_data *pd,
+					    unsigned int power);
arch/arm/mach- renamed from arch/arm/mach-s5p64x0/smdk64x0-common-fb.c +0 -0

s5p64x0/smdk64x0-common-fb.c
new file mode 100644
index 0000000..a3203f8

arch/arm/mach-s5p64x0/smdk64x0-common-fb.c new file +59 -0
@@ -0,0 +1,92 @@
+/* linux/arch/arm/mach-s5p64x0/smdk64x0-common-fb.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *         http://www.samsung.com/
+ *
+ * Includes definitions for variables and functions
+ * needed in order to support framebuffer.
+ * Note that this code is common across SMDK6440 and SMDK6450.
+ *
+ * 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/gpio.h>
+
+#include <mach/regs-clock.h>
+#include <mach/smdk64x0-common-fb.h>
+
+#include <plat/devs.h>
+#include <plat/regs-fb.h>
+
+/* Frame Buffer */
+struct s3c_fb_pd_win smdk64x0_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,
+};
+
+struct s3c_fb_platdata smdk64x0_lcd_pdata __initdata = {
+	.win[0]		= &smdk64x0_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 */
+void smdk64x0_lte480_reset_power(struct plat_lcd_data *pd,
+					unsigned int power)
+{
+	unsigned int cfg;
+	int err;
+
+	if (power) {
+		cfg = readl(S5P64X0_SYS_ID) & 0xf0000;
+		if (cfg == 0x40000) {
+			err = gpio_request(S5P6440_GPN(5), "GPN");
+			if (err) {
+				printk(KERN_ERR "failed to request GPN for

lcd reset\n");

arch/arm/mach-s5p64x0/smdk64x0-common-fb.c new file +11 -0
+				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));
+		} else if (cfg == 0x50000) {
+			err = gpio_request(S5P6450_GPN(5), "GPN");
+			if (err) {
+				printk(KERN_ERR "failed to request GPN for

lcd reset\n");

arch/arm/mach-s5p64x0/smdk64x0-common-fb.c new file +22 -1
+				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));
+		}
+	}
+}
+
+struct plat_lcd_data smdk64x0_lcd_power_data = {
+	.set_power	= smdk64x0_lte480_reset_power,
+};
+
+struct platform_device smdk64x0_lcd_lte480wv = {
+	.name	= "platform-lcd",
+	.dev	= {
+		.parent		= &s3c_device_fb.dev,
+		.platform_data	= &smdk64x0_lcd_power_data,
+	}
+};
--
Quoted 1 line

1.7.0.4

Well, I think, the smdk64x0-common-fb.c is not nice :( Sorry for bothering...but I think the old version is better because of overhead of adding file...

As I know, you need to fix small changes, please re-submit your whole series except 1st one.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#9 lore raw

PATCH v3 6/7 ARM: S5P6440: Enable LCD-LTE480 and Framebuffer support

In reply to Ajay Kumar

This patch enables s3c-fb support and platform-lcd support for SMDK6440.

---
 arch/arm/mach-s5p64x0/Kconfig         |    3 +++
 arch/arm/mach-s5p64x0/mach-smdk6440.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/Kconfig +3 -0
index 00d5873..41a751f 100644
@@ -42,6 +42,7 @@ config SMDK64X0_COMMON_FB
 config MACH_SMDK6440
 	bool "SMDK6440"
 	select CPU_S5P6440
+	select S3C_DEV_FB
 	select S3C_DEV_I2C1
 	select S3C_DEV_RTC
 	select S3C_DEV_WDT
@@ -50,7 +51,9 @@ config MACH_SMDK6440
 	select SAMSUNG_DEV_BACKLIGHT
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
+	select S5P64X0_SETUP_FB
 	select S5P64X0_SETUP_I2C1
+	select SMDK64X0_COMMON_FB
 	help
 	  Machine support for the Samsung SMDK6440
 
arch/arm/mach-s5p64x0/mach-smdk6440.c +5 -0
index 346f8df..106bc8f 100644
@@ -34,6 +34,7 @@
 #include <mach/regs-clock.h>
 #include <mach/i2c.h>
 #include <mach/regs-gpio.h>
+#include <mach/smdk64x0-common-fb.h>
 
 #include <plat/regs-serial.h>
 #include <plat/gpio-cfg.h>
@@ -101,6 +102,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
 	&s3c_device_wdt,
 	&samsung_asoc_dma,
 	&s5p6440_device_iis,
+	&s3c_device_fb,
+	&smdk64x0_lcd_lte480wv,
 };
 
 static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -165,6 +168,8 @@ static void __init smdk6440_machine_init(void)
 			ARRAY_SIZE(smdk6440_i2c_devs1));
 
 	samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data);
+	s3c_fb_set_platdata(&smdk64x0_lcd_pdata);
+	s5p64x0_fb_init(S5P64X0_SPCON0_LCD_SEL_RGB);
 
 	platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
 }
Signature · 1 line
1.7.0.4
author
#10 lore raw

PATCH v3 7/7 ARM: S5P6450: Enable LCD-LTE480 and Framebuffer support

In reply to Ajay Kumar

This patch enables s3c-fb support and platform-lcd support for SMDK6450.

---
 arch/arm/mach-s5p64x0/Kconfig         |    3 +++
 arch/arm/mach-s5p64x0/mach-smdk6450.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-s5p64x0/Kconfig +3 -0
index 41a751f..43493f1 100644
@@ -60,6 +60,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
@@ -68,7 +69,9 @@ config MACH_SMDK6450
 	select SAMSUNG_DEV_BACKLIGHT
 	select SAMSUNG_DEV_PWM
 	select SAMSUNG_DEV_TS
+	select S5P64X0_SETUP_FB
 	select S5P64X0_SETUP_I2C1
+	select SMDK64X0_COMMON_FB
 	help
 	  Machine support for the Samsung SMDK6450
 
arch/arm/mach-s5p64x0/mach-smdk6450.c +5 -0
index 33f2adf..880421c 100644
@@ -34,6 +34,7 @@
 #include <mach/regs-clock.h>
 #include <mach/i2c.h>
 #include <mach/regs-gpio.h>
+#include <mach/smdk64x0-common-fb.h>
 
 #include <plat/regs-serial.h>
 #include <plat/gpio-cfg.h>
@@ -119,6 +120,8 @@ static struct platform_device *smdk6450_devices[] __initdata = {
 	&s3c_device_wdt,
 	&samsung_asoc_dma,
 	&s5p6450_device_iis0,
+	&s3c_device_fb,
+	&smdk64x0_lcd_lte480wv,
 	/* s5p6450_device_spi0 will be added */
 };
 
@@ -184,6 +187,8 @@ static void __init smdk6450_machine_init(void)
 			ARRAY_SIZE(smdk6450_i2c_devs1));
 
 	samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
+	s3c_fb_set_platdata(&smdk64x0_lcd_pdata);
+	s5p64x0_fb_init(S5P64X0_SPCON0_LCD_SEL_RGB);
 
 	platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
 }
Signature · 1 line
1.7.0.4