summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-07-11 23:41:59 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-07-11 23:41:59 +0000
commit76b6c4fc778662cc8c8a42581530b37be7932edd (patch)
tree484ca6910f1435769b1625afafad25ab04251d09 /sys/dev
parent35af0a1c6e3fca9719d837c9ff0b9c9526fc738f (diff)
Enable IR receive mode only for infrared capable PXA2x0 UARTs. Normal
reception is blocked while the IR receiver or transmitter is enabled. Also enable the PXA2x0 UART before clearing the FIFO (suggested by drahn@ some time ago), and disable the UART in compwroff(). ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/com.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 238fd92627e..dd167ed9634 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.101 2005/07/02 15:39:04 uwe Exp $ */
+/* $OpenBSD: com.c,v 1.102 2005/07/11 23:41:58 uwe Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -578,6 +578,9 @@ comopen(dev, flag, mode, p)
case COM_UART_TI16750:
bus_space_write_1(iot, ioh, com_ier, 0);
break;
+ case COM_UART_PXA2X0:
+ bus_space_write_1(iot, ioh, com_ier, IER_EUART);
+ break;
}
if (ISSET(sc->sc_hwflags, COM_HW_FIFO)) {
@@ -781,13 +784,16 @@ compwroff(sc)
case COM_UART_TI16750:
bus_space_write_1(iot, ioh, com_ier, IER_SLEEP);
break;
- }
-
-#if defined(COM_PXA2X0) && defined(__zaurus__)
- if (sc->sc_uarttype == COM_UART_PXA2X0 &&
- ISSET(sc->sc_hwflags, COM_HW_SIR))
- scoop_set_irled(0);
+#ifdef COM_PXA2X0
+ case COM_UART_PXA2X0:
+ bus_space_write_1(iot, ioh, com_ier, 0);
+#ifdef __zaurus__
+ if (ISSET(sc->sc_hwflags, COM_HW_SIR))
+ scoop_set_irled(0);
#endif
+ break;
+#endif
+ }
}
void
@@ -1444,6 +1450,7 @@ comintr(arg)
#ifdef COM_PXA2X0
if (sc->sc_uarttype == COM_UART_PXA2X0 &&
+ ISSET(sc->sc_hwflags, COM_HW_SIR) &&
ISSET(lsr, LSR_TXRDY) && ISSET(lsr, LSR_TSRE))
bus_space_write_1(iot, ioh, com_isr, ISR_RECV);
#endif