ACPICA: Deploy new create integer interface where appropriate
[safe/jmp/linux-2.6] / drivers / acpi / video_detect.c
index 70b1e91..8c1b431 100644 (file)
@@ -10,7 +10,7 @@
  * assinged
  *
  * After PCI devices are glued with ACPI devices
- * acpi_get_physical_pci_device() can be called to identify ACPI graphics
+ * acpi_get_pci_dev() can be called to identify ACPI graphics
  * devices for which a real graphics card is plugged in
  *
  * Now acpi_video_get_capabilities() can be called to check which
 
 #include <linux/acpi.h>
 #include <linux/dmi.h>
+#include <linux/pci.h>
+
+#define PREFIX "ACPI: "
 
 ACPI_MODULE_NAME("video");
-#define ACPI_VIDEO_COMPONENT           0x08000000
 #define _COMPONENT             ACPI_VIDEO_COMPONENT
 
 static long acpi_video_support;
@@ -56,6 +58,9 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight "
                                  "support\n"));
                *cap |= ACPI_VIDEO_BACKLIGHT;
+               if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy)))
+                       printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness "
+                                       "control misses _BQC function\n");
                /* We have backlight support, no need to scan further */
                return AE_CTRL_TERMINATE;
        }
@@ -79,7 +84,7 @@ long acpi_is_video_device(struct acpi_device *device)
                return 0;
 
        /* Does this device able to support video switching ? */
-       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) &&
+       if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) ||
            ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy)))
                video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING;
 
@@ -96,7 +101,7 @@ long acpi_is_video_device(struct acpi_device *device)
        /* Only check for backlight functionality if one of the above hit. */
        if (video_caps)
                acpi_walk_namespace(ACPI_TYPE_DEVICE, device->handle,
-                                   ACPI_UINT32_MAX, acpi_backlight_cap_match,
+                                   ACPI_UINT32_MAX, acpi_backlight_cap_match, NULL,
                                    &video_caps, NULL);
 
        return video_caps;
@@ -107,7 +112,7 @@ static acpi_status
 find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
        long *cap = context;
-       struct device *dev;
+       struct pci_dev *dev;
        struct acpi_device *acpi_dev;
 
        const struct acpi_device_id video_ids[] = {
@@ -118,10 +123,10 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv)
                return AE_OK;
 
        if (!acpi_match_device_ids(acpi_dev, video_ids)) {
-               dev = acpi_get_physical_pci_device(handle);
+               dev = acpi_get_pci_dev(handle);
                if (!dev)
                        return AE_OK;
-               put_device(dev);
+               pci_dev_put(dev);
                *cap |= acpi_is_video_device(acpi_dev);
        }
        return AE_OK;
@@ -146,7 +151,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
        if (!graphics_handle) {
                /* Only do the global walk through all graphics devices once */
                acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                                   ACPI_UINT32_MAX, find_video,
+                                   ACPI_UINT32_MAX, find_video, NULL,
                                    &caps, NULL);
                /* There might be boot param flags set already... */
                acpi_video_support |= caps;
@@ -168,7 +173,7 @@ long acpi_video_get_capabilities(acpi_handle graphics_handle)
                        return 0;
                }
                acpi_walk_namespace(ACPI_TYPE_DEVICE, graphics_handle,
-                                   ACPI_UINT32_MAX, find_video,
+                                   ACPI_UINT32_MAX, find_video, NULL,
                                    &caps, NULL);
        }
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "We have 0x%lX video support %s %s\n",
@@ -235,7 +240,7 @@ EXPORT_SYMBOL(acpi_video_display_switch_support);
  * To force that backlight or display output switching is processed by vendor
  * specific acpi drivers or video.ko driver.
  */
-int __init acpi_backlight(char *str)
+static int __init acpi_backlight(char *str)
 {
        if (str == NULL || *str == '\0')
                return 1;
@@ -251,7 +256,7 @@ int __init acpi_backlight(char *str)
 }
 __setup("acpi_backlight=", acpi_backlight);
 
-int __init acpi_display_output(char *str)
+static int __init acpi_display_output(char *str)
 {
        if (str == NULL || *str == '\0')
                return 1;