Sleep a little when closing the midi device to allow the UART to drain.

This commit is contained in:
augustss 2001-01-27 18:37:01 +00:00
parent 3c532ca5ef
commit d13e6a84f2
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4280.c,v 1.12 2001/01/18 20:28:15 jdolecek Exp $ */
/* $NetBSD: cs4280.c,v 1.13 2001/01/27 18:37:01 augustss Exp $ */
/*
* Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved.
@ -65,6 +65,7 @@ int cs4280debug = 0;
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/systm.h>
@ -1886,6 +1887,7 @@ cs4280_midi_close(addr)
u_int32_t mem;
DPRINTF(("midi_close\n"));
tsleep(sc, PWAIT, "cs0clm", hz/10); /* give uart a chance to drain */
mem = BA0READ4(sc, CS4280_MIDCR);
mem &= ~MIDCR_MASK;
BA0WRITE4(sc, CS4280_MIDCR, mem);

View File

@ -1,4 +1,4 @@
/* $NetBSD: eap.c,v 1.42 2000/12/28 22:59:12 sommerfeld Exp $ */
/* $NetBSD: eap.c,v 1.43 2001/01/27 18:37:01 augustss Exp $ */
/* $OpenBSD: eap.c,v 1.6 1999/10/05 19:24:42 csapuntz Exp $ */
/*
@ -1770,6 +1770,7 @@ eap_midi_close(addr)
{
struct eap_softc *sc = addr;
tsleep(sc, PWAIT, "eapclm", hz/10); /* give uart a chance to drain */
EWRITE1(sc, EAP_UART_CONTROL, 0);
EWRITE4(sc, EAP_ICSC, EREAD4(sc, EAP_ICSC) & ~EAP_UART_EN);