From c70c21cf4173ee5e4f7c69c4cc6e4654a6887bd4 Mon Sep 17 00:00:00 2001 From: James_Chao Date: Mon, 6 May 2019 11:29:57 +0800 Subject: ppc/sn5s330: set the deglitch time to 1000 us for PP2 Some type-c device (eg. ASUS MB16ACE) and dongle (eg. Hub-type-c-promate-0001) can't be detect when system resume from S5. After modulating PPC parameter PP1_ILIM_DEGLITCH_0 from 200us to 1ms, those devices can be detect work normally. BUG=b:155109735 BRANCH=octopus TEST=Check the devices can work normally 1.Promate Hub-type-c-promate-0001 2.Apple USB-C Digital AV Multiport Adapter 3.Dell S2718D 4.MONITOR-PHILIPS-258B6QU 5.BENQ EW3270U 6.ASUS MB16ACE,MX27UC 7.LG-34WK95U-W Change-Id: I8a62cb309055b8e64babf1d447eacacc518f9bbd Signed-off-by: James_Chao Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2193251 Reviewed-by: Diana Z --- driver/ppc/sn5s330.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/driver/ppc/sn5s330.c b/driver/ppc/sn5s330.c index 1c9b63f04f..5dbc02437b 100644 --- a/driver/ppc/sn5s330.c +++ b/driver/ppc/sn5s330.c @@ -277,10 +277,14 @@ static int sn5s330_init(int port) return status; } - /* Set analog current limit delay to 200 us for both PP1 & PP2. */ - regval = (PPX_ILIM_DEGLITCH_0_US_200 << 3) | PPX_ILIM_DEGLITCH_0_US_200; - status = i2c_write8(i2c_port, i2c_addr_flags, - SN5S330_FUNC_SET11, regval); + /* + * Set analog current limit delay to 200 us for PP1, + * set 1000 us for PP2 for compatibility. + */ + regval = (PPX_ILIM_DEGLITCH_0_US_200 << 3) | + PPX_ILIM_DEGLITCH_0_US_1000; + status = i2c_write8(i2c_port, i2c_addr_flags, SN5S330_FUNC_SET11, + regval); if (status) { CPRINTS("ppc p%d: Failed to set FUNC_SET11", port); return status; -- cgit v1.2.1