aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sa1100fb.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-14 07:03:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-21 06:56:19 -0500
commit086ada54abaa4316e8603f02410fe8ebc9ba2de1 (patch)
tree0cbcbc821d15d037cb5ad6ab74d9546ceec624b1 /drivers/video/sa1100fb.c
parente1b7a72aeb8292502c97b43eceb01aea47ded40f (diff)
FB: sa1100: remove global sa1100fb_.*_power function pointers
Now that we have platform data contained within the individual board code, we can get rid of the global function pointers, placing them inside the platform data instead. 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.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index d645c6d5fd9f..c9f1e7cd95f8 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -194,9 +194,6 @@
194 194
195#include "sa1100fb.h" 195#include "sa1100fb.h"
196 196
197extern void (*sa1100fb_backlight_power)(int on);
198extern void (*sa1100fb_lcd_power)(int on);
199
200static const struct sa1100fb_rgb rgb_4 = { 197static const struct sa1100fb_rgb rgb_4 = {
201 .red = { .offset = 0, .length = 4, }, 198 .red = { .offset = 0, .length = 4, },
202 .green = { .offset = 0, .length = 4, }, 199 .green = { .offset = 0, .length = 4, },
@@ -426,22 +423,10 @@ sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
426 return 0; 423 return 0;
427} 424}
428 425
429static inline void sa1100fb_set_truecolor(u_int is_true_color) 426static void sa1100fb_set_visual(struct sa1100fb_info *fbi, u32 visual)
430{ 427{
431 if (machine_is_assabet()) { 428 if (fbi->inf->set_visual)
432#if 1 // phase 4 or newer Assabet's 429 fbi->inf->set_visual(visual);
433 if (is_true_color)
434 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
435 else
436 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
437#else
438 // older Assabet's
439 if (is_true_color)
440 ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
441 else
442 ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
443#endif
444 }
445} 430}
446 431
447/* 432/*
@@ -483,7 +468,7 @@ static int sa1100fb_set_par(struct fb_info *info)
483 /* 468 /*
484 * Set (any) board control register to handle new color depth 469 * Set (any) board control register to handle new color depth
485 */ 470 */
486 sa1100fb_set_truecolor(fbi->fb.fix.visual == FB_VISUAL_TRUECOLOR); 471 sa1100fb_set_visual(fbi, fbi->fb.fix.visual);
487 sa1100fb_activate_var(var, fbi); 472 sa1100fb_activate_var(var, fbi);
488 473
489 return 0; 474 return 0;
@@ -740,16 +725,16 @@ static inline void __sa1100fb_backlight_power(struct sa1100fb_info *fbi, int on)
740{ 725{
741 dev_dbg(fbi->dev, "backlight o%s\n", on ? "n" : "ff"); 726 dev_dbg(fbi->dev, "backlight o%s\n", on ? "n" : "ff");
742 727
743 if (sa1100fb_backlight_power) 728 if (fbi->inf->backlight_power)
744 sa1100fb_backlight_power(on); 729 fbi->inf->backlight_power(on);
745} 730}
746 731
747static inline void __sa1100fb_lcd_power(struct sa1100fb_info *fbi, int on) 732static inline void __sa1100fb_lcd_power(struct sa1100fb_info *fbi, int on)
748{ 733{
749 dev_dbg(fbi->dev, "LCD power o%s\n", on ? "n" : "ff"); 734 dev_dbg(fbi->dev, "LCD power o%s\n", on ? "n" : "ff");
750 735
751 if (sa1100fb_lcd_power) 736 if (fbi->inf->lcd_power)
752 sa1100fb_lcd_power(on); 737 fbi->inf->lcd_power(on);
753} 738}
754 739
755static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi) 740static void sa1100fb_setup_gpio(struct sa1100fb_info *fbi)
@@ -1197,6 +1182,7 @@ static struct sa1100fb_info * __devinit sa1100fb_init_fbinfo(struct device *dev)
1197 fbi->task_state = (u_char)-1; 1182 fbi->task_state = (u_char)-1;
1198 fbi->fb.fix.smem_len = fbi->max_xres * fbi->max_yres * 1183 fbi->fb.fix.smem_len = fbi->max_xres * fbi->max_yres *
1199 fbi->max_bpp / 8; 1184 fbi->max_bpp / 8;
1185 fbi->inf = inf;
1200 1186
1201 /* Copy the RGB bitfield overrides */ 1187 /* Copy the RGB bitfield overrides */
1202 for (i = 0; i < NR_RGB; i++) 1188 for (i = 0; i < NR_RGB; i++)