diff options
author | Firas Sammoura <fsammoura@google.com> | 2022-06-17 16:40:54 +0000 |
---|---|---|
committer | Firas Sammoura <fsammoura@google.com> | 2022-06-17 16:40:54 +0000 |
commit | e5fb0b9ba488614b5684e640530f00821ab7b943 (patch) | |
tree | 9a15b4a98d7987870a1805a33883d0cf9123fc05 /driver/retimer/anx7483.c | |
parent | ad46fafb27c419bd416bfecc76df6c6426a99b32 (diff) | |
parent | a46d3f3feaac0d69012f61b66f652bff991d05a7 (diff) | |
download | chrome-ec-e5fb0b9ba488614b5684e640530f00821ab7b943.tar.gz |
Merge remote-tracking branch cros/main into firmware-fpmcu-bloonchipper-release
Generated by: ./util/update_release_branch.py --board bloonchipper --relevant_paths_file ./util/fingerprint-relevant-paths.txt firmware-fpmcu-bloonchipper-release
Relevant changes:
git log --oneline ad46fafb27..a46d3f3fea -- board/hatch_fp
board/bloonchipper common/fpsensor docs/fingerprint driver/fingerprint
util/getversion.sh
981fb88cf8 docs/fingerprint: Resolve contradictory FPMCU factory flashing instructions
38ef6b7306 tree: Files should end with single newline
60032a8828 docs/fingerprint: Clean up formatting in fingerprint-factory-quick-guide.md
f49eb6f894 docs/fingerprint: Run mdformat
64aa5fc7bb docs/fingerprint: Add links to info on fuzz testing
8bd99cc434 fpsensor: Use correct return type
2b2d7a991d fpsensor: Use correct return type
BRANCH=None
BUG=b:234772776 b:234181908 b:172020503 b:234181908
TEST=`make -j buildall`
Cq-Include-Trybots: chromeos/cq:cq-orchestrator
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Change-Id: I18b58de542c8b439d0f9327a7d4f0ec897da080f
Diffstat (limited to 'driver/retimer/anx7483.c')
-rw-r--r-- | driver/retimer/anx7483.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/driver/retimer/anx7483.c b/driver/retimer/anx7483.c index 2add843611..6804fd3de8 100644 --- a/driver/retimer/anx7483.c +++ b/driver/retimer/anx7483.c @@ -6,6 +6,7 @@ */ #include "anx7483.h" +#include "retimer/anx7483_public.h" #include "chipset.h" #include "common.h" #include "console.h" @@ -315,6 +316,34 @@ enum ec_error_list anx7483_set_default_tuning(const struct usb_mux *me, return EC_SUCCESS; } +enum ec_error_list anx7483_set_eq(const struct usb_mux *me, + enum anx7483_tune_pin pin, + enum anx7483_eq_setting eq) +{ + int reg, value; + + if (pin == ANX7483_PIN_UTX1) + reg = ANX7483_UTX1_PORT_CFG0_REG; + else if (pin == ANX7483_PIN_UTX2) + reg = ANX7483_UTX2_PORT_CFG0_REG; + else if (pin == ANX7483_PIN_URX1) + reg = ANX7483_URX1_PORT_CFG0_REG; + else if (pin == ANX7483_PIN_URX2) + reg = ANX7483_URX2_PORT_CFG0_REG; + else if (pin == ANX7483_PIN_DRX1) + reg = ANX7483_DRX1_PORT_CFG0_REG; + else if (pin == ANX7483_PIN_DRX2) + reg = ANX7483_DRX2_PORT_CFG0_REG; + else + return EC_ERROR_INVAL; + + RETURN_ERROR(anx7483_read(me, reg, &value)); + value &= ~ANX7483_CFG0_EQ_MASK; + value |= eq << ANX7483_CFG0_EQ_SHIFT; + + return anx7483_write(me, reg, value); +} + const struct usb_mux_driver anx7483_usb_retimer_driver = { .init = anx7483_init, .set = anx7483_set, |