servo_v4: add usb-c gpio configs

Default to set DUT_CC1 to RD to enable USB and indicate
USB SS orientation. Add ADC entries for SBU detect.

BUG=chromium:571476
TEST=check that ADC maps to the right pins, check that usb3 initializes.
BRANCH=None

Change-Id: Ic9f7c6d1506b9ef83ed3b93a98516ab10b1a471c
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/364301
Reviewed-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
Nick Sanders
2016-07-28 20:33:53 -07:00
committed by chrome-bot
parent ef137bdecc
commit 0152ba2c83
3 changed files with 9 additions and 3 deletions

View File

@@ -90,9 +90,12 @@ USB_GPIO_CONFIG(usb_gpio,
const struct adc_t adc_channels[] = {
/* USB PD CC lines sensing. Converted to mV (3300mV/4096). */
[ADC_DUT_CC1_PD] = {"DUT_CC1_PD", 3300, 4096, 0, STM32_AIN(0)},
[ADC_DUT_CC2_PD] = {"DUT_CC2_PD", 3300, 4096, 0, STM32_AIN(5)},
[ADC_CHG_CC1_PD] = {"CHG_CC1_PD", 3300, 4096, 0, STM32_AIN(2)},
[ADC_CHG_CC2_PD] = {"CHG_CC2_PD", 3300, 4096, 0, STM32_AIN(4)},
[ADC_DUT_CC2_PD] = {"DUT_CC2_PD", 3300, 4096, 0, STM32_AIN(5)},
[ADC_SBU1_DET] = {"SBU1_DET", 3300, 4096, 0, STM32_AIN(3)},
[ADC_SBU2_DET] = {"SBU2_DET", 3300, 4096, 0, STM32_AIN(7)},
[ADC_SUB_C_REF] = {"SUB_C_REF", 3300, 4096, 0, STM32_AIN(1)},
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);

View File

@@ -103,9 +103,12 @@ enum usb_strings {
/* ADC signal */
enum adc_channel {
ADC_DUT_CC1_PD = 0,
ADC_DUT_CC2_PD,
ADC_CHG_CC1_PD,
ADC_CHG_CC2_PD,
ADC_DUT_CC2_PD,
ADC_SBU1_DET,
ADC_SBU2_DET,
ADC_SUB_C_REF,
/* Number of ADC channels */
ADC_CH_COUNT
};

View File

@@ -45,7 +45,7 @@ GPIO(USB_DUT_CC2_TX_DATA, PIN(C, 2), GPIO_INPUT)
GPIO(USB_DUT_CC1_PR3A0, PIN(C, 0), GPIO_INPUT)
GPIO(USB_DUT_CC1_RP1A5, PIN(C, 1), GPIO_INPUT)
GPIO(USB_DUT_CC1_RPUSB, PIN(C, 3), GPIO_INPUT)
GPIO(USB_DUT_CC1_RD, PIN(C, 6), GPIO_INPUT)
GPIO(USB_DUT_CC1_RD, PIN(C, 6), GPIO_OUT_LOW)
GPIO(USB_DUT_CC1_RA, PIN(C, 7), GPIO_INPUT)
GPIO(USB_DUT_CC2_PR3A0, PIN(C, 8), GPIO_INPUT)