csapcm.c (55321) | csapcm.c (56249) |
---|---|
1/* 2 * Copyright (c) 1999 Seigo Tanimura 3 * All rights reserved. 4 * 5 * Portions of this source are based on cwcealdr.cpp and dhwiface.cpp in 6 * cwcealdr1.zip, the sample sources by Crystal Semiconductor. 7 * Copyright (c) 1996-1998 Crystal Semiconductor Corp. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * | 1/* 2 * Copyright (c) 1999 Seigo Tanimura 3 * All rights reserved. 4 * 5 * Portions of this source are based on cwcealdr.cpp and dhwiface.cpp in 6 * cwcealdr1.zip, the sample sources by Crystal Semiconductor. 7 * Copyright (c) 1996-1998 Crystal Semiconductor Corp. 8 * --- 13 unchanged lines hidden (view full) --- 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * |
30 * $FreeBSD: head/sys/dev/sound/pci/csapcm.c 55321 2000-01-03 05:26:12Z tanimura $ | 30 * $FreeBSD: head/sys/dev/sound/pci/csapcm.c 56249 2000-01-18 17:13:43Z cg $ |
31 */ 32 33#include <sys/soundcard.h> 34#include <dev/sound/pcm/sound.h> 35#include <dev/sound/pcm/ac97.h> 36#include <dev/sound/chip.h> 37#include <dev/sound/pci/csareg.h> 38#include <dev/sound/pci/csavar.h> --- 282 unchanged lines hidden (view full) --- 321 ulCorrectionPerGOF = ulTemp1 / GOF_PER_SEC; 322 ulTemp1 -= ulCorrectionPerGOF * GOF_PER_SEC; 323 ulCorrectionPerSec = ulTemp1; 324 ulInitialDelay = ((ulInRate * 24) + ulOutRate - 1) / ulOutRate; 325 326 /* 327 * Fill in the VariDecimate control block. 328 */ | 31 */ 32 33#include <sys/soundcard.h> 34#include <dev/sound/pcm/sound.h> 35#include <dev/sound/pcm/ac97.h> 36#include <dev/sound/chip.h> 37#include <dev/sound/pci/csareg.h> 38#include <dev/sound/pci/csavar.h> --- 282 unchanged lines hidden (view full) --- 321 ulCorrectionPerGOF = ulTemp1 / GOF_PER_SEC; 322 ulTemp1 -= ulCorrectionPerGOF * GOF_PER_SEC; 323 ulCorrectionPerSec = ulTemp1; 324 ulInitialDelay = ((ulInRate * 24) + ulOutRate - 1) / ulOutRate; 325 326 /* 327 * Fill in the VariDecimate control block. 328 */ |
329 csa_writemem(resp, BA1_CSRC, | 329 csa_writemem(resp, BA1_CSRC, |
330 ((ulCorrectionPerSec << 16) & 0xFFFF0000) | (ulCorrectionPerGOF & 0xFFFF)); 331 csa_writemem(resp, BA1_CCI, ulCoeffIncr); | 330 ((ulCorrectionPerSec << 16) & 0xFFFF0000) | (ulCorrectionPerGOF & 0xFFFF)); 331 csa_writemem(resp, BA1_CCI, ulCoeffIncr); |
332 csa_writemem(resp, BA1_CD, | 332 csa_writemem(resp, BA1_CD, |
333 (((BA1_VARIDEC_BUF_1 + (ulInitialDelay << 2)) << 16) & 0xFFFF0000) | 0x80); 334 csa_writemem(resp, BA1_CPI, ulPhiIncr); 335 336 /* 337 * Figure out the frame group length for the write back task. Basically, 338 * this is just the factors of 24000 (2^6*3*5^3) that are not present in 339 * the output sample rate. 340 */ --- 442 unchanged lines hidden (view full) --- 783 csa_releaseres(csa, dev); 784 return (ENXIO); 785 } 786 787 if (csa_init(csa)) { 788 csa_releaseres(csa, dev); 789 return (ENXIO); 790 } | 333 (((BA1_VARIDEC_BUF_1 + (ulInitialDelay << 2)) << 16) & 0xFFFF0000) | 0x80); 334 csa_writemem(resp, BA1_CPI, ulPhiIncr); 335 336 /* 337 * Figure out the frame group length for the write back task. Basically, 338 * this is just the factors of 24000 (2^6*3*5^3) that are not present in 339 * the output sample rate. 340 */ --- 442 unchanged lines hidden (view full) --- 783 csa_releaseres(csa, dev); 784 return (ENXIO); 785 } 786 787 if (csa_init(csa)) { 788 csa_releaseres(csa, dev); 789 return (ENXIO); 790 } |
791 codec = ac97_create(csa, csa_rdcd, csa_wrcd); | 791 codec = ac97_create(dev, csa, csa_rdcd, csa_wrcd); |
792 if (codec == NULL) 793 return (ENXIO); 794 mixer_init(devinfo, &ac97_mixer, codec); 795 796 snprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq)); 797 798 /* Enable interrupt. */ 799 if (bus_setup_intr(dev, resp->irq, INTR_TYPE_TTY, csa_intr, csa, &csa->ih)) { --- 56 unchanged lines hidden --- | 792 if (codec == NULL) 793 return (ENXIO); 794 mixer_init(devinfo, &ac97_mixer, codec); 795 796 snprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq)); 797 798 /* Enable interrupt. */ 799 if (bus_setup_intr(dev, resp->irq, INTR_TYPE_TTY, csa_intr, csa, &csa->ih)) { --- 56 unchanged lines hidden --- |