Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296345
b: refs/heads/master
c: 531060f
h: refs/heads/master
i:
  296343: 40fab3c
v: v3
  • Loading branch information
Russell King committed Feb 21, 2012
1 parent fb199fb commit b0fad1e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 798892966871077b8c867abf3d491227037dc2eb
refs/heads/master: 531060fc1989a438fbc2c3198f5057c40121ff50
21 changes: 14 additions & 7 deletions trunk/drivers/video/sa1100fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
22 changes: 10 additions & 12 deletions trunk/drivers/video/sa1100fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
* for more details.
*/

/*
* These are the bitfields for each
* display depth that we support.
*/
#define RGB_4 0
#define RGB_8 1
#define RGB_16 2
#define NR_RGB 3

/* These are the bitfields for each display depth that we support. */
struct sa1100fb_rgb {
struct fb_bitfield red;
struct fb_bitfield green;
struct fb_bitfield blue;
struct fb_bitfield transp;
};

/*
* This structure describes the machine which we are running on.
*/
/* This structure describes the machine which we are running on. */
struct sa1100fb_mach_info {
u_long pixclock;

Expand All @@ -47,6 +47,9 @@ struct sa1100fb_mach_info {

u_int lccr0;
u_int lccr3;

/* Overrides for the default RGB maps */
const struct sa1100fb_rgb *rgb[NR_RGB];
};

/* Shadows for LCD controller registers */
Expand All @@ -57,11 +60,6 @@ struct sa1100fb_lcd_reg {
unsigned long lccr3;
};

#define RGB_4 (0)
#define RGB_8 (1)
#define RGB_16 (2)
#define NR_RGB 3

struct sa1100fb_info {
struct fb_info fb;
struct device *dev;
Expand Down

0 comments on commit b0fad1e

Please sign in to comment.