mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 02:20:48 +00:00
Implement keyboard backlight control through HID output report. One
could enable CONFIG_USB_HID_KEYBOARD_BACKLIGHT to enable keyboard
backlight support for a given board. Target board must implement the
`void board_set_backlight(int brightness)` function in order correctly
set backlight.
BRANCH=none
BUG=b:37971411,b:63364143
TEST=with follow up CLs
1. `make BOARD=hammer -j`
2. `echo 10 > /sys/class/leds/hammer\:\:kbd_backlight/brightness`
console shows 'Keyboard backlight set to 10%'
Change-Id: Ibeff510a0d996ddebf61b54ed6b500b02c35564a
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/586348
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
34 lines
762 B
C
34 lines
762 B
C
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* USB HID definitions.
|
|
*/
|
|
|
|
#ifndef __CROS_EC_USB_HID_TOUCHPAD_H
|
|
#define __CROS_EC_USB_HID_TOUCHPAD_H
|
|
|
|
#define USB_HID_TOUCHPAD_TIMESTAMP_UNIT 100 /* usec */
|
|
|
|
struct usb_hid_touchpad_report {
|
|
uint8_t id; /* 0x01 */
|
|
struct {
|
|
unsigned tip:1;
|
|
unsigned inrange:1;
|
|
unsigned id:4;
|
|
unsigned pressure:10;
|
|
unsigned width:12;
|
|
unsigned height:12;
|
|
unsigned x:12;
|
|
unsigned y:12;
|
|
} __packed finger[5];
|
|
uint8_t count:7;
|
|
uint8_t button:1;
|
|
uint16_t timestamp;
|
|
} __packed;
|
|
|
|
/* class implementation interfaces */
|
|
void set_touchpad_report(struct usb_hid_touchpad_report *report);
|
|
|
|
#endif
|