From 5b5f737d8f6f1be15d4ab5f42f290d20576307c4 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Mon, 11 May 2015 17:31:16 -0700 Subject: pd: move non-phy layer config out of usb_pd_config.h Move parts of usb_pd_config.h that are not part of the phy layer out of usb_pd_config.h and into board.h. This cleans up the division between the TCPC and TCPM as only the TCPC needs to use usb_pd_config.h. Also cleans up the use of the CC detection voltage thresholds by creating standard macros to use based on Rp strength for the board. BUG=none BRANCH=none TEST=make -j buildall Change-Id: I946cceb38bea8233095b8a4b287102bb8a3a296d Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/270337 Reviewed-by: Todd Broch Reviewed-by: Vincent Palatin --- board/zinger/board.h | 11 +++++++++++ board/zinger/usb_pd_config.h | 17 ----------------- 2 files changed, 11 insertions(+), 17 deletions(-) (limited to 'board/zinger') diff --git a/board/zinger/board.h b/board/zinger/board.h index 49a8064c36..1b94b30064 100644 --- a/board/zinger/board.h +++ b/board/zinger/board.h @@ -57,6 +57,7 @@ #undef CONFIG_USB_PD_INTERNAL_COMP #define CONFIG_USB_PD_LOGGING #define CONFIG_USB_PD_LOG_SIZE 256 +#define CONFIG_USB_PD_PORT_COUNT 1 #define CONFIG_USB_PD_TCPC #define CONFIG_USB_PD_TCPM_STUB #undef CONFIG_USB_PD_RX_COMP_IRQ @@ -97,6 +98,16 @@ enum adc_channel { /* captive cable : no CC2 */ #define ADC_CH_CC2_PD ADC_CH_CC1_PD +/* 3.0A Rp */ +#define PD_SRC_VNC (PD_SRC_3_0_VNC_MV * 4096 / 3300/* 12-bit ADC, 3.3V range */) + +/* we are a power supply, boot as a power source waiting for a sink */ +#define PD_DEFAULT_STATE PD_STATE_SRC_DISCONNECTED + +/* delay necessary for the voltage transition on the power supply */ +#define PD_POWER_SUPPLY_TURN_ON_DELAY 50000 /* us */ +#define PD_POWER_SUPPLY_TURN_OFF_DELAY 50000 /* us */ + /* Initialize all useful registers */ void hardware_init(void); diff --git a/board/zinger/usb_pd_config.h b/board/zinger/usb_pd_config.h index f31087fab2..7541285429 100644 --- a/board/zinger/usb_pd_config.h +++ b/board/zinger/usb_pd_config.h @@ -8,13 +8,6 @@ #ifndef __USB_PD_CONFIG_H #define __USB_PD_CONFIG_H -/* Port and task configuration */ -#define PD_PORT_COUNT 1 -/* Stub value */ -#define TASK_ID_PD 0 -#define PORT_TO_TASK_ID(port) TASK_ID_PD -#define TASK_ID_TO_PORT(id) 0 - /* Timer selection for baseband PD communication */ #define TIM_CLOCK_PD_TX_C0 14 #define TIM_CLOCK_PD_RX_C0 3 @@ -113,14 +106,4 @@ static inline int pd_adc_read(int port, int cc) return (cc == 0) ? adc_read_channel(ADC_CH_CC1_PD) : 4096; } -/* 3.0A DFP : no-connect voltage is 2.45V */ -#define PD_SRC_VNC (2450 /*mV*/ * 4096 / 3300/* 12-bit ADC with 3.3V range */) - -/* we are a power supply, boot as a power source waiting for a sink */ -#define PD_DEFAULT_STATE PD_STATE_SRC_DISCONNECTED - -/* delay necessary for the voltage transition on the power supply */ -#define PD_POWER_SUPPLY_TURN_ON_DELAY 50000 /* us */ -#define PD_POWER_SUPPLY_TURN_OFF_DELAY 50000 /* us */ - #endif /* __USB_PD_CONFIG_H */ -- cgit v1.2.1