From: Seth Forshee <seth.forshee@canonical.com>
To: Matthew Garrett <mjg@redhat.com>
Cc: Azael Avalos <coproscefalo@gmail.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] toshiba_acpi: Support SPFC as an HCI method
Date: Tue, 20 Sep 2011 16:55:52 -0500 [thread overview]
Message-ID: <1316555754-25949-5-git-send-email-seth.forshee@canonical.com> (raw)
In-Reply-To: <1316555754-25949-1-git-send-email-seth.forshee@canonical.com>
Some Toshiba models, notably those with the TOS1900 device, use
the SPFC method for HCI calls instead of GHCI. Test for this method
if GHCI isn't found, and if it exists use it for all HCI calls.
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
drivers/platform/x86/toshiba_acpi.c | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index a924c7f..cc629e6 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -892,11 +892,26 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev, int type)
return 0;
}
+static const char * __devinit find_hci_method(acpi_handle handle)
+{
+ acpi_status status;
+ acpi_handle hci_handle;
+
+ status = acpi_get_handle(handle, "GHCI", &hci_handle);
+ if (ACPI_SUCCESS(status))
+ return "GHCI";
+
+ status = acpi_get_handle(handle, "SPFC", &hci_handle);
+ if (ACPI_SUCCESS(status))
+ return "SPFC";
+
+ return NULL;
+}
+
static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev)
{
struct toshiba_acpi_dev *dev;
- acpi_status status;
- acpi_handle handle;
+ const char *hci_method;
u32 hci_result;
bool bt_present;
int ret = 0;
@@ -905,16 +920,17 @@ static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev)
pr_info("Toshiba Laptop ACPI Extras version %s\n",
TOSHIBA_ACPI_VERSION);
- /* simple device detection: look for HCI method */
- status = acpi_get_handle(acpi_dev->handle, "GHCI", &handle);
- if (ACPI_FAILURE(status))
+ hci_method = find_hci_method(acpi_dev->handle);
+ if (!hci_method) {
+ pr_err("HCI interface not found\n");
return -ENODEV;
+ }
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
dev->acpi_dev = acpi_dev;
- dev->method_hci = "GHCI";
+ dev->method_hci = hci_method;
acpi_dev->driver_data = dev;
if (toshiba_acpi_setup_keyboard(dev))
--
1.7.4.1
next prev parent reply other threads:[~2011-09-20 21:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 21:55 [PATCH 0/6] toshiba_acpi: Cleanup and TOS1900 device support Seth Forshee
2011-09-20 21:55 ` [PATCH 1/6] toshiba_acpi: Convert to use acpi_driver Seth Forshee
2011-09-20 22:17 ` Joe Perches
2011-09-21 7:31 ` Corentin Chary
2011-09-21 12:52 ` Seth Forshee
2011-09-21 7:28 ` Corentin Chary
2011-09-21 13:24 ` Seth Forshee
2011-09-21 13:30 ` Corentin Chary
2011-09-21 15:13 ` Azael Avalos
2011-09-21 15:35 ` Matthew Garrett
2011-09-20 21:55 ` [PATCH 2/6] toshiba_acpi: Fix up return codes Seth Forshee
2011-09-20 21:55 ` [PATCH 3/6] toshiba_acpi: Use handle for HCI calls Seth Forshee
2011-09-20 21:55 ` Seth Forshee [this message]
2011-09-20 21:55 ` [PATCH 5/6] toshiba_acpi: Don't add devices for unsupported features Seth Forshee
2011-09-20 21:55 ` [PATCH 6/6] toshiba_acpi: Initialize brightness in backlight device Seth Forshee
2011-09-21 15:31 ` [PATCH 0/6] toshiba_acpi: Cleanup and TOS1900 device support Matthew Garrett
2011-09-21 16:10 ` Seth Forshee
2011-10-26 13:54 ` Seth Forshee
2011-10-26 16:58 ` Azael Avalos
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=1316555754-25949-5-git-send-email-seth.forshee@canonical.com \
--to=seth.forshee@canonical.com \
--cc=coproscefalo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@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
all inboxes | Powered by JetHome®