summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2021-01-29 09:14:06 +0300
committerBenson Leung <bleung@chromium.org>2021-02-02 10:49:54 +0300
commit0371616d8bef6926e9aa05757f35b901268d3724 (patch)
tree4b40dbd2231d0ac8c8b8ec33adc3e90c6feba8d5 /drivers/platform
parentcefc011f8daf0ff3003208349b85174cda0b708d (diff)
downloadlinux-0371616d8bef6926e9aa05757f35b901268d3724.tar.xz
platform/chrome: cros_ec_typec: Set opmode to PD on SOP connected
When SOP Discovery is done, set the opmode to PD if status indicates SOP is connected. SOP connected indicates a PD contract is in place, and is a solid indication we have transitioned to PD power negotiation, either as source or sink. Signed-off-by: Benson Leung <bleung@chromium.org> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20210129061406.2680146-7-bleung@chromium.org Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/chrome/cros_ec_typec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 6bc6fafd54a4..a7778258d0a0 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -900,6 +900,9 @@ static void cros_typec_handle_status(struct cros_typec_data *typec, int port_num
dev_err(typec->dev, "Couldn't parse SOP Disc data, port: %d\n", port_num);
else
typec->ports[port_num]->sop_disc_done = true;
+
+ if (resp.sop_connected)
+ typec_set_pwr_opmode(typec->ports[port_num]->port, TYPEC_PWR_MODE_PD);
}
if (resp.events & PD_STATUS_EVENT_SOP_PRIME_DISC_DONE &&