aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2008-11-11 08:50:39 -0500
committerEric Miao <eric.miao@marvell.com>2008-12-02 01:43:47 -0500
commita5718a14a1d91b871e65d4e6b349e39c22cac943 (patch)
tree5abb6a68692614580eca8d658d374a2a7fd8590f /drivers
parent9179825cf5e96bd0784456ef43811cab4db17cd9 (diff)
[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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/pxafb.c18
-rw-r--r--drivers/video/pxafb.h3
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index cc59c52e1103..d6aa07b978ed 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -69,9 +69,6 @@
69#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP | LCCR3_VSP |\ 69#define LCCR3_INVALID_CONFIG_MASK (LCCR3_HSP | LCCR3_VSP |\
70 LCCR3_PCD | LCCR3_BPP) 70 LCCR3_PCD | LCCR3_BPP)
71 71
72static void (*pxafb_backlight_power)(int);
73static void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
74
75static int pxafb_activate_var(struct fb_var_screeninfo *var, 72static int pxafb_activate_var(struct fb_var_screeninfo *var,
76 struct pxafb_info *); 73 struct pxafb_info *);
77static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); 74static void set_ctrlr_state(struct pxafb_info *fbi, u_int state);
@@ -814,6 +811,7 @@ static int pxafb_smart_init(struct pxafb_info *fbi)
814 __func__); 811 __func__);
815 return PTR_ERR(fbi->smart_thread); 812 return PTR_ERR(fbi->smart_thread);
816 } 813 }
814
817 return 0; 815 return 0;
818} 816}
819#else 817#else
@@ -976,16 +974,16 @@ static inline void __pxafb_backlight_power(struct pxafb_info *fbi, int on)
976{ 974{
977 pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff"); 975 pr_debug("pxafb: backlight o%s\n", on ? "n" : "ff");
978 976
979 if (pxafb_backlight_power) 977 if (fbi->backlight_power)
980 pxafb_backlight_power(on); 978 fbi->backlight_power(on);
981} 979}
982 980
983static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on) 981static inline void __pxafb_lcd_power(struct pxafb_info *fbi, int on)
984{ 982{
985 pr_debug("pxafb: LCD power o%s\n", on ? "n" : "ff"); 983 pr_debug("pxafb: LCD power o%s\n", on ? "n" : "ff");
986 984
987 if (pxafb_lcd_power) 985 if (fbi->lcd_power)
988 pxafb_lcd_power(on, &fbi->fb.var); 986 fbi->lcd_power(on, &fbi->fb.var);
989} 987}
990 988
991static void pxafb_setup_gpio(struct pxafb_info *fbi) 989static void pxafb_setup_gpio(struct pxafb_info *fbi)
@@ -1748,8 +1746,7 @@ static int __devinit pxafb_probe(struct platform_device *dev)
1748 ret = -EINVAL; 1746 ret = -EINVAL;
1749 goto failed; 1747 goto failed;
1750 } 1748 }
1751 pxafb_backlight_power = inf->pxafb_backlight_power; 1749
1752 pxafb_lcd_power = inf->pxafb_lcd_power;
1753 fbi = pxafb_init_fbinfo(&dev->dev); 1750 fbi = pxafb_init_fbinfo(&dev->dev);
1754 if (!fbi) { 1751 if (!fbi) {
1755 /* only reason for pxafb_init_fbinfo to fail is kmalloc */ 1752 /* only reason for pxafb_init_fbinfo to fail is kmalloc */
@@ -1758,6 +1755,9 @@ static int __devinit pxafb_probe(struct platform_device *dev)
1758 goto failed; 1755 goto failed;
1759 } 1756 }
1760 1757
1758 fbi->backlight_power = inf->pxafb_backlight_power;
1759 fbi->lcd_power = inf->pxafb_lcd_power;
1760
1761 r = platform_get_resource(dev, IORESOURCE_MEM, 0); 1761 r = platform_get_resource(dev, IORESOURCE_MEM, 0);
1762 if (r == NULL) { 1762 if (r == NULL) {
1763 dev_err(&dev->dev, "no I/O memory resource defined\n"); 1763 dev_err(&dev->dev, "no I/O memory resource defined\n");
diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h
index 31541b86f13d..d8eb93fa03a3 100644
--- a/drivers/video/pxafb.h
+++ b/drivers/video/pxafb.h
@@ -124,6 +124,9 @@ struct pxafb_info {
124 struct notifier_block freq_transition; 124 struct notifier_block freq_transition;
125 struct notifier_block freq_policy; 125 struct notifier_block freq_policy;
126#endif 126#endif
127
128 void (*lcd_power)(int, struct fb_var_screeninfo *);
129 void (*backlight_power)(int);
127}; 130};
128 131
129#define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member) 132#define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)