typec: tcpm: Represent source supply through power_supply
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Mon, 23 Apr 2018 14:11:00 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 12:20:20 +0000 (14:20 +0200)
commitf2a8aa053c1761232ce561e4fa725f02b8bd13fd
treefae6318a59c2cc64b73fc436a22c64f5b29bf6e2
parentcf45004195efea6b479a1d710d6fc21c2b19353e
typec: tcpm: Represent source supply through power_supply

This commit adds a power_supply class instance to represent a
PD source's voltage and current properties. This provides an
interface for reading these properties from user-space or other
drivers.

For PPS enabled Sources, this also provides write access to set
the current and voltage and allows for swapping between standard
PDO and PPS APDO.

As this represents a superset of the information provided in the
fusb302 driver, the power_supply instance in that code is removed
as part of this change, so reverting the commit titled
'typec: tcpm: Represent source supply through power_supply class'

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/Kconfig
drivers/usb/typec/fusb302/Kconfig
drivers/usb/typec/fusb302/fusb302.c
drivers/usb/typec/tcpm.c