aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-02-10 10:04:08 -0500
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 04:26:40 -0500
commit321709c5994f952b78d567fd7083dbebbdc381b7 (patch)
treedf237c216e8bab6ce5c14d5797a796d4bf889a92 /drivers/video/aty
parente0e34ef7f02915cfe50e501e9f32c24217177a96 (diff)
backlight: Clean up pmac_backlight handling
Move the setting/unsetting of pmac_backlight into the backlight core instead of doing it in each driver. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/aty128fb.c20
-rw-r--r--drivers/video/aty/atyfb_base.c20
-rw-r--r--drivers/video/aty/radeon_backlight.c13
3 files changed, 4 insertions, 49 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index ef3e7861c27a..4de8d6252c3c 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1829,13 +1829,6 @@ static void aty128_bl_init(struct aty128fb_par *par)
1829 bd->props->power = FB_BLANK_UNBLANK; 1829 bd->props->power = FB_BLANK_UNBLANK;
1830 backlight_update_status(bd); 1830 backlight_update_status(bd);
1831 1831
1832#ifdef CONFIG_PMAC_BACKLIGHT
1833 mutex_lock(&pmac_backlight_mutex);
1834 if (!pmac_backlight)
1835 pmac_backlight = bd;
1836 mutex_unlock(&pmac_backlight_mutex);
1837#endif
1838
1839 printk("aty128: Backlight initialized (%s)\n", name); 1832 printk("aty128: Backlight initialized (%s)\n", name);
1840 1833
1841 return; 1834 return;
@@ -1846,17 +1839,8 @@ error:
1846 1839
1847static void aty128_bl_exit(struct backlight_device *bd) 1840static void aty128_bl_exit(struct backlight_device *bd)
1848{ 1841{
1849 if (bd) { 1842 backlight_device_unregister(bd);
1850#ifdef CONFIG_PMAC_BACKLIGHT 1843 printk("aty128: Backlight unloaded\n");
1851 mutex_lock(&pmac_backlight_mutex);
1852 if (pmac_backlight == bd)
1853 pmac_backlight = NULL;
1854 mutex_unlock(&pmac_backlight_mutex);
1855#endif
1856 backlight_device_unregister(bd);
1857
1858 printk("aty128: Backlight unloaded\n");
1859 }
1860} 1844}
1861#endif /* CONFIG_FB_ATY128_BACKLIGHT */ 1845#endif /* CONFIG_FB_ATY128_BACKLIGHT */
1862 1846
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 66462286e704..35ba26567598 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2198,13 +2198,6 @@ static void aty_bl_init(struct atyfb_par *par)
2198 bd->props->power = FB_BLANK_UNBLANK; 2198 bd->props->power = FB_BLANK_UNBLANK;
2199 backlight_update_status(bd); 2199 backlight_update_status(bd);
2200 2200
2201#ifdef CONFIG_PMAC_BACKLIGHT
2202 mutex_lock(&pmac_backlight_mutex);
2203 if (!pmac_backlight)
2204 pmac_backlight = bd;
2205 mutex_unlock(&pmac_backlight_mutex);
2206#endif
2207
2208 printk("aty: Backlight initialized (%s)\n", name); 2201 printk("aty: Backlight initialized (%s)\n", name);
2209 2202
2210 return; 2203 return;
@@ -2215,17 +2208,8 @@ error:
2215 2208
2216static void aty_bl_exit(struct backlight_device *bd) 2209static void aty_bl_exit(struct backlight_device *bd)
2217{ 2210{
2218 if (bd) { 2211 backlight_device_unregister(bd);
2219#ifdef CONFIG_PMAC_BACKLIGHT 2212 printk("aty: Backlight unloaded\n");
2220 mutex_lock(&pmac_backlight_mutex);
2221 if (pmac_backlight == bd)
2222 pmac_backlight = NULL;
2223 mutex_unlock(&pmac_backlight_mutex);
2224#endif
2225 backlight_device_unregister(bd);
2226
2227 printk("aty: Backlight unloaded\n");
2228 }
2229} 2213}
2230 2214
2231#endif /* CONFIG_FB_ATY_BACKLIGHT */ 2215#endif /* CONFIG_FB_ATY_BACKLIGHT */
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index f94e4616788d..8c775e6a7e03 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -192,13 +192,6 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
192 bd->props->power = FB_BLANK_UNBLANK; 192 bd->props->power = FB_BLANK_UNBLANK;
193 backlight_update_status(bd); 193 backlight_update_status(bd);
194 194
195#ifdef CONFIG_PMAC_BACKLIGHT
196 mutex_lock(&pmac_backlight_mutex);
197 if (!pmac_backlight)
198 pmac_backlight = bd;
199 mutex_unlock(&pmac_backlight_mutex);
200#endif
201
202 printk("radeonfb: Backlight initialized (%s)\n", name); 195 printk("radeonfb: Backlight initialized (%s)\n", name);
203 196
204 return; 197 return;
@@ -215,12 +208,6 @@ void radeonfb_bl_exit(struct radeonfb_info *rinfo)
215 if (bd) { 208 if (bd) {
216 struct radeon_bl_privdata *pdata; 209 struct radeon_bl_privdata *pdata;
217 210
218#ifdef CONFIG_PMAC_BACKLIGHT
219 mutex_lock(&pmac_backlight_mutex);
220 if (pmac_backlight == bd)
221 pmac_backlight = NULL;
222 mutex_unlock(&pmac_backlight_mutex);
223#endif
224 pdata = class_get_devdata(&bd->class_dev); 211 pdata = class_get_devdata(&bd->class_dev);
225 backlight_device_unregister(bd); 212 backlight_device_unregister(bd);
226 kfree(pdata); 213 kfree(pdata);