{
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;
}
------------------------------------
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/)
},
.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",
},
.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",
},
.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",
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,
};
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);
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;
}
#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
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
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 ----------------------
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 -----------------------
*/
#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