aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-14 07:32:14 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:21 -0500
commitba5fd193f4fd35e5e1771de15cc1aba11d19590d (patch)
tree6b75de0769990aaadc193ea9b8321dc0bb256065 /drivers/video
parentd1a378876c2ab3ea119eea502e8d48e25ef253e4 (diff)
FB: sa1100: use inf members directly
Now that the LCD information is available while the driver is loaded, we don't need to cache that information into our driver private data structure. Get rid of it. Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/sa1100fb.c31
-rw-r--r--drivers/video/sa1100fb.h10
2 files changed, 12 insertions, 29 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index f6e27f4da1d8..d1d97cab24c8 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -298,7 +298,7 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
298 * is what you poke into the framebuffer to produce the 298 * is what you poke into the framebuffer to produce the
299 * colour you requested. 299 * colour you requested.
300 */ 300 */
301 if (fbi->cmap_inverse) { 301 if (fbi->inf->cmap_inverse) {
302 red = 0xffff - red; 302 red = 0xffff - red;
303 green = 0xffff - green; 303 green = 0xffff - green;
304 blue = 0xffff - blue; 304 blue = 0xffff - blue;
@@ -372,10 +372,10 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
372 var->xres = MIN_XRES; 372 var->xres = MIN_XRES;
373 if (var->yres < MIN_YRES) 373 if (var->yres < MIN_YRES)
374 var->yres = MIN_YRES; 374 var->yres = MIN_YRES;
375 if (var->xres > fbi->max_xres) 375 if (var->xres > fbi->inf->xres)
376 var->xres = fbi->max_xres; 376 var->xres = fbi->inf->xres;
377 if (var->yres > fbi->max_yres) 377 if (var->yres > fbi->inf->yres)
378 var->yres = fbi->max_yres; 378 var->yres = fbi->inf->yres;
379 var->xres_virtual = max(var->xres_virtual, var->xres); 379 var->xres_virtual = max(var->xres_virtual, var->xres);
380 var->yres_virtual = max(var->yres_virtual, var->yres); 380 var->yres_virtual = max(var->yres_virtual, var->yres);
381 381
@@ -440,7 +440,7 @@ static int sa1100fb_set_par(struct fb_info *info)
440 440
441 if (var->bits_per_pixel == 16) 441 if (var->bits_per_pixel == 16)
442 fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR; 442 fbi->fb.fix.visual = FB_VISUAL_TRUECOLOR;
443 else if (!fbi->cmap_static) 443 else if (!fbi->inf->cmap_static)
444 fbi->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; 444 fbi->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
445 else { 445 else {
446 /* 446 /*
@@ -481,7 +481,7 @@ sa1100fb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
481 /* 481 /*
482 * Make sure the user isn't doing something stupid. 482 * Make sure the user isn't doing something stupid.
483 */ 483 */
484 if (!kspc && (fbi->fb.var.bits_per_pixel == 16 || fbi->cmap_static)) 484 if (!kspc && (fbi->fb.var.bits_per_pixel == 16 || fbi->inf->cmap_static))
485 return -EINVAL; 485 return -EINVAL;
486 486
487 return gen_set_cmap(cmap, kspc, con, info); 487 return gen_set_cmap(cmap, kspc, con, info);
@@ -652,7 +652,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
652 fbi->fb.fix.id, var->lower_margin); 652 fbi->fb.fix.id, var->lower_margin);
653#endif 653#endif
654 654
655 new_regs.lccr0 = fbi->lccr0 | 655 new_regs.lccr0 = fbi->inf->lccr0 |
656 LCCR0_LEN | LCCR0_LDM | LCCR0_BAM | 656 LCCR0_LEN | LCCR0_LDM | LCCR0_BAM |
657 LCCR0_ERM | LCCR0_LtlEnd | LCCR0_DMADel(0); 657 LCCR0_ERM | LCCR0_LtlEnd | LCCR0_DMADel(0);
658 658
@@ -667,7 +667,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
667 * the YRES parameter. 667 * the YRES parameter.
668 */ 668 */
669 yres = var->yres; 669 yres = var->yres;
670 if (fbi->lccr0 & LCCR0_Dual) 670 if (fbi->inf->lccr0 & LCCR0_Dual)
671 yres /= 2; 671 yres /= 2;
672 672
673 new_regs.lccr2 = 673 new_regs.lccr2 =
@@ -677,7 +677,7 @@ static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_
677 LCCR2_EndFrmDel(var->lower_margin); 677 LCCR2_EndFrmDel(var->lower_margin);
678 678
679 pcd = get_pcd(var->pixclock, cpufreq_get(0)); 679 pcd = get_pcd(var->pixclock, cpufreq_get(0));
680 new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi->lccr3 | 680 new_regs.lccr3 = LCCR3_PixClkDiv(pcd) | fbi->inf->lccr3 |
681 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | 681 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) |
682 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); 682 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL);
683 683
@@ -1154,13 +1154,10 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
1154 panic("sa1100fb error: invalid LCCR3 fields set or zero " 1154 panic("sa1100fb error: invalid LCCR3 fields set or zero "
1155 "pixclock."); 1155 "pixclock.");
1156 1156
1157 fbi->max_xres = inf->xres;
1158 fbi->fb.var.xres = inf->xres; 1157 fbi->fb.var.xres = inf->xres;
1159 fbi->fb.var.xres_virtual = inf->xres; 1158 fbi->fb.var.xres_virtual = inf->xres;
1160 fbi->max_yres = inf->yres;
1161 fbi->fb.var.yres = inf->yres; 1159 fbi->fb.var.yres = inf->yres;
1162 fbi->fb.var.yres_virtual = inf->yres; 1160 fbi->fb.var.yres_virtual = inf->yres;
1163 fbi->max_bpp = inf->bpp;
1164 fbi->fb.var.bits_per_pixel = inf->bpp; 1161 fbi->fb.var.bits_per_pixel = inf->bpp;
1165 fbi->fb.var.pixclock = inf->pixclock; 1162 fbi->fb.var.pixclock = inf->pixclock;
1166 fbi->fb.var.hsync_len = inf->hsync_len; 1163 fbi->fb.var.hsync_len = inf->hsync_len;
@@ -1171,14 +1168,10 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
1171 fbi->fb.var.lower_margin = inf->lower_margin; 1168 fbi->fb.var.lower_margin = inf->lower_margin;
1172 fbi->fb.var.sync = inf->sync; 1169 fbi->fb.var.sync = inf->sync;
1173 fbi->fb.var.grayscale = inf->cmap_greyscale; 1170 fbi->fb.var.grayscale = inf->cmap_greyscale;
1174 fbi->cmap_inverse = inf->cmap_inverse;
1175 fbi->cmap_static = inf->cmap_static;
1176 fbi->lccr0 = inf->lccr0;
1177 fbi->lccr3 = inf->lccr3;
1178 fbi->state = C_STARTUP; 1171 fbi->state = C_STARTUP;
1179 fbi->task_state = (u_char)-1; 1172 fbi->task_state = (u_char)-1;
1180 fbi->fb.fix.smem_len = fbi->max_xres * fbi->max_yres * 1173 fbi->fb.fix.smem_len = inf->xres * inf->yres *
1181 fbi->max_bpp / 8; 1174 inf->bpp / 8;
1182 fbi->inf = inf; 1175 fbi->inf = inf;
1183 1176
1184 /* Copy the RGB bitfield overrides */ 1177 /* Copy the RGB bitfield overrides */
diff --git a/drivers/video/sa1100fb.h b/drivers/video/sa1100fb.h
index 3a634abbec14..e968e1d69520 100644
--- a/drivers/video/sa1100fb.h
+++ b/drivers/video/sa1100fb.h
@@ -23,10 +23,6 @@ struct sa1100fb_info {
23 struct device *dev; 23 struct device *dev;
24 const struct sa1100fb_rgb *rgb[NR_RGB]; 24 const struct sa1100fb_rgb *rgb[NR_RGB];
25 25
26 u_int max_bpp;
27 u_int max_xres;
28 u_int max_yres;
29
30 /* 26 /*
31 * These are the addresses we mapped 27 * These are the addresses we mapped
32 * the framebuffer memory region to. 28 * the framebuffer memory region to.
@@ -44,12 +40,6 @@ struct sa1100fb_info {
44 dma_addr_t dbar1; 40 dma_addr_t dbar1;
45 dma_addr_t dbar2; 41 dma_addr_t dbar2;
46 42
47 u_int lccr0;
48 u_int lccr3;
49 u_int cmap_inverse:1,
50 cmap_static:1,
51 unused:30;
52
53 u_int reg_lccr0; 43 u_int reg_lccr0;
54 u_int reg_lccr1; 44 u_int reg_lccr1;
55 u_int reg_lccr2; 45 u_int reg_lccr2;