Lines Matching +full:reset +full:- +full:n +full:- +full:io
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2015-2018 Tai-hwa Liang <avatar@FreeBSD.org>
70 int io_rid; /* io rid */
71 struct resource *io; /* io */
86 return bus_space_read_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset) & 0xffffffff;
95 bus_space_write_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset, data);
103 if (scp->mpu_intr)
104 (scp->mpu_intr)(scp->mpu);
128 printf("csamidi_mread: unknown register %d\n", reg);
147 /* reset the MIDI port */
155 /* switch to UART mode, no-op */
165 printf("csamidi_mwrite: unknown register %d\n", reg);
175 mtx_lock(&scp->mtx);
176 scp->mpu_intr = NULL;
177 mtx_unlock(&scp->mtx);
190 if (func == NULL || func->func != SCF_MIDI)
206 scp->dev = dev;
209 scp->io_rid = PCIR_BAR(0);
210 scp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
211 &scp->io_rid, RF_ACTIVE);
212 if (scp->io == NULL)
216 scp->mpu = mpu401_init(&csamidi_mpu_class, scp, csamidi_midi_intr,
217 &scp->mpu_intr);
218 if (scp->mpu == NULL) {
223 mtx_init(&scp->mtx, device_get_nameunit(dev), "csamidi softc",
226 /* reset the MIDI port */
234 bus_release_resource(dev, SYS_RES_MEMORY, scp->io_rid, scp->io);
235 scp->io = NULL;
247 rc = mpu401_uninit(scp->mpu);
250 if (scp->io != NULL) {
251 bus_release_resource(dev, SYS_RES_MEMORY, scp->io_rid,
252 scp->io);
253 scp->io = NULL;
255 mtx_destroy(&scp->mtx);