]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ACPI: video: Add dev argument for backlight_device_register
authorYu Luming <luming.yu@gmail.com>
Tue, 19 Dec 2006 20:56:15 +0000 (12:56 -0800)
committerLen Brown <len.brown@intel.com>
Wed, 20 Dec 2006 06:42:19 +0000 (01:42 -0500)
This patch set adds generic abstract layer support for acpi video driver to
have generic user interface to control backlight and output switch control by
leveraging the existing backlight sysfs class driver, and by adding a new
video output sysfs class driver.

This patch:

Add dev argument for backlight_device_register to link the class device to
real device object.  The platform specific driver should find a way to get the
real device object for their video device.

[akpm@osdl.org: build fix]
[akpm@osdl.org: fix msi-laptop.c]
Signed-off-by: Luming Yu <Luming.yu@intel.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/asus_acpi.c
drivers/acpi/ibm_acpi.c
drivers/acpi/toshiba_acpi.c
drivers/misc/msi-laptop.c
drivers/usb/misc/appledisplay.c
drivers/video/backlight/backlight.c
include/linux/backlight.h

index bf7bc25e680efa6e53d863b26a51608f122cd8ea..11468e46253c4e86edec63f29f7247ad5fe3553f 100644 (file)
@@ -1402,7 +1402,7 @@ static int __init asus_acpi_init(void)
                return result;
        }
 
-       asus_backlight_device = backlight_device_register("asus", NULL,
+       asus_backlight_device = backlight_device_register("asus",NULL,NULL,
                                                          &asus_backlight_data);
         if (IS_ERR(asus_backlight_device)) {
                printk(KERN_ERR "Could not register asus backlight device\n");
index 1397efb71341a657ff5bf3be2a64741004839aa9..da08b9c62ffc5a5ba00192592a7eff0a50bc71df 100644 (file)
@@ -1714,7 +1714,7 @@ static struct backlight_properties ibm_backlight_data = {
 
 static int brightness_init(void)
 {
-       ibm_backlight_device = backlight_device_register("ibm", NULL,
+       ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
                                                         &ibm_backlight_data);
        if (IS_ERR(ibm_backlight_device)) {
                printk(IBM_ERR "Could not register backlight device\n");
index 2f35f891593f73582edb7b3d25c900b38262f5cc..88aeccbafaaf9e46ed4678b573e0f28cc6a6f5f2 100644 (file)
@@ -590,7 +590,8 @@ static int __init toshiba_acpi_init(void)
                        remove_proc_entry(PROC_TOSHIBA, acpi_root_dir);
        }
 
-       toshiba_backlight_device = backlight_device_register("toshiba", NULL,
+       toshiba_backlight_device = backlight_device_register("toshiba",NULL,
+                                               NULL,
                                                &toshiba_backlight_data);
         if (IS_ERR(toshiba_backlight_device)) {
                printk(KERN_ERR "Could not register toshiba backlight device\n");
index fdb7153f4426c42b35be5e1206424c984f4de5ea..8e5e07e4c1cf6b91219148ad82bf10f1469fe3e6 100644 (file)
@@ -317,7 +317,8 @@ static int __init msi_init(void)
 
        /* Register backlight stuff */
 
-       msibl_device = backlight_device_register("msi-laptop-bl", NULL, &msibl_props);
+       msibl_device = backlight_device_register("msi-laptop-bl", NULL, NULL,
+                                               &msibl_props);
        if (IS_ERR(msibl_device))
                return PTR_ERR(msibl_device);
 
index 6b23a1def9fe9e12d9a36a6a6c3316fc44d38f06..a4522e6c31ec2a68c9c6d897e88266b323368233 100644 (file)
@@ -283,7 +283,7 @@ static int appledisplay_probe(struct usb_interface *iface,
        /* Register backlight device */
        snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
                atomic_inc_return(&count_displays) - 1);
-       pdata->bd = backlight_device_register(bl_name, pdata,
+       pdata->bd = backlight_device_register(bl_name, NULL, NULL,
                                                &appledisplay_bl_data);
        if (IS_ERR(pdata->bd)) {
                err("appledisplay: Backlight registration failed");
index 27597c576eff3f4cb0a116dee1d682f8ce4f9383..1d97cdf6f38249ca3bb8b24f3f2be512f2df1cde 100644 (file)
@@ -190,8 +190,10 @@ static int fb_notifier_callback(struct notifier_block *self,
  * Creates and registers new backlight class_device. Returns either an
  * ERR_PTR() or a pointer to the newly allocated device.
  */
-struct backlight_device *backlight_device_register(const char *name, void *devdata,
-                                                  struct backlight_properties *bp)
+struct backlight_device *backlight_device_register(const char *name,
+       struct device *dev,
+       void *devdata,
+       struct backlight_properties *bp)
 {
        int i, rc;
        struct backlight_device *new_bd;
@@ -206,6 +208,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
        new_bd->props = bp;
        memset(&new_bd->class_dev, 0, sizeof(new_bd->class_dev));
        new_bd->class_dev.class = &backlight_class;
+       new_bd->class_dev.dev = dev;
        strlcpy(new_bd->class_dev.class_id, name, KOBJ_NAME_LEN);
        class_set_devdata(&new_bd->class_dev, devdata);
 
index 75e91f5b6a04ce7dc0626599d9d21ac08f8b3059..a5cf1beacb443a18edbfcd1767e2866a24dc6299 100644 (file)
@@ -54,7 +54,7 @@ struct backlight_device {
 };
 
 extern struct backlight_device *backlight_device_register(const char *name,
-       void *devdata, struct backlight_properties *bp);
+       struct device *dev,void *devdata,struct backlight_properties *bp);
 extern void backlight_device_unregister(struct backlight_device *bd);
 
 #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)