Re: Add Sony Vaio VPCZ1 series to the nopnp table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 21, 2010 at 12:01:58AM -0700, Dmitry Torokhov wrote:
> On Mon, Apr 19, 2010 at 11:46:14AM +0200, Jan-Hendrik Zab wrote:
> > On 14/04/10 16:34 -0700, Dmitry Torokhov wrote:
> > > Sorry for the delay. I wonder if we simply do not recognize PNP ID for
> > > the touchpad. Coudl you give me output of:
> > > 
> > > for i in /sys/bus/pnp/devices/*; do echo $i; cat $i/id; done
> > > 
> > > and also your dsdt.
> > 
> > Hey,
> > I attached the DSDT and uploaded it to [0] for everyone on the
> > mailing list.
> > 
> 
> *sigh*
> 
> 
>                 Device (PS2M)
>                 {
>                     Name (_HID, "SNYSYN0003")
>                     Name (_CID, EisaId ("PNP0F13"))
>                     Name (_CRS, ResourceTemplate ()
> 
> PNP ID should be 7 characters...
> 
> Bjorn, do you think we could substitute CID for HID in case HID is
> invalid PNP device ID but CID is valid?
> 

Does something like below help in any way?

-- 
Dmitry


PNPACPI: cope with invalid device IDs

If primary ID (HID) is invalid try locating first valid ID on compatible
ID list before giving up.

Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>
---

 drivers/pnp/pnpacpi/core.c      |   27 +++++++++++++++++++++++----
 include/linux/mod_devicetable.h |    1 +
 2 files changed, 24 insertions(+), 4 deletions(-)


diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index f7ff628..1bf1677 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -28,7 +28,7 @@
 #include "../base.h"
 #include "pnpacpi.h"
 
-static int num = 0;
+static int num;
 
 /* We need only to blacklist devices that have already an acpi driver that
  * can't use pnp layer. We don't need to blacklist device that are directly
@@ -157,11 +157,24 @@ struct pnp_protocol pnpacpi_protocol = {
 };
 EXPORT_SYMBOL(pnpacpi_protocol);
 
+static char *pnpacpi_get_id(struct acpi_device *device)
+{
+	struct acpi_hardware_id *id;
+
+	list_for_each_entry(id, &device->pnp.ids, list) {
+		if (ispnpidacpi(id->id))
+			return id->id;
+	}
+
+	return NULL;
+}
+
 static int __init pnpacpi_add_device(struct acpi_device *device)
 {
 	acpi_handle temp = NULL;
 	acpi_status status;
 	struct pnp_dev *dev;
+	char *pnpid;
 	struct acpi_hardware_id *id;
 
 	/*
@@ -169,11 +182,17 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
 	 * driver should not be loaded.
 	 */
 	status = acpi_get_handle(device->handle, "_CRS", &temp);
-	if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
-	    is_exclusive_device(device) || (!device->status.present))
+	if (ACPI_FAILURE(status))
+		return 0;
+
+	pnpid = pnpacpi_get_id(device);
+	if (!pnpid)
+		return 0;
+
+	if (!is_exclusive_device(device) || !device->status.present)
 		return 0;
 
-	dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device));
+	dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid);
 	if (!dev)
 		return -ENOMEM;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux