platform/chrome: cros_ec_typec: Add DP mode check
authorPrashant Malani <pmalani@chromium.org>
Wed, 21 Apr 2021 04:21:09 +0000 (21:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 09:40:53 +0000 (11:40 +0200)
commit6a40e3f9a803d958ea497bc8522b33597b763b5c
tree003ba5094a62a6b2185ee2f50a751e6405934a50
parentb01b7999f49e9f9a4278442c0af73b8777f68f2c
platform/chrome: cros_ec_typec: Add DP mode check

[ Upstream commit c5bb32f57bf3a30ed03be51f7be0840325ba8b4a ]

There are certain transitional situations where the dp_mode field in the
PD_CONTROL response might not be populated with the right DP pin
assignment value yet. Add a check for that to avoid sending an invalid
value to the Type C mode switch.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210421042108.2002-1-pmalani@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/chrome/cros_ec_typec.c