summaryrefslogtreecommitdiff
path: root/driver/tcpm
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-06-12 11:30:49 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-22 15:34:33 +0000
commitaab67baa3519d3d0fc36c98dc9303104ce06c9b3 (patch)
treeac41466ede81b4a0459451c0828231731bebe9a4 /driver/tcpm
parent08a567f57bd969d2bd8cdc9de9381fe3d7f7b47d (diff)
downloadchrome-ec-aab67baa3519d3d0fc36c98dc9303104ce06c9b3.tar.gz
ec_commands: Rename 'renew' to 'live' in EC_CMD_USB_PD_CHIP_INFO
Semantics of renew field in EC_CMD_USB_PD_CHIP_INFO is changing as follows: 0 -> Return hard-coded info for Vendor ID/Product ID and cached info for the Firmware Version 1 -> Return the live chip info for Vendor ID/Product ID/Firmware Version Also rename the 'renew' field to 'live' to match the new semantics. BUG=b:128820536,b:119046668 BRANCH=None TEST=make -j buildall; Boot to ChromeOS. Change-Id: Ie3dd022336b0be5c9728bb0ebabef32b7a6b5d57 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1617893 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Karthikeyan Ramasubramanian <kramasub@chromium.org> Auto-Submit: Karthikeyan Ramasubramanian <kramasub@chromium.org> (cherry picked from commit 5936367096413abf294aa4584df53ec80bf8ef4c) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1713105 Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> (cherry picked from commit 8b3577c2e46150d9ee9b3a2166c9e0ba0a5c15fe) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1713108
Diffstat (limited to 'driver/tcpm')
-rw-r--r--driver/tcpm/anx74xx.c6
-rw-r--r--driver/tcpm/it83xx.c2
-rw-r--r--driver/tcpm/ps8xxx.c6
-rw-r--r--driver/tcpm/tcpci.c6
-rw-r--r--driver/tcpm/tcpci.h2
-rw-r--r--driver/tcpm/tcpm.h4
6 files changed, 13 insertions, 13 deletions
diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c
index 4ad5eb67c0..94d1b292a2 100644
--- a/driver/tcpm/anx74xx.c
+++ b/driver/tcpm/anx74xx.c
@@ -1039,17 +1039,17 @@ static int anx74xx_tcpm_init(int port)
return EC_SUCCESS;
}
-static int anx74xx_get_chip_info(int port, int renew,
+static int anx74xx_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **chip_info)
{
- int rv = tcpci_get_chip_info(port, renew, chip_info);
+ int rv = tcpci_get_chip_info(port, live, chip_info);
int val;
if (rv)
return rv;
if ((*chip_info)->fw_version_number == 0 ||
- (*chip_info)->fw_version_number == -1 || renew) {
+ (*chip_info)->fw_version_number == -1 || live) {
rv = tcpc_read(port, ANX74XX_REG_FW_VERSION, &val);
if (rv)
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c
index f63e9e38bb..d34505e641 100644
--- a/driver/tcpm/it83xx.c
+++ b/driver/tcpm/it83xx.c
@@ -574,7 +574,7 @@ static int it83xx_tcpm_transmit(int port,
return EC_SUCCESS;
}
-static int it83xx_tcpm_get_chip_info(int port, int renew,
+static int it83xx_tcpm_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **chip_info)
{
static struct ec_response_pd_chip_info_v1 i;
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index 1ffb18a2c3..fb4038dc8b 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -131,17 +131,17 @@ static int ps8xxx_tcpm_release(int port)
return tcpci_tcpm_release(port);
}
-static int ps8xxx_get_chip_info(int port, int renew,
+static int ps8xxx_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **chip_info)
{
int val;
- int rv = tcpci_get_chip_info(port, renew, chip_info);
+ int rv = tcpci_get_chip_info(port, live, chip_info);
if (rv)
return rv;
if ((*chip_info)->fw_version_number == 0 ||
- (*chip_info)->fw_version_number == -1 || renew) {
+ (*chip_info)->fw_version_number == -1 || live) {
rv = tcpc_read(port, FW_VER_REG, &val);
if (rv)
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index ea4183c247..c9e6c3c7a1 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -606,7 +606,7 @@ void tcpci_tcpc_alert(int port)
* Once it's called, the chip info will be stored in cache, which can be
* accessed by tcpm_get_chip_info without worrying about chip states.
*/
-int tcpci_get_chip_info(int port, int renew,
+int tcpci_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **chip_info)
{
static struct ec_response_pd_chip_info_v1
@@ -625,8 +625,8 @@ int tcpci_get_chip_info(int port, int renew,
if (chip_info)
*chip_info = i;
- /* If already populated and renewal is not asked, return cache value */
- if (i->vendor_id && !renew)
+ /* If already cached && live data is not asked, return cached value */
+ if (i->vendor_id && !live)
return EC_SUCCESS;
error = tcpc_read16(port, TCPC_REG_VENDOR_ID, &val);
diff --git a/driver/tcpm/tcpci.h b/driver/tcpm/tcpci.h
index d0b29b796b..3ef53fc2f1 100644
--- a/driver/tcpm/tcpci.h
+++ b/driver/tcpm/tcpci.h
@@ -155,7 +155,7 @@ int tcpci_tcpm_mux_init(int i2c_addr);
int tcpci_tcpm_mux_set(int i2c_addr, mux_state_t mux_state);
int tcpci_tcpm_mux_get(int i2c_addr, mux_state_t *mux_state);
int tcpci_tcpm_mux_enter_low_power(int port);
-int tcpci_get_chip_info(int port, int renew,
+int tcpci_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **chip_info);
#ifdef CONFIG_USBC_PPC
int tcpci_tcpm_set_snk_ctrl(int port, int enable);
diff --git a/driver/tcpm/tcpm.h b/driver/tcpm/tcpm.h
index 0dee179e36..bb8aa1aff8 100644
--- a/driver/tcpm/tcpm.h
+++ b/driver/tcpm/tcpm.h
@@ -232,11 +232,11 @@ static inline int tcpc_i2c_write(const int port, const int addr,
}
#endif
-static inline int tcpm_get_chip_info(int port, int renew,
+static inline int tcpm_get_chip_info(int port, int live,
struct ec_response_pd_chip_info_v1 **info)
{
if (tcpc_config[port].drv->get_chip_info)
- return tcpc_config[port].drv->get_chip_info(port, renew, info);
+ return tcpc_config[port].drv->get_chip_info(port, live, info);
return EC_ERROR_UNIMPLEMENTED;
}