clevo-keyboard/README.md

221 lines
4.5 KiB
Markdown
Raw Normal View History

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="#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
2019-12-19 18:00:00 +01:00
- WMI Support for 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
2019-12-19 18:00:00 +01:00
- dkms (Only when using this module with DKMS functionality)
2018-06-08 11:56:32 +02:00
2019-12-19 18:00:00 +01:00
## Warning when 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
```
## The DKMS route:
2018-06-08 11:56:32 +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-12-19 18:00:00 +01:00
sudo mkdir /usr/src/tuxedo-keyboard-2.0.0/
sudo cp -R . /usr/src/tuxedo-keyboard-2.0.0/
2019-08-18 21:18:54 +02:00
2019-12-18 17:05:57 +01:00
sudo dkms add -m tuxedo-keyboard -v 2.0.0
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-12-18 17:05:57 +01:00
sudo dkms build -m tuxedo-keyboard -v 2.0.0
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-12-18 17:05:57 +01:00
sudo dkms install -m tuxedo-keyboard -v 2.0.0
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
2019-12-19 18:00:00 +01:00
### Uninstalling the DKMS module:
2018-06-08 11:56:32 +02:00
2019-12-19 18:00:00 +01:00
Remove the DKMS module and source:
2018-06-08 11:56:32 +02:00
```sh
2019-12-18 17:05:57 +01:00
sudo dkms remove -m tuxedo-keyboard -v 2.0.0 --all
2018-06-08 11:56:32 +02:00
2019-12-18 17:05:57 +01:00
sudo rm -rf /usr/src/tuxedo-keyboard-2.0.0
2019-11-08 21:43:46 +01:00
sudo rm /etc/modprobe.d/tuxedo_keyboard.conf
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.
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-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
```
2020-01-02 01:15:05 +01:00
or
```sh
sudo cp tuxedo_keyboard.conf /etc/modprobe.d/tuxedo_keyboard.conf
```
2018-06-08 11:56:32 +02:00
# 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
Value: 7