2020-04-02 23:48:24 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2010-01-17 15:08:17 +01:00
|
|
|
|
2011-01-27 12:43:03 +01:00
|
|
|
#ifndef _EC_ACPI_H
|
|
|
|
#define _EC_ACPI_H
|
2010-01-17 15:08:17 +01:00
|
|
|
|
2016-10-25 16:03:22 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2010-01-17 15:08:17 +01:00
|
|
|
#define EC_DATA 0x62
|
|
|
|
#define EC_SC 0x66
|
|
|
|
|
|
|
|
/* EC_SC input */
|
|
|
|
#define EC_SMI_EVT (1 << 6) // 1: SMI event pending
|
|
|
|
#define EC_SCI_EVT (1 << 5) // 1: SCI event pending
|
|
|
|
#define EC_BURST (1 << 4) // controller is in burst mode
|
|
|
|
#define EC_CMD (1 << 3) // 1: byte in data register is command
|
|
|
|
// 0: byte in data register is data
|
|
|
|
#define EC_IBF (1 << 1) // 1: input buffer full (data ready for ec)
|
|
|
|
#define EC_OBF (1 << 0) // 1: output buffer full (data ready for host)
|
|
|
|
/* EC_SC output */
|
|
|
|
#define RD_EC 0x80 // Read Embedded Controller
|
|
|
|
#define WR_EC 0x81 // Write Embedded Controller
|
|
|
|
#define BE_EC 0x82 // Burst Enable Embedded Controller
|
2018-05-29 11:02:43 +02:00
|
|
|
#define BD_EC 0x83 // Burst Disable Embedded Controller
|
|
|
|
#define QR_EC 0x84 // Query Embedded Controller
|
2010-01-17 15:08:17 +01:00
|
|
|
|
|
|
|
int send_ec_command(u8 command);
|
|
|
|
int send_ec_data(u8 data);
|
|
|
|
int send_ec_data_nowait(u8 data);
|
|
|
|
u8 recv_ec_data(void);
|
2017-10-26 05:45:49 +02:00
|
|
|
void ec_clear_out_queue(void);
|
2017-01-23 13:54:41 +01:00
|
|
|
u8 ec_status(void);
|
2011-03-15 10:52:07 +01:00
|
|
|
u8 ec_query(void);
|
2010-01-17 15:08:17 +01:00
|
|
|
u8 ec_read(u8 addr);
|
|
|
|
int ec_write(u8 addr, u8 data);
|
2011-03-14 09:18:17 +01:00
|
|
|
void ec_set_bit(u8 addr, u8 bit);
|
|
|
|
void ec_clr_bit(u8 addr, u8 bit);
|
2011-03-14 09:18:27 +01:00
|
|
|
void ec_set_ports(u16 cmd_reg, u16 data_reg);
|
2010-01-17 15:08:17 +01:00
|
|
|
|
2014-06-17 12:13:08 +02:00
|
|
|
#endif /* _EC_ACPI_H */
|