public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it
@ 2007-10-15 16:33 Thomas Renninger
       [not found] ` <1192465995.9847.587.camel-X8wR35IVlAxolqkO4TVVkw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Renninger @ 2007-10-15 16:33 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown, Li, Shaohua, Christian Birchinger, ibm-acpi-devel

Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it

Those laptops define one grahpics device on a PCI Express (e.g. Internal Intel
965 card) and one on a separate PCI bus (via a PCI root bridge, e.g. in AGP
case for an Nvidia graphics card).
PCI devices need to be enumerated and checked whether on the ACPI video device
a graphics card is really connected to.

This patch only checks whether a PCI device exists (could also be a PCI bridge).
To really get the pci_dev struct and check it whether it really is of class
"graphics card" or to further make use of it in this driver, it must be checked
what got set up behind a possilbe bridge.

Signed-off-by: Thomas Renninger <trenn@suse.de>

---
 drivers/acpi/video.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Index: lenb/drivers/acpi/video.c
===================================================================
--- lenb.orig/drivers/acpi/video.c
+++ lenb/drivers/acpi/video.c
@@ -34,6 +34,8 @@
 #include <linux/input.h>
 #include <linux/backlight.h>
 #include <linux/video_output.h>
+#include <linux/pci.h>
+#include <linux/acpi.h>
 #include <asm/uaccess.h>
 
 #include <acpi/acpi_bus.h>
@@ -1901,11 +1903,29 @@ static int acpi_video_bus_add(struct acp
 	acpi_status status = 0;
 	struct acpi_video_bus *video = NULL;
 	struct input_dev *input;
+	struct pci_dev *pci = NULL;
 
 
 	if (!device)
 		return -EINVAL;
 
+	/* TBD(trenn):
+	 *	Check against pci->class whether we have a graphics device
+	 *	If we have a bridge, find out the bus no. it is associated
+	 *	to and check whether there a graphics device sits.
+	 *
+	 *	Not sure whether this is needed, maybe it's enough to find out
+	 *	whether there is a PCI device registered at as done now,
+	 *	but it might be	helpful for the video module to access the
+	 *	video device's struct pci_dev* structure.
+	 */
+	result = acpi_find_pci_device(device, pci);
+	if (result < 0) {
+		printk (KERN_DEBUG PREFIX "Video device %s not physically"
+			" connected, ignoring\n", acpi_device_bid(device));
+		return -ENODEV;
+	}
+
 	video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
 	if (!video)
 		return -ENOMEM;



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-17 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15 16:33 [PATCH 2/2] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it Thomas Renninger
     [not found] ` <1192465995.9847.587.camel-X8wR35IVlAxolqkO4TVVkw@public.gmane.org>
2007-10-16 17:50   ` Christian Birchinger
2007-10-16 18:09     ` Maik Broemme
2007-10-17  8:25       ` Thomas Renninger
2007-10-17 10:12         ` Maik Broemme
2007-10-17 10:40           ` Thomas Renninger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox