From 5d03fd8082b6fc956b0ec6a3cc63c69c01e8e5bb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 May 2021 14:33:02 +0200 Subject: [PATCH] Revert "usb: typec: tcpm: Address incorrect values of tcpm psy for fixed supply" This reverts commit c87bb48ac5c5942e594c285218cf0af4065d71ec which is commit f3dedafb8263ca4791a92a23f5230068f5bde008 in 5.4.119 as it breaks the kernel abi. If it needs to come back, it needs to be done in an abi-preserving way. Bug: 161946584 Cc: Badhri Jagan Sridharan Signed-off-by: Greg Kroah-Hartman Change-Id: I8e6087067096b210af2521d22203bc0020d8d52b --- drivers/usb/typec/tcpm/tcpm.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index f7da2d607857..dab03d5f9ecd 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -285,10 +285,7 @@ struct tcpm_port { unsigned int operating_snk_mw; bool update_sink_caps; - /* Requested current / voltage to the port partner */ - u32 req_current_limit; - u32 req_supply_voltage; - /* Actual current / voltage limit of the local port */ + /* Requested current / voltage */ u32 current_limit; u32 supply_voltage; @@ -1721,8 +1718,8 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port, case SNK_TRANSITION_SINK: if (port->vbus_present) { tcpm_set_current_limit(port, - port->req_current_limit, - port->req_supply_voltage); + port->current_limit, + port->supply_voltage); port->explicit_contract = true; tcpm_set_state(port, SNK_READY, 0); } else { @@ -1794,8 +1791,8 @@ static void tcpm_pd_ctrl_request(struct tcpm_port *port, break; case SNK_NEGOTIATE_PPS_CAPABILITIES: port->pps_data.active = true; - port->req_supply_voltage = port->pps_data.out_volt; - port->req_current_limit = port->pps_data.op_curr; + port->supply_voltage = port->pps_data.out_volt; + port->current_limit = port->pps_data.op_curr; tcpm_set_state(port, SNK_TRANSITION_SINK, 0); break; case SOFT_RESET_SEND: @@ -2399,8 +2396,8 @@ static int tcpm_pd_build_request(struct tcpm_port *port, u32 *rdo) flags & RDO_CAP_MISMATCH ? " [mismatch]" : ""); } - port->req_current_limit = ma; - port->req_supply_voltage = mv; + port->current_limit = ma; + port->supply_voltage = mv; return 0; }