ANDROID: bring back typec charger changes.

This file was originally touched to revert an upstream change that broke
the Pixel from charging, but it has now been resolved properly upstream
and the real fix will come in through the USB tree correctly.  Revert
the out-of-tree changes to allow the merge to happen properly.

Bug: 307718635
Bug: 298207935
Cc: André Draszik <draszik@google.com>
Change-Id: Icaba3965ad54d2eecf5a851520613b35770dccee
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2023-12-13 15:18:40 +00:00
parent 5d88b26cbb
commit 5032efbbcf
+7 -3
View File
@@ -4267,7 +4267,9 @@ static void run_state_machine(struct tcpm_port *port)
if (port->slow_charger_loop && (current_lim > PD_P_SNK_STDBY_MW / 5))
current_lim = PD_P_SNK_STDBY_MW / 5;
tcpm_set_current_limit(port, current_lim, 5000);
tcpm_set_charge(port, true);
/* Not sink vbus if operational current is 0mA */
tcpm_set_charge(port, !!pdo_max_current(port->snk_pdo[0]));
if (!port->pd_supported)
tcpm_set_state(port, SNK_READY, 0);
else
@@ -4550,7 +4552,8 @@ static void run_state_machine(struct tcpm_port *port)
tcpm_set_current_limit(port,
tcpm_get_current_limit(port),
5000);
tcpm_set_charge(port, true);
/* Not sink vbus if operational current is 0mA */
tcpm_set_charge(port, !!pdo_max_current(port->snk_pdo[0]));
}
if (port->ams == HARD_RESET)
tcpm_ams_finish(port);
@@ -4853,7 +4856,8 @@ static void run_state_machine(struct tcpm_port *port)
break;
case PORT_RESET:
tcpm_reset_port(port);
tcpm_set_cc(port, TYPEC_CC_OPEN);
tcpm_set_cc(port, tcpm_default_state(port) == SNK_UNATTACHED ?
TYPEC_CC_RD : tcpm_rp_cc(port));
tcpm_set_state(port, PORT_RESET_WAIT_OFF,
PD_T_ERROR_RECOVERY);
break;