--- Makefile.orig 2002-08-11 01:30:45.000000000 +0000 +++ Makefile 2008-01-21 10:57:28.000000000 +0000 @@ -1,8 +1,8 @@ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_ns_geode -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += ns_geode.c -KMODDEPS = snd_pcm +.PATH: ${.CURDIR}/../../../../dev/sound/pci +KMOD = snd_ns_geode +SRCS = device_if.h bus_if.h isa_if.h pci_if.h +SRCS += ns_geode.c +MODULE_DEPENDS = sound +MODULE_VERSION = 1.0 .include --- ns_geode.c.orig 2002-08-11 01:30:18.000000000 +0000 +++ ns_geode.c 2008-01-21 10:57:23.000000000 +0000 @@ -246,17 +246,17 @@ #include -#include -#include +#include +#include /*---- @@ Debug enables. ---------------------------------------------------*/ -#define GEODE_DEBUG 0 /* Compile dump routines (for DDB calls). */ -#define GEODE_DEBUG_INIT 0 /* Call dump routines during init. */ +#define GEODE_DEBUG 1 /* Compile dump routines (for DDB calls). */ +#define GEODE_DEBUG_INIT 1 /* Call dump routines during init. */ #define F3BAR_TRACE 0 #define DMA_TRACE 0 #define AC97_TRACE 0 -#define OP_TRACE 0 +#define OP_TRACE 1 #define CRASH_ON_ATTACH 0 /* Trap to DDB on initial driver attach.*/ @@ -949,9 +949,11 @@ b2 = codec_direct_reg_read( LM4549_VENDOR_ID1 ); if( NSC_ID1 != b2 ) fail++; +printf("ID1: %04x\n", b2); b2 = codec_direct_reg_read( LM4549_VENDOR_ID2 ); if( NSC_ID2 != b2 ) fail++; +printf("ID2: %04x\n", b2); if( fail ) return( 0 ); @@ -1247,6 +1249,7 @@ /* Allocate a data buffer for DMA using associated DMA tag.*/ if ( sndbuf_alloc( ch->ch_snd_dbuf, /* For this control buffer*/ sc->sc_parent_dmat, /* using this TAG (mem rqmts).*/ + 0 , /* DMA flags */ sc->sc_buf_size ) == -1) /* Allocate this size buffer.*/ return( NULL ); @@ -1744,15 +1747,20 @@ static int geode_pci_probe( device_t dev ) { + unsigned devid = pci_get_devid( dev ); + unsigned classid = pci_get_class( dev ); #if OP_TRACE - printf( "\n\n**** geode Probe!\n\n" ); + printf( "\n\n**** geode Probe devid %08x classid %08x!\n\n", devid, classid ); #endif - switch( pci_get_devid( dev ) ) { + switch( devid ) { case 0x1031078: device_set_desc( dev, "NatSemi CS5530A (Geode)" ); return( 0 ); /* Yes, give it to us!*/ - + case 0x20931022: + device_set_desc( dev, "CS5536 Audio Controller" ); + return( 0 ); /* Yes, give it to us!*/ + default: return( ENXIO ); } @@ -1884,12 +1892,13 @@ * F3 Audio function uses memory-mapped registers. */ - sc->sc_regid = PCIR_MAPS; + sc->sc_regid = PCIR_BAR(0); sc->sc_regtype = SYS_RES_MEMORY; /* Not SYS_RES_IOPORT, enable access to mem in dev.*/ + device_printf( dev, "calling bus_alloc_resource\n" ); sc->sc_reg = bus_alloc_resource( dev, sc->sc_regtype, &sc->sc_regid, 0, ~0, 1, /* start, end, count.*/ - RF_ACTIVE ); /* Activate rsrc w/o rman call.*/ + RF_ACTIVE); /* Activate rsrc w/o rman call.*/ if (!sc->sc_reg ) { device_printf( dev, "unable to map BAR reg\n" ); goto bad; @@ -1973,6 +1982,7 @@ sc->sc_buf_size, /* Maxsize in single alloc.*/ 1, 0x0000FFFF, /* Num scat/gath segs, Max such seg size.*/ 0, /* flags*/ + NULL, NULL, &sc->sc_parent_dmat ) /* Returned TAG for DMA mem ops.*/ != 0 ) { @@ -2231,7 +2241,7 @@ * child of the "pci" driver (bus), with driver_t "geode_driver". */ DRIVER_MODULE( snd_geode, pci, geode_driver, pcm_devclass, 0, 0 ); -MODULE_DEPEND( snd_geode, snd_pcm, PCM_MINVER, PCM_PREFVER, PCM_MAXVER ); +MODULE_DEPEND( snd_geode, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER ); MODULE_VERSION( snd_geode, 1 );