diff options
author | Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> | 2021-04-22 16:27:13 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-10 06:25:43 +0000 |
commit | ec5ee30c8fed2d46c07bb915c5e8ca2bdb9b9dcb (patch) | |
tree | 5312886ad487bf4a3a33191b7e81c32181afed1e | |
parent | 89d35ca465a8053b26ac8158a992c6098fc37ac1 (diff) | |
download | chrome-ec-ec5ee30c8fed2d46c07bb915c5e8ca2bdb9b9dcb.tar.gz |
hayato: Modify HS Detector threshold of PS8743 setting value
Modify HS detector threshold setting (0x3C) to 0x60 for USB-C C1 port
signal quality.
BUG=b:177980418
BRANCH=asurada
TEST=manual
Run command "ectool i2cread 8 4 0x20 0x3c" to check register value.
Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com>
Change-Id: I97b6bb16e7c5298ff42e35d936e0f9e60ec3b730
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845564
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | baseboard/asurada/baseboard.c | 15 | ||||
-rw-r--r-- | baseboard/asurada/baseboard.h | 1 | ||||
-rw-r--r-- | board/asurada/board.c | 12 | ||||
-rw-r--r-- | board/spherion/board.c | 9 | ||||
-rw-r--r-- | driver/usb_mux/ps8743.h | 11 |
5 files changed, 34 insertions, 14 deletions
diff --git a/baseboard/asurada/baseboard.c b/baseboard/asurada/baseboard.c index 4943aedc9d..edefec3ff3 100644 --- a/baseboard/asurada/baseboard.c +++ b/baseboard/asurada/baseboard.c @@ -64,8 +64,6 @@ static void x_ec_interrupt(enum gpio_signal signal); #define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) #define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args) -static enum board_sub_board board_get_sub_board(void); - /* Wake-up pins for hibernate */ enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, @@ -192,7 +190,7 @@ static void ppc_interrupt(enum gpio_signal signal) /* Sub-board */ -static enum board_sub_board board_get_sub_board(void) +enum board_sub_board board_get_sub_board(void) { static enum board_sub_board sub = SUB_BOARD_NONE; @@ -259,17 +257,6 @@ const int usb_port_enable[] = { }; BUILD_ASSERT(ARRAY_SIZE(usb_port_enable) == USB_PORT_COUNT); -/* USB Mux */ - -void board_usb_mux_init(void) -{ - if (board_get_sub_board() == SUB_BOARD_TYPEC) - ps8743_tune_usb_eq(&usb_muxes[1], - PS8743_USB_EQ_TX_12_8_DB, - PS8743_USB_EQ_RX_12_8_DB); -} -DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); - static int board_ps8743_mux_set(const struct usb_mux *me, mux_state_t mux_state) { diff --git a/baseboard/asurada/baseboard.h b/baseboard/asurada/baseboard.h index 649fccd773..9045b0aaa6 100644 --- a/baseboard/asurada/baseboard.h +++ b/baseboard/asurada/baseboard.h @@ -211,5 +211,6 @@ enum board_sub_board { int board_get_version(void); void board_reset_pd_mcu(void); +enum board_sub_board board_get_sub_board(void); #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BASEBOARD_H */ diff --git a/board/asurada/board.c b/board/asurada/board.c index a73bb246b1..5f6218299a 100644 --- a/board/asurada/board.c +++ b/board/asurada/board.c @@ -350,3 +350,15 @@ __override int syv682x_board_is_syv682c(int port) return board_get_version() > 2; } +void board_usb_mux_init(void) +{ + if (board_get_sub_board() == SUB_BOARD_TYPEC) { + ps8743_tune_usb_eq(&usb_muxes[1], + PS8743_USB_EQ_TX_12_8_DB, + PS8743_USB_EQ_RX_12_8_DB); + ps8743_write(&usb_muxes[1], + PS8743_REG_HS_DET_THRESHOLD, + PS8743_USB_HS_THRESH_NEG_10); + } +} +DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/board/spherion/board.c b/board/spherion/board.c index ae1b932ff6..670eb91dd9 100644 --- a/board/spherion/board.c +++ b/board/spherion/board.c @@ -103,3 +103,12 @@ static void kb_backlight_disable(void) gpio_set_level(GPIO_EC_KB_BL_EN, 0); } DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, kb_backlight_disable, HOOK_PRIO_DEFAULT); + +void board_usb_mux_init(void) +{ + if (board_get_sub_board() == SUB_BOARD_TYPEC) + ps8743_tune_usb_eq(&usb_muxes[1], + PS8743_USB_EQ_TX_12_8_DB, + PS8743_USB_EQ_RX_12_8_DB); +} +DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/driver/usb_mux/ps8743.h b/driver/usb_mux/ps8743.h index 70a47bdb9b..a520f970ac 100644 --- a/driver/usb_mux/ps8743.h +++ b/driver/usb_mux/ps8743.h @@ -75,6 +75,17 @@ #define PS8743_USB_EQ_RX_21_3_DB 0xd0 #define PS8743_USB_EQ_RX_22_2_DB 0xe0 +/* USB High Speed Signal Detector thershold adjustment */ +#define PS8743_REG_HS_DET_THRESHOLD 0x3c +#define PS8743_USB_HS_THRESH_DEFAULT 0x00 +#define PS8743_USB_HS_THRESH_POS_10 0x20 +#define PS8743_USB_HS_THRESH_POS_33 0x40 +#define PS8743_USB_HS_THRESH_NEG_10 0x60 +#define PS8743_USB_HS_THRESH_NEG_25 0x80 +#define PS8743_USB_HS_THRESH_POS_25 0xa0 +#define PS8743_USB_HS_THRESH_NEG_45 0xc0 +#define PS8743_USB_HS_THRESH_NEG_35 0xe0 + int ps8743_tune_usb_eq(const struct usb_mux *me, uint8_t tx, uint8_t rx); int ps8743_write(const struct usb_mux *me, uint8_t reg, uint8_t val); int ps8743_read(const struct usb_mux *me, uint8_t reg, int *val); |