2018-06-08 11:56:32 +02:00
# Table of Content
- < a href = "#description" > Description</ a >
- < a href = "#building" > Building and Install</ a >
- < a href = "#install" > Install</ a >
- < a href = "#using" > Using</ a >
- < a href = "#sysfs" > Sysfs</ a >
- < a href = "#kernelparam" > Kernel Parameter</ a >
- < a href = "#modes" > Modes</ a >
# Description <a name="description"></a>
2019-10-15 21:59:30 +02:00
TUXEDO Computers Kernel Module for keyboard backlighting.
2018-06-08 11:56:32 +02:00
Additions
- Sysfs interface to control the brightness, mode, color, on/off state
- DKMS Ready
- Full RGB Color Support
2018-06-08 11:59:16 +02:00
- WMI Support for switch over the FN-Keys
2018-06-08 11:56:32 +02:00
# Building and Install <a name="building"></a>
2019-10-15 21:59:30 +02:00
## Dependencies:
2018-06-08 11:56:32 +02:00
- make
- gcc
- linux-headers
- dkms (Only when use this module with the DKMS functionality)
2018-06-28 23:18:03 +02:00
## Warning on installing the module:
Use either method only. Do not combine installation methods, such as starting with the build step below and proceeding to use the same build artifacts with the DKMS module. Otherwise the module built via dkms will fail to load with an `exec_format` error on newer kernels due to a mismatched version magic.
This is why the DKMS build step begins with a `make clean` step.
For convenience, on platforms where DKMS is in use, skip to the DKMS section directly.
2019-10-15 21:59:30 +02:00
## Clone the Git Repo:
2019-07-10 18:16:25 +02:00
```sh
git clone https://github.com/tuxedocomputers/tuxedo-keyboard.git
```
2019-10-15 21:59:30 +02:00
## Build the Module:
2018-06-08 11:56:32 +02:00
```sh
2019-07-10 18:16:25 +02:00
cd tuxedo-keyboard
2018-06-08 11:56:32 +02:00
make clean & & make
```
2018-06-28 23:18:03 +02:00
## The DKMS route:
2018-06-08 11:56:32 +02:00
2018-06-28 23:18:03 +02:00
### Add as DKMS Module:
2018-06-08 11:56:32 +02:00
2019-10-15 21:59:30 +02:00
Add the Module:
2018-06-08 11:56:32 +02:00
```sh
make clean
2019-08-18 21:18:54 +02:00
2019-08-26 22:03:29 +02:00
sudo cp -R . /usr/src/tuxedo_keyboard-2
2019-08-18 21:18:54 +02:00
2019-08-26 22:03:29 +02:00
sudo dkms add -m tuxedo_keyboard -v 2
2018-06-08 11:56:32 +02:00
```
2019-10-15 21:59:30 +02:00
Compile the Module:
2018-06-08 11:56:32 +02:00
```sh
2019-08-26 22:03:29 +02:00
sudo dkms build -m tuxedo_keyboard -v 2
2018-06-08 11:56:32 +02:00
```
2019-10-15 22:00:34 +02:00
Install the Module:
2018-06-08 11:56:32 +02:00
```sh
2019-08-26 22:03:29 +02:00
sudo dkms install -m tuxedo_keyboard -v 2
2018-06-08 11:56:32 +02:00
```
2019-10-15 21:59:30 +02:00
Load the Module with modprobe:
2018-06-08 11:56:32 +02:00
```sh
modprobe tuxedo_keyboard
```
2019-10-15 21:59:30 +02:00
or
```sh
sudo modprobe tuxedo_keyboard
```
2018-06-08 11:56:32 +02:00
2018-06-28 23:18:03 +02:00
### Uninstalling the DKMS Module:
2018-06-08 11:56:32 +02:00
2019-10-15 21:59:30 +02:00
Remove the DKMS Module and Source:
2018-06-08 11:56:32 +02:00
```sh
2019-08-26 22:03:29 +02:00
sudo dkms remove -m tuxedo_keyboard -v 2 --all
2018-06-08 11:56:32 +02:00
2019-08-26 22:03:29 +02:00
sudo rm -rf /usr/src/tuxedo_keyboard-2
2018-06-08 11:56:32 +02:00
```
# Using <a name="using"></a>
## modprobe
```sh
modprobe tuxedo_keyboard
```
2019-10-15 21:59:30 +02:00
## Load the Module on boot:
2018-06-08 11:56:32 +02:00
Add Module to /etc/modules
```sh
sudo su
2019-08-18 21:18:54 +02:00
2018-06-08 11:56:32 +02:00
echo tuxedo_keyboard >> /etc/modules
```
Default Parameters at start.
2018-06-28 23:18:03 +02:00
In this example, we start the kernel module with the following settings:
2018-06-08 11:56:32 +02:00
- mode 0 (Custom / Default Mode)
- red color for the left side of keyboard
- green color for the center of keyboard
- blue color for the right side of keyboard
2019-10-15 21:59:30 +02:00
Note that we write it's settings to a `.conf` file under `/etc/modprobe.d` named `tuxedo_keyboard.conf` .
2018-06-28 23:18:03 +02:00
2018-06-08 11:56:32 +02:00
```sh
sudo su
2019-08-18 21:18:54 +02:00
2018-06-08 11:56:32 +02:00
echo "options tuxedo_keyboard mode=0 color_left=0xFF0000 color_center=0x00FF00 color_right=0x0000FF" > /etc/modprobe.d/tuxedo_keyboard.conf
```
# Sysfs <a name="sysfs"></a>
## General
Path: /sys/devices/platform/tuxedo_keyboard
## color_left
2018-06-08 11:57:52 +02:00
Allowed Values: Hex-Value (e.g. 0xFF0000 for the Color Red)
2018-06-08 11:56:32 +02:00
Description: Set the color of the left Keyboard Side
## color_center
2018-06-08 11:57:52 +02:00
Allowed Values: Hex-Value (e.g. 0xFF0000 for the Color Red)
2018-06-08 11:56:32 +02:00
Description: Set the color of the center of Keyboard
## color_right
2018-06-08 11:57:52 +02:00
Allowed Values: Hex-Value (e.g. 0xFF0000 for the Color Red)
2018-06-08 11:56:32 +02:00
Description: Set the color of the right Keyboard Side
## color_extra
2018-06-08 11:57:52 +02:00
Allowed Values: Hex-Value (e.g. 0xFF0000 for the Color Red)
2018-06-08 11:56:32 +02:00
Description: Set the color of the extra region (if exist) of the Keyboard
## brightness
2018-06-08 11:57:52 +02:00
Allowed Values: 0 - 255
2018-06-08 11:56:32 +02:00
Description: Set the brightness of the Keyboard
## mode
2018-06-08 11:57:52 +02:00
Allowed Values: 0 - 7
2018-06-08 11:56:32 +02:00
Description: Set the mode of the Keyboard. A list with the modes is under < a href = "#modes" > Modes< / a >
## state
2018-06-08 11:57:52 +02:00
Allowed Values: 0, 1
2018-06-08 11:56:32 +02:00
Description: Set the State of keyboard, 0 is keyboard is off and 1 is keyboard is on
## extra
2018-06-08 11:57:52 +02:00
Allowed Values: 0, 1
2018-06-08 11:56:32 +02:00
Description: Only get the information, if the keyboard have the extra region
# Kernel Parameter <a name="kernelparam"></a>
## Using
```sh
sudo modprobe tuxedo_keyboard < params >
```
## color_left
Set the color of the left Keyboard Side
## color_center
Set the color of the left Keyboard Side
## color_right
Set the color of the left Keyboard Side
## color_extra
Set the color of the left Keyboard extra region (Only when is a supported keyboard)
## mode
Set the mode (on/off) of keyboard
## brightness
Set the brightness of keyboard
## state
# Modes <a name="modes"></a>
## CUSTOM
2018-06-08 11:59:16 +02:00
Value: 0
2018-06-08 11:56:32 +02:00
## BREATHE
2018-06-08 11:59:16 +02:00
Value: 1
2018-06-08 11:56:32 +02:00
## CYCLE
2018-06-08 11:59:16 +02:00
Value: 2
2018-06-08 11:56:32 +02:00
## DANCE
2018-06-08 11:59:16 +02:00
Value: 3
2018-06-08 11:56:32 +02:00
## FLASH
2018-06-08 11:59:16 +02:00
Value: 4
2018-06-08 11:56:32 +02:00
## RANDOM_COLOR
2018-06-08 11:59:16 +02:00
Value: 5
2018-06-08 11:56:32 +02:00
## TEMPO
2018-06-08 11:59:16 +02:00
Value: 6
2018-06-08 11:56:32 +02:00
2018-06-08 11:59:16 +02:00
## WAVE
2018-06-28 23:18:03 +02:00
Value: 7