linux/drivers/usb/typec
Hans de Goede 146971e624 typec: tcpm: Correctly report power_supply current and voltage for non pd supply
Commit f2a8aa053c ("typec: tcpm: Represent source supply through
power_supply") moved the code to register a power_supply representing
the device supplying power to the type-C connector, from the fusb302
code to the generic tcpm code so that we have a psy reporting the
supply voltage and current for all tcpm devices.

This broke the reporting of current and voltage through the psy interface
when supplied by a a non pd supply (5V, current as reported by
get_current_limit). The cause of this breakage is port->supply_voltage
and port->current_limit not being set in that case.

This commit fixes this by setting port->supply_voltage and
port->current_limit from tcpm_set_current_limit().

This commit also removes setting supply_voltage and current_limit
from tcpm_reset_port() as that calls tcpm_set_current_limit(0, 0)
which now already sets these to 0.

Fixes: f2a8aa053c ("typec: tcpm: Represent source supply through...")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-02 17:38:07 +02:00
..
fusb302 USB: typec: fsusb302: no need to check return value of debugfs_create_dir() 2018-05-31 16:03:59 +02:00
mux usb: typec: driver for Pericom PI3USB30532 Type-C cross switch 2018-03-22 13:49:28 +01:00
ucsi usb: typec: ucsi: Fix for incorrect status data issue 2018-06-25 21:30:12 +08:00
class.c usb: typec: Separate the definitions for data and power roles 2018-03-22 13:40:10 +01:00
Kconfig typec: tcpm: Represent source supply through power_supply 2018-04-25 14:20:20 +02:00
Makefile usb: typec: driver for Pericom PI3USB30532 Type-C cross switch 2018-03-22 13:49:28 +01:00
mux.c usb: typec: Fix htmldocs warning 2018-05-24 18:14:28 +02:00
tcpm.c typec: tcpm: Correctly report power_supply current and voltage for non pd supply 2018-07-02 17:38:07 +02:00
tps6598x.c usb: typec: tps6598x: handle block reads separately with plain-I2C adapters 2018-05-03 10:55:31 -07:00
typec_wcove.c usb: typec: wcove: Remove dependency on HW FSM 2018-05-24 18:17:00 +02:00