linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [4/8] usb: typec: fusb302: Check vconn is off when we start toggling
@ 2019-02-22 14:12 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2019-02-22 14:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus
  Cc: Hans de Goede, linux-usb

The datasheet says the vconn MUST be off when we start toggling. The
tcpm.c state-machine is responsible to make sure vconn is off, but
lets add a WARN_ON check to catch any cases where vconn is not off
for some reason.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/typec/tcpm/fusb302.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c
index 4e75526b3874..f83e777aeabf 100644
--- a/drivers/usb/typec/tcpm/fusb302.c
+++ b/drivers/usb/typec/tcpm/fusb302.c
@@ -607,6 +607,8 @@ static int fusb302_set_toggling(struct fusb302_chip *chip,
 			return ret;
 		chip->intr_togdone = false;
 	} else {
+		/* Datasheet says vconn MUST be off when toggling */
+		WARN_ON(chip->vconn_on);
 		/* unmask TOGDONE interrupt */
 		ret = fusb302_i2c_clear_bits(chip, FUSB_REG_MASKA,
 					     FUSB_REG_MASKA_TOGDONE);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-22 14:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22 14:12 [4/8] usb: typec: fusb302: Check vconn is off when we start toggling Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).