public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: acpi4asus-user@lists.sourceforge.net
Cc: Corentin Chary <corentincj@iksaif.net>, linux-kernel@vger.kernel.org
Subject: [PATCH] EeePC 1005PE rfkill fix
Date: Thu, 28 Jan 2010 12:53:54 +0000	[thread overview]
Message-ID: <201001281253.54878.paul@codesourcery.com> (raw)

The EeePC 1005PE has the wireless card on PCI bus 2.

Signed-off-by: Paul Brook <paul@codesourcery.com>
---
Same as before, but without mail client mangling the patch.

I couldn't figure out a smart way of figuring out the correct bus, so I 
hardcoded the device name. lspci and acpi dumps available at 
http://www.pbrook80.webspace.virginmedia.com/

My guess is that the 1005HA is configured similarly, however I don't have 
hardware to test. The preceding comments imply that the 1005HA does not 
require the pci hotplug bits. On my 1005PE the hotplug bits are definitely 
required (the device stops responding when the rfkill is activated), we just 
need to make sure we disable the right bus. PCI bus 1 contains the wired 
Ethernet controller.

 drivers/platform/x86/eeepc-laptop.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index e2be6bb..6b53701 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -161,6 +161,7 @@ struct eeepc_laptop {
 					   by this BIOS */
 	bool cpufv_disabled;
 	bool hotplug_disabled;
+	int hotplug_bus;
 	u16 event_count[128];		/* count for each event */
 
 	struct platform_device *platform_device;
@@ -585,9 +586,10 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
 	mutex_lock(&eeepc->hotplug_lock);
 
 	if (eeepc->hotplug_slot) {
-		bus = pci_find_bus(0, 1);
+		bus = pci_find_bus(0, eeepc->hotplug_bus);
 		if (!bus) {
-			pr_warning("Unable to find PCI bus 1?\n");
+			pr_warning("Unable to find PCI bus %d?\n",
+				   eeepc->hotplug_bus);
 			goto out_unlock;
 		}
 
@@ -695,7 +697,7 @@ static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
 static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc)
 {
 	int ret = -ENOMEM;
-	struct pci_bus *bus = pci_find_bus(0, 1);
+	struct pci_bus *bus = pci_find_bus(0, eeepc->hotplug_bus);
 
 	if (!bus) {
 		pr_err("Unable to find wifi PCI bus\n");
@@ -1281,6 +1283,13 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 		eeepc->hotplug_disabled = true;
 		pr_info("wlan hotplug disabled\n");
 	}
+
+	/* The eeepc 1005PE has the wireless chip on the second PCIe bus.  */
+	if (strcmp(model, "1005PE") == 0) {
+	    eeepc->hotplug_bus = 2;
+	} else {
+	    eeepc->hotplug_bus = 1;
+	}
 }
 
 static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
-- 
1.6.6


             reply	other threads:[~2010-01-28 12:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 12:53 Paul Brook [this message]
2010-01-28 13:26 ` [PATCH] EeePC 1005PE rfkill fix Corentin Chary
2010-01-28 16:50   ` Paul Brook
  -- strict thread matches above, loose matches on Subject: below --
2010-01-27 15:35 Paul Brook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001281253.54878.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=corentincj@iksaif.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox