1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef EC_CLEVO_IT5570E_COMMANDS_H
4 #define EC_CLEVO_IT5570E_COMMANDS_H
7 #define ECRAM CONFIG_EC_CLEVO_IT5570E_MEM_BASE
9 /* EC RAM fields and bits */
12 #define TP_TOGGLE_CTRLALTF9 (BIT(4) | BIT(2))
34 #define ECCMD_NOP 0x00 /* dummy, triggers FCMDs */
35 #define ECCMD_ENABLE_ACPI_MODE 0x90
36 #define ECCMD_DISABLE_ACPI_MODE 0x91
37 #define ECCMD_READ_MODEL 0x92
38 #define ECCMD_READ_FW_VER 0x93
39 #define ECCMD_ENABLE_HOTKEYS 0x98
40 #define ECCMD_GET_DEVICES_STATE 0x9a
41 #define ECCMD_SET_INV_DEVICE_STATE 0x9c
42 #define DEVICE_CAMERA 2
43 #define DEVICE_STATE(state) (!(state) << 7)
44 #define ECCMD_SET_BATLOW_ALARM 0x9d
45 #define ECCMD_SETUP_DEVICES 0xa8
48 #define FCMD_DEVICES 0xb8
49 #define FDAT_DEVICE_SET_INV_STATE 0xc2 /* inverted! en=0xc2|0, dis=0xc2|1 */
50 #define FCMD_KLED 0xca
51 #define FDAT_KBLED_WHITE_SET_LEVEL 0x00
52 #define FDAT_KBLED_WHITE_GET_LEVEL 0x01
53 #define FCMD_FLEXICHARGER 0xcb
54 #define FCMD_SET_KBLED_TIMEOUT 0xd4
63 char *ec_read_model(void);
64 char *ec_read_fw_version(void);
65 void ec_set_acpi_mode(bool state
);
66 void ec_set_aprd(void);
67 void ec_set_enter_g3_in_s4s5(bool state
);
68 void ec_set_dgpu_present(bool state
);
69 void ec_set_fn_win_swap(bool state
);
70 void ec_set_ac_fan_always_on(bool state
);
71 void ec_set_kbled_timeout(uint16_t timeout
);
72 void ec_set_flexicharger(bool state
, uint8_t start
, uint8_t stop
);
73 void ec_set_camera_boot_state(enum camera_state state
);
74 void ec_set_tp_toggle_mode(uint8_t mode
);
77 #endif /* EC_CLEVO_IT5570E_COMMANDS_H */