aureal.c (193640) | aureal.c (254263) |
---|---|
1/*- 2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 31#include <dev/sound/pcm/sound.h> 32#include <dev/sound/pcm/ac97.h> 33#include <dev/sound/pci/aureal.h> 34 35#include <dev/pci/pcireg.h> 36#include <dev/pci/pcivar.h> 37 | 1/*- 2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 31#include <dev/sound/pcm/sound.h> 32#include <dev/sound/pcm/ac97.h> 33#include <dev/sound/pci/aureal.h> 34 35#include <dev/pci/pcireg.h> 36#include <dev/pci/pcivar.h> 37 |
38SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/aureal.c 193640 2009-06-07 19:12:08Z ariff $"); | 38SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/aureal.c 254263 2013-08-12 23:30:01Z scottl $"); |
39 40/* PCI IDs of supported chips */ 41#define AU8820_PCI_ID 0x000112eb 42 43/* channel interface */ 44static u_int32_t au_playfmt[] = { 45 SND_FORMAT(AFMT_U8, 1, 0), 46 SND_FORMAT(AFMT_U8, 2, 0), --- 498 unchanged lines hidden (view full) --- 545 } 546 547 return ENXIO; 548} 549 550static int 551au_pci_attach(device_t dev) 552{ | 39 40/* PCI IDs of supported chips */ 41#define AU8820_PCI_ID 0x000112eb 42 43/* channel interface */ 44static u_int32_t au_playfmt[] = { 45 SND_FORMAT(AFMT_U8, 1, 0), 46 SND_FORMAT(AFMT_U8, 2, 0), --- 498 unchanged lines hidden (view full) --- 545 } 546 547 return ENXIO; 548} 549 550static int 551au_pci_attach(device_t dev) 552{ |
553 u_int32_t data; | |
554 struct au_info *au; 555 int type[10]; 556 int regid[10]; 557 struct resource *reg[10]; 558 int i, j, mapped = 0; 559 int irqid; 560 struct resource *irq = 0; 561 void *ih = 0; 562 struct ac97_info *codec; 563 char status[SND_STATUSLEN]; 564 565 au = malloc(sizeof(*au), M_DEVBUF, M_WAITOK | M_ZERO); 566 au->unit = device_get_unit(dev); 567 | 553 struct au_info *au; 554 int type[10]; 555 int regid[10]; 556 struct resource *reg[10]; 557 int i, j, mapped = 0; 558 int irqid; 559 struct resource *irq = 0; 560 void *ih = 0; 561 struct ac97_info *codec; 562 char status[SND_STATUSLEN]; 563 564 au = malloc(sizeof(*au), M_DEVBUF, M_WAITOK | M_ZERO); 565 au->unit = device_get_unit(dev); 566 |
568 data = pci_read_config(dev, PCIR_COMMAND, 2); 569 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); 570 pci_write_config(dev, PCIR_COMMAND, data, 2); 571 data = pci_read_config(dev, PCIR_COMMAND, 2); | 567 pci_enable_busmaster(dev); |
572 573 j=0; 574 /* XXX dfr: is this strictly necessary? */ 575 for (i=0; i<PCI_MAXMAPS_0; i++) { 576#if 0 577 /* Slapped wrist: config_id and map are private structures */ 578 if (bootverbose) { 579 printf("pcm%d: map %d - allocating ", unit, i+1); --- 109 unchanged lines hidden --- | 568 569 j=0; 570 /* XXX dfr: is this strictly necessary? */ 571 for (i=0; i<PCI_MAXMAPS_0; i++) { 572#if 0 573 /* Slapped wrist: config_id and map are private structures */ 574 if (bootverbose) { 575 printf("pcm%d: map %d - allocating ", unit, i+1); --- 109 unchanged lines hidden --- |