Making Asus UX305CA touchpad work in Ubuntu (temporary fix!)

Hello everyone – I acquired a fine Asus UX305C “ultrabook” but I was somewhat disappointed to find that its touchpad, the ELAN1000, doesn’t work under Ubuntu.

A bit of Googling taught me that this is a widespread problem. It seems to come down to a bug in the i2c driver, and relating to some timing delay not being respected. It’s likely also to get fixed in the major next Linux kernel (4.5), but I don’t know when that one will come along. Anyway, as you can hear from the way I talk about it I have no clue what the actual problem is, but I found Kevin Fenzi’s fix here (and thanks to Benjamin Tissoires for pointing me to it):

https://bugzilla.redhat.com/show_bug.cgi?id=1275718#c7

The problem is at the above link it’s only explained how to do this for Fedora. Here I’ll show how to do this under Ubuntu.

This is a workaround – it’s not a real fix. The problem is expected to be actually solved in the 4.5 kernel but for the time being, you can use the instructions here as a workaround.

First, get ready to download, build and install a custom kernel. This is nowhere near as scary as it sounds. Follow the instructions here:

https://wiki.ubuntu.com/KernelTeam/GitKernelBuild

It may be a wise idea to test that you can get this custom kernel compiled, installed and running using the instructions above. It won’t actually solve your problem but once you manage to, you’re almost there.

Now in the kernel sources that you downloaded in the above tutorial, open the file

drivers/i2c/busses/i2c-designware-platdrv.c

In this file, find the following section:

static int dw_i2c_acpi_configure(struct platform_device *pdev)
        dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, NULL);
        dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt,
                           &dev->sda_hold_time);
 
        return 0;
 }

Depending on the source you downloaded, there may be some extra lines before the return statement, but that’s irrelevant. Now after the two lines that start with dw_i2c_acpi_params, add the following line:

dev->sda_hold_time = 30;

When this is done, save the file. Now you just need to recompile the kernel sources and install them as explained in the kernel building tutorial, and then boot into the new kernel, and voilà, your touchpad should work. Booting into the new kernel is fairly easy: if you followed the steps in the tutorial then it should appear in your boot menu.

Confirmed to work for XUbuntu 15.10 on UX305.

Advertisements

44 thoughts on “Making Asus UX305CA touchpad work in Ubuntu (temporary fix!)

  1. Unfortunately, this did not work for me. I followed your instructions exactly (and booted into new kernel), but I still see no sign that my laptop sees the touchpad at all. Mine is a ZenBook UX305CA bought on Dec 20 2015 (so unlikely to be a revision of your model), but I am running Ubuntu 15.04 rather than Xubuntu 15.10. I don’t see how that could make a difference with a self-compiled kernel and identical hardware.

    Not expecting you to solve my problem, this is just FYI.

    • Hi Stuart, thanks for your comment, and I’m sorry to hear it doesn’t work for you. If you run dmesg can you still see the i2c error messages like before? I assume that you also made sure to boot into the new kernel. I agree with you that XUbuntu/Ubuntu shouldn’t make a difference for this.

  2. HI Floris, unfortunately also does not work for me (UX305C bought Dec 2015. I’m running Ubuntu Gnome 15.04). Also I find the screen flickers horizontal lines from time to time in kernel 4.4, not so in the stock 3.19 kernel. Will upgrade to 15.10 and try again. Any other suggestions welcome, would be great to have the trackpad working!
    Thanks
    Steve

      • Hi Robert,
        I had screen flickering when I tried to run the patch on an 3.19 kernel. As soon as I upgraded to Ubuntu Gnome 15.10 and later debian 8 both with Florus’ fixed 4.4something kernel I no longer had the issue. The strange behaviour of the Video player as well as a strange but useable graphics issue in OpenShot video editor remain. Not sure if this is any use to you?
        Steve

  3. Hi Steve, sorry to hear that the fix doesn’t work for you. At least your graphics issue got solved! It reminds me of an issue I still have with Skype and some media players, described here:
    http://askubuntu.com/questions/710960/video-display-problems-ubuntu-on-asus-ux305-skype-and-vlc-and-other-programs
    Do you have that issue too now that you’re on the same version of Ubuntu as I am? I haven’t been able to solve it.
    To get back to your question: did your dmesg output still give you the i2c error (arbitration lost)? In my case it disappeared and at the same time the problem was solved.
    Let’s hope we get all of this to work. It’s too beautiful a laptop not to be fully supported by Ubuntu!

    • Hi Floris,
      Thanks for the input. The video issue you described is a bit different and solved in 15.10. I just checked with VLC and have the same behavior as you describe… strange! No issue with Videos for playback of the same files.
      When I boot in 4.2 kernel I get the following eror on dmesg:
      [ 8.540988] i2c_designware i2c_designware.0: i2c_dw_handle_tx_abort: lost arbitration
      When booting in the custom kernel 4.4 rc7 it disappears.
      However, in neither I get the touchpad listed with:
      cat /proc/bus/input/devices
      Not sure if that gives you any ideas. Indeed its a great laptop but silly to have to carry around an external mouse at all times!

      • Hi Steve, that’s curious. When I boot into the 4.4 kernel (with the modified source code), I get the following device:

        I: Bus=0018 Vendor=04f3 Product=0005 Version=0000
        N: Name="Elan Touchpad"
        P: Phys=
        S: Sysfs=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-4/i2c-ELAN1000:00/input/input11
        U: Uniq=
        H: Handlers=mouse1 event11
        B: PROP=5
        B: EV=b
        B: KEY=e520 10000 0 0 0 0
        B: ABS=663800013000003

        Honestly I don’t know what to try next. Would there be a way to verify that the source code fix you made really compiled into the kernel? One thing I could imagine is that somehow the compiled kernel files remained the same (from before your edit of the source). But I don’t know how to check this.

      • HI, that’s not unlikely, it’s the first kernel I (tried to) compile. Would it be possible for you to share the kernel files with me (dropbox or something like that)?

  4. Dear Floris,
    thanks a lot for your little codelines. I used the latest kernel 4.4.0-rc7. Just wanted to report that the touchpad is working now on my Zenbook UX305CA-FC037 with Ubuntu-15.10 (64 bit). Yay 😀

    Had to remove all old kernels with “sudo apt-get remove ” and “sudo update-grub” otherwise there was only a chance to start with the new custom kernel by the “advanced options” in the grub menu. “sudo apt-get autoremove” did not work for me in that case.

    There is just one issue (which I do not miss but just want to mention): the two-finger-zoom that is working under W10 is still not functional. Same for brightness hot-keys 😉

    All the best,
    therese

    • Hi Therese, glad it worked for you. I have also not yet been able to make the brightness keys work. Let me know if you manage it. And same for the two-finger zoom.
      Best wishes
      Floris

      • I fixed the brightness hotkeys by installing xbacklight and putting xbacklight +10 and -10 as custom shortcuts set through settings>keyboard>shortcuts
        best
        steve

      • For the brightness key issue: I tried something similar but I couldn’t link to the shortcut key Fn+f5 and Fn+f6 as they are shown on the keyboard. But I could just link it to some other key combination.

      • I linked f5 and f6 directly rather than Fn…

        As for your kernel: thanks a lot, it works like a charm. 2-fingerscrolling, tap to click, all of it!!

  5. Thank you! Thank you! Thank you! I was able to get this working on Ubuntu 15.10 using your method. If it matters, I ended up using and compiling the 4.4-rc8 kernel with the changes you supplied.

  6. Dear Floris,
    The .deb files you published manage to do the trick for me. As a linux beginner I was really clueless – and this solution worked like magic. BTW – My release is Ubuntu 14.04 and not 15.10 so I hope that shouldn’t be a problem.

    many many thanks,
    Elad

    • Hello Elad, glad to hear this worked for you too. I think using Ubuntu 14.04 should be fine, but if you notice anything odd please write a comment here so that others can learn from it too.
      Floris

      • don’t know if it is related but I had some screen issue which made me want to upgrade to 15.10 and when doing the upgrade I ran into some trouble – just saying, it might be related to the fact I had the 4.4 kernels with the 14.04 release but personally it is beyond my expertise.

  7. This was my first time compiling my own kernel (4.4.0-rc8-floriscustom) — not at all as bad as it sounds. Trackpad is working in Linux Mint 17.3 Rosa!

    One note: I had previously installed the 4.4-rc8-generic kernel to get the trackpad working, it remained the default grub option. So to make floriscustom the default, I followed the top comment from this answer: http://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry

    Thank you for your work putting this together!

  8. First of all, I would like to say thank you Floris for being a wizard. I have been experimenting with Elementary OS and still find it a bit too buggy even with your work around. The Fedora Rawhide route has been stable out of the box. Has anyone found any other distros that appear to function well with this hardware?

  9. Works perfectly without file, drivers/i2c/busses/i2c-designware-platdrv.c, motification, on current kernel commit!! Thank you for your helpful post, florisvanvugt!!

    • Hi Jason, that’s really useful to know! I think this means that the actual fix of the problem (rather than the “hack” that I suggested) made it into the current kernel on git. Thanks for letting us know.

  10. Hi florisvanvugt,

    thanks for sharing. I’m using linux mint, but saw another reader had success with your custom kernel. However, when I run

    make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom

    I receive the error: unrecognized command line option ‘-fastck-protector-strong’. Any thoughts?

      • Oh figured out it was a gcc / g++ vers issue. Got it to work. Weirdly enough, when I installed the custom kernel it linked to 4.5 rc and the touchpad worked – however the screen started to flicker. Now i’m working on a way to make the custom kernel off of 4.4 and then follow your post.

  11. Hi Floris,
    I thought I’d ask here whether anyone else has problems with the suspend on ubuntu 15.10, asus ux305 and if anyone knows a solution. The problem is instead of properly suspending, the computer shuts down or something and forgets its previous state.

    best,
    Elad

      • This worked for me too. I still have the weird screen flicker issue and my brightness keys don’t work, but the essentials are there.

        Just a note, if you have Virtualbox installed, you may get some DKMS errors/warnings when installing the new kernel, but they seem safe to ignore.

        Thanks again Floris. I probably would have returned my new laptop three months ago if not for this page!

  12. do you guys experience loss in touchpad sensitivity when switching to libinput drivers? and if so, any suggestions on how to solve it? Thanks
    Steve

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s