summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 13:30:44 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-29 09:11:39 +0000
commitd43ac7fcf61465e71c3663287d0ffaf4d1fda824 (patch)
tree7ed0e03fe4f5e42b4f2cdead9fde39f58dae63c4
parent2920d62d4d5ced547ebbf8766b1e01df45d47e09 (diff)
downloadchrome-ec-d43ac7fcf61465e71c3663287d0ffaf4d1fda824.tar.gz
board/dojo/board.c: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I76a3f7411d657598cbd6480263847d6abbff528a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728229 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> (cherry picked from commit bc8f5701f751a53b95c67032f98bbae7d39f5d61) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3733876 Auto-Submit: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/dojo/board.c66
1 files changed, 29 insertions, 37 deletions
diff --git a/board/dojo/board.c b/board/dojo/board.c
index f539d17d2d..4d7178bfad 100644
--- a/board/dojo/board.c
+++ b/board/dojo/board.c
@@ -25,8 +25,8 @@
#include "system.h"
#include "usb_mux.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
uint32_t board_version;
@@ -66,17 +66,20 @@ static void board_update_vol_up_key(void)
* Set vol up key to T13 for KB_BL_TOGGLE_KEY_PRESENT
* and board_version >= 2
*/
- set_vol_up_key(vol_up_key_matrix_T13.row, vol_up_key_matrix_T13.col);
+ set_vol_up_key(vol_up_key_matrix_T13.row,
+ vol_up_key_matrix_T13.col);
} else {
/*
* Set vol up key to T12 for KB_BL_TOGGLE_KEY_ABSENT
* and board_version >= 2
*/
- set_vol_up_key(vol_up_key_matrix_T12.row, vol_up_key_matrix_T12.col);
+ set_vol_up_key(vol_up_key_matrix_T12.row,
+ vol_up_key_matrix_T12.col);
}
} else {
/* Set vol up key to T13 for board_version < 2 */
- set_vol_up_key(vol_up_key_matrix_T13.row, vol_up_key_matrix_T13.col);
+ set_vol_up_key(vol_up_key_matrix_T13.row,
+ vol_up_key_matrix_T13.col);
}
}
@@ -109,23 +112,17 @@ static struct bmi_drv_data_t g_bmi260_data;
static struct kionix_accel_data g_kx022_data;
/* Matrix to rotate accelrator into standard reference frame */
-static const mat33_fp_t base_standard_ref = {
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t base_standard_ref = { { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
-static const mat33_fp_t lid_standard_ref = {
- { FLOAT_TO_FP(1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(-1)}
-};
+static const mat33_fp_t lid_standard_ref = { { FLOAT_TO_FP(1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(-1) } };
-static const mat33_fp_t bmi260_standard_ref = {
- { 0, FLOAT_TO_FP(-1), 0},
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t bmi260_standard_ref = { { 0, FLOAT_TO_FP(-1), 0 },
+ { FLOAT_TO_FP(1), 0, 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
struct motion_sensor_t motion_sensors[] = {
/*
@@ -319,8 +316,7 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
/* USB Mux */
-static int board_ps8762_mux_set(const struct usb_mux *me,
- mux_state_t mux_state)
+static int board_ps8762_mux_set(const struct usb_mux *me, mux_state_t mux_state)
{
/* Make sure the PS8802 is awake */
RETURN_ERROR(ps8802_i2c_wake(me));
@@ -328,21 +324,18 @@ static int board_ps8762_mux_set(const struct usb_mux *me,
/* USB specific config */
if (mux_state & USB_PD_MUX_USB_ENABLED) {
/* Boost the USB gain */
- RETURN_ERROR(ps8802_i2c_field_update16(me,
- PS8802_REG_PAGE2,
- PS8802_REG2_USB_SSEQ_LEVEL,
- PS8802_USBEQ_LEVEL_UP_MASK,
- PS8802_USBEQ_LEVEL_UP_12DB));
+ RETURN_ERROR(ps8802_i2c_field_update16(
+ me, PS8802_REG_PAGE2, PS8802_REG2_USB_SSEQ_LEVEL,
+ PS8802_USBEQ_LEVEL_UP_MASK,
+ PS8802_USBEQ_LEVEL_UP_12DB));
}
/* DP specific config */
if (mux_state & USB_PD_MUX_DP_ENABLED) {
/* Boost the DP gain */
- RETURN_ERROR(ps8802_i2c_field_update8(me,
- PS8802_REG_PAGE2,
- PS8802_REG2_DPEQ_LEVEL,
- PS8802_DPEQ_LEVEL_UP_MASK,
- PS8802_DPEQ_LEVEL_UP_9DB));
+ RETURN_ERROR(ps8802_i2c_field_update8(
+ me, PS8802_REG_PAGE2, PS8802_REG2_DPEQ_LEVEL,
+ PS8802_DPEQ_LEVEL_UP_MASK, PS8802_DPEQ_LEVEL_UP_9DB));
}
return EC_SUCCESS;
@@ -350,11 +343,10 @@ static int board_ps8762_mux_set(const struct usb_mux *me,
static int board_ps8762_mux_init(const struct usb_mux *me)
{
- return ps8802_i2c_field_update8(
- me, PS8802_REG_PAGE1,
- PS8802_REG_DCIRX,
- PS8802_AUTO_DCI_MODE_DISABLE | PS8802_FORCE_DCI_MODE,
- PS8802_AUTO_DCI_MODE_DISABLE);
+ return ps8802_i2c_field_update8(me, PS8802_REG_PAGE1, PS8802_REG_DCIRX,
+ PS8802_AUTO_DCI_MODE_DISABLE |
+ PS8802_FORCE_DCI_MODE,
+ PS8802_AUTO_DCI_MODE_DISABLE);
}
static int board_anx3443_mux_set(const struct usb_mux *me,