]> Devoid-pointer.net GitWeb - omnibook.git/commitdiff
* Update for acpi and backlight API changes in linux 2.6.23
authorMathieu Bérard <mathieu.berard@crans.org>
Sun, 30 Sep 2007 20:05:49 +0000 (20:05 +0000)
committerMathieu Bérard <mathieu.berard@crans.org>
Sun, 30 Sep 2007 20:05:49 +0000 (20:05 +0000)
acpi.c
lcd.c

diff --git a/acpi.c b/acpi.c
index c716f4ac1decffc04c1fd9f8e84dd9ab71cdad1a..6278b3bc5ae8b294192d6d7c84e0851b3af0b906 100644 (file)
--- a/acpi.c
+++ b/acpi.c
@@ -70,6 +70,23 @@ static char ec_dev_list[][20] = {
 static int omnibook_acpi_bt_add(struct acpi_device *device);
 static int omnibook_acpi_bt_remove(struct acpi_device *device, int type);
 
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+const struct acpi_device_id omnibook_bt_ids[] = {
+       {"TOS6205", 0},
+       {"", 0},
+};
+
+static struct acpi_driver omnibook_bt_driver = {
+       .name   = OMNIBOOK_MODULE_NAME,
+       .class  = TOSHIBA_ACPI_BT_CLASS,
+       .ids    = omnibook_bt_ids,
+       .ops    = {
+                       .add    =  omnibook_acpi_bt_add,
+                       .remove =  omnibook_acpi_bt_remove,
+                 },
+};
+#else /* 2.6.23 */
 static struct acpi_driver omnibook_bt_driver = {
        .name   = OMNIBOOK_MODULE_NAME,
        .class  = TOSHIBA_ACPI_BT_CLASS,
@@ -79,6 +96,8 @@ static struct acpi_driver omnibook_bt_driver = {
                        .remove =  omnibook_acpi_bt_remove,
                  },
 };
+#endif /* 2.6.23 */
+
 
 /*
  * ACPI backend private data structure
diff --git a/lcd.c b/lcd.c
index 020b8d6e71ddac9460374b6e4eb4f1f70cc746bf..8bc9d70c75269c9598c2caa070a10619c374d615 100644 (file)
--- a/lcd.c
+++ b/lcd.c
@@ -49,7 +49,11 @@ static int omnibook_get_backlight(struct backlight_device *bd)
        struct omnibook_operation *io_op;
        u8 brgt;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+       io_op = bl_get_data(bd);
+#else /* 2.6.23 */     
        io_op = class_get_devdata(&bd->class_dev);
+#endif /* 2.6.23 */
        retval = backend_byte_read(io_op, &brgt);
        if (!retval)
                retval = brgt;
@@ -66,7 +70,11 @@ static int omnibook_set_backlight(struct backlight_device *bd)
 #endif /* 2.6.21 */    
        struct omnibook_operation *io_op;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
+       io_op = bl_get_data(bd);
+#else /* 2.6.23 */     
        io_op = class_get_devdata(&bd->class_dev);
+#endif /* 2.6.23 */
        return backend_byte_write(io_op, intensity);
 }
 #endif /* CONFIG_OMNIBOOK_BACKLIGHT */