summaryrefslogtreecommitdiff
path: root/board/host/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/host/board.c')
-rw-r--r--board/host/board.c73
1 files changed, 29 insertions, 44 deletions
diff --git a/board/host/board.c b/board/host/board.c
index e639b6bc99..baaed22b43 100644
--- a/board/host/board.c
+++ b/board/host/board.c
@@ -1,4 +1,4 @@
-/* Copyright 2013 The Chromium OS Authors. All rights reserved.
+/* Copyright 2013 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -28,7 +28,7 @@
* GPIO ports. This maps back to 0, which is then ignored by the host GPIO mock
* code.
*/
-#define GPIO_0 0
+#define GPIO_0 0
#include "gpio_list.h"
@@ -48,10 +48,10 @@ test_mockable_static int mock_temp_get_val(int idx, int *temp_ptr)
}
const struct temp_sensor_t temp_sensors[] = {
- {"CPU", TEMP_SENSOR_TYPE_CPU, mock_temp_get_val, 0},
- {"Board", TEMP_SENSOR_TYPE_BOARD, mock_temp_get_val, 1},
- {"Case", TEMP_SENSOR_TYPE_CASE, mock_temp_get_val, 2},
- {"Battery", TEMP_SENSOR_TYPE_BOARD, mock_temp_get_val, 3},
+ { "CPU", TEMP_SENSOR_TYPE_CPU, mock_temp_get_val, 0 },
+ { "Board", TEMP_SENSOR_TYPE_BOARD, mock_temp_get_val, 1 },
+ { "Case", TEMP_SENSOR_TYPE_CASE, mock_temp_get_val, 2 },
+ { "Battery", TEMP_SENSOR_TYPE_BOARD, mock_temp_get_val, 3 },
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
@@ -67,45 +67,31 @@ test_mockable void fps_event(enum gpio_signal signal)
/* I2C ports */
const struct i2c_port_t i2c_ports[] = {
#ifdef I2C_PORT_BATTERY
- {
- .name = "battery",
- .port = I2C_PORT_BATTERY,
- .kbps = 100,
- .scl = 0,
- .sda = 0
- },
+ { .name = "battery",
+ .port = I2C_PORT_BATTERY,
+ .kbps = 100,
+ .scl = 0,
+ .sda = 0 },
#elif defined I2C_PORT_LIGHTBAR
- {
- .name = "lightbar",
- .port = I2C_PORT_LIGHTBAR,
- .kbps = 100,
- .scl = 0,
- .sda = 0
- },
+ { .name = "lightbar",
+ .port = I2C_PORT_LIGHTBAR,
+ .kbps = 100,
+ .scl = 0,
+ .sda = 0 },
#elif defined I2C_PORT_HOST_TCPC
- {
- .name = "tcpc",
- .port = I2C_PORT_HOST_TCPC,
- .kbps = 100,
- .scl = 0,
- .sda = 0
- },
+ { .name = "tcpc",
+ .port = I2C_PORT_HOST_TCPC,
+ .kbps = 100,
+ .scl = 0,
+ .sda = 0 },
#elif defined I2C_PORT_EEPROM
- {
- .name = "eeprom",
- .port = I2C_PORT_EEPROM,
- .kbps = 100,
- .scl = 0,
- .sda = 0
- },
+ { .name = "eeprom",
+ .port = I2C_PORT_EEPROM,
+ .kbps = 100,
+ .scl = 0,
+ .sda = 0 },
#elif defined I2C_PORT_WLC
- {
- .name = "wlc",
- .port = I2C_PORT_WLC,
- .kbps = 100,
- .scl = 0,
- .sda = 0
- },
+ { .name = "wlc", .port = I2C_PORT_WLC, .kbps = 100, .scl = 0, .sda = 0 },
#endif
};
@@ -141,9 +127,8 @@ int board_get_entropy(void *buffer, int len)
static uint8_t eeprom[CBI_IMAGE_SIZE];
-int eeprom_i2c_xfer(int port, uint16_t addr_flags,
- const uint8_t *out, int out_size,
- uint8_t *in, int in_size, int flags)
+int eeprom_i2c_xfer(int port, uint16_t addr_flags, const uint8_t *out,
+ int out_size, uint8_t *in, int in_size, int flags)
{
static int offset;