/ src / include / console / system76_ec.h
system76_ec.h
 1  /* SPDX-License-Identifier: GPL-2.0-only */
 2  
 3  #ifndef CONSOLE_SYSTEM76_EC_H
 4  #define CONSOLE_SYSTEM76_EC_H 1
 5  
 6  #include <stdint.h>
 7  
 8  void system76_ec_init(void);
 9  void system76_ec_flush(void);
10  void system76_ec_print(uint8_t byte);
11  
12  #define __CONSOLE_SYSTEM76_EC_ENABLE__	(CONFIG(CONSOLE_SYSTEM76_EC) && \
13  	(ENV_BOOTBLOCK || ENV_SEPARATE_ROMSTAGE || ENV_RAMSTAGE \
14  	 || ENV_SEPARATE_VERSTAGE || ENV_POSTCAR \
15  	 || (ENV_SMM && CONFIG(DEBUG_SMI))))
16  
17  #if __CONSOLE_SYSTEM76_EC_ENABLE__
18  static inline void __system76_ec_init(void)
19  {
20  	system76_ec_init();
21  }
22  static inline void __system76_ec_tx_flush(void)
23  {
24  	system76_ec_flush();
25  }
26  static inline void __system76_ec_tx_byte(unsigned char byte)
27  {
28  	system76_ec_print(byte);
29  }
30  #else
31  static inline void __system76_ec_init(void) {}
32  static inline void __system76_ec_tx_flush(void) {}
33  static inline void __system76_ec_tx_byte(unsigned char byte) {}
34  #endif
35  
36  #endif