Skip to content

Commit a420e46

Browse files
watologo1Matthew Garrett
authored andcommitted
X86 platform drivers: Remove EC dump from thinkpad_acpi
There is a general interface for that now (provided by other patches in this patch series): /sys/kernel/debug/ec/*/io Signed-off-by: Thomas Renninger <[email protected]> CC: Alexey Starikovskiy <[email protected]> CC: Len Brown <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] CC: Henrique de Moraes Holschuh <[email protected]> CC: [email protected] Signed-off-by: Matthew Garrett <[email protected]>
1 parent 49c6c5f commit a420e46

File tree

2 files changed

+11
-133
lines changed

2 files changed

+11
-133
lines changed

Documentation/laptops/thinkpad-acpi.txt

Lines changed: 11 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -960,70 +960,21 @@ Sysfs notes:
960960
subsystem, and follow all of the hwmon guidelines at
961961
Documentation/hwmon.
962962

963+
EXPERIMENTAL: Embedded controller register dump
964+
-----------------------------------------------
963965

964-
EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump
965-
------------------------------------------------------------------------
966-
967-
This feature is marked EXPERIMENTAL because the implementation
968-
directly accesses hardware registers and may not work as expected. USE
969-
WITH CAUTION! To use this feature, you need to supply the
970-
experimental=1 parameter when loading the module.
971-
972-
This feature dumps the values of 256 embedded controller
973-
registers. Values which have changed since the last time the registers
974-
were dumped are marked with a star:
975-
976-
[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
977-
EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
978-
EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
979-
EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
980-
EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
981-
EC 0x30: 01 07 1a 00 30 04 00 00 *85 00 00 10 00 50 00 00
982-
EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
983-
EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 *bc *02 *bc
984-
EC 0x60: *02 *bc *02 00 00 00 00 00 00 00 00 00 00 00 00 00
985-
EC 0x70: 00 00 00 00 00 12 30 40 *24 *26 *2c *27 *20 80 *1f 80
986-
EC 0x80: 00 00 00 06 *37 *0e 03 00 00 00 0e 07 00 00 00 00
987-
EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
988-
EC 0xa0: *ff 09 ff 09 ff ff *64 00 *00 *00 *a2 41 *ff *ff *e0 00
989-
EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
990-
EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
991-
EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
992-
EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
993-
EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
994-
995-
This feature can be used to determine the register holding the fan
996-
speed on some models. To do that, do the following:
966+
This feature is not included in the thinkpad driver anymore.
967+
Instead the EC can be accessed through /sys/kernel/debug/ec with
968+
a userspace tool which can be found here:
969+
ftp://ftp.suse.com/pub/people/trenn/sources/ec
997970

971+
Use it to determine the register holding the fan
972+
speed on some models. To do that, do the following:
998973
- make sure the battery is fully charged
999974
- make sure the fan is running
1000-
- run 'cat /proc/acpi/ibm/ecdump' several times, once per second or so
1001-
1002-
The first step makes sure various charging-related values don't
1003-
vary. The second ensures that the fan-related values do vary, since
1004-
the fan speed fluctuates a bit. The third will (hopefully) mark the
1005-
fan register with a star:
1006-
1007-
[root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump
1008-
EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f
1009-
EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00
1010-
EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00
1011-
EC 0x20: 00 00 00 00 00 00 00 00 00 00 00 03 43 00 00 80
1012-
EC 0x30: 01 07 1a 00 30 04 00 00 85 00 00 10 00 50 00 00
1013-
EC 0x40: 00 00 00 00 00 00 14 01 00 04 00 00 00 00 00 00
1014-
EC 0x50: 00 c0 02 0d 00 01 01 02 02 03 03 03 03 bc 02 bc
1015-
EC 0x60: 02 bc 02 00 00 00 00 00 00 00 00 00 00 00 00 00
1016-
EC 0x70: 00 00 00 00 00 12 30 40 24 27 2c 27 21 80 1f 80
1017-
EC 0x80: 00 00 00 06 *be 0d 03 00 00 00 0e 07 00 00 00 00
1018-
EC 0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1019-
EC 0xa0: ff 09 ff 09 ff ff 64 00 00 00 a2 41 ff ff e0 00
1020-
EC 0xb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1021-
EC 0xc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1022-
EC 0xd0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1023-
EC 0xe0: 00 00 00 00 00 00 00 00 11 20 49 04 24 06 55 03
1024-
EC 0xf0: 31 55 48 54 35 38 57 57 08 2f 45 73 07 65 6c 1a
1025-
1026-
Another set of values that varies often is the temperature
975+
- use above mentioned tool to read out the EC
976+
977+
Often fan and temperature values vary between
1027978
readings. Since temperatures don't change vary fast, you can take
1028979
several quick dumps to eliminate them.
1029980

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -5837,75 +5837,6 @@ static struct ibm_struct thermal_driver_data = {
58375837
.exit = thermal_exit,
58385838
};
58395839

5840-
/*************************************************************************
5841-
* EC Dump subdriver
5842-
*/
5843-
5844-
static u8 ecdump_regs[256];
5845-
5846-
static int ecdump_read(struct seq_file *m)
5847-
{
5848-
int i, j;
5849-
u8 v;
5850-
5851-
seq_printf(m, "EC "
5852-
" +00 +01 +02 +03 +04 +05 +06 +07"
5853-
" +08 +09 +0a +0b +0c +0d +0e +0f\n");
5854-
for (i = 0; i < 256; i += 16) {
5855-
seq_printf(m, "EC 0x%02x:", i);
5856-
for (j = 0; j < 16; j++) {
5857-
if (!acpi_ec_read(i + j, &v))
5858-
break;
5859-
if (v != ecdump_regs[i + j])
5860-
seq_printf(m, " *%02x", v);
5861-
else
5862-
seq_printf(m, " %02x", v);
5863-
ecdump_regs[i + j] = v;
5864-
}
5865-
seq_putc(m, '\n');
5866-
if (j != 16)
5867-
break;
5868-
}
5869-
5870-
/* These are way too dangerous to advertise openly... */
5871-
#if 0
5872-
seq_printf(m, "commands:\t0x<offset> 0x<value>"
5873-
" (<offset> is 00-ff, <value> is 00-ff)\n");
5874-
seq_printf(m, "commands:\t0x<offset> <value> "
5875-
" (<offset> is 00-ff, <value> is 0-255)\n");
5876-
#endif
5877-
return 0;
5878-
}
5879-
5880-
static int ecdump_write(char *buf)
5881-
{
5882-
char *cmd;
5883-
int i, v;
5884-
5885-
while ((cmd = next_cmd(&buf))) {
5886-
if (sscanf(cmd, "0x%x 0x%x", &i, &v) == 2) {
5887-
/* i and v set */
5888-
} else if (sscanf(cmd, "0x%x %u", &i, &v) == 2) {
5889-
/* i and v set */
5890-
} else
5891-
return -EINVAL;
5892-
if (i >= 0 && i < 256 && v >= 0 && v < 256) {
5893-
if (!acpi_ec_write(i, v))
5894-
return -EIO;
5895-
} else
5896-
return -EINVAL;
5897-
}
5898-
5899-
return 0;
5900-
}
5901-
5902-
static struct ibm_struct ecdump_driver_data = {
5903-
.name = "ecdump",
5904-
.read = ecdump_read,
5905-
.write = ecdump_write,
5906-
.flags.experimental = 1,
5907-
};
5908-
59095840
/*************************************************************************
59105841
* Backlight/brightness subdriver
59115842
*/
@@ -8882,9 +8813,6 @@ static struct ibm_init_struct ibms_init[] __initdata = {
88828813
.init = thermal_init,
88838814
.data = &thermal_driver_data,
88848815
},
8885-
{
8886-
.data = &ecdump_driver_data,
8887-
},
88888816
{
88898817
.init = brightness_init,
88908818
.data = &brightness_driver_data,
@@ -8993,7 +8921,6 @@ TPACPI_PARAM(light);
89938921
TPACPI_PARAM(cmos);
89948922
TPACPI_PARAM(led);
89958923
TPACPI_PARAM(beep);
8996-
TPACPI_PARAM(ecdump);
89978924
TPACPI_PARAM(brightness);
89988925
TPACPI_PARAM(volume);
89998926
TPACPI_PARAM(fan);

0 commit comments

Comments
 (0)