summaryrefslogtreecommitdiff
path: root/drivers/usb/typec/tcpm/tcpci.h
diff options
context:
space:
mode:
authorBadhri Jagan Sridharan <badhri@google.com>2020-12-01 20:08:39 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-09 14:49:54 +0100
commit766c485b86ef52765926b69a1145cadcf2db1e7d (patch)
tree941c45885b08152e39bc78a8efb1e652fa86cea2 /drivers/usb/typec/tcpm/tcpci.h
parent28b43d3d746b89fc112fe681e018b39b43495dad (diff)
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>
Diffstat (limited to 'drivers/usb/typec/tcpm/tcpci.h')
-rw-r--r--drivers/usb/typec/tcpm/tcpci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm/tcpci.h b/drivers/usb/typec/tcpm/tcpci.h
index 3fe313655f0c..116a69c85e38 100644
--- a/drivers/usb/typec/tcpm/tcpci.h
+++ b/drivers/usb/typec/tcpm/tcpci.h
@@ -49,6 +49,9 @@
#define TCPC_TCPC_CTRL_ORIENTATION BIT(0)
#define TCPC_TCPC_CTRL_BIST_TM BIT(1)
+#define TCPC_EXTENDED_STATUS 0x20
+#define TCPC_EXTENDED_STATUS_VSAFE0V BIT(0)
+
#define TCPC_ROLE_CTRL 0x1a
#define TCPC_ROLE_CTRL_DRP BIT(6)
#define TCPC_ROLE_CTRL_RP_VAL_SHIFT 4
@@ -155,11 +158,14 @@ struct tcpci;
* is sourcing vbus.
* @auto_discharge_disconnect:
* Optional; Enables TCPC to autonously discharge vbus on disconnect.
+ * @vbus_vsafe0v:
+ * optional; Set when TCPC can detect whether vbus is at VSAFE0V.
*/
struct tcpci_data {
struct regmap *regmap;
unsigned char TX_BUF_BYTE_x_hidden:1;
unsigned char auto_discharge_disconnect:1;
+ unsigned char vbus_vsafe0v:1;
int (*init)(struct tcpci *tcpci, struct tcpci_data *data);
int (*set_vconn)(struct tcpci *tcpci, struct tcpci_data *data,