Lines Matching +full:func +full:- +full:uart +full:- +full:b
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2015-2018 Tai-hwa Liang <avatar@FreeBSD.org>
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);
135 csamidi_mwrite(struct mpu401 *arg __unused, void *cookie, int reg, unsigned char b)
142 switch (b)
155 /* switch to UART mode, no-op */
162 csamidi_writeio(scp, BA0_MIDWP, b);
175 mtx_lock(&scp->mtx);
176 scp->mpu_intr = NULL;
177 mtx_unlock(&scp->mtx);
185 struct sndcard_func *func;
189 func = device_get_ivars(dev);
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",
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);