Package: tp-smapi-dkms
Version: 0.40-9
Tags: patch
The tp-smapi kernel module doesn't load on the latest generation of ThinkPads
(T420(s), T520, X220(t), W520) although they have a working embedded
controller. It seems the EC just isn't announced via DMI anymore or if it is,
then in an unknown way.
This causes modprobe to fail with the error: "No such device" and kernel log
to show "thinkpad_ec: no ThinkPad embedded controller!"
I can verify this for my T420s with EC version 1.07 but it can easily be
confirmed for other models by googling for "X220 tp_smapi" or similar.
However by adding the new models to the whitelist intended for older ThinkPad
models most of the known functionality of tp_smapi is available with the
exception that force_discharge and start_charge_threshold cannot be read as
the read returns ENXIO.
I've used kernels 2.6.38 and 2.6.39 and am now working on 3.0.0-rc1 however
there doesn't seem to be any change.
I suggest to whitelists all the sandybridge models in tp-smapi as this seems
to be a reasonable workaround to at least restore access to most of tp_smapi's
features for these new models. Therefore I've attached a patch doing that.
diff --git a/thinkpad_ec.c b/thinkpad_ec.c
index 2d77a64..87a83b1 100644
--- a/thinkpad_ec.c
+++ b/thinkpad_ec.c
@@ -456,6 +456,12 @@ static int __init check_dmi_for_ec(void)
TP_DMI_MATCH("IBM", "ThinkPad A30"),
TP_DMI_MATCH("IBM", "ThinkPad T23"),
TP_DMI_MATCH("IBM", "ThinkPad X24"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad T420"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad T420s"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad T520"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad X220"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad X220t"),
+ TP_DMI_MATCH("LENOVO", "ThinkPad W520"),
{ .ident = NULL }
};
return dmi_find_substring(DMI_DEV_TYPE_OEM_STRING,