diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2022-06-27 14:04:25 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-28 06:25:35 +0000 |
commit | 49a47c5cabc4fb23961fa8494ab2d450b51ae728 (patch) | |
tree | c852cec9fe3842f46bddd5b80691e0090a001bd6 /board/servo_v4 | |
parent | fcfb2c1d51bd65a8bad710d1d71a26933f5ba845 (diff) | |
download | chrome-ec-49a47c5cabc4fb23961fa8494ab2d450b51ae728.tar.gz |
board/servo_v4/usb_pd_config.h: Format with clang-format
BUG=b:236386294
BRANCH=none
TEST=none
Change-Id: I297cc1bf39ed3954ee0410a84d517d917e5b87dc
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728906
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'board/servo_v4')
-rw-r--r-- | board/servo_v4/usb_pd_config.h | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/board/servo_v4/usb_pd_config.h b/board/servo_v4/usb_pd_config.h index af9d84922c..4b42bd6c29 100644 --- a/board/servo_v4/usb_pd_config.h +++ b/board/servo_v4/usb_pd_config.h @@ -56,22 +56,22 @@ #define CONFIG_HW_CRC /* Servo v4 CC configuration */ -#define CC_DETACH BIT(0) /* Emulate detach: both CC open */ -#define CC_DISABLE_DTS BIT(1) /* Apply resistors to single or both CC? */ -#define CC_ALLOW_SRC BIT(2) /* Allow charge through by policy? */ -#define CC_ENABLE_DRP BIT(3) /* Enable dual-role port */ -#define CC_SNK_WITH_PD BIT(4) /* Force enabling PD comm for sink role */ -#define CC_POLARITY BIT(5) /* CC polarity */ +#define CC_DETACH BIT(0) /* Emulate detach: both CC open */ +#define CC_DISABLE_DTS BIT(1) /* Apply resistors to single or both CC? */ +#define CC_ALLOW_SRC BIT(2) /* Allow charge through by policy? */ +#define CC_ENABLE_DRP BIT(3) /* Enable dual-role port */ +#define CC_SNK_WITH_PD BIT(4) /* Force enabling PD comm for sink role */ +#define CC_POLARITY BIT(5) /* CC polarity */ /* Servo v4 DP alt-mode configuration */ -#define ALT_DP_ENABLE BIT(0) /* Enable DP alt-mode or not */ -#define ALT_DP_PIN_C BIT(1) /* Pin assignment C supported */ -#define ALT_DP_PIN_D BIT(2) /* Pin assignment D supported */ -#define ALT_DP_PIN_E BIT(3) /* Pin assignment E supported */ -#define ALT_DP_MF_PREF BIT(4) /* Multi-Function preferred */ -#define ALT_DP_PLUG BIT(5) /* Plug or receptacle */ -#define ALT_DP_OVERRIDE_HPD BIT(6) /* Override the HPD signal */ -#define ALT_DP_HPD_LVL BIT(7) /* HPD level if overridden */ +#define ALT_DP_ENABLE BIT(0) /* Enable DP alt-mode or not */ +#define ALT_DP_PIN_C BIT(1) /* Pin assignment C supported */ +#define ALT_DP_PIN_D BIT(2) /* Pin assignment D supported */ +#define ALT_DP_PIN_E BIT(3) /* Pin assignment E supported */ +#define ALT_DP_MF_PREF BIT(4) /* Multi-Function preferred */ +#define ALT_DP_PLUG BIT(5) /* Plug or receptacle */ +#define ALT_DP_OVERRIDE_HPD BIT(6) /* Override the HPD signal */ +#define ALT_DP_HPD_LVL BIT(7) /* HPD level if overridden */ /* TX uses SPI1 on PB3-4 for CHG port, SPI2 on PB 13-14 for DUT port */ #define SPI_REGS(p) ((p) ? STM32_SPI2_REGS : STM32_SPI1_REGS) @@ -94,14 +94,14 @@ static inline void spi_enable_clock(int port) #define TIM_TX_CCR_IDX(p) ((p) ? TIM_TX_CCR_DUT : TIM_TX_CCR_CHG) #define TIM_RX_CCR_IDX(p) ((p) ? TIM_RX_CCR_DUT : TIM_RX_CCR_CHG) -#define TIM_CCR_CS 1 +#define TIM_CCR_CS 1 /* * EXTI line 21 is connected to the CMP1 output, * EXTI line 22 is connected to the CMP2 output, * CHG uses CMP2, and DUT uses CMP1. */ -#define EXTI_COMP_MASK(p) ((p) ? (1<<21) : BIT(22)) +#define EXTI_COMP_MASK(p) ((p) ? (1 << 21) : BIT(22)) #define IRQ_COMP STM32_IRQ_COMP /* triggers packet detection on comparator falling edge */ @@ -193,13 +193,23 @@ static inline void pd_select_polarity(int port, int polarity) if (port == 0) { /* CHG use the right comparator inverted input for COMP2 */ STM32_COMP_CSR = (val & ~STM32_COMP_CMP2INSEL_MASK) | - (polarity ? STM32_COMP_CMP2INSEL_INM4 /* PA4: C0_CC2 */ - : STM32_COMP_CMP2INSEL_INM6);/* PA2: C0_CC1 */ + (polarity ? STM32_COMP_CMP2INSEL_INM4 /* PA4: + C0_CC2 + */ + : + STM32_COMP_CMP2INSEL_INM6); /* PA2: + C0_CC1 + */ } else { /* DUT use the right comparator inverted input for COMP1 */ STM32_COMP_CSR = (val & ~STM32_COMP_CMP1INSEL_MASK) | - (polarity ? STM32_COMP_CMP1INSEL_INM5 /* PA5: C1_CC2 */ - : STM32_COMP_CMP1INSEL_INM6);/* PA0: C1_CC1 */ + (polarity ? STM32_COMP_CMP1INSEL_INM5 /* PA5: + C1_CC2 + */ + : + STM32_COMP_CMP1INSEL_INM6); /* PA0: + C1_CC1 + */ } } @@ -279,7 +289,6 @@ static inline void pd_config_init(int port, uint8_t power_role) /* Initialize TX pins and put them in Hi-Z */ pd_tx_init(); - } int pd_adc_read(int port, int cc); |