Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: tcpm: update power supply once partner accepts

power_supply_changed needs to be called to notify clients
after the partner accepts the requested values for the pps
case.

Also, remove the redundant power_supply_changed at the end
of the tcpm_reset_port as power_supply_changed is already
called right after usb_type is changed.

Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply")
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210407200723.1914388-3-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Badhri Jagan Sridharan and committed by
Greg Kroah-Hartman
4050f268 e3a07202

+1 -3
+1 -3
drivers/usb/typec/tcpm/tcpm.c
··· 2568 2568 port->pps_data.max_curr = port->pps_data.req_max_curr; 2569 2569 port->req_supply_voltage = port->pps_data.req_out_volt; 2570 2570 port->req_current_limit = port->pps_data.req_op_curr; 2571 + power_supply_changed(port->psy); 2571 2572 tcpm_set_state(port, SNK_TRANSITION_SINK, 0); 2572 2573 break; 2573 2574 case SOFT_RESET_SEND: ··· 3137 3136 port->pps_data.req_out_volt)); 3138 3137 port->pps_data.req_op_curr = min(port->pps_data.max_curr, 3139 3138 port->pps_data.req_op_curr); 3140 - power_supply_changed(port->psy); 3141 3139 } 3142 3140 3143 3141 return src_pdo; ··· 3561 3561 port->sink_cap_done = false; 3562 3562 if (port->tcpc->enable_frs) 3563 3563 port->tcpc->enable_frs(port->tcpc, false); 3564 - 3565 - power_supply_changed(port->psy); 3566 3564 } 3567 3565 3568 3566 static void tcpm_detach(struct tcpm_port *port)