bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-
printk("pmubl: Backlight initialized (%s)\n", name);
return;
static int sony_backlight_update_status(struct backlight_device *bd)
{
return acpi_callsetfunc(sony_acpi_handle, "SBRT",
- bd->props->brightness + 1, NULL);
+ bd->props.brightness + 1, NULL);
}
static int sony_backlight_get_brightness(struct backlight_device *bd)
}
static struct backlight_device *sony_backlight_device;
-static struct backlight_properties sony_backlight_properties = {
+static struct backlight_ops sony_backlight_ops = {
.update_status = sony_backlight_update_status,
.get_brightness = sony_backlight_get_brightness,
- .max_brightness = SONY_MAX_BRIGHTNESS - 1,
};
/*
if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) {
sony_backlight_device = backlight_device_register("sony", NULL,
NULL,
- &sony_backlight_properties);
+ &sony_backlight_ops);
if (IS_ERR(sony_backlight_device)) {
printk(LOG_PFX "unable to register backlight device\n");
sony_backlight_device = NULL;
- } else
- sony_backlight_properties.brightness =
+ } else {
+ sony_backlight_device->props.brightness =
sony_backlight_get_brightness
(sony_backlight_device);
+ sony_backlight_device->props.max_brightness =
+ SONY_MAX_BRIGHTNESS - 1;
+ }
+
}
if (sony_snc_pf_add())
bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
-
printk("aty128: Backlight initialized (%s)\n", name);
return;
static void aty128_bl_exit(struct backlight_device *bd)
{
- if (bd) {
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (pmac_backlight == bd)
- pmac_backlight = NULL;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
- backlight_device_unregister(bd);
-
- printk("aty128: Backlight unloaded\n");
- }
+ backlight_device_unregister(bd);
+ printk("aty128: Backlight unloaded\n");
}
#endif /* CONFIG_FB_ATY128_BACKLIGHT */
bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
-
printk("aty: Backlight initialized (%s)\n", name);
return;
static void aty_bl_exit(struct backlight_device *bd)
{
- if (bd) {
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (pmac_backlight == bd)
- pmac_backlight = NULL;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
- backlight_device_unregister(bd);
-
- printk("aty: Backlight unloaded\n");
- }
+ backlight_device_unregister(bd);
+ printk("aty: Backlight unloaded\n");
}
#endif /* CONFIG_FB_ATY_BACKLIGHT */
bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
-
printk("radeonfb: Backlight initialized (%s)\n", name);
return;
if (bd) {
struct radeon_bl_privdata *pdata;
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (pmac_backlight == bd)
- pmac_backlight = NULL;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
pdata = class_get_devdata(&bd->class_dev);
backlight_device_unregister(bd);
kfree(pdata);
#include <linux/err.h>
#include <linux/fb.h>
+#ifdef CONFIG_PMAC_BACKLIGHT
+#include <asm/backlight.h>
+#endif
#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \
defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
}
}
+#ifdef CONFIG_PMAC_BACKLIGHT
+ mutex_lock(&pmac_backlight_mutex);
+ if (!pmac_backlight)
+ pmac_backlight = new_bd;
+ mutex_unlock(&pmac_backlight_mutex);
+#endif
+
return new_bd;
}
EXPORT_SYMBOL(backlight_device_register);
pr_debug("backlight_device_unregister: name=%s\n", bd->class_dev.class_id);
+#ifdef CONFIG_PMAC_BACKLIGHT
+ mutex_lock(&pmac_backlight_mutex);
+ if (pmac_backlight == bd)
+ pmac_backlight = NULL;
+ mutex_unlock(&pmac_backlight_mutex);
+#endif
+
for (i = 0; i < ARRAY_SIZE(bl_class_device_attributes); i++)
class_device_remove_file(&bd->class_dev,
&bl_class_device_attributes[i]);
#include "nv_type.h"
#include "nv_proto.h"
-#ifdef CONFIG_PMAC_BACKLIGHT
-#include <asm/backlight.h>
-#include <asm/machdep.h>
-#endif
-
/* We do not have any information about which values are allowed, thus
* we used safe values.
*/
bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
-
printk("nvidia: Backlight initialized (%s)\n", name);
return;
struct fb_info *info = pci_get_drvdata(par->pci_dev);
struct backlight_device *bd = info->bl_dev;
- if (bd) {
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (pmac_backlight == bd)
- pmac_backlight = NULL;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
- backlight_device_unregister(bd);
-
- printk("nvidia: Backlight unloaded\n");
- }
+ backlight_device_unregister(bd);
+ printk("nvidia: Backlight unloaded\n");
}
bd->props->power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (!pmac_backlight)
- pmac_backlight = bd;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
-
printk("riva: Backlight initialized (%s)\n", name);
return;
{
struct backlight_device *bd = info->bl_dev;
- if (bd) {
-#ifdef CONFIG_PMAC_BACKLIGHT
- mutex_lock(&pmac_backlight_mutex);
- if (pmac_backlight == bd)
- pmac_backlight = NULL;
- mutex_unlock(&pmac_backlight_mutex);
-#endif
- backlight_device_unregister(bd);
-
- printk("riva: Backlight unloaded\n");
- }
+ backlight_device_unregister(bd);
+ printk("riva: Backlight unloaded\n");
}
#else
static inline void riva_bl_init(struct riva_par *par) {}