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/host | |
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/host')
-rw-r--r-- | board/host/board.h | 17 | ||||
-rw-r--r-- | board/host/usb_pd_config.c | 5 | ||||
-rw-r--r-- | board/host/usb_pd_config.h | 26 | ||||
-rw-r--r-- | board/host/usb_pd_policy.c | 6 |
4 files changed, 23 insertions, 31 deletions
diff --git a/board/host/board.h b/board/host/board.h index d33a4a56dc..677237ab43 100644 --- a/board/host/board.h +++ b/board/host/board.h @@ -56,4 +56,21 @@ enum charge_supplier { /* supplier_priority table defined in board.c */ extern const int supplier_priority[]; +/* Standard-current Rp */ +#define PD_SRC_VNC PD_SRC_DEF_VNC_MV +#define PD_SRC_RD_THRESHOLD PD_SRC_DEF_RD_THRESH_MV + +/* start as a sink in case we have no other power supply/battery */ +#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 20000 /* us */ +#define PD_POWER_SUPPLY_TURN_OFF_DELAY 20000 /* us */ + +/* Define typical operating power and max power */ +#define PD_OPERATING_POWER_MW 15000 +#define PD_MAX_POWER_MW 60000 +#define PD_MAX_CURRENT_MA 3000 +#define PD_MAX_VOLTAGE_MV 20000 + #endif /* __BOARD_H */ diff --git a/board/host/usb_pd_config.c b/board/host/usb_pd_config.c index 15ea815d47..0363b1ec78 100644 --- a/board/host/usb_pd_config.c +++ b/board/host/usb_pd_config.c @@ -33,8 +33,3 @@ test_mockable int pd_adc_read(int port, int cc) return 0; } -test_mockable int pd_snk_is_vbus_provided(int port) -{ - /* Not implemented */ - return 1; -} diff --git a/board/host/usb_pd_config.h b/board/host/usb_pd_config.h index ed4f8e5960..8055591770 100644 --- a/board/host/usb_pd_config.h +++ b/board/host/usb_pd_config.h @@ -8,11 +8,6 @@ #ifndef __USB_PD_CONFIG_H #define __USB_PD_CONFIG_H -/* Port and task configuration */ -#define PD_PORT_COUNT 2 -#define PORT_TO_TASK_ID(port) ((port) ? TASK_ID_PD_C1 : TASK_ID_PD_C0) -#define TASK_ID_TO_PORT(id) ((id) == TASK_ID_PD_C0 ? 0 : 1) - /* Use software CRC */ #define CONFIG_SW_CRC @@ -26,25 +21,4 @@ void pd_config_init(int port, uint8_t power_role); int pd_adc_read(int port, int cc); -int pd_snk_is_vbus_provided(int port); - -/* Standard-current DFP : no-connect voltage is 1.55V */ -#define PD_SRC_VNC 1550 /* mV */ - -/* UFP-side : threshold for DFP connection detection */ -#define PD_SNK_VA 200 /* mV */ - -/* start as a sink in case we have no other power supply/battery */ -#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 20000 /* us */ -#define PD_POWER_SUPPLY_TURN_OFF_DELAY 20000 /* us */ - -/* Define typical operating power and max power */ -#define PD_OPERATING_POWER_MW 15000 -#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/host/usb_pd_policy.c b/board/host/usb_pd_policy.c index a515f58800..dbc15b1788 100644 --- a/board/host/usb_pd_policy.c +++ b/board/host/usb_pd_policy.c @@ -79,6 +79,12 @@ void pd_set_input_current_limit(int port, uint32_t max_ma, /* Not implemented */ } +test_mockable int pd_snk_is_vbus_provided(int port) +{ + /* Not implemented */ + return 1; +} + int pd_board_checks(void) { return EC_SUCCESS; |