Skip to content

Linux kernel support for the Lenovo SL series ThinkPads

Notifications You must be signed in to change notification settings

jukil/lenovo-sl-laptop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 

Repository files navigation

Development discontinued


lenovo-sl-laptop

General

This is an experimental driver for the Lenovo ThinkPad SL series, since those laptops are currently not supported by the thinkpad_acpi driver.

Works: hotkeys, bluetooth, the Lenovo Care LED, the fan Experimental: backlight brightness, WWAN Not tested: UWB Not implemented: hdaps accelerometer

NB: to make the Lenovo Care LED blink, make sure the LED timer trigger is enabled (CONFIG_LEDS_TRIGGERS_TIMER) and do echo "timer" > /sys/class/leds/lensl::lenovocare/trigger

The backlight brightness control is useful because the SL series use the ACPI brightness API in a non-standard manner, causing buggy behavior with the standard ACPI video module backlight control.

To enable the brightness control, load the module with the "control_backlight=1" module parameter (i.e. insmod lenovo-sl-laptop.ko control_backlight=1 )

Note that the brightness control will likely conflict with the ACPI video driver brightness control. So, if you have the ACPI video driver loaded (and you probably do):

echo 0 > /sys/module/video/parameters/brightness_switch_enabled insmod lenovo-sl-laptop.ko control_backlight=1 and then restart X.

Alternatively, you can try to use the "acpi_backlight=vendor" kernel boot parameter (recognized by kernel versions 2.6.28 and higher).

Alternatively alternatively, simply unload the ACPI video driver (rmmod video).

Installation

To build the module for your current kernel, run make. Note that you will need to have the sources or headers for your kernel in the correct location (depends on the distro).

Installation procedure (Thanks to Tilo)

Compiling and installing the module

Based on: http://robert.orzanna.de/2011/01/05/working-lenovo-sl-laptop-module-with-newer-kernel-versions/

$ make all
$ sudo cp lenovo-sl-laptop.ko /lib/modules/`uname -r`/kernel/drivers/misc
$ sudo depmod
$ sudo modprobe lenovo-sl-laptop

Testing / Enabling fan control

Enabling fan control

hwmon1 can be also hwmon2 etc:

$ sudo sh -c "echo 1 > /sys/devices/platform/lenovo-sl-laptop/hwmon/hwmon1/pwm1_enable"
Setting speed

Values between 0 and 255 are valid:

$ sudo sh -c "echo 70 > /sys/devices/platform/lenovo-sl-laptop/hwmon/hwmon1/pwm1"

Shows current rotation speed:

$ cat /sys/devices/platform/lenovo-sl-laptop/hwmon/hwmon1/fan1_input

Configuring autostart for module

Adding name to /etc/modules:

$ echo -e "\n# Lenovo sl fan module\nlenovo-sl-laptop" | sudo tee --append /etc/modules

Copy module (Repeat after every kernel update):

$ sudo cp lenovo-sl-laptop.ko /lib/modules/$(uname -r)/kernel/drivers/hwmon/

Configure automatic control by fancontrol

Edit /etc/fancontrol:

Based on: https://wiki.archlinux.org/index.php/Fan_Speed_Control

pwmconfig' doesn't work because the kernel-module doesn't provide enough information.

INTERVAL=10
DEVPATH=hwmon2=devices/platform/lenovo-sl-laptop hwmon1=devices/platform/coretemp.0
#hwmon0=devices/virtual/thermal/thermal_zone0
#DEVNAME=hwmon2=lenovo hwmon1=coretemp hwmon0=acpitz
FCTEMPS=hwmon2/device/hwmon/hwmon2/pwm1=hwmon1/device/temp2_input hwmon2/device/hwmon/hwmon2/pwm1=hwmon1/device/temp3_input/hwmon2/device/hwmon/hwmon2/pwm1=hwmon0/temp1_input
FCFANS=hwmon2/device/hwmon/hwmon2/pwm1=hwmon2/device/hwmon/hwmon2/fan1_input
MINTEMP=hwmon2/device/hwmon/hwmon2/pwm1=40
MAXTEMP=hwmon2/device/hwmon/hwmon2/pwm1=60
MINSTART=hwmon2/device/hwmon/hwmon2/pwm1=70
MINSTOP=hwmon2/device/hwmon/hwmon2/pwm1=75
MINPWM=hwmon2/device/hwmon/hwmon2/pwm1=70

For autostart:

$ sudo update-rc.d fancontrol defaults

Voila!

About

Linux kernel support for the Lenovo SL series ThinkPads

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published