From patchwork Sun Jul 11 00:29:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yi Lee X-Patchwork-Id: 111257 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6B0Tgr9028667 for ; Sun, 11 Jul 2010 00:29:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561Ab0GKA3h (ORCPT ); Sat, 10 Jul 2010 20:29:37 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:49238 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753453Ab0GKA3g (ORCPT ); Sat, 10 Jul 2010 20:29:36 -0400 Received: by pvc7 with SMTP id 7so1347743pvc.19 for ; Sat, 10 Jul 2010 17:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=gNvKV7OKI/8JJS1z+w4rh3+CRpSeTV36+1AGrMvXrOg=; b=jbFoDQ/AFsPx7HbqNqxTQ8uhB1ASq+H9SlG6q57NTu+DHg7sw733nHvIymlZ9z4CyX 7GSv/sejyvZXP2CQgzlDD5+MH3S5hY84LG5U/JVAJuARlL348AZ9bXDRFVdojZF2lyw2 Vgtv7hnV54r/dMZHeAt/9GMgcdKJ6i9485cUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=PRDpOjlg/eQL0O5DsOQwrno+MtIt+2nW5K2ItHn5shI5nig5MSL7wELjfuTlWiWjc5 gTQRR9pYcU40FTcmEEJ/GBVP2LN01NbBYwXtgtwNW1CWnPNol5e7RqjQV/3s8ZM7QN3J RvHAAb9gzipRrsdnLnZ5f22Xf1h6Y3R28dX2c= Received: by 10.142.192.4 with SMTP id p4mr8446186wff.311.1278808174717; Sat, 10 Jul 2010 17:29:34 -0700 (PDT) Received: from localhost.localdomain (124-11-22-254.dynamic.tfn.net.tw [124.11.22.254]) by mx.google.com with ESMTPS id g37sm2620571rvb.5.2010.07.10.17.29.32 (version=SSLv3 cipher=RC4-MD5); Sat, 10 Jul 2010 17:29:34 -0700 (PDT) From: "Lee, Chun-Yi" To: linux-acpi@vger.kernel.org Cc: "Lee, Chun-Yi" Subject: [PATCH] Add intel drm blacklist to intel_opregion_present detect Date: Sun, 11 Jul 2010 08:29:17 +0800 Message-Id: <1278808157-6441-1-git-send-email-jlee@novell.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 11 Jul 2010 00:29:42 +0000 (UTC) There have some machines not support by i915 drm driver, e.g. MSI U110/U150, there are use poulsbo chip and drm driver not support it because legal issue. Those machines's acpi backlight control actually work fine and don't need apply the intel opregion support. So, add intel drm blacklist to intel_opregion_present, it can enable the acpi brightness interface but not use intel opregion. Signed-off-by: Lee, Chun-Yi --- drivers/acpi/video.c | 17 ++++++++++++++++- include/linux/pci_ids.h | 1 + 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 9865d46..25a70e0 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -88,6 +88,11 @@ static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device, int type); static void acpi_video_bus_notify(struct acpi_device *device, u32 event); +static const struct pci_device_id intel_drm_blacklist[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_VGA) }, + { } /* Terminating entry */ +}; + static const struct acpi_device_id video_device_ids[] = { {ACPI_VIDEO_HID, 0}, {"", 0}, @@ -2531,8 +2536,11 @@ static int __init intel_opregion_present(void) #if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE) struct pci_dev *dev = NULL; u32 address; + int i; + bool in_blacklist; for_each_pci_dev(dev) { + in_blacklist = 0; if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) continue; if (dev->vendor != PCI_VENDOR_ID_INTEL) @@ -2540,7 +2548,14 @@ static int __init intel_opregion_present(void) pci_read_config_dword(dev, 0xfc, &address); if (!address) continue; - return 1; + for (i = 0; intel_drm_blacklist[i].device != 0; i++) { + if (dev->device == intel_drm_blacklist[i].device) { + in_blacklist = 1; + break; + } + } + if (!in_blacklist) + return 1; } #endif return 0; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3bedcc1..78858b1 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2669,6 +2669,7 @@ #define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 #define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 +#define PCI_DEVICE_ID_INTEL_SCH_VGA 0x8108 #define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119 #define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4