diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-05-11 17:31:16 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-27 02:39:41 +0000 |
commit | 5b5f737d8f6f1be15d4ab5f42f290d20576307c4 (patch) | |
tree | be384973f533436d9a53c46b742be35f5b377a4f /board/plankton | |
parent | 25ce43fc3d35669500d74e44f3b7c96302ee2ade (diff) | |
download | chrome-ec-5b5f737d8f6f1be15d4ab5f42f290d20576307c4.tar.gz |
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 <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/270337
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/plankton')
-rw-r--r-- | board/plankton/board.c | 1 | ||||
-rw-r--r-- | board/plankton/board.h | 20 | ||||
-rw-r--r-- | board/plankton/usb_pd_config.h | 29 | ||||
-rw-r--r-- | board/plankton/usb_pd_policy.c | 5 |
4 files changed, 24 insertions, 31 deletions
diff --git a/board/plankton/board.c b/board/plankton/board.c index 487b165a67..40b0c2b2d8 100644 --- a/board/plankton/board.c +++ b/board/plankton/board.c @@ -18,7 +18,6 @@ #include "task.h" #include "timer.h" #include "usb_pd.h" -#include "usb_pd_config.h" #include "util.h" void button_event(enum gpio_signal signal); diff --git a/board/plankton/board.h b/board/plankton/board.h index 25826395eb..f367879a70 100644 --- a/board/plankton/board.h +++ b/board/plankton/board.h @@ -21,10 +21,11 @@ #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_CUSTOM_VDM #define CONFIG_USB_PD_DUAL_ROLE +#define CONFIG_USB_PD_DYNAMIC_SRC_CAP #define CONFIG_USB_PD_IDENTITY_HW_VERS 1 #define CONFIG_USB_PD_IDENTITY_SW_VERS 1 #define CONFIG_USB_PD_INTERNAL_COMP -#define CONFIG_USB_PD_DYNAMIC_SRC_CAP +#define CONFIG_USB_PD_PORT_COUNT 1 #define CONFIG_USB_PD_TCPC #define CONFIG_USB_PD_TCPM_STUB #define CONFIG_ADC @@ -71,6 +72,23 @@ enum board_src_cap { SRC_CAP_20V, }; +/* 3.0A Rp */ +#define PD_SRC_VNC PD_SRC_3_0_VNC_MV +#define PD_SNK_RD_THRESHOLD PD_SRC_3_0_RD_THRESH_MV + +/* we are acting only as a sink */ +#define PD_DEFAULT_STATE PD_STATE_SNK_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 */ + +/* Define typical operating power and max power */ +#define PD_OPERATING_POWER_MW 5000 +#define PD_MAX_POWER_MW 60000 +#define PD_MAX_CURRENT_MA 3000 +#define PD_MAX_VOLTAGE_MV 20000 + /* Set USB PD source capability */ void board_set_source_cap(enum board_src_cap cap); diff --git a/board/plankton/usb_pd_config.h b/board/plankton/usb_pd_config.h index 23bdd82d0e..4946695c09 100644 --- a/board/plankton/usb_pd_config.h +++ b/board/plankton/usb_pd_config.h @@ -10,11 +10,6 @@ #include "board.h" -/* USB-PD configuration */ -#define PD_PORT_COUNT 1 -#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 17 #define TIM_CLOCK_PD_RX_C0 1 @@ -166,28 +161,4 @@ static inline int pd_adc_read(int port, int cc) return adc_read_channel(ADC_CH_CC2_PD); } -static inline int pd_snk_is_vbus_provided(int port) -{ - return gpio_get_level(GPIO_VBUS_WAKE); -} - -/* 3.0A DFP : no-connect voltage is 2.45V */ -#define PD_SRC_VNC 2450 /* mV */ - -/* UFP-side : threshold for DFP connection detection */ -#define PD_SNK_VA 250 /* mV */ - -/* we are acting only as a sink */ -#define PD_DEFAULT_STATE PD_STATE_SNK_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 */ - -/* Define typical operating power and max power */ -#define PD_OPERATING_POWER_MW 5000 -#define PD_MAX_POWER_MW 60000 -#define PD_MAX_CURRENT_MA 3000 -#define PD_MAX_VOLTAGE_MV 20000 - #endif /* __USB_PD_CONFIG_H */ diff --git a/board/plankton/usb_pd_policy.c b/board/plankton/usb_pd_policy.c index f510dc7268..691f8bff6c 100644 --- a/board/plankton/usb_pd_policy.c +++ b/board/plankton/usb_pd_policy.c @@ -121,6 +121,11 @@ void pd_power_supply_reset(int port) gpio_set_level(GPIO_USBC_VSEL_1, 0); } +int pd_snk_is_vbus_provided(int port) +{ + return gpio_get_level(GPIO_VBUS_WAKE); +} + int pd_board_checks(void) { static int was_connected = -1; |