8

I bought a Lenovo IdeaPad 5 15are05 yesterday and installed Ubuntu 20.04 on it. Problem is, the touchpad doesn't work.

I've also tried 18.04 and even Debian 10, but the only OS it works on is Windows.

I've looked through many fora and I found nothing that helped me. However, I did find some commands and I think you will find these outputs interesting

cat /proc/bus/input/devices:

I: Bus=0018 Vendor=0000 Product=0000 Version=0000
N: Name="Elan Touchscreen"
P: Phys=
S: Sysfs=/devices/platform/AMDI0010:01/i2c-1/i2c-ELAN0001:00/input/input4
U: Uniq=
H: Handlers=mouse0 event4 
B: PROP=2
B: EV=b
B: KEY=400 0 0 0 0 0
B: ABS=661800001000003

Even though it says "Touchscreen", I know for a fact that this is my touchpad. How do I know this? Well, when I go to a terminal using ctrl+alt+f3, and I try to use my touchpad, it outputs this:

elants_i2c i2c-ELAN0001:00: unknown packet 0e 00 04 03 03 meaning that I'm touching it. That value changed on different actions, for example, it becomes 01 on 'releasing' the touchpad.

This means that the touchpad is listed under ELAN0001, which the "Touchscreen" is listed under as well. I don't think it's that weird that it says it's a touchscreen, because they're very similar.

xinput outputs this:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ NEWMEN1500 Mouse Consumer Control         id=13   [slave  pointer  (2)]
⎜   ↳ NEWMEN1500 Mouse                          id=15   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ NEWMEN1500 Mouse Consumer Control         id=14   [slave  keyboard (3)]
    ↳ NEWMEN1500 Mouse                          id=12   [slave  keyboard (3)]
    ↳ Integrated Camera: Integrated C           id=9    [slave  keyboard (3)]
    ↳ Ideapad extra buttons                     id=10   [slave  keyboard (3)]

The touchpad should be listed under Virtual core pointer, but it isn't.

I would really like to know a fix for this, since I need the touchpad to work and I don't want to buy a new laptop, so please help me!

  • Based on the Phoronix benchmarking on this hardware, you need 5.6 kernel or later. Google 'Ubuntu mainline kernel ' – Tim Richardson Jun 08 '20 at 12:38
  • @TimRichardson I just tried kernel 5.6.17 and 5.7.1 and they both do not want to boot and I also still get unknown packet errors when trying to use my touchpad – Kelvin Bouma Jun 08 '20 at 16:53
  • @TimRichardson Update: I got 5.7.1 to work. However, the touchpad still doesn't work, it also is not listed in /proc/bus/input/devices anymore – Kelvin Bouma Jun 08 '20 at 18:16
  • Is your hardware the same as https://www.phoronix.com/scan.php?page=article&item=ryzen7-4700u-linux&num=1 – Tim Richardson Jun 08 '20 at 18:19
  • @TimRichardson no it isn't, mine has a Ryzen 5 4500U. Mine is an IdeaPad 5 15are05 and that one is an IdeaPad 5 (14) – Kelvin Bouma Jun 08 '20 at 19:39
  • HI, that hardware is I think virtually identical to the system Phoronix tested. I am getting one in two or three weeks (for my son) – Tim Richardson Jun 09 '20 at 01:34
  • 1
    @TimRichardson well, with touchpad it's a lot different, but I found the solution, I will now post it as the answer to my question. I hope you get it working for your son too! – Kelvin Bouma Jun 09 '20 at 08:33

5 Answers5

8

It seems not to be possible to blacklist elants_i2c driver, as it is a built-in kernel module for Ubuntu:

stefano@stefano-IdeaPad-5-15ARE05:~$ modinfo elants-i2c
name:           elants_i2c
filename:       (builtin)
license:        GPL
description:    Elan I2c Touchscreen driver
author:         Scott Liu <scott.liu@emc.com.tw>

so there is a faster way than compiling the kernel. Just create a SystemD unit like the below:

stefano@stefano-IdeaPad-5-15ARE05:~$ cat /etc/systemd/system/touchpadfix.service 
[Unit]
Description=Fix touchpad issue by binding correct driver

[Service] ExecStart=/usr/local/bin/touchpadfix Type=oneshot RemainAfterExit=yes

[Install] WantedBy=multi-user.target

and create /usr/local/bin/touchpadfix file as follows

stefano@stefano-IdeaPad-5-15ARE05:~$ cat  /usr/local/bin/touchpadfix
#!/bin/bash
modprobe i2c_hid
echo "i2c-ELAN0001:00" > /sys/bus/i2c/drivers/elants_i2c/unbind
echo "i2c-ELAN0001:00" > /sys/bus/i2c/drivers/i2c_hid/bind

and then make it executable, enable and start the unit with the following commands:

chmod +x /usr/local/bin/touchpadfix
sudo systemctl daemon-reload
sudo systemctl enable --now touchpadfix.service

and touchpad should start to work immediately!

SOURCE: https://wiki.archlinux.org/index.php/Lenovo_IdeaPad_5_15are0 which is giving us unbind-bind fix and dl3it user on this post https://bugzilla.kernel.org/show_bug.cgi?id=207759#c17

  • 1
    Great, that also works on IdeaPad-3 14ARE05! – bgraves Jun 28 '20 at 09:53
  • 1
    way easier than recompiling the linux kernel – Sulliwane Jul 26 '20 at 08:27
  • 1
    I now suggest this solution below https://askubuntu.com/a/1258389/694750 which is even easier than mine – theunreal89 Jul 31 '20 at 15:43
  • 1
    Confirmed to work on Pop!_OS 20.04 – Zachary Fields Aug 28 '20 at 01:35
  • 1
    Thanks! The idea (with modifications) helped on a Fujitsu E5510. Touchpad, Wifi and ethernet and keyboard did not start! Better result with Ubuntu 21.04(!). What eventually helped in my case: Create a Systemd service essentially invoking "modprobe i2c_hid" (not more) . . Do not forget the "sudo systemctl enable" part! FF! – opinion_no9 Apr 17 '21 at 20:58
  • 1
    FYI My file at /etc/systemd/system/touchpadfix.service spontaneously disappeared after a system crash. According to this answer it is better suited in /lib/systemd/system/ : https://askubuntu.com/questions/717574/dpkg-and-systemd-unit-file-silently-disappears – Tasos Bitsios Aug 17 '21 at 18:58
6

I found the solution, big shoutout to dl3it on Ideapad 5-15ARE05: Touchscreen not working | Lenovo Forums. (Note: it says touchscreen, but that's just the name of the touchpad I guess. It works fine.)

The problem is that the kernel does something wrong with the drivers. To fix this, you will have to install a mainline kernel and configure it yourself.

First off, install dependencies by executing this on a command line:

sudo apt-get install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf

Then, download kernel 5.6.x or 5.7.x (x can be any integer, I used 5.7.1 and it has been tested on 5.6.14 and 5.7.0-rc7) from source (via kernel.org). Once on kernel.org, click on [tarball] for the kernel you want.

Extract everything as you would do with any other .tar.gz file.

Then, move to the linux-5.6.x or linux-5.7.x directory in a command line.

Execute sudo make menuconfig and navigate to Device Drivers → Input device support → Touchscreens → Elan eKTH I2C touchscreen.

Once there, change the asterisk to an m by hitting enter and then typing the m.

After that, use the left and right arrows to change the selected option in the bottom to "save" and hit Enter. Then, you will want to save it as .config (which it should default to).

Now still being in the same directory, execute this command:

sudo make -jx && sudo make modules_install -jx && sudo make install -jx

(Change x to the amount of threads your CPU has. Leaving out this option will make this take a long time.)

This will take some time, but after it's finished, you will want to make sure your PC will boot on the new kernel. To do that, execute:

sudo update-initramfs -c -k <kernel-version>

(Change <kernel-version> to the kernel version you just installed, for example 5.7.1.)

Then, fix the grub config by executing:

sudo update-grub

And then reboot and your touchpad should work just fine!

NOTE: websites I used and didn't mention before:

  • thanks for this effort. When I get the new ideapad as mentioned above, I will add my feedback, in case it is needed. – Tim Richardson Jun 09 '20 at 09:38
  • Thanks, that really helped. 2 small notes: strip the debug symbols with ´INSTALL_MOD_STRIP=1´ or the image will be 1gb+; and ´make clean´ after. – Imaskar Jun 11 '20 at 22:33
  • This may now be overkill, as there are two options for blacklisting it at boot time, which allows it to function normally, later. – Walf Jul 09 '20 at 03:25
  • Please file a bug report for this issue. The kernel developers would love to know about it. – user535733 Aug 28 '20 at 23:00
4

Almost 100% correct, here is the workaround.

Open Terminal and open the file /etc/default/grub for editing using your preferred text editor, for example

sudo mousepad /etc/default/grub

Edit the line that begins GRUB_CMDLINE_LINUX so that it reads:

GRUB_CMDLINE_LINUX="initcall_blacklist=elants_i2c_driver_init"

Save, exit mousepad or text editor of your choosing, and run this command to write the configuration:

sudo update-grub

Whether additional parameters are added before or after quiet splash does not matter.

Keep in mind that this is a workaround that will get the touchpad working; the touchpad indicator icon will NOT work properly.

Zanna
  • 70,465
  • I should have included this in my answer because editing the installer's grub line was not permanent, and I had to do this after the first normal boot, too. – Walf Jul 23 '20 at 04:36
  • 1
    what is mousepad? – Zachary Fields Aug 27 '20 at 21:57
  • mousepad is a text editor, just like gedit, only a little more lightweight. Its the default on some flavors of linux. You can replace 'mousepad' with your favorite text editor. – GoOnGetErDone Aug 29 '20 at 00:30
  • Note from below I have ALSO needed to add pci=nocrs to GRUB_CMDLINE_LINUX_DEFAULT as noted here: https://askubuntu.com/a/1303168/9578 – rik-shaw Feb 19 '21 at 10:19
  • 1
    did not work so tried @rik-shaw 's advice as well, still does not work on my ideapad 3 but I'm loading my Ubuntu 20.04 on external SSD that came out of my Thinkpad T420. Does anyone know what to do in my situation? – mLstudent33 Mar 20 '21 at 22:41
  • after a couple of reboots, it started working. – mLstudent33 Mar 31 '21 at 05:47
  • It started working after a few days, maybe a few reboots but on my new installation tried rebooting 3 times but not working yet so maybe in a few more reboots. – mLstudent33 Mar 31 '21 at 06:24
  • it works if you do the pci=nocrs as @rik-shaw states above. – mLstudent33 Apr 01 '21 at 01:53
3

I was able to resolve this issue using the advice from this launchpad bug comment (via this Lenovo forum reply):

Jasper van der Neut - Stulen (neutstulen) wrote on 2020-06-18: #31

As a workaround you can add "initcall_blacklist=elants_i2c_driver_init" to GRUB_CMDLINE_LINUX, run update-grub, power down the laptop and start it again.

This also works when booting from installation media, by adding initcall_blacklist=elants_i2c_driver_init to the boot parameters. In grub's load screen, I added it after quiet splash when editing the Start Ubuntu option.

Walf
  • 398
  • I have had multiple machines needing this fix, and in both cases I needed to add pci=nocrs to GRUB_CMDLINE_LINUX_DEFAULT in ADDITION to adding this blacklist command to GRUB_CMDLINE_LINUX? Reference: https://askubuntu.com/a/1303168/9578 – rik-shaw Feb 19 '21 at 10:18
2

An easier solution is: add blacklist elants_i2c to /etc/modprobe.d/unneeded-modules.conf (you'll have to create this), save and reboot. Working on identical touchpad and Manjaro. Vendor=04f3 Product=3140 Version=0100