summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-06-23 16:47:57 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-24 23:13:28 +0000
commitcbb79c255806d25e7d6c6d0f36597cd48caf6710 (patch)
tree6d1ad8d7a74a0757bc665c85bf819dd1f95f9047
parent564256d2eeb40e63e400ddea0a27489ca4947da1 (diff)
downloadchrome-ec-cbb79c255806d25e7d6c6d0f36597cd48caf6710.tar.gz
pd: create driver/tcpm/ to hold TCPM drivers
Create driver/tcpm/ folder to hold TCPM drivers. Currently the two drivers are a stub driver which is used when TCPM and TCPC are on the same MCU and can make direct calls between the two and the TCPCI driver which implements the standard TCPCI protocol. BUG=chrome-os-partner:41842 BRANCH=none TEST=make -j buildall Change-Id: Ie4d9b36eb33155254f8b87b83861f98a7a80693a Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/281630 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/pdeval-stm32f072/PD_evaluation.md4
-rw-r--r--common/build.mk2
-rw-r--r--driver/build.mk4
-rw-r--r--driver/tcpm/stub.c (renamed from common/usb_pd_tcpm_stub.c)0
-rw-r--r--driver/tcpm/tcpci.c (renamed from common/usb_pd_tcpm.c)0
5 files changed, 6 insertions, 4 deletions
diff --git a/board/pdeval-stm32f072/PD_evaluation.md b/board/pdeval-stm32f072/PD_evaluation.md
index 1b47e02d4f..6c38ee457a 100644
--- a/board/pdeval-stm32f072/PD_evaluation.md
+++ b/board/pdeval-stm32f072/PD_evaluation.md
@@ -3,7 +3,7 @@ USB PD chip evaluation configuration
This board configuration implements a USB Power Delivery TCPM
in order to evaluate various TCPC chips.
-The code tries to follow the preliminary USB PD interface standard but for TCPC chip implementing proprietary I2C protocol, a new TCPM file can be implemented as explained in the [Updating the code](#Updating the code) section below.
+The code tries to follow the preliminary USB PD interface standard but for TCPC chip implementing proprietary I2C protocol, a new TCPM file can be implemented as explained in the [Updating the code](#Updating-the-code) section below.
Building
--------
@@ -26,7 +26,7 @@ Updating the code
### TCPC Communication code
-Please duplicate [`common/usb_pd_tcpm.c`](../../common/usb_pd_tcpm.c) into `common/usb_pd_tcpm_<vendor>.c`.
+Please duplicate [driver/tcpm/tcpci.c](../../driver/tcpm/tcpci.c) into **driver/tcpm/<vendor>.c**.
Then update the control logic through I2C there.
### Board configuration
diff --git a/common/build.mk b/common/build.mk
index 1c006a843b..4003086c48 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -82,8 +82,6 @@ common-$(CONFIG_USB_PORT_POWER_SMART)+=usb_port_power_smart.o
common-$(CONFIG_USB_POWER_DELIVERY)+=usb_pd_protocol.o usb_pd_policy.o
common-$(CONFIG_USB_PD_LOGGING)+=pd_log.o
common-$(CONFIG_USB_PD_TCPC)+=usb_pd_tcpc.o
-common-$(CONFIG_USB_PD_TCPM_STUB)+=usb_pd_tcpm_stub.o
-common-$(CONFIG_USB_PD_TCPM_TCPCI)+=usb_pd_tcpm.o
common-$(CONFIG_VBOOT_HASH)+=sha256.o vboot_hash.o
common-$(CONFIG_WIRELESS)+=wireless.o
common-$(HAS_TASK_BLOB)+=blob.o
diff --git a/driver/build.mk b/driver/build.mk
index 89a099226b..998cd9cbce 100644
--- a/driver/build.mk
+++ b/driver/build.mk
@@ -54,6 +54,10 @@ driver-$(CONFIG_TEMP_SENSOR_G781)+=temp_sensor/g781.o
driver-$(CONFIG_TEMP_SENSOR_TMP006)+=temp_sensor/tmp006.o
driver-$(CONFIG_TEMP_SENSOR_TMP432)+=temp_sensor/tmp432.o
+# Type-C port controller (TCPC) drivers
+driver-$(CONFIG_USB_PD_TCPM_STUB)+=tcpm/stub.o
+driver-$(CONFIG_USB_PD_TCPM_TCPCI)+=tcpm/tcpci.o
+
# USB switches
driver-$(CONFIG_USB_SWITCH_PI3USB9281)+=usb_switch_pi3usb9281.o
driver-$(CONFIG_USB_SWITCH_PI3USB30532)+=usb_switch_pi3usb30532.o
diff --git a/common/usb_pd_tcpm_stub.c b/driver/tcpm/stub.c
index 60651670a5..60651670a5 100644
--- a/common/usb_pd_tcpm_stub.c
+++ b/driver/tcpm/stub.c
diff --git a/common/usb_pd_tcpm.c b/driver/tcpm/tcpci.c
index 7d2c38774b..7d2c38774b 100644
--- a/common/usb_pd_tcpm.c
+++ b/driver/tcpm/tcpci.c