Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 3/8] 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 <at> hmh.eng.br>
---
 drivers/platform/x86/thinkpad_acpi.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cc4155c..d69ab3f 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -1621,6 +1621,9  <at>  <at>  static void tpacpi_remove_driver_attributes(struct device_driver *drv)
  *
  *  Sources: IBM ThinkPad Public Web Documents (update changelogs),
  *  Information from users in ThinkWiki
+ *
+ *  WARNING: we use this table also to detect that the machine is
+ *  a ThinkPad in some cases, so don't remove entries lightly.
  */

 #define TPV_Q(__v, __id1, __id2, __bv1, __bv2)		\
 <at>  <at>  -1782,6 +1785,12  <at>  <at>  static void __init tpacpi_check_outdated_fw(void)
 	}
 }

+static bool __init tpacpi_is_fw_known(void)
+{
+	return tpacpi_check_quirks(tpacpi_bios_version_qtable,
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 1/8] thinkpad-acpi: don't ask about brightness_mode for fw. 1V and 1R

X40 (firmware 1V) and T41 (firmware 1R) have been confirmed to work
well with the new defaults, so we can stop pestering people to confirm
that fact.

For now, whitelist just these two firmware types.  It is best to have
at least one more firmware type confirmed for Radeon 9xxx and Intel
GMA-2 ThinkPads before removing the confirmation requests entirely.

Reported-by: Robert de Rooy <robert.de.rooy <at> gmail.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
Cc: stable <at> kernel.org
---
 drivers/platform/x86/thinkpad_acpi.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e856008..d287283 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -5655,16 +5655,16  <at>  <at>  static const struct tpacpi_quirk brightness_quirk_table[] __initconst = {
 	/* Models with ATI GPUs known to require ECNVRAM mode */
 	TPACPI_Q_IBM('1', 'Y', TPACPI_BRGHT_Q_EC),	/* T43/p ATI */

-	/* Models with ATI GPUs (waiting confirmation) */
-	TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
+	/* Models with ATI GPUs that can use ECNVRAM */
+	TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_EC),
 	TPACPI_Q_IBM('1', 'Q', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
 	TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
 	TPACPI_Q_IBM('7', '8', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 5/8] thinkpad-acpi: deprecate hotkey_bios_mask

Some analysis of the ACPI DSDTs shows that the HKEY pre-enabled mask
is always 0x80c (FN+F3,FN+F4 and FN+F12), which are the hotkeys that
the second gen of HKEY firmware supported (the first gen didn't report
any hotkeys, the second reported these tree hotkeys but had no mask
support, and the third added mask support).

So, this is probably some sort of backwards compatibility with older
versions of the IBM ThinkVantage suite.  We have no use for that, and
I know of exactly ZERO users of that attribute, anyway.  Start the
process of getting rid of it.

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 Documentation/laptops/thinkpad-acpi.txt |    6 +++++-
 drivers/platform/x86/thinkpad_acpi.c    |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index e2ddcde..ab4b58e 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
 <at>  <at>  -240,9 +240,13  <at>  <at>  sysfs notes:
 		Returns 0.

 	hotkey_bios_mask:
+		DEPRECATED, DON'T USE, WILL BE REMOVED IN THE FUTURE.
+
 		Returns the hot keys mask when thinkpad-acpi was loaded.
 		Upon module unload, the hot keys mask will be restored
-		to this value.
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[GIT PATCH] thinkpad-acpi patches for the merge window

Len,

This patch set are the changes for thinkpad-acpi that I have queued
for the merge window so far.  They're mostly bug fixes.

Please merge into acpi-test.  The first patch (1/8) should go to
stable <at> kernel.org after it gets merged in mainline.

Thanks!

PS: it looks like I have some kind of problem getting patches to you
lately, I will try assigning this stack to you through patchwork.
Please check if your spam filters are getting aggravated by something
in my email headers...

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 8/8] thinkpad-acpi: report brightness events when required

Report KEY_BRIGHTNESSUP and KEY_BRIGHTNESSDOWN input events when the
ThinkPad is in "passive brightness control" mode (because either we or
ACPI video touched _BCL), and ACPI video is not processing these
events by itself.

This happens only on Lenovo ThinkPads with ACPI video support, when
operating with the ACPI video driver in acpi_backlight=vendor mode.

Issuing these events is the right thing to do, and will work around
bugzilla #13368, if userspace is properly configured and actively
handles these events.

For other ThinkPads, and when ACPI video is handling brightness
changes, thinkpad-acpi will continue NOT sending KEY_BRIGHTNESS*
events by default.

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 drivers/platform/x86/thinkpad_acpi.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 9c3bb0c..955adf6 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -2854,6 +2854,15  <at>  <at>  static void hotkey_exit(void)
 	}
 }

+static void __init hotkey_unmap(const unsigned int scancode)
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 4/8] thinkpad-acpi: hotkey poll fixes

Fix some locking, avoid exiting the kthread before kthread_stop() is
called on it, and clean up the hotkey poll routines a little bit.

Also, restore bits in the firmware mask after hotkey_source_mask is
changed.  Without this, we leave events disabled...

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 drivers/platform/x86/thinkpad_acpi.c |  108 +++++++++++++++++++++++-----------
 1 files changed, 73 insertions(+), 35 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d69ab3f..679a73b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -1922,16 +1922,42  <at>  <at>  struct tp_nvram_state {
        u8 volume_level;
 };

+/* kthread for the hotkey poller */
 static struct task_struct *tpacpi_hotkey_task;
-static u32 hotkey_source_mask;		/* bit mask 0=ACPI,1=NVRAM */
-static int hotkey_poll_freq = 10;	/* Hz */
+
+/* Acquired while the poller kthread is running, use to sync start/stop */
 static struct mutex hotkey_thread_mutex;
+
+/*
+ * Acquire mutex to write poller control variables.
+ * Increment hotkey_config_change when changing them.
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 2/8] thinkpad-acpi: firmware version checks

Use the quirk infrastructure to warn of outdated firmware and also of
firmware versions that are known to cause problems.

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 drivers/platform/x86/thinkpad_acpi.c |  182 ++++++++++++++++++++++++++++++++++
 1 files changed, 182 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d287283..cc4155c 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -1601,6 +1601,187  <at>  <at>  static void tpacpi_remove_driver_attributes(struct device_driver *drv)
 #endif
 }

+/*************************************************************************
+ * Firmware Data
+ */
+
+/*
+ * Table of recommended minimum BIOS versions
+ *
+ * Reasons for listing:
+ *    1. Stable BIOS, listed because the unknown ammount of
+ *       bugs and bad ACPI behaviour on older versions
+ *
+ *    2. BIOS or EC fw with known bugs that trigger on Linux
+ *
+ *    3. BIOS with known reduced functionality in older versions
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 6/8] thinkpad-acpi: Fix procfs hotkey reset command

echo "reset" > /proc/acpi/ibm/hotkey should do something non-useless,
so instead of setting it to Fn+F2, Fn+F3, Fn+F5, set it to
hotkey_recommended_mask.

It is not like it will survive for much longer, anyway.

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 Documentation/laptops/thinkpad-acpi.txt |    2 +-
 drivers/platform/x86/thinkpad_acpi.c    |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index ab4b58e..6d03487 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
 <at>  <at>  -219,7 +219,7  <at>  <at>  The following commands can be written to the /proc/acpi/ibm/hotkey file:
 	echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys
 	echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys
 	... any other 8-hex-digit mask ...
-	echo reset > /proc/acpi/ibm/hotkey -- restore the original mask
+	echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask

 The following commands have been deprecated and will cause the kernel
 to log a warning:
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 6b66789..dd779e5 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -3569,7 +3569,8  <at>  <at>  static int hotkey_write(char *buf)
(Continue reading)

Henrique de Moraes Holschuh | 12 Sep 20:22 2009
Picon

[PATCH 7/8] thinkpad-acpi: don't poll by default any of the reserved hotkeys

Init hotkey_source_mask late, so that we can make use of
hotkey_reserved_mask to avoid polling any of the reserved
hotkeys by default.

Signed-off-by: Henrique de Moraes Holschuh <hmh <at> hmh.eng.br>
---
 drivers/platform/x86/thinkpad_acpi.c |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index dd779e5..9c3bb0c 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
 <at>  <at>  -3062,19 +3062,6  <at>  <at>  static int __init hotkey_init(struct ibm_init_struct *iibm)
 			goto err_exit;
 	}

-#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
-	if (tp_features.hotkey_mask) {
-		hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK
-					& ~hotkey_all_mask;
-	} else {
-		hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK;
-	}
-
-	vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
-		    "hotkey source mask 0x%08x, polling freq %u\n",
-		    hotkey_source_mask, hotkey_poll_freq);
-#endif
-
(Continue reading)

Len Brown | 19 Sep 07:06 2009

Re: [GIT PATCH] thinkpad-acpi patches for the merge window

series applied.

thanks,
Len Brown, Intel Open Source Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane