diff options
author | Scott Collyer <scollyer@google.com> | 2021-03-16 07:22:25 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-15 18:24:31 +0000 |
commit | e721551bbbdf0eb0edf107f57efd49577a6f8d88 (patch) | |
tree | 5f824fc4641528b54dd85480503328b118f28261 /baseboard/honeybuns | |
parent | 654e8de3ae38ba76bbec24167899f9f90c1f1fab (diff) | |
download | chrome-ec-e721551bbbdf0eb0edf107f57efd49577a6f8d88.tar.gz |
honeybuns: Allow for board specific mf preference
This CL enables a given board to have its own policy regarding the mf
preference bit which is used by a UFP to signal its preferred pin
configuration in the DP Status message.
BUG=b:175434634
BRANCH=None
TEST=Verfied that the mf bit in the DP status message follows the
board preference.
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: Ied7cdb72d1e302aab25dd5531856b1c7c148e64f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765422
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'baseboard/honeybuns')
-rw-r--r-- | baseboard/honeybuns/baseboard.h | 13 | ||||
-rw-r--r-- | baseboard/honeybuns/usb_pd_policy.c | 12 |
2 files changed, 14 insertions, 11 deletions
diff --git a/baseboard/honeybuns/baseboard.h b/baseboard/honeybuns/baseboard.h index 76bcaf490d..a8b8e9e902 100644 --- a/baseboard/honeybuns/baseboard.h +++ b/baseboard/honeybuns/baseboard.h @@ -219,6 +219,11 @@ struct power_seq { unsigned int delay_ms; /* delay (in msec) after setting gpio_signal */ }; +enum mf_preference { + MF_OFF = 0, + MF_ON, +}; + /* * This is required as adc_channel is included in adc.h which ends up being * included when TCPMv2 functions are included @@ -240,6 +245,14 @@ void baseboard_power_button_evt(int level); int baseboard_usbc_init(int port); /* + * Get a board's desired multi-function (MF) prefernce. This allows for board + * specific policy. + * + * @return 1 if multi function (DP + USB3) is preferred, 0 otherwise + */ +int dock_get_mf_preference(void); + +/* * Set MST_LANE_CONTROL gpio to match the DP pin configuration selected * by the host in the DP Configure SVDM message. * diff --git a/baseboard/honeybuns/usb_pd_policy.c b/baseboard/honeybuns/usb_pd_policy.c index 3a670b51ff..67ff188178 100644 --- a/baseboard/honeybuns/usb_pd_policy.c +++ b/baseboard/honeybuns/usb_pd_policy.c @@ -326,17 +326,7 @@ static int amode_dp_status(int port, uint32_t *payload) { int opos = PD_VDO_OPOS(payload[0]); int hpd = gpio_get_level(GPIO_DP_HPD); - uint32_t fw_config; - int mf = 0; - int rv; - - /* MF (multi function) preferece is indicated by bit 0 of the fw_config - * data field. If this data field does not exist, then default to 4 lane - * mode. - */ - rv = cbi_get_fw_config(&fw_config); - if (!rv) - mf = fw_config & 1; + int mf = dock_get_mf_preference(); if (opos != OPOS_DP) return 0; /* nak */ |