summaryrefslogtreecommitdiff
path: root/driver/usb_mux_ps874x.c
diff options
context:
space:
mode:
authorDivya Sasidharan <divya.s.sasidharan@intel.com>2017-12-29 14:44:12 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-03-22 18:16:50 -0700
commitb9fbc80fa332f2869539ce4fb49b3dda8fc0515c (patch)
tree099825b7c79278f34cb3ee99d4c260dd4da77441 /driver/usb_mux_ps874x.c
parent4c4d80ca5dcda0224c514f55dd9d51c2fb0922a1 (diff)
downloadchrome-ec-b9fbc80fa332f2869539ce4fb49b3dda8fc0515c.tar.gz
usb_mux: Fix incorrect revision check at init for ps874x
This patch fixes revision check for ps8xxx usb mux and thereby removing print "Error initializing mux port(x)" at bootup. This is just a cosmetic change and should not affect any functionality. BUG=none BRANCH=glkrvp TEST=On glkrvp: Boot up the system to verify the error message setting mux is gone at init. Change-Id: I0926077d50e818bd93aaa4214106b2f8067d9710 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/846291 Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com> Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/usb_mux_ps874x.c')
-rw-r--r--driver/usb_mux_ps874x.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/driver/usb_mux_ps874x.c b/driver/usb_mux_ps874x.c
index 76b7eb26c3..900ae0763a 100644
--- a/driver/usb_mux_ps874x.c
+++ b/driver/usb_mux_ps874x.c
@@ -33,20 +33,27 @@ static int ps874x_init(int i2c_addr)
/*
* Verify revision / chip ID registers.
- * From Parade: PS8743 may have REVISION_ID1 as 0 or 1,
- * PS8740 may have REVISION_ID2 as 0 or 1,
- * 1 is derived from 0 and have same functionality.
*/
res = ps874x_read(i2c_addr, PS874X_REG_REVISION_ID1, &val);
if (res)
return res;
- if (val < PS874X_REVISION_ID1)
+
+#ifdef CONFIG_USB_MUX_PS8743
+ /*
+ * From Parade: PS8743 may have REVISION_ID1 as 0 or 1
+ * Rev 1 is derived from Rev 0 and have same functionality.
+ */
+ if (val != PS874X_REVISION_ID1_0 && val != PS874X_REVISION_ID1_1)
+ return EC_ERROR_UNKNOWN;
+#else
+ if (val != PS874X_REVISION_ID1)
return EC_ERROR_UNKNOWN;
+#endif
res = ps874x_read(i2c_addr, PS874X_REG_REVISION_ID2, &val);
if (res)
return res;
- if (val < PS874X_REVISION_ID2)
+ if (val != PS874X_REVISION_ID2)
return EC_ERROR_UNKNOWN;
res = ps874x_read(i2c_addr, PS874X_REG_CHIP_ID1, &val);