From: Mathieu BĂ©rard Date: Sun, 30 Sep 2007 20:05:49 +0000 (+0000) Subject: * Update for acpi and backlight API changes in linux 2.6.23 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=585203cdb241bb6fa14d743ab74dab296dec627d;p=omnibook.git * Update for acpi and backlight API changes in linux 2.6.23 --- diff --git a/acpi.c b/acpi.c index c716f4a..6278b3b 100644 --- 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 020b8d6..8bc9d70 100644 --- 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 */