Can linux change hardware functionality directly?

Posted on

Problem :

Edit: The chosen answer did not solve it for me but was the closest and maybe it could be of help to others.

I have a Lenovo Y720 laptop, which has han RGB keyboard. Unfortunately, the RGB only works on windows, because it requires a program called “Lenovo Nerve Sense”, which controls the lights. Since this program is only available on windows, is it possible in any way to light up the keyboard on Ubuntu? I have tried every single thread out there, which refers to tcpi or thinkpads, xled, xset led, and all of these functions which doesn’t work. Ubuntu actually can’t even see that I got LEDs in my keyboard, it can only see caps lock and numlock, since those are on firmware level, while the keyboard backlight is not.

Is Linux able to make changes in the hardware, like finding some register for the RGB light? Lenovo will not help with this they said, neither port the program to Linux.

Solution :

Possible answer (may not apply to your specific machine):

On my Lenovo P50 on my stock Kubuntu 16.04:

  • There is a directory /proc/acpi/ibm/ in the /proc pseudo-filesystem (Lenovo inherited IBM’s laptop brand)
  • There are several files in that directory, including one named /proc/acpi/ibm/kbdlight
  • cat /proc/acpi/ibm/kbdlight says:

    status:         0
    commands:       0, 1, 2
  • then

    sudo bash -c 'echo 2 >/proc/acpi/ibm/kbdlight'

    actually lights up the keyboard (using echo 1 dims it, and echo 0 turns it off).

You may already have something similar on your laptop, so cat the files, and experiment. Note: the sudo command is a bit contrived because the more natural sudo echo 2 >/proc/acpi/ibm/kbdlight doesn’t work since the redirection to /proc/acpi/ibm/kbdlight is done by your non-privileged userid.

PS: in addition, on my P50, the Fnspace key combo does natively control the keyboard lights.

PPS: The underlying module is the thinkpad_acpi driver which is now part of the Linux kernel (since late 2.6 versions) and seems actively maintained (additions in April to support the P50…). Note that the documentation says that the use of /proc/acpi is deprecated and one should use /sys/devices/platform/thinkpad_acpi/ instead.

Leave a Reply

Your email address will not be published. Required fields are marked *