-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathi2c_hid_mediakeys.h
More file actions
42 lines (33 loc) · 1.09 KB
/
i2c_hid_mediakeys.h
File metadata and controls
42 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Copyright 2020 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.
*/
/* Implementation of I2C HID for media keys */
#ifndef __CROS_EC_I2C_HID_MEDIAKEYS_H
#define __CROS_EC_I2C_HID_MEDIAKEYS_H
#include "common.h"
#include "stdbool.h"
#include "stdint.h"
/* I2C slave address */
#define I2C_HID_SLAVE_ADDR 0x50
/* 2 bytes for length + 1 byte for report ID */
#define I2C_HID_HEADER_SIZE 3
/* Framework HID fields */
#define I2C_HID_MEDIAKEYS_VENDOR_ID 0x32AC
#define I2C_HID_MEDIAKEYS_PRODUCT_ID 0x0006
#define I2C_HID_MEDIAKEYS_FW_VERSION 0x0001
#define I2C_HID_MEDIAKEYS_HID_DESC_REGISTER 0x0055
enum media_key {
HID_KEY_DISPLAY_BRIGHTNESS_UP,
HID_KEY_DISPLAY_BRIGHTNESS_DN,
HID_KEY_AIRPLANE_MODE,
HID_KEY_FN,
HID_KEY_FN_LOCK,
HID_FN_LOCK_INDICATOR,
HID_KEY_DISPLAY_TOGGLE,
HID_KEY_MAX
};
/*HID_KEY_MAX cannot be > TASK_EVENT_CUSTOM_BIT*/
BUILD_ASSERT(HID_KEY_MAX < 16);
int update_hid_key(enum media_key key, bool pressed);
#endif /* __CROS_EC_I2C_HID_MEDIAKEYS_H */