aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-03-06 01:53:41 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-03-06 06:57:14 -0500
commit5c44778eb0b8928aabfe039ba6f11ca88be6d650 (patch)
tree861bb2bab929e96787cf300beecb4d82b30f9d63 /drivers/video/s3c-fb.c
parent23f1365677a84f775d374a1d8ca0360257685894 (diff)
video: s3c-fb: Add support EXYNOS5 FIMD
This patch adds s3c_fb_driverdata s3c_fb_data_exynos5 for EXYNOS5 and adds extended timing control setting. EXYNOS5 FIMD needs extended setting for video timing control. Additional bits are added to VIDTCON2, VIDWxxADD2, VIDOSDxA and VIDOSDxB registers in order to set timing value for lager resolution. Also, address offset of VIDTCONx registers is changed from 0x0 to 0x20000, thus variable type should be changed to int type to handle the address offset of VIDTCONx registers for EXYNOS5 FIMD. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c52
1 files changed, 47 insertions, 5 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 1fb7ddf8fb5f..f3105160bf98 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -89,7 +89,7 @@ struct s3c_fb;
89struct s3c_fb_variant { 89struct s3c_fb_variant {
90 unsigned int is_2443:1; 90 unsigned int is_2443:1;
91 unsigned short nr_windows; 91 unsigned short nr_windows;
92 unsigned short vidtcon; 92 unsigned int vidtcon;
93 unsigned short wincon; 93 unsigned short wincon;
94 unsigned short winmap; 94 unsigned short winmap;
95 unsigned short keycon; 95 unsigned short keycon;
@@ -568,7 +568,9 @@ static int s3c_fb_set_par(struct fb_info *info)
568 writel(data, regs + sfb->variant.vidtcon + 4); 568 writel(data, regs + sfb->variant.vidtcon + 4);
569 569
570 data = VIDTCON2_LINEVAL(var->yres - 1) | 570 data = VIDTCON2_LINEVAL(var->yres - 1) |
571 VIDTCON2_HOZVAL(var->xres - 1); 571 VIDTCON2_HOZVAL(var->xres - 1) |
572 VIDTCON2_LINEVAL_E(var->yres - 1) |
573 VIDTCON2_HOZVAL_E(var->xres - 1);
572 writel(data, regs + sfb->variant.vidtcon + 8); 574 writel(data, regs + sfb->variant.vidtcon + 8);
573 } 575 }
574 576
@@ -584,17 +586,23 @@ static int s3c_fb_set_par(struct fb_info *info)
584 586
585 pagewidth = (var->xres * var->bits_per_pixel) >> 3; 587 pagewidth = (var->xres * var->bits_per_pixel) >> 3;
586 data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) | 588 data = VIDW_BUF_SIZE_OFFSET(info->fix.line_length - pagewidth) |
587 VIDW_BUF_SIZE_PAGEWIDTH(pagewidth); 589 VIDW_BUF_SIZE_PAGEWIDTH(pagewidth) |
590 VIDW_BUF_SIZE_OFFSET_E(info->fix.line_length - pagewidth) |
591 VIDW_BUF_SIZE_PAGEWIDTH_E(pagewidth);
588 writel(data, regs + sfb->variant.buf_size + (win_no * 4)); 592 writel(data, regs + sfb->variant.buf_size + (win_no * 4));
589 593
590 /* write 'OSD' registers to control position of framebuffer */ 594 /* write 'OSD' registers to control position of framebuffer */
591 595
592 data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0); 596 data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0) |
597 VIDOSDxA_TOPLEFT_X_E(0) | VIDOSDxA_TOPLEFT_Y_E(0);
593 writel(data, regs + VIDOSD_A(win_no, sfb->variant)); 598 writel(data, regs + VIDOSD_A(win_no, sfb->variant));
594 599
595 data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel, 600 data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
596 var->xres - 1)) | 601 var->xres - 1)) |
597 VIDOSDxB_BOTRIGHT_Y(var->yres - 1); 602 VIDOSDxB_BOTRIGHT_Y(var->yres - 1) |
603 VIDOSDxB_BOTRIGHT_X_E(s3c_fb_align_word(var->bits_per_pixel,
604 var->xres - 1)) |
605 VIDOSDxB_BOTRIGHT_Y_E(var->yres - 1);
598 606
599 writel(data, regs + VIDOSD_B(win_no, sfb->variant)); 607 writel(data, regs + VIDOSD_B(win_no, sfb->variant));
600 608
@@ -1903,6 +1911,37 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
1903 .win[4] = &s3c_fb_data_s5p_wins[4], 1911 .win[4] = &s3c_fb_data_s5p_wins[4],
1904}; 1912};
1905 1913
1914static struct s3c_fb_driverdata s3c_fb_data_exynos5 = {
1915 .variant = {
1916 .nr_windows = 5,
1917 .vidtcon = VIDTCON0,
1918 .wincon = WINCON(0),
1919 .winmap = WINxMAP(0),
1920 .keycon = WKEYCON,
1921 .osd = VIDOSD_BASE,
1922 .osd_stride = 16,
1923 .buf_start = VIDW_BUF_START(0),
1924 .buf_size = VIDW_BUF_SIZE(0),
1925 .buf_end = VIDW_BUF_END(0),
1926
1927 .palette = {
1928 [0] = 0x2400,
1929 [1] = 0x2800,
1930 [2] = 0x2c00,
1931 [3] = 0x3000,
1932 [4] = 0x3400,
1933 },
1934 .has_shadowcon = 1,
1935 .has_blendcon = 1,
1936 .has_fixvclk = 1,
1937 },
1938 .win[0] = &s3c_fb_data_s5p_wins[0],
1939 .win[1] = &s3c_fb_data_s5p_wins[1],
1940 .win[2] = &s3c_fb_data_s5p_wins[2],
1941 .win[3] = &s3c_fb_data_s5p_wins[3],
1942 .win[4] = &s3c_fb_data_s5p_wins[4],
1943};
1944
1906/* S3C2443/S3C2416 style hardware */ 1945/* S3C2443/S3C2416 style hardware */
1907static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = { 1946static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
1908 .variant = { 1947 .variant = {
@@ -1981,6 +2020,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
1981 .name = "exynos4-fb", 2020 .name = "exynos4-fb",
1982 .driver_data = (unsigned long)&s3c_fb_data_exynos4, 2021 .driver_data = (unsigned long)&s3c_fb_data_exynos4,
1983 }, { 2022 }, {
2023 .name = "exynos5-fb",
2024 .driver_data = (unsigned long)&s3c_fb_data_exynos5,
2025 }, {
1984 .name = "s3c2443-fb", 2026 .name = "s3c2443-fb",
1985 .driver_data = (unsigned long)&s3c_fb_data_s3c2443, 2027 .driver_data = (unsigned long)&s3c_fb_data_s3c2443,
1986 }, { 2028 }, {