1 /* SPDX-License-Identifier: GPL-2.0-only */
12 #define EC_SMI_EVT (1 << 6) // 1: SMI event pending
13 #define EC_SCI_EVT (1 << 5) // 1: SCI event pending
14 #define EC_BURST (1 << 4) // 1: controller is in burst mode
15 #define EC_CMD (1 << 3) // 1: byte in data register is command
16 // 0: byte in data register is data
17 #define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
18 #define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
20 #define RD_EC 0x80 // Read Embedded Controller
21 #define WR_EC 0x81 // Write Embedded Controller
22 #define BE_EC 0x82 // Burst Enable Embedded Controller
23 #define BD_EC 0x83 // Burst Disable Embedded Controller
24 #define QR_EC 0x84 // Query Embedded Controller
26 bool ec_ready_send(int timeout_us
);
27 bool ec_ready_recv(int timeout_us
);
28 int send_ec_command(u8 command
);
29 int send_ec_command_timeout(u8 command
, int timeout
);
30 int send_ec_data(u8 data
);
31 int send_ec_data_timeout(u8 data
, int timeout
);
32 int recv_ec_data(void);
33 int recv_ec_data_timeout(int timeout
);
34 void ec_clear_out_queue(void);
38 int ec_write(u8 addr
, u8 data
);
39 void ec_set_bit(u8 addr
, u8 bit
);
40 void ec_clr_bit(u8 addr
, u8 bit
);
41 void ec_set_ports(u16 cmd_reg
, u16 data_reg
);
43 #endif /* _EC_ACPI_H */