Skip to contentSkip to conversation

s3c2410fb: multi-display support

PATCH New Antonino A. Daplas 1 participant 1 message Aug 13, 2007

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 7/22 s3c2410fb: multi-display support

From: Krzysztof Helt <[email protected]>

This patch adds a new structure to describe and handle more than one panel (display mode) for the s3c2410 framebuffer. This structure is added after the pxafb driver.

---

 arch/arm/mach-s3c2410/mach-amlm5900.c |   49 +++---
 arch/arm/mach-s3c2410/mach-bast.c     |  177 ++++++++++++++++++++---
 arch/arm/mach-s3c2410/mach-h1940.c    |   26 ++-
 arch/arm/mach-s3c2410/mach-qt2410.c   |  252 ++++++++++++++-------------------
 arch/arm/mach-s3c2440/mach-rx3715.c   |   38 ++---
 arch/arm/mach-s3c2440/mach-smdk2440.c |   41 ++---
 drivers/video/s3c2410fb.c             |   83 ++++++-----
 drivers/video/s3c2410fb.h             |    2 
 include/asm-arm/arch-s3c2410/fb.h     |   33 ++--
 9 files changed, 396 insertions(+), 305 deletions(-)
arch/arm/mach-s3c2410/mach-amlm5900.c +21 -28
index 43bb5e1..1946934 100644
@@ -168,13 +168,32 @@ static void __init amlm5900_map_io(void)
 }
 
 #ifdef CONFIG_FB_S3C2410
-static struct s3c2410fb_mach_info __initdata amlm5900_lcd_info = {
+static struct s3c2410fb_display __initdata amlm5900_lcd_info = {
 	.width		= 160,
 	.height		= 160,
 
 /* commented out until stn patch is submitted
 *	.type		= S3C2410_LCDCON1_STN4,
 */
+	.xres		= 160,
+	.yres		= 160,
+	.bpp		= 4,
+
+	.regs		= {
+		.lcdcon1	= 0x00008225,
+		.lcdcon2	= 0x0027c000,
+		.lcdcon3	= 0x00182708,
+		.lcdcon4	= 0x00000002,
+		.lcdcon5	= 0x00000001,
+	}
+};
+
+static struct s3c2410fb_mach_info __initdata amlm5900_fb_info = {
+
+	.displays = &amlm5900_lcd_info,
+	.num_displays = 1,
+	.default_display = 0,
+
 	.gpccon =	0xaaaaaaaa,
 	.gpccon_mask =	0xffffffff,
 	.gpcup =	0x0000ffff,
@@ -184,32 +203,6 @@ static struct s3c2410fb_mach_info __init
 	.gpdcon_mask =	0xffffffff,
 	.gpdup =	0x0000ffff,
 	.gpdup_mask =	0xffffffff,
-
-	.xres		= {
-		.min		= 160,
-		.max		= 160,
-		.defval		= 160,
-	},
-
-	.yres		= {
-		.min		= 160,
-		.max	        = 160,
-		.defval		= 160,
-	},
-
-	.bpp		= {
-		.min		= 4,
-		.max		= 4,
-		.defval		= 4,
-	},
-
-	.regs		= {
-		.lcdcon1	= 0x00008225,
-		.lcdcon2	= 0x0027c000,
-		.lcdcon3	= 0x00182708,
-		.lcdcon4	= 0x00000002,
-		.lcdcon5	= 0x00000001,
-	}
 };
 #endif
 
@@ -239,7 +232,7 @@ static void __init amlm5900_init(void)
 {
 	amlm5900_init_pm();
 #ifdef CONFIG_FB_S3C2410
-	s3c24xx_fb_set_platdata(&amlm5900_lcd_info);
+	s3c24xx_fb_set_platdata(&amlm5900_fb_info);
 #endif
 	platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
 }
arch/arm/mach-s3c2410/mach-bast.c +151 -26

193 lines not on this page · raw message

arch/arm/mach-s3c2410/mach-h1940.c +17 -9
index 9a172b4..ab04b29 100644
@@ -133,8 +133,7 @@ static struct s3c2410_udc_mach_info h194
 /**
  * Set lcd on or off
  **/
-static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = {
-	.fixed_syncs=		1,
+static struct s3c2410fb_display h1940_lcd __initdata = {
 	.regs={
 		.lcdcon1=	S3C2410_LCDCON1_TFT16BPP | \
 				S3C2410_LCDCON1_TFT | \
@@ -156,6 +155,21 @@ static struct s3c2410fb_mach_info h1940_
 				S3C2410_LCDCON5_INVVLINE | \
 				S3C2410_LCDCON5_HWSWP,
 	},
+
+	.width =	240,
+	.height =	320,
+	.xres =		240,
+	.yres =		320,
+	.bpp =		16,
+};
+
+static struct s3c2410fb_mach_info h1940_fb_info __initdata = {
+	.fixed_syncs =		1,
+
+	.displays = &h1940_lcd,
+	.num_displays = 1,
+	.default_display = 0,
+
 	.lpcsel=	0x02,
 	.gpccon=	0xaa940659,
 	.gpccon_mask=	0xffffffff,
@@ -165,12 +179,6 @@ static struct s3c2410fb_mach_info h1940_
 	.gpdcon_mask=	0xffffffff,
 	.gpdup=		0x0000faff,
 	.gpdup_mask=	0xffffffff,
-
-	.width=		240,
-	.height=	320,
-	.xres=		{240,240,240},
-	.yres=		{320,320,320},
-	.bpp=		{16,16,16},
 };
 
 static struct platform_device s3c_device_leds = {
@@ -217,7 +225,7 @@ static void __init h1940_init(void)
 {
 	u32 tmp;
 
-	s3c24xx_fb_set_platdata(&h1940_lcdcfg);
+	s3c24xx_fb_set_platdata(&h1940_fb_info);
  	s3c24xx_udc_set_platdata(&h1940_udc_cfg);
 
 	/* Turn off suspend on both USB ports, and switch the
arch/arm/mach-s3c2410/mach-qt2410.c +106 -146

279 lines not on this page · raw message

arch/arm/mach-s3c2440/mach-rx3715.c +16 -22
index b59e6d3..c830788 100644
@@ -110,7 +110,7 @@ static struct s3c2410_uartcfg rx3715_uar
 
 /* framebuffer lcd controller information */
 
-static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {
+static struct s3c2410fb_display rx3715_lcdcfg __initdata = {
 	.regs	= {
 		.lcdcon1 =	S3C2410_LCDCON1_TFT16BPP | \
 				S3C2410_LCDCON1_TFT | \
@@ -133,6 +133,20 @@ static struct s3c2410fb_mach_info rx3715
 				S3C2410_LCDCON5_HWSWP,
 	},
 
+	.width  =	240,
+	.height =	320,
+
+	.xres	= 240,
+	.yres	= 320,
+	.bpp	= 16,
+};
+
+static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
+
+	.displays =	&rx3715_lcdcfg,
+	.num_displays =	1,
+	.default_display = 0,
+
 	.lpcsel =	0xf82,
 
 	.gpccon =	0xaa955699,
@@ -146,26 +160,6 @@ static struct s3c2410fb_mach_info rx3715
 	.gpdup_mask =	0xffffffff,
 
 	.fixed_syncs =	1,
-	.width  =	240,
-	.height =	320,
-
-	.xres	= {
-		.min =		240,
-		.max =		240,
-		.defval =	240,
-	},
-
-	.yres	= {
-		.max =		320,
-		.min =		320,
-		.defval	=	320,
-	},
-
-	.bpp	= {
-		.min =		16,
-		.max =		16,
-		.defval =	16,
-	},
 };
 
 static struct mtd_partition rx3715_nand_part[] = {
@@ -224,7 +218,7 @@ #ifdef CONFIG_PM_H1940
 #endif
 	s3c2410_pm_init();
 
-	s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
+	s3c24xx_fb_set_platdata(&rx3715_fb_info);
 	platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
 }
 
arch/arm/mach-s3c2440/mach-smdk2440.c +17 -24

65 lines not on this page · raw message

drivers/video/s3c2410fb.c +49 -34

180 lines not on this page · raw message

drivers/video/s3c2410fb.h +2 -0
index eec7708..9e86fff 100644
@@ -34,6 +34,8 @@ struct s3c2410fb_info {
 
 	struct s3c2410fb_mach_info *mach_info;
 
+	unsigned current_display;
+
 	/* raw memory addresses */
 	dma_addr_t		map_dma;	/* physical */
 	u_char *		map_cpu;	/* virtual */
include/asm-arm/arch-s3c2410/fb.h +17 -16
index 93a58e7..c0e18b2 100644
@@ -14,12 +14,6 @@ #define __ASM_ARM_FB_H
 
 #include <asm/arch/regs-lcd.h>
 
-struct s3c2410fb_val {
-	unsigned int	defval;
-	unsigned int	min;
-	unsigned int	max;
-};
-
 struct s3c2410fb_hw {
 	unsigned long	lcdcon1;
 	unsigned long	lcdcon2;
@@ -28,23 +22,30 @@ struct s3c2410fb_hw {
 	unsigned long	lcdcon5;
 };
 
-struct s3c2410fb_mach_info {
-	unsigned char	fixed_syncs;	/* do not update sync/border */
-
-	/* LCD types */
-	int		type;
+/* LCD description */
+struct s3c2410fb_display {
+	/* LCD type */
+	unsigned type;
 
 	/* Screen size */
-	int		width;
-	int		height;
+	unsigned short width;
+	unsigned short height;
 
 	/* Screen info */
-	struct s3c2410fb_val xres;
-	struct s3c2410fb_val yres;
-	struct s3c2410fb_val bpp;
+	unsigned short xres;
+	unsigned short yres;
+	unsigned short bpp;
 
 	/* lcd configuration registers */
 	struct s3c2410fb_hw  regs;
+};
+
+struct s3c2410fb_mach_info {
+	unsigned char	fixed_syncs;	/* do not update sync/border */
+
+	struct s3c2410fb_display *displays;	/* attached diplays info */
+	unsigned num_displays;			/* number of defined displays */
+	unsigned default_display;
 
 	/* GPIOs */
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/