lkml.org 
[lkml]   [2019]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/1] usb: typec: tcpci: Clear the fault status register
Date
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.

Fixes: fault status register stuck
Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
---
drivers/usb/typec/tcpm/tcpci.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index c1f7073a56de..a5746657b190 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -463,6 +463,17 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
else if (status & TCPC_ALERT_TX_FAILED)
tcpm_pd_transmit_complete(tcpci->port, TCPC_TX_FAILED);

+ if (status & TCPC_ALERT_FAULT) {
+ u16 fault_status;
+
+ tcpci_read16(tcpci, TCPC_FAULT_STATUS, &fault_status);
+
+ dev_warn(tcpci->dev, "FAULT ALERT status 0x%x\n", 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
\
 
 \ /
  Last update: 2019-05-08 02:30    [W:0.070 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site