A Linux USB driver for the OLED keys on the OCZ Sabre keyboard.
I have coded C for a while, but this is my first Linux kernel module, so although the code should be fairly clean, I haven’t necessarily followed the guidelines for Linux kernel development in terms of code style and structuring, etc. Also, although I have taken care to perform a healthy degree of error checking, there may still be bugs which are specific to how the kernel works which break things. Install at your own risk. Having said that, I’ve been running it on the keyboard I have for while and haven’t had any problems.
As the superuser:
$ cd /usr/src $ hg clone $REPO oczoled-0.1 $ dkms add -m oczoled -v 0.1 $ dkms build -m oczoled -v 0.1 $ dkms install -m oczoled -v 0.1 $ modprobe oczoled
/sys/bus/usb/drivers/oczoled/$USBINTERFACE, where $USBINTERFACE looks something like 1-1:3.0, you’ll find some files:
led[0-8] contain the bitmaps for the keys.
They contain 512 bytes, representing the bitmap in row major order.
You can read and write to this: it’s a buffer in kernel memory, which is regularly sent to the keyboard.
brightness contains a single number from 0-255.
Writing to this file controls the brightness of the keys.