aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video_detect.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/video_detect.c')
-rw-r--r--drivers/acpi/video_detect.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 4ac2593234e7..66f67626f02e 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -67,40 +67,37 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
67 return 0; 67 return 0;
68} 68}
69 69
70/* Returns true if the device is a video device which can be handled by 70/* Returns true if the ACPI object is a video device which can be
71 * video.ko. 71 * handled by video.ko.
72 * The device will get a Linux specific CID added in scan.c to 72 * The device will get a Linux specific CID added in scan.c to
73 * identify the device as an ACPI graphics device 73 * identify the device as an ACPI graphics device
74 * Be aware that the graphics device may not be physically present 74 * Be aware that the graphics device may not be physically present
75 * Use acpi_video_get_capabilities() to detect general ACPI video 75 * Use acpi_video_get_capabilities() to detect general ACPI video
76 * capabilities of present cards 76 * capabilities of present cards
77 */ 77 */
78long acpi_is_video_device(struct acpi_device *device) 78long acpi_is_video_device(acpi_handle handle)
79{ 79{
80 acpi_handle h_dummy; 80 acpi_handle h_dummy;
81 long video_caps = 0; 81 long video_caps = 0;
82 82
83 if (!device)
84 return 0;
85
86 /* Is this device able to support video switching ? */ 83 /* Is this device able to support video switching ? */
87 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) || 84 if (ACPI_SUCCESS(acpi_get_handle(handle, "_DOD", &h_dummy)) ||
88 ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy))) 85 ACPI_SUCCESS(acpi_get_handle(handle, "_DOS", &h_dummy)))
89 video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; 86 video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING;
90 87
91 /* Is this device able to retrieve a video ROM ? */ 88 /* Is this device able to retrieve a video ROM ? */
92 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy))) 89 if (ACPI_SUCCESS(acpi_get_handle(handle, "_ROM", &h_dummy)))
93 video_caps |= ACPI_VIDEO_ROM_AVAILABLE; 90 video_caps |= ACPI_VIDEO_ROM_AVAILABLE;
94 91
95 /* Is this device able to configure which video head to be POSTed ? */ 92 /* Is this device able to configure which video head to be POSTed ? */
96 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) && 93 if (ACPI_SUCCESS(acpi_get_handle(handle, "_VPO", &h_dummy)) &&
97 ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) && 94 ACPI_SUCCESS(acpi_get_handle(handle, "_GPD", &h_dummy)) &&
98 ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy))) 95 ACPI_SUCCESS(acpi_get_handle(handle, "_SPD", &h_dummy)))
99 video_caps |= ACPI_VIDEO_DEVICE_POSTING; 96 video_caps |= ACPI_VIDEO_DEVICE_POSTING;
100 97
101 /* Only check for backlight functionality if one of the above hit. */ 98 /* Only check for backlight functionality if one of the above hit. */
102 if (video_caps) 99 if (video_caps)
103 acpi_walk_namespace(ACPI_TYPE_DEVICE, device->handle, 100 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
104 ACPI_UINT32_MAX, acpi_backlight_cap_match, NULL, 101 ACPI_UINT32_MAX, acpi_backlight_cap_match, NULL,
105 &video_caps, NULL); 102 &video_caps, NULL);
106 103
@@ -127,7 +124,7 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
127 if (!dev) 124 if (!dev)
128 return AE_OK; 125 return AE_OK;
129 pci_dev_put(dev); 126 pci_dev_put(dev);
130 *cap |= acpi_is_video_device(acpi_dev); 127 *cap |= acpi_is_video_device(handle);
131 } 128 }
132 return AE_OK; 129 return AE_OK;
133} 130}