]> Devoid-pointer.net GitWeb - omnibook.git/commitdiff
* Fix cooling feature actual state output
authorMathieu Bérard <mathieu.berard@crans.org>
Sat, 24 Mar 2007 17:52:20 +0000 (17:52 +0000)
committerMathieu Bérard <mathieu.berard@crans.org>
Sat, 24 Mar 2007 17:52:20 +0000 (17:52 +0000)
* Added dmi signature for P25 M60 and another flavor of Tecra S1
* Updated Changelog
* Added support for upcoming 2.6.21 blacklight API changes, there is now
  3 API versions supported (2.6.16 to 2.6.19 ; 2.6.20 only and 2.6.21 to ...)
  which of course leads to more #ifdef uglyness ...

cooling.c
doc/ChangeLog
laptop.h
lcd.c
misc/dmi_strings.txt
omnibook.h

index e2054c671b5369eee7450c137d5574364b835d0d..486aa861cc776799ba16ac2fdfa4311fbfd6d8a2 100644 (file)
--- a/cooling.c
+++ b/cooling.c
@@ -35,16 +35,28 @@ static int omnibook_cooling_write(char *buffer, struct omnibook_operation *io_op
 {
        int retval = 0;
 
+       if(mutex_lock_interruptible(&io_op->backend->mutex))
+               return -ERESTARTSYS;
+
+
        if (*buffer == '0') {
-               retval = backend_byte_write(io_op, 
+               retval = __backend_byte_write(io_op, 
                                TSM70_COOLING_OFFSET + TSM70_COOLING_POWERSAVE);
        } else if (*buffer == '1') {
-               retval = backend_byte_write(io_op,
+               retval = __backend_byte_write(io_op,
                                TSM70_COOLING_OFFSET + TSM70_COOLING_PERF);
        } else {
-               return -EINVAL;
+               retval = -EINVAL;
+               goto out;
        }
 
+       /* *buffer is either '0' or '1' here */
+       if (!retval)
+               io_op->backend->cooling_state = *buffer - '0' ;
+
+       mutex_unlock(&io_op->backend->mutex);
+
+       out:
        return retval;
 }
 
index 89952fc622cd3f9f89fe8ec0808169bb59c3590a..f901febcbdc08bbce8ef5df3f6d05c9af12a63c4 100644 (file)
@@ -2,6 +2,11 @@ Changelog file for omnibook package:
 ------------------------------------
 
 2.XXXXXXXX Mathieu Bérard <math_b@users.sourceforge.net>
+* DMI signature added:
+       Toshiba Satellite P25 (ectype 11)
+       Toshiba Satellite M60 (ectype 12)
+
+2.20070211 Mathieu Bérard <math_b@users.sourceforge.net>
 * Disable Acer support, acerhk module should provided better
   support with a far more complete autodetection database
   (see http://www2.informatik.hu-berlin.de/~tauber/acerhk/)
index cf8a81fd9d47f43b6d29107239d09e71007e9d23..5aba4e13f3b446c12f0f77dee3b1b5f571f2b51c 100644 (file)
--- a/laptop.h
+++ b/laptop.h
@@ -658,6 +658,15 @@ static struct  dmi_system_id omnibook_ids[] __initdata = {
                },
                .driver_data = (void*) TSP10
        },
+       {
+               .callback = dmi_matched,
+               .ident = "Toshiba Satellite P25",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P25"),
+               },
+               .driver_data = (void*) TSP10
+       },
        {
                .callback = dmi_matched,
                .ident = "Toshiba Satellite M30X",
@@ -676,6 +685,15 @@ static struct  dmi_system_id omnibook_ids[] __initdata = {
                },
                .driver_data = (void*) TSM70
        },
+       {
+               .callback = dmi_matched,
+               .ident = "Toshiba Satellite M60",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Satellite M60"),
+               },
+               .driver_data = (void*) TSM70
+       },
        {
                .callback = dmi_matched,
                .ident = "Toshiba Satellite M70",
@@ -748,6 +766,15 @@ static struct  dmi_system_id omnibook_ids[] __initdata = {
                },
                .driver_data = (void*) TSM40
        },
+       {
+               .callback = dmi_matched,
+               .ident = "Toshiba Tecra S1",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Tecra S1"),
+               },
+               .driver_data = (void*) TSM40
+       },
        {
                .callback = dmi_matched,
                .ident = "Toshiba Tecra S2",
diff --git a/lcd.c b/lcd.c
index 8aade89b0f42a01c4774707d29a71ad3a6aebd65..020b8d6e71ddac9460374b6e4eb4f1f70cc746bf 100644 (file)
--- a/lcd.c
+++ b/lcd.c
@@ -33,8 +33,12 @@ static struct backlight_device *omnibook_backlight_device;
 static int omnibook_get_backlight(struct backlight_device *bd);
 static int omnibook_set_backlight(struct backlight_device *bd);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+static struct backlight_ops omnibookbl_ops = {
+#else /* 2.6.21 */
 static struct backlight_properties omnibookbl_data = {
        .owner = THIS_MODULE,
+#endif /* 2.6.21 */
        .get_brightness = omnibook_get_backlight,
        .update_status = omnibook_set_backlight,
 };
@@ -55,7 +59,11 @@ static int omnibook_get_backlight(struct backlight_device *bd)
 
 static int omnibook_set_backlight(struct backlight_device *bd)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+       u8 intensity = bd->props.brightness;
+#else /* 2.6.21 */
        u8 intensity = bd->props->brightness;
+#endif /* 2.6.21 */    
        struct omnibook_operation *io_op;
 
        io_op = class_get_devdata(&bd->class_dev);
@@ -93,8 +101,12 @@ static int omnibook_brightness_write(char *buffer, struct omnibook_operation *io
                else {
                        backend_byte_write(io_op, brgt);
 #ifdef CONFIG_OMNIBOOK_BACKLIGHT
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+                       omnibook_backlight_device->props.brightness = brgt;
+#else /* 2.6.21 */
                        omnibookbl_data.brightness = brgt;
-#endif                 
+#endif
+#endif 
                }
        }
        return 0;
@@ -124,12 +136,14 @@ static int __init omnibook_brightness_init(struct omnibook_operation *io_op)
        }
 
 #ifdef CONFIG_OMNIBOOK_BACKLIGHT
-       backend_byte_read(io_op, (u8*) &omnibookbl_data.brightness);
-       omnibookbl_data.max_brightness = omnibook_max_brightness;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+       
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+       omnibook_backlight_device =
+           backlight_device_register(OMNIBOOK_MODULE_NAME, NULL, (void *)io_op, &omnibookbl_ops);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
        omnibook_backlight_device =
            backlight_device_register(OMNIBOOK_MODULE_NAME, NULL, (void *)io_op, &omnibookbl_data);
-#else
+#else /*  < 2.6.20 */
        omnibook_backlight_device =
            backlight_device_register(OMNIBOOK_MODULE_NAME, (void *)io_op, &omnibookbl_data);
 #endif
@@ -137,10 +151,18 @@ static int __init omnibook_brightness_init(struct omnibook_operation *io_op)
                printk(O_ERR "Unable to register as backlight device.\n");
                return -ENODEV;
        }
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+       omnibook_backlight_device->props.max_brightness = omnibook_max_brightness;
+       backend_byte_read(io_op, (u8*) &omnibook_backlight_device->props.brightness);
+#else /* < 2.6.21 */
+       omnibookbl_data.max_brightness = omnibook_max_brightness;
+       backend_byte_read(io_op, (u8*) &omnibookbl_data.brightness);
 #endif
+#endif /* CONFIG_OMNIBOOK_BACKLIGHT */
        return 0;
 }
-
 static void __exit omnibook_brightness_cleanup(struct omnibook_operation *io_op)
 {
 #ifdef CONFIG_OMNIBOOK_BACKLIGHT
index 1842467e8416e706992a465e01eb0838bacb5d02..0668eaf418d5822c17b56cc043cfa4e99fd7e6fd 100644 (file)
@@ -229,6 +229,19 @@ Board Vendor:  TOSHIBA
 Board Name:    DAL00
 Board Version: Null
 
+---------------------------------------------
+Toshiba Satellite P25 -----------------------
+
+BIOS Vendor:   TOSHIBA
+BIOS Version:  V2.10
+BIOS Release:  12/27/2004
+System Vendor: TOSHIBA
+Product Name:  Satellite P25
+Version:       PSP20U-19PS8R
+Serial Number: Y3026615C
+Board Vendor:  TOSHIBA
+Board Name:    Null
+
 ---------------------------------------------
 Toshiba Satellite P100 ----------------------
 
@@ -279,6 +292,18 @@ Board Vendor:  TOSHIBA
 Board Name:    EAL30
 Board Version: Null
 
+---------------------------------------------
+Toshiba Satellite M60 -----------------------
+
+BIOS Vendor:   TOSHIBA
+BIOS Version:  V1.60
+BIOS Release:  03/16/2006
+System Vendor: TOSHIBA
+Product Name:  Satellite M60
+Version:       PSM60E-0CD01FIT
+Board Vendor:  TOSHIBA
+Board Name:    Null
+
 ---------------------------------------------
 Toshiba Satellite M70 -----------------------
 
index 64e4030dc0957269899c576da579d2faf88ed236..7c8cac2a4233794a5b8f203e25f55ff4dcc5847c 100644 (file)
@@ -151,7 +151,7 @@ void omnibook_report_key(struct input_dev *dev, unsigned int keycode);
  */
 
 #ifdef  OMNIBOOK_STANDALONE
-#if     (defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
+#if     (defined (CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE)) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16))
 #define CONFIG_OMNIBOOK_BACKLIGHT
 #else
 #undef  CONFIG_OMNIBOOK_BACKLIGHT