usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-

tcpm-source-psy- does not invoke power_supply_changed API when
one of the published power supply properties is changed.
power_supply_changed needs to be called to notify
userspace clients(uevents) and kernel clients.

Fixes: f2a8aa053c176 ("typec: tcpm: Represent source supply through power_supply")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210317181249.1062995-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by Badhri Jagan Sridharan and committed by Greg Kroah-Hartman 86629e09 3cac9104

+8 -1
+8 -1
drivers/usb/typec/tcpm/tcpm.c
··· 942 942 943 943 port->supply_voltage = mv; 944 944 port->current_limit = max_ma; 945 + power_supply_changed(port->psy); 945 946 946 947 if (port->tcpc->set_current_limit) 947 948 ret = port->tcpc->set_current_limit(port->tcpc, max_ma, mv); ··· 2929 2928 2930 2929 port->pps_data.supported = false; 2931 2930 port->usb_type = POWER_SUPPLY_USB_TYPE_PD; 2931 + power_supply_changed(port->psy); 2932 2932 2933 2933 /* 2934 2934 * Select the source PDO providing the most power which has a ··· 2954 2952 port->pps_data.supported = true; 2955 2953 port->usb_type = 2956 2954 POWER_SUPPLY_USB_TYPE_PD_PPS; 2955 + power_supply_changed(port->psy); 2957 2956 } 2958 2957 continue; 2959 2958 default: ··· 3112 3109 port->pps_data.out_volt)); 3113 3110 port->pps_data.op_curr = min(port->pps_data.max_curr, 3114 3111 port->pps_data.op_curr); 3112 + power_supply_changed(port->psy); 3115 3113 } 3116 3114 3117 3115 return src_pdo; ··· 3348 3344 return ret; 3349 3345 } 3350 3346 port->vbus_charge = charge; 3347 + power_supply_changed(port->psy); 3351 3348 return 0; 3352 3349 } 3353 3350 ··· 3528 3523 port->try_src_count = 0; 3529 3524 port->try_snk_count = 0; 3530 3525 port->usb_type = POWER_SUPPLY_USB_TYPE_C; 3526 + power_supply_changed(port->psy); 3531 3527 port->nr_sink_caps = 0; 3532 3528 port->sink_cap_done = false; 3533 3529 if (port->tcpc->enable_frs) ··· 5911 5905 ret = -EINVAL; 5912 5906 break; 5913 5907 } 5914 - 5908 + power_supply_changed(port->psy); 5915 5909 return ret; 5916 5910 } 5917 5911 ··· 6064 6058 err = devm_tcpm_psy_register(port); 6065 6059 if (err) 6066 6060 goto out_role_sw_put; 6061 + power_supply_changed(port->psy); 6067 6062 6068 6063 port->typec_port = typec_register_port(port->dev, &port->typec_caps); 6069 6064 if (IS_ERR(port->typec_port)) {