diff options
author | Scott Collyer <scollyer@google.com> | 2021-02-08 21:10:49 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-02 18:51:59 +0000 |
commit | ac04e07d387782fc91a8758890570c13adfb7d81 (patch) | |
tree | e1885c50e20ecada1d3a98138ec3e00da91e2023 /driver/usb_mux/ps8822.h | |
parent | 651debfcc8ca9bdd02ac1583cf114cbaf5ad9b27 (diff) | |
download | chrome-ec-ac04e07d387782fc91a8758890570c13adfb7d81.tar.gz |
usb_mux: ps8822: Add support to adjust rx DP EQ setting
This CL modifies the PS8822 usb_mux driver to support multiple pages
(there is a page 0, 1, and 2 for this chip). The usb_mux driver only
needs access to page 0, but page 1 access is needed for DP EQ
settings.
In addition this CL adds a new driver function to allow setting of the
DP Rx equalization gain value.
BUG=b:178656398
BRANCH=None
TEST=tested on quiche and verified the register is programmed when DP
mode is active.
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I65cb2fc2c982b01537eb60c0b9da30f4363419aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2686918
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'driver/usb_mux/ps8822.h')
-rw-r--r-- | driver/usb_mux/ps8822.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/driver/usb_mux/ps8822.h b/driver/usb_mux/ps8822.h index d37e0600f5..86b911db70 100644 --- a/driver/usb_mux/ps8822.h +++ b/driver/usb_mux/ps8822.h @@ -16,6 +16,8 @@ #define PS8822_I2C_ADDR2_FLAG 0x58 #define PS8822_I2C_ADDR3_FLAG 0x60 +#define PS8822_REG_PAGE0 0x00 + /* Mode register for setting mux */ #define PS8822_REG_MODE 0x01 #define PS8822_MODE_ALT_DP_EN BIT(7) @@ -36,4 +38,29 @@ #define PS8822_ID_LEN 6 +#define PS8822_REG_PAGE1 0x01 +#define PS8822_REG_DP_EQ 0xB6 +#define PS8822_DP_EQ_AUTO_EN BIT(7) + +#define PS8822_DPEQ_LEVEL_UP_9DB 0x00 +#define PS8822_DPEQ_LEVEL_UP_11DB 0x01 +#define PS8822_DPEQ_LEVEL_UP_12DB 0x02 +#define PS8822_DPEQ_LEVEL_UP_14DB 0x03 +#define PS8822_DPEQ_LEVEL_UP_17DB 0x04 +#define PS8822_DPEQ_LEVEL_UP_18DB 0x05 +#define PS8822_DPEQ_LEVEL_UP_19DB 0x06 +#define PS8822_DPEQ_LEVEL_UP_20DB 0x07 +#define PS8822_DPEQ_LEVEL_UP_21DB 0x08 +#define PS8822_DPEQ_LEVEL_UP_MASK 0x0F +#define PS8822_REG_DP_EQ_SHIFT 3 + +/** + * Set DP Rx Equalization value + * + * @param *me pointer to usb_mux descriptor + * @param db requested gain setting for DP Rx path + * @return EC_SUCCESS if db param is valid and I2C is successful + */ +int ps8822_set_dp_rx_eq(const struct usb_mux *me, int db); + #endif /* __CROS_EC_PS8822_H */ |