Deleted Added
full compact
sb8.c (53465) sb8.c (53553)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * Copyright 1997,1998 Luigi Rizzo.
4 *
5 * Derived from files in the Voxware 3.5 distribution,
6 * Copyright by Hannu Savolainen 1994, under the same copyright
7 * conditions.
8 * All rights reserved.

--- 14 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * Copyright 1997,1998 Luigi Rizzo.
4 *
5 * Derived from files in the Voxware 3.5 distribution,
6 * Copyright by Hannu Savolainen 1994, under the same copyright
7 * conditions.
8 * All rights reserved.

--- 14 unchanged lines hidden (view full) ---

23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * $FreeBSD: head/sys/dev/sound/isa/sb8.c 53465 1999-11-20 16:50:33Z cg $
31 * $FreeBSD: head/sys/dev/sound/isa/sb8.c 53553 1999-11-22 06:07:49Z tanimura $
32 */
33
34#include <dev/sound/pcm/sound.h>
35#if NPCM > 0
36
32 */
33
34#include <dev/sound/pcm/sound.h>
35#if NPCM > 0
36
37#include "sbc.h"
38
37#define __SB_MIXER_C__ /* XXX warning... */
38#include <dev/sound/isa/sb.h>
39#define __SB_MIXER_C__ /* XXX warning... */
40#include <dev/sound/isa/sb.h>
41#include <dev/sound/chip.h>
39
40/* channel interface */
41static void *sbchan_init(void *devinfo, snd_dbuf *b, pcm_channel *c, int dir);
42static int sbchan_setdir(void *data, int dir);
43static int sbchan_setformat(void *data, u_int32_t format);
44static int sbchan_setspeed(void *data, u_int32_t speed);
45static int sbchan_setblocksize(void *data, u_int32_t blocksize);
46static int sbchan_trigger(void *data, int go);

--- 1206 unchanged lines hidden (view full) ---

1253#if NPNP > 0
1254static int
1255sbpnp_probe(device_t dev)
1256{
1257 char *s = NULL;
1258 u_int32_t logical_id = isa_get_logicalid(dev);
1259
1260 switch(logical_id) {
42
43/* channel interface */
44static void *sbchan_init(void *devinfo, snd_dbuf *b, pcm_channel *c, int dir);
45static int sbchan_setdir(void *data, int dir);
46static int sbchan_setformat(void *data, u_int32_t format);
47static int sbchan_setspeed(void *data, u_int32_t speed);
48static int sbchan_setblocksize(void *data, u_int32_t blocksize);
49static int sbchan_trigger(void *data, int go);

--- 1206 unchanged lines hidden (view full) ---

1256#if NPNP > 0
1257static int
1258sbpnp_probe(device_t dev)
1259{
1260 char *s = NULL;
1261 u_int32_t logical_id = isa_get_logicalid(dev);
1262
1263 switch(logical_id) {
1261 case 0x43008c0e: /* CTL0043 */
1262 case 0x01008c0e: /* CTL0001 */
1263 s = "Vibra16X";
1264 break;
1265
1266 case 0x31008c0e: /* CTL0031 */
1267 case 0x41008c0e: /* CTL0041 */
1268 case 0x42008c0e: /* CTL0042 */
1269 s = "SB16 PnP";
1270 break;
1271
1272 case 0x44008c0e: /* CTL0044 */
1273 s = "Creative SB AWE64 Gold";
1274 break;
1275
1276 case 0x45008c0e: /* CTL0045 */
1277 s = "Creative AWE64 PnP";
1278 break;
1279
1280 case 0x01100000: /* @@@1001 */
1281 s = "Avance Asound 110";
1282 break;
1283
1284 case 0x01200000: /* @@@2001 */
1285 s = "Avance Logic ALS120";
1286 break;
1287

--- 6 unchanged lines hidden (view full) ---

1294 break;
1295
1296 case 0x88187316: /* ESS1888 */
1297 s = "ESS1888";
1298 break;
1299 }
1300 if (s) {
1301 device_set_desc(dev, s);
1264 case 0x01100000: /* @@@1001 */
1265 s = "Avance Asound 110";
1266 break;
1267
1268 case 0x01200000: /* @@@2001 */
1269 s = "Avance Logic ALS120";
1270 break;
1271

--- 6 unchanged lines hidden (view full) ---

1278 break;
1279
1280 case 0x88187316: /* ESS1888 */
1281 s = "ESS1888";
1282 break;
1283 }
1284 if (s) {
1285 device_set_desc(dev, s);
1302 return 0;
1286 return (0);
1303 }
1304 return ENXIO;
1305}
1306
1307static int
1308sbpnp_attach(device_t dev)
1309{
1310 struct sb_info *sb;

--- 26 unchanged lines hidden (view full) ---

1337 sbpnp_methods,
1338 sizeof(snddev_info),
1339};
1340
1341DRIVER_MODULE(sbpnp, isa, sbpnp_driver, pcm_devclass, 0, 0);
1342
1343#endif /* NPNP > 0 */
1344
1287 }
1288 return ENXIO;
1289}
1290
1291static int
1292sbpnp_attach(device_t dev)
1293{
1294 struct sb_info *sb;

--- 26 unchanged lines hidden (view full) ---

1321 sbpnp_methods,
1322 sizeof(snddev_info),
1323};
1324
1325DRIVER_MODULE(sbpnp, isa, sbpnp_driver, pcm_devclass, 0, 0);
1326
1327#endif /* NPNP > 0 */
1328
1329#if NSBC > 0
1330#define DESCSTR " PCM Audio"
1331static int
1332sbsbc_probe(device_t dev)
1333{
1334 char *s = NULL;
1335 struct sndcard_func *func;
1336
1337 /* The parent device has already been probed. */
1338
1339 func = device_get_ivars(dev);
1340 if (func == NULL || func->func != SCF_PCM)
1341 return (ENXIO);
1342
1343 s = "SB PCM Audio";
1344
1345 device_set_desc(dev, s);
1346 return 0;
1347}
1348
1349static int
1350sbsbc_attach(device_t dev)
1351{
1352 struct sb_info *sb;
1353 u_int32_t vend_id;
1354 device_t sbc;
1355
1356 sbc = device_get_parent(dev);
1357 vend_id = isa_get_vendorid(sbc);
1358 sb = (struct sb_info *)malloc(sizeof *sb, M_DEVBUF, M_NOWAIT);
1359 if (!sb) return ENXIO;
1360 bzero(sb, sizeof *sb);
1361
1362 switch(vend_id) {
1363 case 0xf0008c0e:
1364 case 0x10019305:
1365 case 0x20019305:
1366 /* XXX add here the vend_id for other vibra16X cards... */
1367 sb->bd_flags = BD_F_SB16X;
1368 }
1369 return sb_doattach(dev, sb);
1370}
1371
1372static device_method_t sbsbc_methods[] = {
1373 /* Device interface */
1374 DEVMETHOD(device_probe, sbsbc_probe),
1375 DEVMETHOD(device_attach, sbsbc_attach),
1376
1377 { 0, 0 }
1378};
1379
1380static driver_t sbsbc_driver = {
1381 "pcm",
1382 sbsbc_methods,
1383 sizeof(snddev_info),
1384};
1385
1386DRIVER_MODULE(sbsbc, sbc, sbsbc_driver, pcm_devclass, 0, 0);
1387
1388#endif /* NSBC > 0 */
1389
1345#endif /* NPCM > 0 */
1346
1347
1390#endif /* NPCM > 0 */
1391
1392