Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09fe75f6 authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds
Browse files

s3c2410fb: multi-display support



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.

Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 110c1fa7
Loading
Loading
Loading
Loading
+21 −28
Original line number Diff line number Diff line
@@ -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 __initdata amlm5900_lcd_info = {
	.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));
}
+151 −26
Original line number Diff line number Diff line
@@ -467,27 +467,142 @@ static struct platform_device bast_device_axpp = {

/* LCD/VGA controller */

static struct s3c2410fb_mach_info __initdata bast_lcd_info = {
static struct s3c2410fb_display __initdata bast_lcd_info[] = {
	{
		.width		= 640,
		.height		= 480,
		.xres		= 320,
		.yres		= 240,

		.bpp		= 4,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 640,
		.yres		= 480,
		.bpp		= 4,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 800,
		.yres		= 600,
		.bpp		= 4,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 320,
		.yres		= 240,
		.bpp		= 8,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

	.xres		= {
		.min		= 320,
		.max		= 1024,
		.defval		= 640,
		.xres		= 640,
		.yres		= 480,
		.bpp		= 8,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

	.yres		= {
		.min		= 240,
		.max	        = 600,
		.defval		= 480,
		.xres		= 800,
		.yres		= 600,
		.bpp		= 8,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 320,
		.yres		= 240,
		.bpp		= 16,

	.bpp		= {
		.min		= 4,
		.max		= 16,
		.defval		= 8,
		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 640,
		.yres		= 480,
		.bpp		= 16,

		.regs		= {
			.lcdcon1	= 0x00000176,
			.lcdcon2	= 0x1d77c7c2,
			.lcdcon3	= 0x013a7f13,
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
	{
		.width		= 640,
		.height		= 480,

		.xres		= 800,
		.yres		= 600,
		.bpp		= 16,

		.regs		= {
			.lcdcon1	= 0x00000176,
@@ -496,6 +611,16 @@ static struct s3c2410fb_mach_info __initdata bast_lcd_info = {
			.lcdcon4	= 0x00000057,
			.lcdcon5	= 0x00014b02,
		}
	},
};

/* LCD/VGA controller */

static struct s3c2410fb_mach_info __initdata bast_fb_info = {

	.displays = bast_lcd_info,
	.num_displays = ARRAY_SIZE(bast_lcd_info),
	.default_display = 4,
};

/* Standard BAST devices */
@@ -552,7 +677,7 @@ static void __init bast_map_io(void)

static void __init bast_init(void)
{
	s3c24xx_fb_set_platdata(&bast_lcd_info);
	s3c24xx_fb_set_platdata(&bast_fb_info);
	platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
}

+17 −9
Original line number Diff line number Diff line
@@ -133,8 +133,7 @@ static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
/**
 * 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_lcdcfg __initdata = {
				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_lcdcfg __initdata = {
	.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
+106 −146
Original line number Diff line number Diff line
@@ -95,8 +95,9 @@ static struct s3c2410_uartcfg smdk2410_uartcfgs[] = {

/* LCD driver info */

static struct s3c2410fb_display qt2410_lcd_cfg[] __initdata = {
	{
		/* Configuration for 640x480 SHARP LQ080V3DG01 */
static struct s3c2410fb_mach_info qt2410_biglcd_cfg __initdata = {
		.regs	= {

			.lcdcon1 = S3C2410_LCDCON1_TFT16BPP |
@@ -122,32 +123,15 @@ static struct s3c2410fb_mach_info qt2410_biglcd_cfg __initdata = {
				   S3C2410_LCDCON5_HWSWP,
		},

	.lpcsel		= ((0xCE6) & ~7) | 1<<4,

		.width		= 640,
		.height		= 480,

	.xres		= {
		.min	= 640,
		.max	= 640,
		.defval	= 640,
	},

	.yres		= {
		.min	= 480,
		.max	= 480,
		.defval = 480,
	},

	.bpp		= {
		.min	= 16,
		.max	= 16,
		.defval = 16,
		.xres		= 640,
		.yres		= 480,
		.bpp		= 16,
	},
};

	{
		/* Configuration for 480x640 toppoly TD028TTEC1 */
static struct s3c2410fb_mach_info qt2410_prodlcd_cfg __initdata = {
		.regs	= {

			.lcdcon1 = S3C2410_LCDCON1_TFT16BPP |
@@ -173,32 +157,14 @@ static struct s3c2410fb_mach_info qt2410_prodlcd_cfg __initdata = {
				   S3C2410_LCDCON5_HWSWP,
		},

	.lpcsel		= ((0xCE6) & ~7) | 1<<4,

		.width		= 480,
		.height		= 640,

	.xres		= {
		.min	= 480,
		.max	= 480,
		.defval	= 480,
	},

	.yres		= {
		.min	= 640,
		.max	= 640,
		.defval = 640,
	},

	.bpp		= {
		.min	= 16,
		.max	= 16,
		.defval = 16,
		.xres		= 480,
		.yres		= 640,
		.bpp		= 16,
	},
};

	{
		/* Config for 240x320 LCD */
static struct s3c2410fb_mach_info qt2410_lcd_cfg __initdata = {
		.regs	= {

			.lcdcon1 = S3C2410_LCDCON1_TFT16BPP |
@@ -224,28 +190,21 @@ static struct s3c2410fb_mach_info qt2410_lcd_cfg __initdata = {
				   S3C2410_LCDCON5_HWSWP,
		},

	.lpcsel		= ((0xCE6) & ~7) | 1<<4,

		.width		= 240,
		.height		= 320,

	.xres		= {
		.min	= 240,
		.max	= 240,
		.defval	= 240,
		.xres		= 240,
		.yres		= 320,
		.bpp		= 16,
	},
};

	.yres		= {
		.min	= 320,
		.max	= 320,
		.defval = 320,
	},

	.bpp		= {
		.min	= 16,
		.max	= 16,
		.defval = 16,
	},
static struct s3c2410fb_mach_info qt2410_fb_info __initdata = {
	.displays 	= qt2410_lcd_cfg,
	.num_displays 	= ARRAY_SIZE(qt2410_lcd_cfg),
	.default_display = 0,

	.lpcsel		= ((0xCE6) & ~7) | 1<<4,
};

/* CS8900 */
@@ -408,16 +367,17 @@ static void __init qt2410_machine_init(void)

	switch (tft_type) {
	case 'p': /* production */
		s3c24xx_fb_set_platdata(&qt2410_prodlcd_cfg);
		qt2410_fb_info.default_display = 1;
		break;
	case 'b': /* big */
		s3c24xx_fb_set_platdata(&qt2410_biglcd_cfg);
		qt2410_fb_info.default_display = 0;
		break;
	case 's': /* small */
	default:
		s3c24xx_fb_set_platdata(&qt2410_lcd_cfg);
		qt2410_fb_info.default_display = 2;
		break;
	}
	s3c24xx_fb_set_platdata(&qt2410_fb_info);

	s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPIO_OUTPUT);
	s3c2410_gpio_setpin(S3C2410_GPB0, 1);
+16 −22
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = {

/* 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_lcdcfg __initdata = {
				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_lcdcfg __initdata = {
	.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 @@ static void __init rx3715_init_machine(void)
#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));
}

Loading