aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2011-09-20 17:55:52 -0400
committerMatthew Garrett <mjg@redhat.com>2011-10-24 10:52:36 -0400
commita540d6b5b577f5a320d873a9cc8778ff20bf5ddf (patch)
tree0215c79f5c74337687066b960c1ba85d37b681cc /drivers/platform/x86
parent6e02cc7eb61aeafadb91f7b591a768cdb7a57740 (diff)
toshiba_acpi: Support SPFC as an HCI method
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> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index a924c7f77220..cc629e621e46 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)
892 return 0; 892 return 0;
893} 893}
894 894
895static const char * __devinit find_hci_method(acpi_handle handle)
896{
897 acpi_status status;
898 acpi_handle hci_handle;
899
900 status = acpi_get_handle(handle, "GHCI", &hci_handle);
901 if (ACPI_SUCCESS(status))
902 return "GHCI";
903
904 status = acpi_get_handle(handle, "SPFC", &hci_handle);
905 if (ACPI_SUCCESS(status))
906 return "SPFC";
907
908 return NULL;
909}
910
895static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev) 911static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev)
896{ 912{
897 struct toshiba_acpi_dev *dev; 913 struct toshiba_acpi_dev *dev;
898 acpi_status status; 914 const char *hci_method;
899 acpi_handle handle;
900 u32 hci_result; 915 u32 hci_result;
901 bool bt_present; 916 bool bt_present;
902 int ret = 0; 917 int ret = 0;
@@ -905,16 +920,17 @@ static int __devinit toshiba_acpi_add(struct acpi_device *acpi_dev)
905 pr_info("Toshiba Laptop ACPI Extras version %s\n", 920 pr_info("Toshiba Laptop ACPI Extras version %s\n",
906 TOSHIBA_ACPI_VERSION); 921 TOSHIBA_ACPI_VERSION);
907 922
908 /* simple device detection: look for HCI method */ 923 hci_method = find_hci_method(acpi_dev->handle);
909 status = acpi_get_handle(acpi_dev->handle, "GHCI", &handle); 924 if (!hci_method) {
910 if (ACPI_FAILURE(status)) 925 pr_err("HCI interface not found\n");
911 return -ENODEV; 926 return -ENODEV;
927 }
912 928
913 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 929 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
914 if (!dev) 930 if (!dev)
915 return -ENOMEM; 931 return -ENOMEM;
916 dev->acpi_dev = acpi_dev; 932 dev->acpi_dev = acpi_dev;
917 dev->method_hci = "GHCI"; 933 dev->method_hci = hci_method;
918 acpi_dev->driver_data = dev; 934 acpi_dev->driver_data = dev;
919 935
920 if (toshiba_acpi_setup_keyboard(dev)) 936 if (toshiba_acpi_setup_keyboard(dev))