* [GIT PATCH] thinkpad-acpi queue for 2.6.25-rc3
@ 2008-02-16 4:17 Henrique de Moraes Holschuh
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-acpi-u79uwXL29TY76Z2rM5mHXA
Len,
This patchset has my current thinkpad-acpi queue with fixes that should go
into 2.6.25-rc.
There are some minor obviously correct fixes, some typo fixes, and an event
interface change that I'd rather get into 2.6.25, since the interface that
is being changed was introduced in my previous patch series, which made it
to -rc1. That way, I can avoid changing an interface published in a stable
kernel...
The interface change is in patch "ACPI: thinkpad-acpi: issue input events
for tablet swivel events". Patch "ACPI: thinkpad-acpi: add tablet-mode
reporting" is required for it to work well, otherwise we might lose the
first event we try to send through the input layer. The change is an
"obviously desired" one: instead of issuing thinkpad-acpi specific events
over the ACPI netlink socket, issue a generic event over an input device.
Here's the shortlog:
Henrique de Moraes Holschuh (9):
ACPI: thinkpad-acpi: trivial fix to module_desc typo
ACPI: thinkpad-acpi: trivial fix to documentation
ACPI: thinkpad-acpi: always track input device open/close
ACPI: thinkpad-acpi: synchronize input device switches
ACPI: thinkpad-acpi: make the video output feature optional
ACPI: thinkpad-acpi: issue input events for tablet swivel events
ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation
ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes
ACPI: thinkpad-acpi: add tablet-mode reporting
Please merge it with the changes targetted at -rc3.
Thanks!
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/9] ACPI: thinkpad-acpi: trivial fix to module_desc typo
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 2/9] ACPI: thinkpad-acpi: trivial fix to documentation Henrique de Moraes Holschuh
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Thanks to Damjan <gdamjan-L9MyPDI+PXW5x1IKQUDGbQ@public.gmane.org> for noticing this one.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
drivers/misc/thinkpad_acpi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index e2c7edd..723d37b 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -5918,7 +5918,7 @@ MODULE_PARM_DESC(hotkey_report_mode,
#define TPACPI_PARAM(feature) \
module_param_call(feature, set_ibm_param, NULL, NULL, 0); \
- MODULE_PARM_DESC(feature, "Simulates thinkpad-aci procfs command " \
+ MODULE_PARM_DESC(feature, "Simulates thinkpad-acpi procfs command " \
"at module load, see documentation")
TPACPI_PARAM(hotkey);
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/9] ACPI: thinkpad-acpi: trivial fix to documentation
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2008-02-16 4:17 ` [PATCH 1/9] ACPI: thinkpad-acpi: trivial fix to module_desc typo Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 3/9] ACPI: thinkpad-acpi: always track input device open/close Henrique de Moraes Holschuh
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Fix a stray ibm-acpi that should have been replaced with thinkpad-acpi.
Thanks to Damjan <gdamjan-L9MyPDI+PXW5x1IKQUDGbQ@public.gmane.org> for noticing this one.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
Documentation/laptops/thinkpad-acpi.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 6c24777..33d6e5a 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -1309,7 +1309,7 @@ Enabling debugging output
The module takes a debug parameter which can be used to selectively
enable various classes of debugging output, for example:
- modprobe ibm_acpi debug=0xffff
+ modprobe thinkpad_acpi debug=0xffff
will enable all debugging output classes. It takes a bitmask, so
to enable more than one output class, just add their values.
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/9] ACPI: thinkpad-acpi: always track input device open/close
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2008-02-16 4:17 ` [PATCH 1/9] ACPI: thinkpad-acpi: trivial fix to module_desc typo Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 2/9] ACPI: thinkpad-acpi: trivial fix to documentation Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 4/9] ACPI: thinkpad-acpi: synchronize input device switches Henrique de Moraes Holschuh
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
The open() and close() hooks for the input device are useful even when
hotkey NVRAM polling support is not in use, so it is better to always have
them around.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
drivers/misc/thinkpad_acpi.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 723d37b..6da3f40 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1417,6 +1417,14 @@ static void hotkey_poll_setup_safe(int may_warn)
mutex_unlock(&hotkey_mutex);
}
+#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
+
+static void hotkey_poll_setup_safe(int __unused)
+{
+}
+
+#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
+
static int hotkey_inputdev_open(struct input_dev *dev)
{
switch (tpacpi_lifecycle) {
@@ -1444,7 +1452,6 @@ static void hotkey_inputdev_close(struct input_dev *dev)
if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING)
hotkey_poll_setup_safe(0);
}
-#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
/* sysfs hotkey enable ------------------------------------------------- */
static ssize_t hotkey_enable_show(struct device *dev,
@@ -2023,12 +2030,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
(hotkey_report_mode < 2) ?
"enabled" : "disabled");
-#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
tpacpi_inputdev->open = &hotkey_inputdev_open;
tpacpi_inputdev->close = &hotkey_inputdev_close;
hotkey_poll_setup_safe(1);
-#endif
}
return (tp_features.hotkey)? 0 : 1;
@@ -2221,9 +2226,7 @@ static void hotkey_resume(void)
hotkey_radio_sw_notify_change();
hotkey_wakeup_reason_notify_change();
hotkey_wakeup_hotunplug_complete_notify_change();
-#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
hotkey_poll_setup_safe(0);
-#endif
}
/* procfs -------------------------------------------------------------- */
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/9] ACPI: thinkpad-acpi: synchronize input device switches
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (2 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 3/9] ACPI: thinkpad-acpi: always track input device open/close Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional Henrique de Moraes Holschuh
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Issue EV_SW events at module init time to synchronize the input device with
the current state of the switch, otherwise we might lose the first event.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
drivers/misc/thinkpad_acpi.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 6da3f40..02f9465 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -2034,6 +2034,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
tpacpi_inputdev->close = &hotkey_inputdev_close;
hotkey_poll_setup_safe(1);
+ tpacpi_input_send_radiosw();
}
return (tp_features.hotkey)? 0 : 1;
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (3 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 4/9] ACPI: thinkpad-acpi: synchronize input device switches Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 5:39 ` Len Brown
2008-02-16 4:17 ` [PATCH 6/9] ACPI: thinkpad-acpi: issue input events for tablet swivel events Henrique de Moraes Holschuh
` (3 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
The video output port control feature is not very useful on many ThinkPads
(especially when a X server is running), and lately userspace is getting
better and better at it, so it makes sense to allow users to stripe out the
thinkpad-acpi video feature from their kernels and save at least 2KB.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
drivers/misc/Kconfig | 17 +++++++++++++++++
drivers/misc/thinkpad_acpi.c | 20 +++++++++++++-------
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 1abc95c..982e27b 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -258,6 +258,23 @@ config THINKPAD_ACPI_BAY
If you are not sure, say Y here.
+config THINKPAD_ACPI_VIDEO
+ bool "Video output control support"
+ depends on THINKPAD_ACPI
+ default y
+ ---help---
+ Allows the thinkpad_acpi driver to provide an interface to control
+ the various video output ports.
+
+ This feature often won't work well, depending on ThinkPad model,
+ display state, video output devices in use, whether there is a X
+ server running, phase of the moon, and the current mood of
+ Schroedinger's cat. If you can use X.org's RandR to control
+ your ThinkPad's video output ports instead of this feature,
+ don't think twice: do it and say N here to save some memory.
+
+ If you are not sure, say Y here.
+
config THINKPAD_ACPI_HOTKEY_POLL
bool "Suport NVRAM polling for hot keys"
depends on THINKPAD_ACPI
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 02f9465..4ea3866 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -301,6 +301,13 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */
"HKEY", /* all others */
); /* 570 */
+TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */
+ "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
+ "\\_SB.PCI0.VID0", /* 770e */
+ "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
+ "\\_SB.PCI0.AGP.VID", /* all others */
+ ); /* R30, R31 */
+
/*************************************************************************
* ACPI helpers
@@ -2680,6 +2687,8 @@ static struct ibm_struct wan_driver_data = {
* Video subdriver
*/
+#ifdef CONFIG_THINKPAD_ACPI_VIDEO
+
enum video_access_mode {
TPACPI_VIDEO_NONE = 0,
TPACPI_VIDEO_570, /* 570 */
@@ -2707,13 +2716,6 @@ static int video_orig_autosw;
static int video_autosw_get(void);
static int video_autosw_set(int enable);
-TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */
- "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
- "\\_SB.PCI0.VID0", /* 770e */
- "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
- "\\_SB.PCI0.AGP.VID", /* all others */
- ); /* R30, R31 */
-
TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */
static int __init video_init(struct ibm_init_struct *iibm)
@@ -3023,6 +3025,8 @@ static struct ibm_struct video_driver_data = {
.exit = video_exit,
};
+#endif /* CONFIG_THINKPAD_ACPI_VIDEO */
+
/*************************************************************************
* Light (thinklight) subdriver
*/
@@ -5807,10 +5811,12 @@ static struct ibm_init_struct ibms_init[] __initdata = {
.init = wan_init,
.data = &wan_driver_data,
},
+#ifdef CONFIG_THINKPAD_ACPI_VIDEO
{
.init = video_init,
.data = &video_driver_data,
},
+#endif
{
.init = light_init,
.data = &light_driver_data,
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/9] ACPI: thinkpad-acpi: issue input events for tablet swivel events
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (4 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 7/9] ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation Henrique de Moraes Holschuh
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Issue EV_SW SW_TABLET_MODE events for HKEY events 0x5009 and 0x500A on the
X41t/X60t/X61t. As usual, we suppress the HKEY events on the netlink
interface to avoid sending duplicate events to userspace.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
Documentation/laptops/thinkpad-acpi.txt | 4 ++--
drivers/misc/thinkpad_acpi.c | 22 ++++++++++++++++++++--
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 33d6e5a..0ae5708 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -491,6 +491,8 @@ generate input device EV_KEY events.
Non hot-key ACPI HKEY event map:
0x5001 Lid closed
0x5002 Lid opened
+0x5009 Tablet swivel: switched to tablet mode
+0x500A Tablet swivel: switched to normal mode
0x7000 Radio Switch may have changed state
The above events are not propagated by the driver, except for legacy
@@ -505,8 +507,6 @@ The above events are never propagated by the driver.
0x3003 Bay ejection (see 0x2x05) complete, can sleep again
0x4003 Undocked (see 0x2x04), can sleep again
-0x5009 Tablet swivel: switched to tablet mode
-0x500A Tablet swivel: switched to normal mode
0x500B Tablet pen insterted into its storage bay
0x500C Tablet pen removed from its storage bay
0x5010 Brightness level changed (newer Lenovo BIOSes)
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 4ea3866..3548350 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1172,6 +1172,17 @@ static void tpacpi_input_send_radiosw(void)
mutex_unlock(&tpacpi_inputdev_send_mutex);
}
+static void tpacpi_input_send_tabletsw(unsigned int state)
+{
+ mutex_lock(&tpacpi_inputdev_send_mutex);
+
+ input_report_switch(tpacpi_inputdev,
+ SW_TABLET_MODE, !!state);
+ input_sync(tpacpi_inputdev);
+
+ mutex_unlock(&tpacpi_inputdev_send_mutex);
+}
+
static void tpacpi_input_send_key(unsigned int scancode)
{
unsigned int keycode;
@@ -2020,6 +2031,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
set_bit(EV_SW, tpacpi_inputdev->evbit);
set_bit(SW_RADIO, tpacpi_inputdev->swbit);
}
+ if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) {
+ set_bit(EV_SW, tpacpi_inputdev->evbit);
+ set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit);
+ }
dbg_printk(TPACPI_DBG_INIT,
"enabling hot key handling\n");
@@ -2169,11 +2184,14 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
/* 0x5000-0x5FFF: human interface helpers */
switch (hkey) {
case 0x5010: /* Lenovo new BIOS: brightness changed */
- case 0x5009: /* X61t: swivel up (tablet mode) */
- case 0x500a: /* X61t: swivel down (normal mode) */
case 0x500b: /* X61t: tablet pen inserted into bay */
case 0x500c: /* X61t: tablet pen removed from bay */
break;
+ case 0x5009: /* X61t: swivel up (tablet mode) */
+ case 0x500a: /* X61t: swivel down (normal mode) */
+ tpacpi_input_send_tabletsw((hkey == 0x5009));
+ send_acpi_ev = 0;
+ break;
case 0x5001:
case 0x5002:
/* LID switch events. Do not propagate */
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/9] ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (5 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 6/9] ACPI: thinkpad-acpi: issue input events for tablet swivel events Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 8/9] ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 9/9] ACPI: thinkpad-acpi: add tablet-mode reporting Henrique de Moraes Holschuh
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Fix a few spelling errors, and also document the EV_SW events thinkpad-acpi
can issue.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
Documentation/laptops/thinkpad-acpi.txt | 48 +++++++++++++++++-------------
1 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 0ae5708..91f688c 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -160,7 +160,7 @@ Hot keys
procfs: /proc/acpi/ibm/hotkey
sysfs device attribute: hotkey_*
-In a ThinkPad, the ACPI HKEY handler is responsible for comunicating
+In a ThinkPad, the ACPI HKEY handler is responsible for communicating
some important events and also keyboard hot key presses to the operating
system. Enabling the hotkey functionality of thinkpad-acpi signals the
firmware that such a driver is present, and modifies how the ThinkPad
@@ -193,7 +193,7 @@ Not all bits in the mask can be modified. Not all bits that can be
modified do anything. Not all hot keys can be individually controlled
by the mask. Some models do not support the mask at all, and in those
models, hot keys cannot be controlled individually. The behaviour of
-the mask is, therefore, higly dependent on the ThinkPad model.
+the mask is, therefore, highly dependent on the ThinkPad model.
Note that unmasking some keys prevents their default behavior. For
example, if Fn+F5 is unmasked, that key will no longer enable/disable
@@ -288,7 +288,7 @@ sysfs notes:
in ACPI event mode, volume up/down/mute are reported as
separate events, but this behaviour may be corrected in
future releases of this driver, in which case the
- ThinkPad volume mixer user interface semanthics will be
+ ThinkPad volume mixer user interface semantics will be
enforced.
hotkey_poll_freq:
@@ -308,7 +308,7 @@ sysfs notes:
hotkey_radio_sw:
if the ThinkPad has a hardware radio switch, this
attribute will read 0 if the switch is in the "radios
- disabled" postition, and 1 if the switch is in the
+ disabled" position, and 1 if the switch is in the
"radios enabled" position.
This attribute has poll()/select() support.
@@ -339,7 +339,7 @@ sysfs notes:
wakeup_hotunplug_complete:
Set to 1 if the system was waken up because of an
undock or bay ejection request, and that request
- was sucessfully completed. At this point, it might
+ was successfully completed. At this point, it might
be useful to send the system back to sleep, at the
user's choice. Refer to HKEY events 0x4003 and
0x3003, below.
@@ -392,7 +392,7 @@ event code Key Notes
Lenovo: battery
0x1004 0x03 FN+F4 Sleep button (ACPI sleep button
- semanthics, i.e. sleep-to-RAM).
+ semantics, i.e. sleep-to-RAM).
It is always generate some kind
of event, either the hot key
event or a ACPI sleep button
@@ -403,12 +403,12 @@ event code Key Notes
time passes.
0x1005 0x04 FN+F5 Radio. Enables/disables
- the internal BlueTooth hardware
+ the internal Bluetooth hardware
and W-WAN card if left in control
of the firmware. Does not affect
the WLAN card.
Should be used to turn on/off all
- radios (bluetooth+W-WAN+WLAN),
+ radios (Bluetooth+W-WAN+WLAN),
really.
0x1006 0x05 FN+F6 -
@@ -417,7 +417,7 @@ event code Key Notes
Do you feel lucky today?
0x1008 0x07 FN+F8 IBM: toggle screen expand
- Lenovo: configure ultranav
+ Lenovo: configure UltraNav
0x1009 0x08 FN+F9 -
.. .. ..
@@ -447,7 +447,7 @@ event code Key Notes
0x1011 0x10 FN+END Brightness down. See brightness
up for details.
-0x1012 0x11 FN+PGUP Thinklight toggle. This key is
+0x1012 0x11 FN+PGUP ThinkLight toggle. This key is
always handled by the firmware,
even when unmasked.
@@ -469,7 +469,7 @@ event code Key Notes
key is always handled by the
firmware, even when unmasked.
-0x1018 0x17 THINKPAD Thinkpad/Access IBM/Lenovo key
+0x1018 0x17 THINKPAD ThinkPad/Access IBM/Lenovo key
0x1019 0x18 unknown
.. .. ..
@@ -488,6 +488,12 @@ If a key is mapped to KEY_UNKNOWN, it generates an input event that
includes an scan code. If a key is mapped to anything else, it will
generate input device EV_KEY events.
+In addition to the EV_KEY events, thinkpad-acpi may also issue EV_SW
+events for switches:
+
+SW_RADIO T60 and later hardare rfkill rocker switch
+SW_TABLET_MODE Tablet ThinkPads HKEY events 0x5009 and 0x500A
+
Non hot-key ACPI HKEY event map:
0x5001 Lid closed
0x5002 Lid opened
@@ -507,7 +513,7 @@ The above events are never propagated by the driver.
0x3003 Bay ejection (see 0x2x05) complete, can sleep again
0x4003 Undocked (see 0x2x04), can sleep again
-0x500B Tablet pen insterted into its storage bay
+0x500B Tablet pen inserted into its storage bay
0x500C Tablet pen removed from its storage bay
0x5010 Brightness level changed (newer Lenovo BIOSes)
@@ -539,7 +545,7 @@ sysfs (it is read-only).
If the hotkey_report_mode module parameter is set to 1 or 2, it cannot
be changed later through sysfs (any writes will return -EPERM to signal
that hotkey_report_mode was locked. On 2.6.23 and later, where
-hotkey_report_mode cannot be changed at all, writes will return -EACES).
+hotkey_report_mode cannot be changed at all, writes will return -EACCES).
hotkey_report_mode set to 1 makes the driver export through the procfs
ACPI event interface all hot key presses (which are *also* sent to the
@@ -584,7 +590,7 @@ Sysfs notes:
0: disables Bluetooth / Bluetooth is disabled
1: enables Bluetooth / Bluetooth is enabled.
- Note: this interface will be probably be superseeded by the
+ Note: this interface will be probably be superseded by the
generic rfkill class, so it is NOT to be considered stable yet.
Video output control -- /proc/acpi/ibm/video
@@ -791,12 +797,12 @@ on the X40 (tpb is the ThinkPad Buttons utility):
1 - Related to "Volume up" key press
2 - Related to "Mute on" key press
3 - Related to "Access IBM" key press
- 4 - Related to "LCD brightness up" key pess
+ 4 - Related to "LCD brightness up" key press
5 - Related to "LCD brightness down" key press
11 - Related to "toggle screen expansion" key press/function
12 - Related to "ThinkLight on"
13 - Related to "ThinkLight off"
- 14 - Related to "ThinkLight" key press (toggle thinklight)
+ 14 - Related to "ThinkLight" key press (toggle ThinkLight)
The cmos command interface is prone to firmware split-brain problems, as
in newer ThinkPads it is just a compatibility layer. Do not use it, it is
@@ -1024,7 +1030,7 @@ There are two interfaces to the firmware for direct brightness control,
EC and CMOS. To select which one should be used, use the
brightness_mode module parameter: brightness_mode=1 selects EC mode,
brightness_mode=2 selects CMOS mode, brightness_mode=3 selects both EC
-and CMOS. The driver tries to autodetect which interface to use.
+and CMOS. The driver tries to auto-detect which interface to use.
When display backlight brightness controls are available through the
standard ACPI interface, it is best to use it instead of this direct
@@ -1266,8 +1272,8 @@ experimental=1 parameter when loading the module.
This feature shows the presence and current state of a W-WAN (Sierra
Wireless EV-DO) device.
-It was tested on a Lenovo Thinkpad X60. It should probably work on other
-Thinkpad models which come with this module installed.
+It was tested on a Lenovo ThinkPad X60. It should probably work on other
+ThinkPad models which come with this module installed.
Procfs notes:
@@ -1286,7 +1292,7 @@ Sysfs notes:
0: disables WWAN card / WWAN card is disabled
1: enables WWAN card / WWAN card is enabled.
- Note: this interface will be probably be superseeded by the
+ Note: this interface will be probably be superseded by the
generic rfkill class, so it is NOT to be considered stable yet.
Multiple Commands, Module Parameters
@@ -1356,7 +1362,7 @@ Sysfs interface changelog:
NVRAM is compiled out by the user because it is
unneeded/undesired in the first place).
0x020101: Marker for thinkpad-acpi with hot key NVRAM polling
- and proper hotkey_mask semanthics (version 8 of the
+ and proper hotkey_mask semantics (version 8 of the
NVRAM polling patch). Some development snapshots of
0.18 had an earlier version that did strange things
to hotkey_mask.
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 8/9] ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (6 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 7/9] ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 9/9] ACPI: thinkpad-acpi: add tablet-mode reporting Henrique de Moraes Holschuh
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
Fixes some minor points in the radio switch code and docs.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
Documentation/laptops/thinkpad-acpi.txt | 2 +-
drivers/misc/thinkpad_acpi.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 91f688c..606af16 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -306,7 +306,7 @@ sysfs notes:
The recommended polling frequency is 10Hz.
hotkey_radio_sw:
- if the ThinkPad has a hardware radio switch, this
+ If the ThinkPad has a hardware radio switch, this
attribute will read 0 if the switch is in the "radios
disabled" position, and 1 if the switch is in the
"radios enabled" position.
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 3548350..c119cf2 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1161,15 +1161,15 @@ static void tpacpi_input_send_radiosw(void)
{
int wlsw;
- mutex_lock(&tpacpi_inputdev_send_mutex);
-
if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) {
+ mutex_lock(&tpacpi_inputdev_send_mutex);
+
input_report_switch(tpacpi_inputdev,
SW_RADIO, !!wlsw);
input_sync(tpacpi_inputdev);
- }
- mutex_unlock(&tpacpi_inputdev_send_mutex);
+ mutex_unlock(&tpacpi_inputdev_send_mutex);
+ }
}
static void tpacpi_input_send_tabletsw(unsigned int state)
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 9/9] ACPI: thinkpad-acpi: add tablet-mode reporting
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
` (7 preceding siblings ...)
2008-02-16 4:17 ` [PATCH 8/9] ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes Henrique de Moraes Holschuh
@ 2008-02-16 4:17 ` Henrique de Moraes Holschuh
8 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 4:17 UTC (permalink / raw)
To: lenb-DgEjT+Ai2ygdnm+yROfE0A
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Henrique de Moraes Holschuh, linux-acpi-u79uwXL29TY76Z2rM5mHXA
A quick study of the 0x5009/0x500A HKEY event on the X61t DSDT revealed the
existence of the EC HTAB register (EC 0x0f, bit 7), and a compare with the
X41t DSDT shows that HKEY.MHKG can be used to verify if the ThinkPad is
tablet-capable (MHKG present), and in tablet mode (bit 3 of MHKG return is
set).
Add an attribute to report this information, "hotkey_tablet_mode". This
attribute has poll()/select() support, and can be used along with EV_SW
SW_TABLET_MODE to hook userspace to tablet events.
Signed-off-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
---
Documentation/laptops/thinkpad-acpi.txt | 7 +++
drivers/misc/thinkpad_acpi.c | 79 ++++++++++++++++++++++++++----
2 files changed, 75 insertions(+), 11 deletions(-)
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 606af16..76cb428 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -313,6 +313,13 @@ sysfs notes:
This attribute has poll()/select() support.
+ hotkey_tablet_mode:
+ If the ThinkPad has tablet capabilities, this attribute
+ will read 0 if the ThinkPad is in normal mode, and
+ 1 if the ThinkPad is in tablet mode.
+
+ This attribute has poll()/select() support.
+
hotkey_report_mode:
Returns the state of the procfs ACPI event report mode
filter for hot keys. If it is set to 1 (the default),
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index c119cf2..bb269d0 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -221,6 +221,7 @@ static struct {
u32 hotkey:1;
u32 hotkey_mask:1;
u32 hotkey_wlsw:1;
+ u32 hotkey_tablet:1;
u32 light:1;
u32 light_status:1;
u32 bright_16levels:1;
@@ -1060,6 +1061,9 @@ static struct attribute_set *hotkey_dev_attributes;
#define HOTKEY_CONFIG_CRITICAL_END
#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
+/* HKEY.MHKG() return bits */
+#define TP_HOTKEY_TABLET_MASK (1 << 3)
+
static int hotkey_get_wlsw(int *status)
{
if (!acpi_evalf(hkey_handle, status, "WLSW", "d"))
@@ -1067,6 +1071,16 @@ static int hotkey_get_wlsw(int *status)
return 0;
}
+static int hotkey_get_tablet_mode(int *status)
+{
+ int s;
+
+ if (!acpi_evalf(hkey_handle, &s, "MHKG", "d"))
+ return -EIO;
+
+ return ((s & TP_HOTKEY_TABLET_MASK) != 0);
+}
+
/*
* Call with hotkey_mutex held
*/
@@ -1172,15 +1186,20 @@ static void tpacpi_input_send_radiosw(void)
}
}
-static void tpacpi_input_send_tabletsw(unsigned int state)
+static void tpacpi_input_send_tabletsw(void)
{
- mutex_lock(&tpacpi_inputdev_send_mutex);
+ int state;
- input_report_switch(tpacpi_inputdev,
- SW_TABLET_MODE, !!state);
- input_sync(tpacpi_inputdev);
+ if (tp_features.hotkey_tablet &&
+ !hotkey_get_tablet_mode(&state)) {
+ mutex_lock(&tpacpi_inputdev_send_mutex);
- mutex_unlock(&tpacpi_inputdev_send_mutex);
+ input_report_switch(tpacpi_inputdev,
+ SW_TABLET_MODE, !!state);
+ input_sync(tpacpi_inputdev);
+
+ mutex_unlock(&tpacpi_inputdev_send_mutex);
+ }
}
static void tpacpi_input_send_key(unsigned int scancode)
@@ -1691,6 +1710,29 @@ static void hotkey_radio_sw_notify_change(void)
"hotkey_radio_sw");
}
+/* sysfs hotkey tablet mode (pollable) --------------------------------- */
+static ssize_t hotkey_tablet_mode_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int res, s;
+ res = hotkey_get_tablet_mode(&s);
+ if (res < 0)
+ return res;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", !!s);
+}
+
+static struct device_attribute dev_attr_hotkey_tablet_mode =
+ __ATTR(hotkey_tablet_mode, S_IRUGO, hotkey_tablet_mode_show, NULL);
+
+static void hotkey_tablet_mode_notify_change(void)
+{
+ if (tp_features.hotkey_tablet)
+ sysfs_notify(&tpacpi_pdev->dev.kobj, NULL,
+ "hotkey_tablet_mode");
+}
+
/* sysfs hotkey report_mode -------------------------------------------- */
static ssize_t hotkey_report_mode_show(struct device *dev,
struct device_attribute *attr,
@@ -1903,7 +1945,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
str_supported(tp_features.hotkey));
if (tp_features.hotkey) {
- hotkey_dev_attributes = create_attr_set(12, NULL);
+ hotkey_dev_attributes = create_attr_set(13, NULL);
if (!hotkey_dev_attributes)
return -ENOMEM;
res = add_many_to_attr_set(hotkey_dev_attributes,
@@ -1982,6 +2024,18 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
&dev_attr_hotkey_radio_sw.attr);
}
+ /* For X41t, X60t, X61t Tablets... */
+ if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
+ tp_features.hotkey_tablet = 1;
+ printk(TPACPI_INFO
+ "possible tablet mode switch found; "
+ "ThinkPad in %s mode\n",
+ (status & TP_HOTKEY_TABLET_MASK)?
+ "tablet" : "laptop");
+ res = add_to_attr_set(hotkey_dev_attributes,
+ &dev_attr_hotkey_tablet_mode.attr);
+ }
+
if (!res)
res = register_attr_set_with_sysfs(
hotkey_dev_attributes,
@@ -2031,7 +2085,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
set_bit(EV_SW, tpacpi_inputdev->evbit);
set_bit(SW_RADIO, tpacpi_inputdev->swbit);
}
- if (thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO) {
+ if (tp_features.hotkey_tablet) {
set_bit(EV_SW, tpacpi_inputdev->evbit);
set_bit(SW_TABLET_MODE, tpacpi_inputdev->swbit);
}
@@ -2057,6 +2111,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
hotkey_poll_setup_safe(1);
tpacpi_input_send_radiosw();
+ tpacpi_input_send_tabletsw();
}
return (tp_features.hotkey)? 0 : 1;
@@ -2187,9 +2242,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
case 0x500b: /* X61t: tablet pen inserted into bay */
case 0x500c: /* X61t: tablet pen removed from bay */
break;
- case 0x5009: /* X61t: swivel up (tablet mode) */
- case 0x500a: /* X61t: swivel down (normal mode) */
- tpacpi_input_send_tabletsw((hkey == 0x5009));
+ case 0x5009: /* X41t-X61t: swivel up (tablet mode) */
+ case 0x500a: /* X41t-X61t: swivel down (normal mode) */
+ tpacpi_input_send_tabletsw();
+ hotkey_tablet_mode_notify_change();
send_acpi_ev = 0;
break;
case 0x5001:
@@ -2250,6 +2306,7 @@ static void hotkey_resume(void)
"from firmware\n");
tpacpi_input_send_radiosw();
hotkey_radio_sw_notify_change();
+ hotkey_tablet_mode_notify_change();
hotkey_wakeup_reason_notify_change();
hotkey_wakeup_hotunplug_complete_notify_change();
hotkey_poll_setup_safe(0);
--
1.5.3.8
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional
2008-02-16 4:17 ` [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional Henrique de Moraes Holschuh
@ 2008-02-16 5:39 ` Len Brown
2008-02-16 17:47 ` Henrique de Moraes Holschuh
0 siblings, 1 reply; 12+ messages in thread
From: Len Brown @ 2008-02-16 5:39 UTC (permalink / raw)
To: Henrique de Moraes Holschuh; +Cc: ibm-acpi-devel, linux-acpi, rui.zhang
On Friday 15 February 2008 23:17, Henrique de Moraes Holschuh wrote:
> The video output port control feature is not very useful on many ThinkPads
> (especially when a X server is running), and lately userspace is getting
> better and better at it, so it makes sense to allow users to stripe out the
> thinkpad-acpi video feature from their kernels and save at least 2KB.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> ---
> drivers/misc/Kconfig | 17 +++++++++++++++++
> drivers/misc/thinkpad_acpi.c | 20 +++++++++++++-------
> 2 files changed, 30 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 1abc95c..982e27b 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -258,6 +258,23 @@ config THINKPAD_ACPI_BAY
>
> If you are not sure, say Y here.
>
> +config THINKPAD_ACPI_VIDEO
> + bool "Video output control support"
> + depends on THINKPAD_ACPI
> + default y
I would consider going one step further and delete this line
to make it default N (and update the description below).
Indeed, we recently deleted the kernel code from the ACPI video driver
that did video display switching -- at the request of the X community.
-Len
> + ---help---
> + Allows the thinkpad_acpi driver to provide an interface to control
> + the various video output ports.
> +
> + This feature often won't work well, depending on ThinkPad model,
> + display state, video output devices in use, whether there is a X
> + server running, phase of the moon, and the current mood of
> + Schroedinger's cat. If you can use X.org's RandR to control
> + your ThinkPad's video output ports instead of this feature,
> + don't think twice: do it and say N here to save some memory.
> +
> + If you are not sure, say Y here.
> +
> config THINKPAD_ACPI_HOTKEY_POLL
> bool "Suport NVRAM polling for hot keys"
> depends on THINKPAD_ACPI
> diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
> index 02f9465..4ea3866 100644
> --- a/drivers/misc/thinkpad_acpi.c
> +++ b/drivers/misc/thinkpad_acpi.c
> @@ -301,6 +301,13 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */
> "HKEY", /* all others */
> ); /* 570 */
>
> +TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */
> + "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
> + "\\_SB.PCI0.VID0", /* 770e */
> + "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
> + "\\_SB.PCI0.AGP.VID", /* all others */
> + ); /* R30, R31 */
> +
>
> /*************************************************************************
> * ACPI helpers
> @@ -2680,6 +2687,8 @@ static struct ibm_struct wan_driver_data = {
> * Video subdriver
> */
>
> +#ifdef CONFIG_THINKPAD_ACPI_VIDEO
> +
> enum video_access_mode {
> TPACPI_VIDEO_NONE = 0,
> TPACPI_VIDEO_570, /* 570 */
> @@ -2707,13 +2716,6 @@ static int video_orig_autosw;
> static int video_autosw_get(void);
> static int video_autosw_set(int enable);
>
> -TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */
> - "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
> - "\\_SB.PCI0.VID0", /* 770e */
> - "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
> - "\\_SB.PCI0.AGP.VID", /* all others */
> - ); /* R30, R31 */
> -
> TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */
>
> static int __init video_init(struct ibm_init_struct *iibm)
> @@ -3023,6 +3025,8 @@ static struct ibm_struct video_driver_data = {
> .exit = video_exit,
> };
>
> +#endif /* CONFIG_THINKPAD_ACPI_VIDEO */
> +
> /*************************************************************************
> * Light (thinklight) subdriver
> */
> @@ -5807,10 +5811,12 @@ static struct ibm_init_struct ibms_init[] __initdata = {
> .init = wan_init,
> .data = &wan_driver_data,
> },
> +#ifdef CONFIG_THINKPAD_ACPI_VIDEO
> {
> .init = video_init,
> .data = &video_driver_data,
> },
> +#endif
> {
> .init = light_init,
> .data = &light_driver_data,
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional
2008-02-16 5:39 ` Len Brown
@ 2008-02-16 17:47 ` Henrique de Moraes Holschuh
0 siblings, 0 replies; 12+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-02-16 17:47 UTC (permalink / raw)
To: Len Brown; +Cc: ibm-acpi-devel, linux-acpi, rui.zhang
On Sat, 16 Feb 2008, Len Brown wrote:
> On Friday 15 February 2008 23:17, Henrique de Moraes Holschuh wrote:
> > The video output port control feature is not very useful on many ThinkPads
> > (especially when a X server is running), and lately userspace is getting
> > better and better at it, so it makes sense to allow users to stripe out the
> > thinkpad-acpi video feature from their kernels and save at least 2KB.
[...]
> > --- a/drivers/misc/Kconfig
> > +++ b/drivers/misc/Kconfig
> > @@ -258,6 +258,23 @@ config THINKPAD_ACPI_BAY
> >
> > If you are not sure, say Y here.
> >
> > +config THINKPAD_ACPI_VIDEO
> > + bool "Video output control support"
> > + depends on THINKPAD_ACPI
> > + default y
>
> I would consider going one step further and delete this line
> to make it default N (and update the description below).
>
> Indeed, we recently deleted the kernel code from the ACPI video driver
> that did video display switching -- at the request of the X community.
thinkpad-acpi's video output switching code never triggers automatically, so
it won't cause problems for X.org people, as long as *nobody* ties it to HAL
(or some likewise braindamaged idea) by default. So far, nobody was
foolhardy enough to do it in any distro or upstream. Users do, but they do
it *after* they tried it manually and therefore they know if it will work
right or not in their setup.
I think it is best to just leave it to default Y for a few more months,
while I get more reports about where it works well (and how well). I know
it is a lost cause on very new thinkpads, but what I really need are reports
on the older models, which I don't get as often as I'd like.
Maybe we can make it default to N for 2.6.26, along with a big fat warning
on the Kconfig and at runtime that I need reports on Axx, T2x, X3x, R3x,
otherwise I'll just rip it out for 2.6.27...
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-02-16 17:47 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-16 4:17 [GIT PATCH] thinkpad-acpi queue for 2.6.25-rc3 Henrique de Moraes Holschuh
[not found] ` <1203135478-4813-1-git-send-email-hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
2008-02-16 4:17 ` [PATCH 1/9] ACPI: thinkpad-acpi: trivial fix to module_desc typo Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 2/9] ACPI: thinkpad-acpi: trivial fix to documentation Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 3/9] ACPI: thinkpad-acpi: always track input device open/close Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 4/9] ACPI: thinkpad-acpi: synchronize input device switches Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 5/9] ACPI: thinkpad-acpi: make the video output feature optional Henrique de Moraes Holschuh
2008-02-16 5:39 ` Len Brown
2008-02-16 17:47 ` Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 6/9] ACPI: thinkpad-acpi: issue input events for tablet swivel events Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 7/9] ACPI: thinkpad-acpi: improve thinkpad-acpi input device documentation Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 8/9] ACPI: thinkpad-acpi: minor hotkey_radio_sw fixes Henrique de Moraes Holschuh
2008-02-16 4:17 ` [PATCH 9/9] ACPI: thinkpad-acpi: add tablet-mode reporting Henrique de Moraes Holschuh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.