[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190506140830.25376-4-angus@akkea.ca>
Date: Mon, 6 May 2019 08:08:30 -0600
From: "Angus Ainslie (Purism)" <angus@...ea.ca>
To: angus.ainslie@...i.sm
Cc: Guenter Roeck <linux@...ck-us.net>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
"Angus Ainslie (Purism)" <angus@...ea.ca>
Subject: [PATCH 3/3] usb: typec: tcpm: Clear the fault status register
If the fault status register doesn't get cleared then
the ptn5110 interrupt gets stuck on. As the fault register gets
set everytime the ptn5110 powers on the interrupt is always stuck.
Signed-off-by: Angus Ainslie (Purism) <angus@...ea.ca>
---
drivers/usb/typec/tcpm/tcpci.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index c6e0e48b9a2a..17a0ffe818c0 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -507,6 +507,18 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
tcpm_log(tcpci->port, "Invalid VBUS voltage %d", ret);
}
+ if (status & TCPC_ALERT_FAULT) {
+ u16 fault_status;
+
+ tcpci_read16(tcpci, TCPC_FAULT_STATUS, &fault_status);
+
+ tcpm_log(tcpci->port, "FAULT ALERT status 0x%x",
+ fault_status);
+
+ /* clear the fault status */
+ tcpci_write16(tcpci, TCPC_FAULT_STATUS, fault_status);
+ }
+
return IRQ_HANDLED;
}
EXPORT_SYMBOL_GPL(tcpci_irq);
--
2.17.1
Powered by blists - more mailing lists