aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3c-fb.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-08-10 21:02:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:10 -0400
commitbc2da1b6fb1a8af9a3226a4f5db3ce32a0a192c9 (patch)
treeb49de2f909dbafb516e8c00570f7fc2ced1ab8c8 /drivers/video/s3c-fb.c
parentc4bb6ffa7754e8d0f8b24decd91de259b549fda1 (diff)
s3c-fb: integrate palette setup code into main driver
Remove the palette setup code from the header files and put it into the main driver. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Cc: InKi Dae <inki.dae@samsung.com> Cc: KyungMin Park <kyungmin.park.samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r--drivers/video/s3c-fb.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 5c7ac01ab61d..b00c064beddf 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -116,6 +116,20 @@ struct s3c_fb_driverdata {
116}; 116};
117 117
118/** 118/**
119 * struct s3c_fb_palette - palette information
120 * @r: Red bitfield.
121 * @g: Green bitfield.
122 * @b: Blue bitfield.
123 * @a: Alpha bitfield.
124 */
125struct s3c_fb_palette {
126 struct fb_bitfield r;
127 struct fb_bitfield g;
128 struct fb_bitfield b;
129 struct fb_bitfield a;
130};
131
132/**
119 * struct s3c_fb_win - per window private data for each framebuffer. 133 * struct s3c_fb_win - per window private data for each framebuffer.
120 * @windata: The platform data supplied for the window configuration. 134 * @windata: The platform data supplied for the window configuration.
121 * @parent: The hardware that this window is part of. 135 * @parent: The hardware that this window is part of.
@@ -866,7 +880,24 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
866 } 880 }
867 881
868 /* setup the r/b/g positions for the window's palette */ 882 /* setup the r/b/g positions for the window's palette */
869 s3c_fb_init_palette(win_no, &win->palette); 883 if (win->variant.palette_16bpp) {
884 /* Set RGB 5:6:5 as default */
885 win->palette.r.offset = 11;
886 win->palette.r.length = 5;
887 win->palette.g.offset = 5;
888 win->palette.g.length = 6;
889 win->palette.b.offset = 0;
890 win->palette.b.length = 5;
891
892 } else {
893 /* Set 8bpp or 8bpp and 1bit alpha */
894 win->palette.r.offset = 16;
895 win->palette.r.length = 8;
896 win->palette.g.offset = 8;
897 win->palette.g.length = 8;
898 win->palette.b.offset = 0;
899 win->palette.b.length = 8;
900 }
870 901
871 /* setup the initial video mode from the window */ 902 /* setup the initial video mode from the window */
872 fb_videomode_to_var(&fbinfo->var, initmode); 903 fb_videomode_to_var(&fbinfo->var, initmode);