summaryrefslogtreecommitdiff
path: root/zephyr/emul/tcpc
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-02-03 17:04:19 +0100
committerCommit Bot <commit-bot@chromium.org>2022-02-22 10:27:49 +0000
commit59a155a91616c8456def1aac594602dd646bb2f0 (patch)
treefd670d9efcad67780a0030f53a5ac792c737c25b /zephyr/emul/tcpc
parent86295f979ec39b8b522e75bb507830a57bf17dcc (diff)
downloadchrome-ec-59a155a91616c8456def1aac594602dd646bb2f0.tar.gz
zephyr: emul: Set FW rev on PS8xxx init
Set some arbitrary FW revision value on PS8xxx emulator initialization. FW revision equals to 0 indicate that device is not working correctly, so value other than zero allows PD task to initialize this TCPC. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I8458ad973233a44edbaf3f0b5c3a15fd0939877b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3437447 Tested-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
Diffstat (limited to 'zephyr/emul/tcpc')
-rw-r--r--zephyr/emul/tcpc/emul_ps8xxx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/emul/tcpc/emul_ps8xxx.c b/zephyr/emul/tcpc/emul_ps8xxx.c
index b0910fb586..e2d7b7d602 100644
--- a/zephyr/emul/tcpc/emul_ps8xxx.c
+++ b/zephyr/emul/tcpc/emul_ps8xxx.c
@@ -529,6 +529,8 @@ static int ps8xxx_emul_init(const struct emul *emul,
tcpci_emul_set_reg(data->tcpci_emul, TCPC_REG_PRODUCT_ID,
data->prod_id);
+ /* FW rev is never 0 in a working device. Set arbitrary FW rev. */
+ tcpci_emul_set_reg(data->tcpci_emul, PS8XXX_REG_FW_REV, 0x31);
return ret;
}