diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2022-06-27 14:56:15 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-28 13:29:00 +0000 |
commit | eaa105ddff3e049c6f3c0d9417964981b3d65c62 (patch) | |
tree | 1b66eb34ee6505c32571b6e8efe91361800f527a /driver/temp_sensor | |
parent | f29415e9816e777fb4ec57247aafe51eebf7fcf0 (diff) | |
download | chrome-ec-eaa105ddff3e049c6f3c0d9417964981b3d65c62.tar.gz |
driver/temp_sensor/g78x.c: Format with clang-format
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: I379000081d79239716210388ed2b6ed092d593fe
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730119
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'driver/temp_sensor')
-rw-r--r-- | driver/temp_sensor/g78x.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/driver/temp_sensor/g78x.c b/driver/temp_sensor/g78x.c index c4fd0ff243..84bddfe719 100644 --- a/driver/temp_sensor/g78x.c +++ b/driver/temp_sensor/g78x.c @@ -35,15 +35,14 @@ static int has_power(void) static int raw_read8(const int offset, int *data_ptr) { - return i2c_read8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, - offset, data_ptr); + return i2c_read8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, offset, + data_ptr); } #ifdef CONFIG_CMD_TEMP_SENSOR static int raw_write8(const int offset, int data) { - return i2c_write8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, - offset, data); + return i2c_write8(I2C_PORT_THERMAL, G78X_I2C_ADDR_FLAGS, offset, data); } #endif @@ -113,10 +112,8 @@ static void temp_sensor_poll(void) DECLARE_HOOK(HOOK_SECOND, temp_sensor_poll, HOOK_PRIO_TEMP_SENSOR); #ifdef CONFIG_CMD_TEMP_SENSOR -static void print_temps(const char *name, - const int temp_reg, - const int therm_limit_reg, - const int high_limit_reg, +static void print_temps(const char *name, const int temp_reg, + const int therm_limit_reg, const int high_limit_reg, const int low_limit_reg) { int value; @@ -145,19 +142,15 @@ static int print_status(void) return EC_ERROR_NOT_POWERED; } - print_temps("Local", G78X_TEMP_LOCAL, - G78X_LOCAL_TEMP_THERM_LIMIT, - G78X_LOCAL_TEMP_HIGH_LIMIT_R, - G78X_LOCAL_TEMP_LOW_LIMIT_R); + print_temps("Local", G78X_TEMP_LOCAL, G78X_LOCAL_TEMP_THERM_LIMIT, + G78X_LOCAL_TEMP_HIGH_LIMIT_R, G78X_LOCAL_TEMP_LOW_LIMIT_R); - print_temps("Remote1", G78X_TEMP_REMOTE1, - G78X_REMOTE1_TEMP_THERM_LIMIT, + print_temps("Remote1", G78X_TEMP_REMOTE1, G78X_REMOTE1_TEMP_THERM_LIMIT, G78X_REMOTE1_TEMP_HIGH_LIMIT_R, G78X_REMOTE1_TEMP_LOW_LIMIT_R); #ifdef CONFIG_TEMP_SENSOR_G782 - print_temps("Remote2", G78X_TEMP_REMOTE1, - G78X_REMOTE2_TEMP_THERM_LIMIT, + print_temps("Remote2", G78X_TEMP_REMOTE1, G78X_REMOTE2_TEMP_THERM_LIMIT, G78X_REMOTE2_TEMP_HIGH_LIMIT_R, G78X_REMOTE2_TEMP_LOW_LIMIT_R); #endif @@ -207,8 +200,8 @@ static int command_g78x(int argc, char **argv) rv = raw_read8(offset, &data); if (rv < 0) return rv; - ccprintf("Byte at offset 0x%02x is %pb\n", - offset, BINARY_VALUE(data, 8)); + ccprintf("Byte at offset 0x%02x is %pb\n", offset, + BINARY_VALUE(data, 8)); return rv; } @@ -231,7 +224,8 @@ static int command_g78x(int argc, char **argv) return rv; } -DECLARE_CONSOLE_COMMAND(g78x, command_g78x, +DECLARE_CONSOLE_COMMAND( + g78x, command_g78x, "[settemp|setbyte <offset> <value>] or [getbyte <offset>]. " "Temps in Celsius.", "Print g781/g782 temp sensor status or set parameters."); |