Message ID | 20201211071145.2199997-1-badhri@google.com |
---|---|
State | New |
Headers | show |
Series | usb: typec: tcpci: Enable bleed discharge when auto discharge is enabled | expand |
On Thu, Dec 10, 2020 at 11:11:45PM -0800, Badhri Jagan Sridharan wrote: > Auto discharge circuits kick in only when vbus decays and reaches > VBUS_SINK_DISCONNECT_THRESHOLD threshold. Enable bleed discharge to > discharge vbus to VBUS_SINK_DISCONNECT_THRESHOLD upon disconnect. > > Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> > --- > drivers/usb/typec/tcpm/tcpci.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c > index af5524338a63..f676abab044b 100644 > --- a/drivers/usb/typec/tcpm/tcpci.c > +++ b/drivers/usb/typec/tcpm/tcpci.c > @@ -725,6 +725,8 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data) > tcpci->tcpc.enable_auto_vbus_discharge = tcpci_enable_auto_vbus_discharge; > tcpci->tcpc.set_auto_vbus_discharge_threshold = > tcpci_set_auto_vbus_discharge_threshold; > + regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_BLEED_DISCHARGE, > + TCPC_POWER_CTRL_BLEED_DISCHARGE); > } > > if (tcpci->data->vbus_vsafe0v) > -- > 2.29.2.576.ga3fc446d84-goog
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index af5524338a63..f676abab044b 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -725,6 +725,8 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data) tcpci->tcpc.enable_auto_vbus_discharge = tcpci_enable_auto_vbus_discharge; tcpci->tcpc.set_auto_vbus_discharge_threshold = tcpci_set_auto_vbus_discharge_threshold; + regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_BLEED_DISCHARGE, + TCPC_POWER_CTRL_BLEED_DISCHARGE); } if (tcpci->data->vbus_vsafe0v)
Auto discharge circuits kick in only when vbus decays and reaches VBUS_SINK_DISCONNECT_THRESHOLD threshold. Enable bleed discharge to discharge vbus to VBUS_SINK_DISCONNECT_THRESHOLD upon disconnect. Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> --- drivers/usb/typec/tcpm/tcpci.c | 2 ++ 1 file changed, 2 insertions(+)