diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index a29b0ccac65a..baa441929720 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <acpi/acpi_bus.h> | 41 | #include <acpi/acpi_bus.h> |
42 | #include <acpi/acpi_drivers.h> | 42 | #include <acpi/acpi_drivers.h> |
43 | 43 | ||
44 | #define ACPI_VIDEO_COMPONENT 0x08000000 | ||
45 | #define ACPI_VIDEO_CLASS "video" | 44 | #define ACPI_VIDEO_CLASS "video" |
46 | #define ACPI_VIDEO_BUS_NAME "Video Bus" | 45 | #define ACPI_VIDEO_BUS_NAME "Video Bus" |
47 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" | 46 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" |
@@ -739,7 +738,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
739 | device->cap._DSS = 1; | 738 | device->cap._DSS = 1; |
740 | } | 739 | } |
741 | 740 | ||
742 | max_level = acpi_video_init_brightness(device); | 741 | if (acpi_video_backlight_support()) |
742 | max_level = acpi_video_init_brightness(device); | ||
743 | 743 | ||
744 | if (device->cap._BCL && device->cap._BCM && max_level > 0) { | 744 | if (device->cap._BCL && device->cap._BCM && max_level > 0) { |
745 | int result; | 745 | int result; |
@@ -785,18 +785,21 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
785 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 785 | printk(KERN_ERR PREFIX "Create sysfs link\n"); |
786 | 786 | ||
787 | } | 787 | } |
788 | if (device->cap._DCS && device->cap._DSS){ | 788 | |
789 | static int count = 0; | 789 | if (acpi_video_display_switch_support()) { |
790 | char *name; | 790 | |
791 | name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); | 791 | if (device->cap._DCS && device->cap._DSS) { |
792 | if (!name) | 792 | static int count; |
793 | return; | 793 | char *name; |
794 | sprintf(name, "acpi_video%d", count++); | 794 | name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); |
795 | device->output_dev = video_output_register(name, | 795 | if (!name) |
796 | NULL, device, &acpi_output_properties); | 796 | return; |
797 | kfree(name); | 797 | sprintf(name, "acpi_video%d", count++); |
798 | device->output_dev = video_output_register(name, | ||
799 | NULL, device, &acpi_output_properties); | ||
800 | kfree(name); | ||
801 | } | ||
798 | } | 802 | } |
799 | return; | ||
800 | } | 803 | } |
801 | 804 | ||
802 | /* | 805 | /* |
@@ -842,11 +845,16 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video) | |||
842 | static int acpi_video_bus_check(struct acpi_video_bus *video) | 845 | static int acpi_video_bus_check(struct acpi_video_bus *video) |
843 | { | 846 | { |
844 | acpi_status status = -ENOENT; | 847 | acpi_status status = -ENOENT; |
845 | 848 | struct device *dev; | |
846 | 849 | ||
847 | if (!video) | 850 | if (!video) |
848 | return -EINVAL; | 851 | return -EINVAL; |
849 | 852 | ||
853 | dev = acpi_get_physical_pci_device(video->device->handle); | ||
854 | if (!dev) | ||
855 | return -ENODEV; | ||
856 | put_device(dev); | ||
857 | |||
850 | /* Since there is no HID, CID and so on for VGA driver, we have | 858 | /* Since there is no HID, CID and so on for VGA driver, we have |
851 | * to check well known required nodes. | 859 | * to check well known required nodes. |
852 | */ | 860 | */ |
@@ -2094,12 +2102,6 @@ static int __init acpi_video_init(void) | |||
2094 | { | 2102 | { |
2095 | int result = 0; | 2103 | int result = 0; |
2096 | 2104 | ||
2097 | |||
2098 | /* | ||
2099 | acpi_dbg_level = 0xFFFFFFFF; | ||
2100 | acpi_dbg_layer = 0x08000000; | ||
2101 | */ | ||
2102 | |||
2103 | acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); | 2105 | acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); |
2104 | if (!acpi_video_dir) | 2106 | if (!acpi_video_dir) |
2105 | return -ENODEV; | 2107 | return -ENODEV; |