aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/thinkpad_acpi.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2009-09-12 14:22:13 -0400
committerLen Brown <len.brown@intel.com>2009-09-19 00:52:52 -0400
commite675abafcc0df38125e6e94a9ba91c92fe774f52 (patch)
tree29c665f45e0f5a280d2e801855ef7ce4e769bf9c /drivers/platform/x86/thinkpad_acpi.c
parent600a99fa3b4ce4a54375fb089e5ce0f3a1c9a7e1 (diff)
thinkpad-acpi: be more strict when detecting a ThinkPad
Use stricter checks to decide that we're running on a supported ThinkPad. This should remove some possible false positives, although nobody ever bothered to report any. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cc4155c3620e..d69ab3f0bdbc 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1621,6 +1621,9 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv)
1621 * 1621 *
1622 * Sources: IBM ThinkPad Public Web Documents (update changelogs), 1622 * Sources: IBM ThinkPad Public Web Documents (update changelogs),
1623 * Information from users in ThinkWiki 1623 * Information from users in ThinkWiki
1624 *
1625 * WARNING: we use this table also to detect that the machine is
1626 * a ThinkPad in some cases, so don't remove entries lightly.
1624 */ 1627 */
1625 1628
1626#define TPV_Q(__v, __id1, __id2, __bv1, __bv2) \ 1629#define TPV_Q(__v, __id1, __id2, __bv1, __bv2) \
@@ -1782,6 +1785,12 @@ static void __init tpacpi_check_outdated_fw(void)
1782 } 1785 }
1783} 1786}
1784 1787
1788static bool __init tpacpi_is_fw_known(void)
1789{
1790 return tpacpi_check_quirks(tpacpi_bios_version_qtable,
1791 ARRAY_SIZE(tpacpi_bios_version_qtable)) != 0;
1792}
1793
1785/**************************************************************************** 1794/****************************************************************************
1786 **************************************************************************** 1795 ****************************************************************************
1787 * 1796 *
@@ -7706,9 +7715,11 @@ static int __init probe_for_thinkpad(void)
7706 7715
7707 /* 7716 /*
7708 * Non-ancient models have better DMI tagging, but very old models 7717 * Non-ancient models have better DMI tagging, but very old models
7709 * don't. 7718 * don't. tpacpi_is_fw_known() is a cheat to help in that case.
7710 */ 7719 */
7711 is_thinkpad = (thinkpad_id.model_str != NULL); 7720 is_thinkpad = (thinkpad_id.model_str != NULL) ||
7721 (thinkpad_id.ec_model != 0) ||
7722 tpacpi_is_fw_known();
7712 7723
7713 /* ec is required because many other handles are relative to it */ 7724 /* ec is required because many other handles are relative to it */
7714 TPACPI_ACPIHANDLE_INIT(ec); 7725 TPACPI_ACPIHANDLE_INIT(ec);
@@ -7719,13 +7730,6 @@ static int __init probe_for_thinkpad(void)
7719 return -ENODEV; 7730 return -ENODEV;
7720 } 7731 }
7721 7732
7722 /*
7723 * Risks a regression on very old machines, but reduces potential
7724 * false positives a damn great deal
7725 */
7726 if (!is_thinkpad)
7727 is_thinkpad = (thinkpad_id.vendor == PCI_VENDOR_ID_IBM);
7728
7729 if (!is_thinkpad && !force_load) 7733 if (!is_thinkpad && !force_load)
7730 return -ENODEV; 7734 return -ENODEV;
7731 7735