razer version 0.01
Razer Blade Pro 2014 keyboard and touchpad linux drivers

Author:  Milan Votava <votava@mageo . cz>

Based on work of Zach Carlson (FxChiP@Gmail . com)
http://fxchip.net/RazerBlade/
https://github.com/FxChiP/rzswitchblade

Description
-----------

WIP

Keyboard and touchpad drivers for Razer Blade Pro 2014 laptop.

Verified to work under Fedora 20 (64b, 3.13.10 kernel)

Features:

  keyboard
    - all simultaneously pressed keys reported to input subsystem
    - all FN keys supported (including brightness control)
    - razerblade buttons reported as F13-F22
    - USB endpoint interval set to 1 (125us)

  touchpad
    - double finger scroll support

Problems:
  keyboard
    - secure boot must be disabled in order to load unsigned razer drivers modules
    - touchpad resets itself from time to time
    - lost key presses occasinally
    - lost key up event (unwanted autorepeat)

WARNING:
This driver uses undocumented features and direct hardware access.
It thus cannot be guaranteed to work, and may cause arbitrary damage
(especially on models it wasn't tested on).


Installation
------------

For testing, you can simply compile and load the driver within the current
working directory:
# make load

To compile and install into the kernel's module path:
# make install

To delete all autogenerated files:
# make clean

Append "DEBUG=1" to "make load" to load razer_kbd/tp with debug=1.

To install compiled modules 
# make install

The original kernel tree is never modified by any these commands.
The /lib/modules directory is modified only by "make install".


Module parameters
-----------------

razer_kbd/tp module:
  debug=1    enables verbose dmesg output.
  ep_interval=<1 .. 16> (default 1)

module parameters can be specified in a file in /etc/modprobe.d directory:

/etc/modprobe.d/razer.conf
options razer_kbd debug=1


Usage
-----
Both keyboard and touchpad are claimed by linux generic HID driver during boot. You may use included shell script razer-bind.sh to reattach both devices to razer drivers (called from /etc/rc.d/c.local ...)


Model-specific status
---------------------

Works (at least partially) on the following Razer model:
* Razer Blade Pro 2014

Please report success/failure by e-mail.

Bug reporting
-------------

Mail <votava@mageo . cz>. Please include:
* Details about your model,
* Relevant "dmesg" output. Make sure razer_kbd and razer_tp are loaded with
  the "debug=1" parameter (e.g., use "make load DEBUG=1").


Files in this package
---------------------

README
  This file.
CHANGES
  Change log.
TODO
  Pending improvements.
Makefile
  Makefile (see "Installation" above).
razer_kbd.c
  keyboard driver module
razer_tp.c
  touchpad driver module
razer-bind-udev.sh
  udev rules shell script to bind an usb device to razer driver
razer-bind.sh
  shell script to bind/unbind an usb device to/from razer/usbhid driver
100-razer.rules
  sample udev rules file to unbind an usb device from usbhid driver and bind it to razer driver (should be put in /etc/udev/rules.d/)


Technical notes
---------------

secure boot must be off (module not signed?)

switchblade:

image format
rgb565
u16

image blitting:

header (6 x u16)
1, x1, y1, x2, y2, chksum

image
usb interface 3
ep 1 - tp 799 x 479 (765442)
ep 2 - buttons 115 x 115 (26450B)


buttons offsets [x, y]:
[9, 151] [178, 151] [346, 151] [515, 151] [683, 151]
[9, 318] [178, 318] [346, 318] [515, 318] [683, 318]

tp offset:
[0, 0]
