aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2008-08-01 11:37:55 -0400
committerLen Brown <len.brown@intel.com>2008-11-07 23:57:55 -0500
commitc3d6de698c84efdbdd3781b7058bcc339ab43da8 (patch)
tree07e08d88bbaaef8a5a1dd58b9d19f7c860442d3a /drivers/acpi/video.c
parent22c13f9d8179f4c9caecfcb60a95214562b9addc (diff)
ACPI video: if no ACPI backlight support, use vendor drivers
If an ACPI graphics device supports backlight brightness functions (cmp. with latest ACPI spec Appendix B), let the ACPI video driver control backlight and switch backlight control off in vendor specific ACPI drivers (asus_acpi, thinkpad_acpi, eeepc, fujitsu_laptop, msi_laptop, sony_laptop, acer-wmi). Currently it is possible to load above drivers and let both poke on the brightness HW registers, the video and vendor specific ACPI drivers -> bad. This patch provides the basic support to check for BIOS capabilities before driver loading time. Driver specific modifications are in separate follow up patches. "acpi_backlight=vendor" Prever vendor driver over ACPI driver for backlight. "acpi_backlight=video" (default) Prever ACPI driver over vendor driver for backlight. Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 6597c2a37c36..2097c399dd06 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -739,7 +739,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
739 device->cap._DSS = 1; 739 device->cap._DSS = 1;
740 } 740 }
741 741
742 max_level = acpi_video_init_brightness(device); 742 if (acpi_video_backlight_support())
743 max_level = acpi_video_init_brightness(device);
743 744
744 if (device->cap._BCL && device->cap._BCM && max_level > 0) { 745 if (device->cap._BCL && device->cap._BCM && max_level > 0) {
745 int result; 746 int result;
@@ -785,18 +786,21 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
785 printk(KERN_ERR PREFIX "Create sysfs link\n"); 786 printk(KERN_ERR PREFIX "Create sysfs link\n");
786 787
787 } 788 }
788 if (device->cap._DCS && device->cap._DSS){ 789
789 static int count = 0; 790 if (acpi_video_display_switch_support()) {
790 char *name; 791
791 name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); 792 if (device->cap._DCS && device->cap._DSS) {
792 if (!name) 793 static int count;
793 return; 794 char *name;
794 sprintf(name, "acpi_video%d", count++); 795 name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
795 device->output_dev = video_output_register(name, 796 if (!name)
796 NULL, device, &acpi_output_properties); 797 return;
797 kfree(name); 798 sprintf(name, "acpi_video%d", count++);
799 device->output_dev = video_output_register(name,
800 NULL, device, &acpi_output_properties);
801 kfree(name);
802 }
798 } 803 }
799 return;
800} 804}
801 805
802/* 806/*