kfree(obj);
if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){
- unsigned long tmp;
++ int result;
static int count = 0;
char *name;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
return;
sprintf(name, "acpi_video%d", count++);
- acpi_video_device_lcd_get_level_current(device, &tmp);
device->backlight = backlight_device_register(name,
NULL, device, &acpi_backlight_ops);
- device->backlight->props.max_brightness = max_level;
- device->backlight->props.brightness = (int)tmp;
+ device->backlight->props.max_brightness = device->brightness->count-3;
+ device->backlight->props.brightness = acpi_video_get_brightness(device->backlight);
backlight_update_status(device->backlight);
--
kfree(name);
++
++ device->cdev = thermal_cooling_device_register("LCD",
++ device->dev, &video_cooling_ops);
++ if (device->cdev) {
++ printk(KERN_INFO PREFIX
++ "%s is registered as cooling_device%d\n",
++ device->dev->dev.bus_id, device->cdev->id);
++ result = sysfs_create_link(&device->dev->dev.kobj,
++ &device->cdev->device.kobj,
++ "thermal_cooling");
++ if (result)
++ printk(KERN_ERR PREFIX "Create sysfs link\n");
++ result = sysfs_create_link(&device->cdev->device.kobj,
++ &device->dev->dev.kobj,
++ "device");
++ if (result)
++ printk(KERN_ERR PREFIX "Create sysfs link\n");
++ }
}
if (device->cap._DCS && device->cap._DSS){
static int count = 0;