summaryrefslogtreecommitdiffstats
path: root/sys/isa/pnp.c
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2000-07-11 11:49:33 +0000
committertanimura <tanimura@FreeBSD.org>2000-07-11 11:49:33 +0000
commit7716c5370ad4c724650bb6def35750d561bc11d2 (patch)
tree9a29f2cea6e8dc8339d0261df8deae0201372989 /sys/isa/pnp.c
parent6cecb051f3990a02c86edb2060aa93c44e6d49da (diff)
downloadFreeBSD-src-7716c5370ad4c724650bb6def35750d561bc11d2.zip
FreeBSD-src-7716c5370ad4c724650bb6def35750d561bc11d2.tar.gz
Finally merge newmidi.
(I had been busy for my own research activity until the last weekend) Supported devices: SB Midi Port (sbc + midi) SB OPL3 (sbc + midi) 16550 UART (midi, needs a trick in your hint) CS461x Midi Port (csa + midi) OSS-compatible sequencer (seq) Supported playing software: playmidi (We definitely need more) Notes: /dev/midistat now reports installed midi drivers. /dev/sndstat reports only pcm drivers. We need the new name(pcmstat?). EMU8000(SB AWE) does not sound yet but does get probed so that the OPL3 synth on an AWE card works. TODO: MSS/PCI bridge drivers Midi-tty interface to support general serial devices Modules
Diffstat (limited to 'sys/isa/pnp.c')
-rw-r--r--sys/isa/pnp.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/sys/isa/pnp.c b/sys/isa/pnp.c
index 12b5dab..f9266bb 100644
--- a/sys/isa/pnp.c
+++ b/sys/isa/pnp.c
@@ -54,6 +54,7 @@ struct pnp_quirk {
u_int32_t logical_id; /* ID of the device with quirk */
int type;
#define PNP_QUIRK_WRITE_REG 1 /* Need to write a pnp register */
+#define PNP_QUIRK_EXTRA_IO 2 /* Has extra io ports */
int arg1;
int arg2;
};
@@ -66,6 +67,24 @@ struct pnp_quirk pnp_quirks[] = {
*/
{ 0x0100561e /* GRV0001 */, 0,
PNP_QUIRK_WRITE_REG, 0xf2, 0xff },
+ /*
+ * An emu8000 does not give us other than the first
+ * port.
+ */
+ { 0x26008c0e /* SB16 */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x42008c0e /* SB32(CTL0042) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x44008c0e /* SB32(CTL0044) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x49008c0e /* SB32(CTL0049) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xf1008c0e /* SB32(CTL00f1) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xc1008c0e /* SB64(CTL00c1) */, 0x22008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xe4008c0e /* SB64(CTL00e4) */, 0x22008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
{ 0 }
};
@@ -363,8 +382,8 @@ pnp_set_config(void *arg, struct isa_config *config, int enable)
/*
* Process quirks for a logical device.. The card must be in Config state.
*/
-static void
-pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn)
+void
+pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn, struct isa_config *config)
{
struct pnp_quirk *qp;
@@ -377,6 +396,22 @@ pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn)
pnp_write(PNP_SET_LDN, ldn);
pnp_write(qp->arg1, qp->arg2);
break;
+ case PNP_QUIRK_EXTRA_IO:
+ if (config == NULL)
+ break;
+ if (qp->arg1 != 0) {
+ config->ic_nport++;
+ config->ic_port[config->ic_nport - 1] = config->ic_port[0];
+ config->ic_port[config->ic_nport - 1].ir_start += qp->arg1;
+ config->ic_port[config->ic_nport - 1].ir_end += qp->arg1;
+ }
+ if (qp->arg2 != 0) {
+ config->ic_nport++;
+ config->ic_port[config->ic_nport - 1] = config->ic_port[0];
+ config->ic_port[config->ic_nport - 1].ir_start += qp->arg2;
+ config->ic_port[config->ic_nport - 1].ir_end += qp->arg2;
+ }
+ break;
}
}
}
@@ -461,7 +496,8 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
*/
if (startres) {
pnp_parse_resources(dev, startres,
- resinfo - startres - 1);
+ resinfo - startres - 1,
+ p->vendor_id, logical_id, ldn);
dev = 0;
startres = 0;
}
@@ -471,7 +507,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
* resources.
*/
bcopy(resinfo, &logical_id, 4);
- pnp_check_quirks(p->vendor_id, logical_id, ldn);
+ pnp_check_quirks(p->vendor_id, logical_id, ldn, NULL);
compat_id = 0;
dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1);
if (desc)
@@ -502,7 +538,8 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
break;
}
pnp_parse_resources(dev, startres,
- resinfo - startres - 1);
+ resinfo - startres - 1,
+ p->vendor_id, logical_id, ldn);
dev = 0;
startres = 0;
scanning = 0;
OpenPOWER on IntegriCloud