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>
This commit is contained in:
Divya Sasidharan
2017-12-29 14:44:12 -08:00
committed by chrome-bot
parent 4c4d80ca5d
commit b9fbc80fa3
2 changed files with 17 additions and 9 deletions

View File

@@ -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);

View File

@@ -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