[PATCH 3/8] ideapad: make sure we bind on the correct device

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ike Panhc
Date: Wednesday, August 18, 2010 - 1:37 am

By reading from method _STA and _CFG to make sure we bind on the correct
VPC2004 device.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
---
 drivers/platform/x86/ideapad_acpi.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/ideapad_acpi.c b/drivers/platform/x86/ideapad_acpi.c
index 6176597..c1eec70 100644
--- a/drivers/platform/x86/ideapad_acpi.c
+++ b/drivers/platform/x86/ideapad_acpi.c
@@ -328,10 +328,18 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids);
 
 static int ideapad_acpi_add(struct acpi_device *adevice)
 {
-	int i;
+	int i, cfg;
 	int devs_present[5];
 	struct ideapad_private *priv;
 
+	if (read_method_int(adevice->handle, "_STA", &i))
+		return -ENODEV;
+	if (i != 0x0F)
+		return -ENODEV;
+
+	if (read_method_int(adevice->handle, "_CFG", &cfg))
+		return -ENODEV;
+
 	for (i = IDEAPAD_DEV_CAMERA; i < IDEAPAD_DEV_KILLSW; i++) {
 		devs_present[i] = ideapad_dev_exists(i);
 		if (devs_present[i] < 0)
-- 
1.7.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/8] ideapad: add ACPI helpers, Ike Panhc, (Wed Aug 18, 1:36 am)
[PATCH 3/8] ideapad: make sure we bind on the correct device, Ike Panhc, (Wed Aug 18, 1:37 am)
[PATCH 6/8] ideapad: rewrite the hw rfkill notify, Ike Panhc, (Wed Aug 18, 1:38 am)
[PATCH 7/8] ideapad: rewrite the sw rfkill set, Ike Panhc, (Wed Aug 18, 1:38 am)
Re: [PATCH 5/8] ideapad: use EC command to control camera, Oliver Neukum, (Wed Aug 18, 1:42 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Wed Aug 18, 8:51 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Thu Aug 19, 12:31 pm)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Fri Aug 20, 2:08 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Mon Aug 30, 11:19 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Wed Sep 1, 12:56 pm)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Thu Sep 9, 11:17 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Fri Sep 10, 12:11 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Wed Sep 15, 4:48 am)
Re: [PATCH 0/8] [Resend] ideapad: using EC command to cont ..., Mario 'BitKoenig' Holbe, (Tue Sep 21, 6:47 am)