diff options
author | Divya Sasidharan <divya.s.sasidharan@intel.com> | 2017-12-29 14:44:12 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-22 18:16:50 -0700 |
commit | b9fbc80fa332f2869539ce4fb49b3dda8fc0515c (patch) | |
tree | 099825b7c79278f34cb3ee99d4c260dd4da77441 | |
parent | 4c4d80ca5dcda0224c514f55dd9d51c2fb0922a1 (diff) | |
download | chrome-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>
-rw-r--r-- | driver/usb_mux_ps874x.c | 17 | ||||
-rw-r--r-- | driver/usb_mux_ps874x.h | 9 |
2 files changed, 17 insertions, 9 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); diff --git a/driver/usb_mux_ps874x.h b/driver/usb_mux_ps874x.h index 8092e448bb..e9d4c1ff36 100644 --- a/driver/usb_mux_ps874x.h +++ b/driver/usb_mux_ps874x.h @@ -40,11 +40,12 @@ #define PS874X_REG_CHIP_ID1 0xf2 #define PS874X_REG_CHIP_ID2 0xf3 #ifdef CONFIG_USB_MUX_PS8740 - #define PS874X_REVISION_ID1 0x00 - #define PS874X_REVISION_ID2 0x0a - #define PS874X_CHIP_ID1 0x40 + #define PS874X_REVISION_ID1 0x00 + #define PS874X_REVISION_ID2 0x0a + #define PS874X_CHIP_ID1 0x40 #elif defined(CONFIG_USB_MUX_PS8743) - #define PS874X_REVISION_ID1 0x01 + #define PS874X_REVISION_ID1_0 0x00 + #define PS874X_REVISION_ID1_1 0x01 #define PS874X_REVISION_ID2 0x0b #define PS874X_CHIP_ID1 0x41 #endif |