[ARM] pxafb: make {backlight,lcd}_power() members of struct pxafb_info

instead of holding them as static pointers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
This commit is contained in:
Eric Miao 2008-11-11 21:50:39 +08:00
parent 9179825cf5
commit a5718a14a1
2 changed files with 12 additions and 9 deletions

View File

@ -69,9 +69,6 @@
#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP | LCCR3_VSP |\ #define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP | LCCR3_VSP |\
LCCR3_PCD | LCCR3_BPP) LCCR3_PCD | LCCR3_BPP)
static void (*pxafb_backlight_power)(int);
static void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
static int pxafb_activate_var(struct fb_var_screeninfo *var, static int pxafb_activate_var(struct fb_var_screeninfo *var,
struct pxafb_info *); struct pxafb_info *);
static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); static void set_ctrlr_state(struct pxafb_info *fbi, u_int state);
@ -814,6 +811,7 @@ static int pxafb_smart_init(struct pxafb_info *fbi)
__func__); __func__);
return PTR_ERR(fbi->smart_thread); return PTR_ERR(fbi->smart_thread);
} }
return 0; return 0;
} }
#else #else
@ -976,16 +974,16 @@ static inline void __pxafb_backlight_power(struct pxafb_info *fbi, int on)
{ {
pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff"); pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff");
if (pxafb_backlight_power) if (fbi->backlight_power)
pxafb_backlight_power(on); fbi->backlight_power(on);
} }
static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on) static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
{ {
pr_debug("pxafb: LCD power o%s\n", on ? "n" : "ff"); pr_debug("pxafb: LCD power o%s\n", on ? "n" : "ff");
if (pxafb_lcd_power) if (fbi->lcd_power)
pxafb_lcd_power(on, &fbi->fb.var); fbi->lcd_power(on, &fbi->fb.var);
} }
static void pxafb_setup_gpio(struct pxafb_info *fbi) static void pxafb_setup_gpio(struct pxafb_info *fbi)
@ -1748,8 +1746,7 @@ static int __devinit pxafb_probe(struct platform_device *dev)
ret = -EINVAL; ret = -EINVAL;
goto failed; goto failed;
} }
pxafb_backlight_power = inf->pxafb_backlight_power;
pxafb_lcd_power = inf->pxafb_lcd_power;
fbi = pxafb_init_fbinfo(&dev->dev); fbi = pxafb_init_fbinfo(&dev->dev);
if (!fbi) { if (!fbi) {
/* only reason for pxafb_init_fbinfo to fail is kmalloc */ /* only reason for pxafb_init_fbinfo to fail is kmalloc */
@ -1758,6 +1755,9 @@ static int __devinit pxafb_probe(struct platform_device *dev)
goto failed; goto failed;
} }
fbi->backlight_power = inf->pxafb_backlight_power;
fbi->lcd_power = inf->pxafb_lcd_power;
r = platform_get_resource(dev, IORESOURCE_MEM, 0); r = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (r == NULL) { if (r == NULL) {
dev_err(&dev->dev, "no I/O memory resource defined\n"); dev_err(&dev->dev, "no I/O memory resource defined\n");

View File

@ -124,6 +124,9 @@ struct pxafb_info {
struct notifier_block freq_transition; struct notifier_block freq_transition;
struct notifier_block freq_policy; struct notifier_block freq_policy;
#endif #endif
void (*lcd_power)(int, struct fb_var_screeninfo *);
void (*backlight_power)(int);
}; };
#define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member) #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)