summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/tcpm/ps8xxx.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/driver/tcpm/ps8xxx.c b/driver/tcpm/ps8xxx.c
index 78b7464fcc..58fb109b3e 100644
--- a/driver/tcpm/ps8xxx.c
+++ b/driver/tcpm/ps8xxx.c
@@ -585,33 +585,30 @@ static int ps8xxx_get_chip_info(int port, int live,
chip_info->product_id = product_id[port];
}
- if (chip_info->fw_version_number == 0 ||
- chip_info->fw_version_number == -1 || live) {
#ifdef CONFIG_USB_PD_TCPM_PS8805_FORCE_DID
- if (chip_info->product_id == PS8805_PRODUCT_ID &&
- chip_info->device_id == 0x0001) {
- rv = ps8805_make_device_id(port, &val);
- if (rv != EC_SUCCESS)
- return rv;
- chip_info->device_id = val;
- }
+ if (chip_info->product_id == PS8805_PRODUCT_ID &&
+ chip_info->device_id == 0x0001) {
+ rv = ps8805_make_device_id(port, &val);
+ if (rv != EC_SUCCESS)
+ return rv;
+ chip_info->device_id = val;
+ }
#endif
#ifdef CONFIG_USB_PD_TCPM_PS8815_FORCE_DID
- if (chip_info->product_id == PS8815_PRODUCT_ID &&
- chip_info->device_id == 0x0001) {
- rv = ps8815_make_device_id(port, &val);
- if (rv != EC_SUCCESS)
- return rv;
- chip_info->device_id = val;
- }
-#endif
- reg = get_reg_by_product(port, REG_FW_VER);
- rv = tcpc_read(port, reg, &val);
+ if (chip_info->product_id == PS8815_PRODUCT_ID &&
+ chip_info->device_id == 0x0001) {
+ rv = ps8815_make_device_id(port, &val);
if (rv != EC_SUCCESS)
return rv;
-
- chip_info->fw_version_number = val;
+ chip_info->device_id = val;
}
+#endif
+ reg = get_reg_by_product(port, REG_FW_VER);
+ rv = tcpc_read(port, reg, &val);
+ if (rv != EC_SUCCESS)
+ return rv;
+
+ chip_info->fw_version_number = val;
/* Treat unexpected values as error (FW not initiated from reset) */
if (live && (