acpi: Update keyboard backlight functions
Existing FDAT values remain unchanged in their functionality. New functionality is added to fill unused FDAT values. FDAT values correspond to the following functionality: - 0: Set brightness - 1: Get brightness - 2: Get backlight type (new) - 3: Set color - 4: Get color (new) - 5: <unused> - 6: Set brightness (duplicate) Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
598aef8c4a
commit
bfbbfe43e6
@ -28,16 +28,20 @@ void fcommand(void) {
|
|||||||
// Keyboard backlight
|
// Keyboard backlight
|
||||||
case 0xCA:
|
case 0xCA:
|
||||||
switch (fdat) {
|
switch (fdat) {
|
||||||
// Set white LED brightness
|
// Set brightness
|
||||||
case 0x00:
|
case 0:
|
||||||
kbled_set(fbuf[0]);
|
kbled_set(fbuf[0]);
|
||||||
break;
|
break;
|
||||||
// Get white LED brightness
|
// Get brightness
|
||||||
case 0x01:
|
case 1:
|
||||||
fbuf[0] = kbled_get();
|
fbuf[0] = kbled_get();
|
||||||
break;
|
break;
|
||||||
// Set LED color
|
// Get type
|
||||||
case 0x03:
|
case 2:
|
||||||
|
fbuf[0] = kbled_kind;
|
||||||
|
break;
|
||||||
|
// Set color
|
||||||
|
case 3:
|
||||||
// clang-format off
|
// clang-format off
|
||||||
kbled_set_color(
|
kbled_set_color(
|
||||||
((uint32_t)fbuf[0]) |
|
((uint32_t)fbuf[0]) |
|
||||||
@ -46,8 +50,17 @@ void fcommand(void) {
|
|||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
break;
|
break;
|
||||||
// Set LED brightness
|
// Get color
|
||||||
case 0x06:
|
case 4:
|
||||||
|
{
|
||||||
|
uint32_t color = kbled_get_color();
|
||||||
|
fbuf[0] = color & 0xFF;
|
||||||
|
fbuf[1] = (color >> 16) & 0xFF;
|
||||||
|
fbuf[2] = (color >> 8) & 0xFF;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// DUPLICATE: Set brightness
|
||||||
|
case 6:
|
||||||
kbled_set(fbuf[0]);
|
kbled_set(fbuf[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user