Skip to content

Commit 5fdbe13

Browse files
11matt556gregkh
authored andcommitted
serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X
Sealevel XR17V35X based devices are inoperable on kernel versions 4.11 and above due to a change in the GPIO preconfiguration introduced in commit 7dea816. This patch fixes this by preconfiguring the GPIO on Sealevel cards to the value (0x00) used prior to commit 7dea816 With GPIOs preconfigured as per commit 7dea816 all ports on Sealevel XR17V35X based devices become stuck in high impedance mode, regardless of dip-switch or software configuration. This causes the device to become effectively unusable. This patch (in various forms) has been distributed to our customers and no issues related to it have been reported. Fixes: 7dea816 ("serial: exar: Preconfigure xr17v35x MPIOs as output") Signed-off-by: Matthew Howell <matthew.howell@sealevel.com> Link: https://lore.kernel.org/r/alpine.DEB.2.21.2007221605270.13247@tstest-VirtualBox Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 033724d commit 5fdbe13

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/tty/serial/8250/8250_exar.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,17 @@ static void setup_gpio(struct pci_dev *pcidev, u8 __iomem *p)
326326
* devices will export them as GPIOs, so we pre-configure them safely
327327
* as inputs.
328328
*/
329-
u8 dir = pcidev->vendor == PCI_VENDOR_ID_EXAR ? 0xff : 0x00;
329+
330+
u8 dir = 0x00;
331+
332+
if ((pcidev->vendor == PCI_VENDOR_ID_EXAR) &&
333+
(pcidev->subsystem_vendor != PCI_VENDOR_ID_SEALEVEL)) {
334+
// Configure GPIO as inputs for Commtech adapters
335+
dir = 0xff;
336+
} else {
337+
// Configure GPIO as outputs for SeaLevel adapters
338+
dir = 0x00;
339+
}
330340

331341
writeb(0x00, p + UART_EXAR_MPIOINT_7_0);
332342
writeb(0x00, p + UART_EXAR_MPIOLVL_7_0);

0 commit comments

Comments
 (0)