Skip to content

corcoran/chromebook_keyboard_backlight_driver

 
 

Repository files navigation

Chromebook Keyboard backlight driver for Linux 3.x. / 4.1.x

Since the newest Linux Kernel (3.12) ships with Chromebook Pixel support, both touchscreen and touchpad all work fine, but the kernel doesn't include the keyboard backlight driver. So I picked the driver from https://github.com/brocktice/pixel_linux and made it standalone and easy to use.

Thanks to brocktice DaveM

Requirements

  • Google Chromebook Pixel, HP Chromebook 13 (G1/Chell), Toshiba Chromebook 2 (2015) (Gandof) or Dell Chromebook 13 (Lulu) with Linux installed.
  • Build toolchains.

Know issue

If we register the keyboard backlight device as backlight to Linux system, Gnome will be confused with the LCD and Keyboard backlight. In the system setting panel, display brightness adjust will be operated on Keyboard Backlight. So, we register it as leds devices to system to make Gnome happy.

How to install

Clone the code.

If you want the keyboard backlight works like an backlight then edit pixel_kb_backlight.c

#ifdef KB_BACKLIGHT
#define DEVICE_NAME "chromeos-keyboard-backlight"
#else
#define DEVICE_NAME "chromeos-keyboard-leds"
#endif

Make these changes and the driver will act as backlight or leds.

Build with:

make

You will get 3 drivers: chromeos_keyboard_bl.ko #backlight class driver chromeos_keyboard_leds.ko #leds class driver chromebook_kb_backlight.ko #keyboard backlight device driver

Now, you can load the drivers:

if you choose backlight

sudo insmod chromeos_keyboard_bl.ko
sudo insmod chromebook_kb_backlight.ko

if you choose leds

sudo insmod chromeos_keyboard_leds.ko
sudo insmod chromebook_kb_backlight.ko

OK, check whether the drivers loaded successfully:

if you choose backlight

ls /sys/class/backlight

if you choose leds

ls /sys/class/leds

If you can see keyboard_backlight or chromeos::kbd_backlight from ls output, It works!

How to use

I have made a helper shell script to adjust the backlight level. You need to edit the script if you chose backlight, to use the correct path.

# turn on the backlight
sudo ./keyboard_brightness.sh on

#turn off the backlight
sudo ./keyboard_brightness.sh off

#turn up 
sudo ./keyboard_brightness.sh up

#turn down
sudo ./keyboard_brightness.sh down

For leds as sample:

Make it load automaticlly while system boot

I installed Ubuntu 13.10 with Linux kernel 3.12.0-031200-generic, so I do the following:

#copy our drivers to the kernel's modules dir
sudo cp chromeos_keyboard_leds.ko /lib/modules/3.12.0-031200-generic/
sudo cp chromebook_kb_backlight.ko /lib/modules/3.12.0-031200-generic/

#tell system we have new modules
sudo depmod -a
sudo modprobe module

then edit /etc/modules and add two lines:

chromeos_keyboard_leds
chromebook_kb_backlight

Just reboot the laptop, the keyboard backlight driver will load automatically.

Enjoy!

About

Chromebook keyboard backlight led driver (pixel / lulu)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.8%
  • Makefile 7.2%