usb: typec: tcpci: Add support to report vSafe0V
authorBadhri Jagan Sridharan <badhri@google.com>
Wed, 2 Dec 2020 04:08:39 +0000 (20:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 13:49:54 +0000 (14:49 +0100)
commit766c485b86ef52765926b69a1145cadcf2db1e7d
tree941c45885b08152e39bc78a8efb1e652fa86cea2
parent28b43d3d746b89fc112fe681e018b39b43495dad
usb: typec: tcpci: Add support to report vSafe0V

This change adds vbus_vsafe0v which when set, makes TCPM
query for VSAFE0V by assigning the tcpc.is_vbus_vsafe0v callback.
Also enables ALERT.ExtendedStatus which is triggered when
status of EXTENDED_STATUS.vSafe0V changes.
EXTENDED_STATUS.vSafe0V is set when vbus is at vSafe0V and
cleared otherwise.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20201202040840.663578-2-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci.c
drivers/usb/typec/tcpm/tcpci.h