cleanup: fix all the header guards

This unifies all the EC header files to use __CROS_EC_FILENAME_H
as the include guard. Well, except for test/ util/ and extra/
which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively.

BUG=chromium:496895
BRANCH=none
TEST=make buildall -j

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029
Reviewed-on: https://chromium-review.googlesource.com/278121
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2015-06-16 21:51:55 -07:00
committed by ChromeOS Commit Bot
parent 19cd951027
commit 104f811e67
157 changed files with 462 additions and 462 deletions

View File

@@ -5,8 +5,8 @@
* Smart battery v1.0
* Smart battery charger v1.1
*/
#ifndef __CROS_EC_SMART_BATTERY_H
#define __CROS_EC_SMART_BATTERY_H
#ifndef __CROS_EC_BATTERY_SMART_H
#define __CROS_EC_BATTERY_SMART_H
#include "common.h"
@@ -153,5 +153,5 @@ int sb_read_string(int port, int slave_addr, int offset, uint8_t *data,
/* Write to battery */
int sb_write(int cmd, int param);
#endif /* __CROS_EC_SMART_BATTERY_H */
#endif /* __CROS_EC_BATTERY_SMART_H */

View File

@@ -4,8 +4,8 @@
*
* Case Closed Debug interface
*/
#ifndef INCLUDE_CASE_CLOSED_DEBUG_H
#define INCLUDE_CASE_CLOSED_DEBUG_H
#ifndef __CROS_EC_CASE_CLOSED_DEBUG_H
#define __CROS_EC_CASE_CLOSED_DEBUG_H
enum ccd_mode {
/*
@@ -33,4 +33,4 @@ enum ccd_mode {
*/
void ccd_set_mode(enum ccd_mode new_mode);
#endif /* INCLUDE_CASE_CLOSED_DEBUG_H */
#endif /* __CROS_EC_CASE_CLOSED_DEBUG_H */

View File

@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
#ifndef __CHARGE_MANAGER_H
#define __CHARGE_MANAGER_H
#ifndef __CROS_EC_CHARGE_MANAGER_H
#define __CROS_EC_CHARGE_MANAGER_H
#include "common.h"
@@ -82,4 +82,4 @@ void board_set_charge_limit(int charge_ma);
/* Called on delayed override timeout */
void board_charge_manager_override_timeout(void);
#endif /* __CHARGE_MANAGER_H */
#endif /* __CROS_EC_CHARGE_MANAGER_H */

View File

@@ -5,8 +5,8 @@
/* Charge input current limit ramp header for Chrome EC */
#ifndef __CROS_EC_CHG_RAMP_H
#define __CROS_EC_CHG_RAMP_H
#ifndef __CROS_EC_CHARGE_RAMP_H
#define __CROS_EC_CHARGE_RAMP_H
#include "timer.h"
@@ -100,4 +100,4 @@ static inline void chg_ramp_charge_supplier_change(
#define chg_ramp_set_min_current board_set_charge_limit
#endif
#endif /* __CROS_EC_CHG_RAMP_H */
#endif /* __CROS_EC_CHARGE_RAMP_H */

View File

@@ -5,8 +5,8 @@
/* Handy clever tricks */
#ifndef __CROS_EC_TRICKS_H
#define __CROS_EC_TRICKS_H
#ifndef __CROS_EC_COMPILE_TIME_MACROS_H
#define __CROS_EC_COMPILE_TIME_MACROS_H
/* Test an important condition at compile time, not run time */
#define _BA1_(cond, line) \
@@ -23,4 +23,4 @@
#define offsetof(type, member) __builtin_offsetof(type, member)
#endif
#endif /* __CROS_EC_TRICKS_H */
#endif /* __CROS_EC_COMPILE_TIME_MACROS_H */

View File

@@ -8,8 +8,8 @@
* a queue, and be notified of new additions to the queue, or of requests to
* flush (empty) the queue.
*/
#ifndef INCLUDE_CONSUMER_H
#define INCLUDE_CONSUMER_H
#ifndef __CROS_EC_CONSUMER_H
#define __CROS_EC_CONSUMER_H
#include "queue.h"
@@ -44,4 +44,4 @@ struct consumer {
struct consumer_ops const *ops;
};
#endif /* INCLUDE_CONSUMER_H */
#endif /* __CROS_EC_CONSUMER_H */

View File

@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
#ifndef _CRC_H
#define _CRC_H
#ifndef __CROS_EC_CRC_H
#define __CROS_EC_CRC_H
/* CRC-32 implementation with USB constants */
/* Note: it's a stateful CRC-32 to match the hardware block interface */
@@ -24,4 +24,4 @@ uint32_t crc32_result(void);
#endif /* CONFIG_HW_CRC */
#endif /* _CRC_H */
#endif /* __CROS_EC_CRC_H */

View File

@@ -4,8 +4,8 @@
*
* Very simple 8-bit CRC function.
*/
#ifndef __EC_CRC8_H__
#define __EC_CRC8_H__
#ifndef __CROS_EC_CRC8_H
#define __CROS_EC_CRC8_H
/**
* crc8
@@ -18,4 +18,4 @@
*/
uint8_t crc8(const uint8_t *data, int len);
#endif /* __EC_CRC8_H__ */
#endif /* __CROS_EC_CRC8_H */

View File

@@ -5,8 +5,8 @@
/* Host communication command constants for Chrome EC */
#ifndef __CROS_EC_COMMANDS_H
#define __CROS_EC_COMMANDS_H
#ifndef __CROS_EC_EC_COMMANDS_H
#define __CROS_EC_EC_COMMANDS_H
/*
* Current version of this protocol
@@ -3347,4 +3347,4 @@ struct ec_params_pd_write_log_entry {
#define EC_LPC_ADDR_OLD_PARAM EC_HOST_CMD_REGION1
#define EC_OLD_PARAM_SIZE EC_HOST_CMD_REGION_SIZE
#endif /* __CROS_EC_COMMANDS_H */
#endif /* __CROS_EC_EC_COMMANDS_H */

View File

@@ -7,8 +7,8 @@
#include "gpio.h"
#ifndef __INDUCTIVE_CHARGING_H
#define __INDUCTIVE_CHARGING_H
#ifndef __CROS_EC_INDUCTIVE_CHARGING_H
#define __CROS_EC_INDUCTIVE_CHARGING_H
/*
* Interrupt handler for inductive charging signal.

View File

@@ -5,8 +5,8 @@
/* Header file for common math functions. */
#ifndef __CROS_MATH_UTIL_H
#define __CROS_MATH_UTIL_H
#ifndef __CROS_EC_MATH_UTIL_H
#define __CROS_EC_MATH_UTIL_H
/* Fixed-point type */
typedef int32_t fp_t;
@@ -114,4 +114,4 @@ void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res);
#endif /* __CROS_MATH_UTIL_H */
#endif /* __CROS_EC_MATH_UTIL_H */

View File

@@ -5,8 +5,8 @@
* TPSChrome PMU APIs.
*/
#ifndef __CROS_EC_TPSCHROME_H
#define __CROS_EC_TPSCHROME_H
#ifndef __CROS_EC_PMU_TPSCHROME_H
#define __CROS_EC_PMU_TPSCHROME_H
#include "gpio.h"
@@ -294,5 +294,5 @@ int charge_keep_power_off(void);
*/
int pmu_board_init(void);
#endif /* __CROS_EC_TPSCHROME_H */
#endif /* __CROS_EC_PMU_TPSCHROME_H */

View File

@@ -8,8 +8,8 @@
* be notified when the queue is read from so that it can take action, such as
* adding new units to the queue.
*/
#ifndef INCLUDE_PRODUCER_H
#define INCLUDE_PRODUCER_H
#ifndef __CROS_EC_PRODUCER_H
#define __CROS_EC_PRODUCER_H
#include "queue.h"
@@ -38,4 +38,4 @@ struct producer {
struct producer_ops const *ops;
};
#endif /* INCLUDE_PRODUCER_H */
#endif /* __CROS_EC_PRODUCER_H */

View File

@@ -4,8 +4,8 @@
*
* Queue data structure.
*/
#ifndef INCLUDE_QUEUE_H
#define INCLUDE_QUEUE_H
#ifndef __CROS_EC_QUEUE_H
#define __CROS_EC_QUEUE_H
#include "common.h"
@@ -178,4 +178,4 @@ size_t queue_peek_memcpy(struct queue const *q,
result; \
})
#endif /* INCLUDE_QUEUE_H */
#endif /* __CROS_EC_QUEUE_H */

View File

@@ -4,8 +4,8 @@
*
* Queue policies.
*/
#ifndef INCLUDE_QUEUE_POLICIES_H
#define INCLUDE_QUEUE_POLICIES_H
#ifndef __CROS_EC_QUEUE_POLICIES_H
#define __CROS_EC_QUEUE_POLICIES_H
#include "queue.h"
#include "consumer.h"
@@ -48,4 +48,4 @@ void queue_remove_direct(struct queue_policy const *policy, size_t count);
extern struct producer const null_producer;
extern struct consumer const null_consumer;
#endif /* INCLUDE_QUEUE_POLICIES_H */
#endif /* __CROS_EC_QUEUE_POLICIES_H */

View File

@@ -3,8 +3,8 @@
* found in the LICENSE file.
*/
#ifndef _INCLUDE_RSA_H
#define _INCLUDE_RSA_H
#ifndef __CROS_EC_RSA_H
#define __CROS_EC_RSA_H
#include "config.h"
@@ -53,4 +53,4 @@ void check_rw_signature(void);
#endif /* !__ASSEMBLER__ */
#endif /* _INCLUDE_RSA_H */
#endif /* __CROS_EC_RSA_H */

View File

@@ -5,8 +5,8 @@
/* SHA-1 functions */
#ifndef _SHA1_H
#define _SHA1_H
#ifndef __CROS_EC_SHA1_H
#define __CROS_EC_SHA1_H
#include "common.h"
#ifdef HOST_TOOLS_BUILD
@@ -33,4 +33,4 @@ void sha1_init(struct sha1_ctx *ctx);
void sha1_update(struct sha1_ctx *ctx, const uint8_t *data, uint32_t len);
uint8_t *sha1_final(struct sha1_ctx *ctx);
#endif /* _SHA1_H */
#endif /* __CROS_EC_SHA1_H */

View File

@@ -5,8 +5,8 @@
/* SHA-256 functions */
#ifndef _CROS_EC_SHA256_H
#define _CROS_EC_SHA256_H
#ifndef __CROS_EC_SHA256_H
#define __CROS_EC_SHA256_H
#include "common.h"
@@ -26,4 +26,4 @@ void SHA256_init(struct sha256_ctx *ctx);
void SHA256_update(struct sha256_ctx *ctx, const uint8_t *data, uint32_t len);
uint8_t *SHA256_final(struct sha256_ctx *ctx);
#endif /* _CROS_EC_SHA256_H */
#endif /* __CROS_EC_SHA256_H */

View File

@@ -6,8 +6,8 @@
* @brief smbus interface APIs
* @see http://smbus.org/specs/smbus20.pdf
*/
#ifndef __EC_SMBUS_H__
#define __EC_SMBUS_H__
#ifndef __CROS_EC_SMBUS_H
#define __CROS_EC_SMBUS_H
/** Maximum transfer of a SMBUS block transfer */
#define SMBUS_MAX_BLOCK_SIZE 32
@@ -155,4 +155,4 @@ int smbus_read_block(uint8_t i2c_port, uint8_t slave_addr,
int smbus_read_string(int i2c_port, uint8_t slave_addr, uint8_t smbus_cmd,
uint8_t *data, uint8_t len);
#endif /* __EC_SMBUS_H__ */
#endif /* __CROS_EC_SMBUS_H */

View File

@@ -6,8 +6,8 @@
* SPI flash protection register translation functions for Chrome OS EC.
*/
#ifndef __CROS_EC_SPI_FLASH_REGS_H
#define __CROS_EC_SPI_FLASH_REGS_H
#ifndef __CROS_EC_SPI_FLASH_REG_H
#define __CROS_EC_SPI_FLASH_REG_H
#include "common.h"
@@ -65,4 +65,4 @@ int spi_flash_reg_to_protect(uint8_t sr1, uint8_t sr2, unsigned int *start,
int spi_flash_protect_to_reg(unsigned int start, unsigned int len, uint8_t *sr1,
uint8_t *sr2);
#endif /* __CROS_EC_SPI_FLASH_REGS_H */
#endif /* __CROS_EC_SPI_FLASH_REG_H */

View File

@@ -4,8 +4,8 @@
* found in the LICENSE file.
*/
#ifndef __CROS_EC_INCLUDE_SPS_H
#define __CROS_EC_INCLUDE_SPS_H
#ifndef __CROS_EC_SPS_H
#define __CROS_EC_SPS_H
#include "spi.h"
#include "util.h"

View File

@@ -5,8 +5,8 @@
/* Trace dump module */
#ifndef __CROS_EC_TRACE_H
#define __CROS_EC_TRACE_H
#ifndef __CROS_EC_STACK_TRACE_H
#define __CROS_EC_STACK_TRACE_H
#ifdef EMU_BUILD
/*
@@ -22,4 +22,4 @@ static inline void task_register_tracedump(void) { }
static inline void task_dump_trace(void) { }
#endif
#endif /* __CROS_EC_TRACE_H */
#endif /* __CROS_EC_STACK_TRACE_H */

View File

@@ -5,8 +5,8 @@
/* define the task identifier of all compiled tasks */
#ifndef __TASK_ID_H
#define __TASK_ID_H
#ifndef __CROS_EC_TASK_ID_H
#define __CROS_EC_TASK_ID_H
/* excludes non-base tasks for test build */
#ifdef TEST_BUILD
@@ -60,4 +60,4 @@ enum {
};
#undef TASK
#endif /* __TASK_ID_H */
#endif /* __CROS_EC_TASK_ID_H */

View File

@@ -5,8 +5,8 @@
/* Temperature sensor module for LM4 chip */
#ifndef __CROS_EC_CHIP_TEMP_SENSOR_H
#define __CROS_EC_CHIP_TEMP_SENSOR_H
#ifndef __CROS_EC_TEMP_SENSOR_CHIP_H
#define __CROS_EC_TEMP_SENSOR_CHIP_H
/**
* Get the last polled value of the sensor.
@@ -18,4 +18,4 @@
*/
int chip_temp_sensor_get_val(int idx, int *temp_ptr);
#endif /* __CROS_EC_CHIP_TEMP_SENSOR_H */
#endif /* __CROS_EC_TEMP_SENSOR_CHIP_H */

View File

@@ -5,8 +5,8 @@
* USB definitions.
*/
#ifndef USB_H
#define USB_H
#ifndef __CROS_EC_USB_H
#define __CROS_EC_USB_H
#include <stddef.h> /* for wchar_t */
@@ -244,4 +244,4 @@ extern const uint8_t usb_string_desc[];
extern const void * const usb_fw_version;
extern const struct bos_context bos_ctx;
#endif /* USB_H */
#endif /* __CROS_EC_USB_H */

View File

@@ -9,8 +9,8 @@
* implementation.
*/
#ifndef USB_API_H
#define USB_API_H
#ifndef __CROS_EC_USB_API_H
#define __CROS_EC_USB_API_H
/*
* Initialize the USB peripheral, enabling its clock and configuring the DP/DN
@@ -42,4 +42,4 @@ void usb_disconnect(void);
*/
void usb_release(void);
#endif /* USB_API_H */
#endif /* __CROS_EC_USB_API_H */

View File

@@ -5,8 +5,8 @@
* USB billboard definitions.
*/
#ifndef USB_BB_H
#define USB_BB_H
#ifndef __CROS_EC_USB_BB_H
#define __CROS_EC_USB_BB_H
/* per Billboard Device Class Spec Revision 1.0 */
@@ -50,5 +50,5 @@ struct usb_bb_caps_base_descriptor {
/* Note, 7W (111b) is reserved */
#endif /* USB_BB_H */
#endif /* __CROS_EC_USB_BB_H */

View File

@@ -5,8 +5,8 @@
/* USB serial console module */
#ifndef __USB_CONSOLE_H
#define __USB_CONSOLE_H
#ifndef __CROS_EC_USB_CONSOLE_H
#define __CROS_EC_USB_CONSOLE_H
#ifdef CONFIG_USB_CONSOLE
@@ -63,4 +63,4 @@ void usb_console_enable(int enabled);
#define usb_va_end(x)
#endif
#endif /* __USB_CONSOLE_H */
#endif /* __CROS_EC_USB_CONSOLE_H */

View File

@@ -5,8 +5,8 @@
* USB HID definitions.
*/
#ifndef USB_HID_H
#define USB_HID_H
#ifndef __CROS_EC_USB_HID_H
#define __CROS_EC_USB_HID_H
#define USB_HID_SUBCLASS_BOOT 1
#define USB_HID_PROTOCOL_KEYBOARD 1

View File

@@ -5,8 +5,8 @@
/* USB Power delivery module */
#ifndef __USB_PD_H
#define __USB_PD_H
#ifndef __CROS_EC_USB_PD_H
#define __CROS_EC_USB_PD_H
#include "common.h"
@@ -1558,4 +1558,4 @@ static inline void pd_log_event(uint8_t type, uint8_t size_port,
static inline int pd_vdm_get_log_entry(uint32_t *payload) { return 0; }
#endif /* CONFIG_USB_PD_LOGGING */
#endif /* __USB_PD_H */
#endif /* __CROS_EC_USB_PD_H */

View File

@@ -5,8 +5,8 @@
/* USB Power delivery port controller */
#ifndef __USB_PD_TCPC_H
#define __USB_PD_TCPC_H
#ifndef __CROS_EC_USB_PD_TCPC_H
#define __CROS_EC_USB_PD_TCPC_H
#ifndef CONFIG_TCPC_I2C_BASE_ADDR
#define CONFIG_TCPC_I2C_BASE_ADDR 0x9c
@@ -35,4 +35,4 @@
void tcpc_i2c_process(int read, int port, int len, uint8_t *payload,
void (*send_response)(int));
#endif /* __USB_PD_TCPC_H */
#endif /* __CROS_EC_USB_PD_TCPC_H */

View File

@@ -5,8 +5,8 @@
/* USB Power delivery port management */
#ifndef __USB_PD_TCPM_H
#define __USB_PD_TCPM_H
#ifndef __CROS_EC_USB_PD_TCPM_H
#define __CROS_EC_USB_PD_TCPM_H
/* Default retry count for transmitting */
#define PD_RETRY_COUNT 3
@@ -256,4 +256,4 @@ int tcpm_get_message(int port, uint32_t *payload, int *head);
int tcpm_transmit(int port, enum tcpm_transmit_type type, uint16_t header,
const uint32_t *data);
#endif /* __USB_PD_TCPM_H */
#endif /* __CROS_EC_USB_PD_TCPM_H */