diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-14 10:49:44 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-21 11:56:19 (GMT) |
commit | 531060fc1989a438fbc2c3198f5057c40121ff50 (patch) | |
tree | 9de13ddf44c42ef3137dacfc1b24d0dd746e6f66 /drivers/video/sa1100fb.c | |
parent | 798892966871077b8c867abf3d491227037dc2eb (diff) | |
download | linux-fsl-qoriq-531060fc1989a438fbc2c3198f5057c40121ff50.tar.xz |
FB: sa1100: combine RGB bitfield overrides into sa1100fb_mach_info
Allow the sa1100fb_mach_info structure to carry the RGB bitfield
overrides, rather than requiring them to be separately initialized
in sa1100fb_get_machine_info().
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/video/sa1100fb.c')
-rw-r--r-- | drivers/video/sa1100fb.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index ecd7cd4..a905e20 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -252,6 +252,13 @@ static struct sa1100fb_mach_info pal_info __devinitdata = { #endif #ifdef CONFIG_SA1100_H3600 +static const struct sa1100fb_rgb h3600_rgb_16 = { + .red = { .offset = 12, .length = 4, }, + .green = { .offset = 7, .length = 4, }, + .blue = { .offset = 1, .length = 4, }, + .transp = { .offset = 0, .length = 0, }, +}; + static struct sa1100fb_mach_info h3600_info __devinitdata = { .pixclock = 174757, .bpp = 16, .xres = 320, .yres = 240, @@ -264,13 +271,8 @@ static struct sa1100fb_mach_info h3600_info __devinitdata = { .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), -}; -static const struct sa1100fb_rgb h3600_rgb_16 = { - .red = { .offset = 12, .length = 4, }, - .green = { .offset = 7, .length = 4, }, - .blue = { .offset = 1, .length = 4, }, - .transp = { .offset = 0, .length = 0, }, + .rgb[RGB_16] = &h3600_rgb_16, }; #endif @@ -413,7 +415,6 @@ sa1100fb_get_machine_info(struct sa1100fb_info *fbi) #ifdef CONFIG_SA1100_H3600 if (machine_is_h3600()) { inf = &h3600_info; - fbi->rgb[RGB_16] = &h3600_rgb_16; } #endif #ifdef CONFIG_SA1100_COLLIE @@ -1352,6 +1353,7 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) { struct sa1100fb_mach_info *inf; struct sa1100fb_info *fbi; + unsigned i; fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16, GFP_KERNEL); @@ -1424,6 +1426,11 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev) fbi->fb.fix.smem_len = fbi->max_xres * fbi->max_yres * fbi->max_bpp / 8; + /* Copy the RGB bitfield overrides */ + for (i = 0; i < NR_RGB; i++) + if (inf->rgb[i]) + fbi->rgb[i] = inf->rgb[i]; + init_waitqueue_head(&fbi->ctrlr_wait); INIT_WORK(&fbi->task, sa1100fb_task); mutex_init(&fbi->ctrlr_lock); |