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