summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-06-10 14:31:18 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-16 19:52:34 +0000
commitb60a603c43372e76a210535c8fb72a6726dec4f1 (patch)
tree242875fedc197cb805b586b4e9f90c1e7c672719 /driver
parent7a9b88e75a9e6e99643b0c45206d78f3c7f36ee9 (diff)
downloadchrome-ec-b60a603c43372e76a210535c8fb72a6726dec4f1.tar.gz
NCT38xx: Add notification for chip reset
An external reset of the chip will reset some information we've gathered from that chip. Notify the driver so stored information may be reset as well. BRANCH=None BUG=b:183660105 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib3335cf2984f2b13bbed7cacee603ba47edd2a51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953875 Reviewed-by: Rob Barnes <robbarnes@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/nct38xx.c6
-rw-r--r--driver/tcpm/nct38xx.h9
2 files changed, 15 insertions, 0 deletions
diff --git a/driver/tcpm/nct38xx.c b/driver/tcpm/nct38xx.c
index 1b620b5c40..c0e44a2e9c 100644
--- a/driver/tcpm/nct38xx.c
+++ b/driver/tcpm/nct38xx.c
@@ -29,6 +29,12 @@ enum nct38xx_boot_type nct38xx_get_boot_type(int port)
return boot_type[port];
}
+void nct38xx_reset_notify(int port)
+{
+ /* A full reset also resets the chip's dead battery boot status */
+ boot_type[port] = NCT38XX_BOOT_UNKNOWN;
+}
+
static int nct38xx_init(int port)
{
int rv;
diff --git a/driver/tcpm/nct38xx.h b/driver/tcpm/nct38xx.h
index 9c131e10ec..f4923b700d 100644
--- a/driver/tcpm/nct38xx.h
+++ b/driver/tcpm/nct38xx.h
@@ -109,6 +109,15 @@ enum nct38xx_boot_type {
*/
enum nct38xx_boot_type nct38xx_get_boot_type(int port);
+/**
+ * Notify the driver that the TCPC has been reset, and any stored state from
+ * the chip should therefore be gathered again. This should be called when
+ * board_reset_pd_mcu is called after init time.
+ *
+ * @param port USB-C port number which has been reset
+ */
+void nct38xx_reset_notify(int port);
+
extern const struct ioexpander_drv nct38xx_ioexpander_drv;
#endif /* defined(__CROS_EC_USB_PD_TCPM_NCT38XX_H) */