Thinkpad L14 Fan Speed  Configuration with Thinkfan
Tags: hardware, linux, configuration, ubuntu
Published: 2021-07-26 14:37:52

I love Thinkpads. They are robust and durable. And no need to mention about their world class keyboards! 

My newest Thinkpad comes with AMD Ryzen 4750u which is really powerful and absolutely perfect for web development purposes. With my [i3 setup](https://i3wm.org/) it works like a charm, but we need to configure it a bit for silence. Let's start!

> Originally posted on [my personal website.](https://devugur.com/blog/thinkpad-l14-fan-speed-configuration-with-thinkfan)

### 1. Install the necessary package

I lately moved my development environment from Arch Linux to Ubuntu, so the following steps might differ in your distro. 

```batch
sudo apt install thinkfan
```
### 2. Create the configuration file
After installing the package we need to create a config file in the following directory: `/etc/thinkfan.conf`

This file requires three main items:

 - The fan information
 - The temperature information
 - Speed level for temperature levels

In order to provide fan information, we write this line:

`tp_fan /proc/acpi/ibm/fan`

For the temperature information we should scan the sensors of the device.

```batch
find /sys/devices -type f -name 'temp*_input'
```
Running this comman should give you something like this but **without hwmon** keyword. **Don't forget to add it** in front of each line.

```
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp6_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp3_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp7_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp4_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp1_input
hwmon /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp5_input
hwmon /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon3/temp1_input
hwmon /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon3/temp2_input
hwmon /sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0/hwmon/hwmon2/temp3_input
hwmon /sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0/hwmon/hwmon2/temp1_input
hwmon /sys/devices/pci0000:00/0000:00:02.1/0000:01:00.0/hwmon/hwmon2/temp2_input
hwmon /sys/devices/pci0000:00/0000:00:08.1/0000:06:00.0/hwmon/hwmon8/temp1_input
hwmon /sys/devices/virtual/thermal/thermal_zone0/hwmon5/temp1_input
```
After adding these lines to the configuration, we need to add our fan speed data for each temperature level. This is a sane configuration for daily usage but **use at your own risk.**

```
# speed level | start temp | end temp

(0,	0,	55)
(1,	48,	60)
(2,	50,	61)
(3,	52,	63)
(4,	56,	65)
(5,	59,	66)
(7,	63,	32767)
```
Now the config file is ready! 

###3. Enable acpi_fancontrol

We need to enable `acpi_fancontrol` on kernel module options! Add this line to `/etc/modprobe.d/thinkpad_acpi.conf` file:

```
options thinkpad_acpi fan_control=1
```
Activate kernel settings by running this:


```
sudo modprobe -r thinkpad_acpi && sudo modprobe thinkpad_acpi
```

### 4. Enable the thinkpan.service

In order to start the service any time you boot up your machine, we need to enable it!

```
sudo systemctl enable --now thinkfan.service
```
### 5. Done!

You can check if the service is running or not with this command:

```
sudo systemctl status thinkfan.service
```
I hope you find  this tutorial useful! Have a nice day and hit me on [Twitter.](https://twitter.com/uguremirmustafa)



[Photo](https://unsplash.com/s/photos/thinkpad-linux?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) by [m20 m20](https://unsplash.com/@m20m20?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)