ad1816.c (170873) | ad1816.c (172568) |
---|---|
1/*- 2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> 3 * Copyright (c) 1997,1998 Luigi Rizzo 4 * Copyright (c) 1994,1995 Hannu Savolainen 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 29#include <dev/sound/pcm/sound.h> 30#include <dev/sound/isa/ad1816.h> 31 32#include <isa/isavar.h> 33 34#include "mixer_if.h" 35 | 1/*- 2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org> 3 * Copyright (c) 1997,1998 Luigi Rizzo 4 * Copyright (c) 1994,1995 Hannu Savolainen 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 29#include <dev/sound/pcm/sound.h> 30#include <dev/sound/isa/ad1816.h> 31 32#include <isa/isavar.h> 33 34#include "mixer_if.h" 35 |
36SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/isa/ad1816.c 170873 2007-06-17 06:10:43Z ariff $"); | 36SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/isa/ad1816.c 172568 2007-10-12 06:03:46Z kevlo $"); |
37 38struct ad1816_info; 39 40struct ad1816_chinfo { 41 struct ad1816_info *parent; 42 struct pcm_channel *channel; 43 struct snd_dbuf *buffer; 44 int dir, blksz; --- 78 unchanged lines hidden (view full) --- 123 124static void 125ad1816_intr(void *arg) 126{ 127 struct ad1816_info *ad1816 = (struct ad1816_info *)arg; 128 unsigned char c, served = 0; 129 130 ad1816_lock(ad1816); | 37 38struct ad1816_info; 39 40struct ad1816_chinfo { 41 struct ad1816_info *parent; 42 struct pcm_channel *channel; 43 struct snd_dbuf *buffer; 44 int dir, blksz; --- 78 unchanged lines hidden (view full) --- 123 124static void 125ad1816_intr(void *arg) 126{ 127 struct ad1816_info *ad1816 = (struct ad1816_info *)arg; 128 unsigned char c, served = 0; 129 130 ad1816_lock(ad1816); |
131 /* get interupt status */ | 131 /* get interrupt status */ |
132 c = io_rd(ad1816, AD1816_INT); 133 | 132 c = io_rd(ad1816, AD1816_INT); 133 |
134 /* check for stray interupts */ | 134 /* check for stray interrupts */ |
135 if (c & ~(AD1816_INTRCI | AD1816_INTRPI)) { 136 printf("pcm: stray int (%x)\n", c); 137 c &= AD1816_INTRCI | AD1816_INTRPI; 138 } | 135 if (c & ~(AD1816_INTRCI | AD1816_INTRPI)) { 136 printf("pcm: stray int (%x)\n", c); 137 c &= AD1816_INTRCI | AD1816_INTRPI; 138 } |
139 /* check for capture interupt */ | 139 /* check for capture interrupt */ |
140 if (sndbuf_runsz(ad1816->rch.buffer) && (c & AD1816_INTRCI)) { 141 ad1816_unlock(ad1816); 142 chn_intr(ad1816->rch.channel); 143 ad1816_lock(ad1816); 144 served |= AD1816_INTRCI; /* cp served */ 145 } | 140 if (sndbuf_runsz(ad1816->rch.buffer) && (c & AD1816_INTRCI)) { 141 ad1816_unlock(ad1816); 142 chn_intr(ad1816->rch.channel); 143 ad1816_lock(ad1816); 144 served |= AD1816_INTRCI; /* cp served */ 145 } |
146 /* check for playback interupt */ | 146 /* check for playback interrupt */ |
147 if (sndbuf_runsz(ad1816->pch.buffer) && (c & AD1816_INTRPI)) { 148 ad1816_unlock(ad1816); 149 chn_intr(ad1816->pch.channel); 150 ad1816_lock(ad1816); 151 served |= AD1816_INTRPI; /* pb served */ 152 } 153 if (served == 0) { 154 /* this probably means this is not a (working) ad1816 chip, */ --- 534 unchanged lines hidden --- | 147 if (sndbuf_runsz(ad1816->pch.buffer) && (c & AD1816_INTRPI)) { 148 ad1816_unlock(ad1816); 149 chn_intr(ad1816->pch.channel); 150 ad1816_lock(ad1816); 151 served |= AD1816_INTRPI; /* pb served */ 152 } 153 if (served == 0) { 154 /* this probably means this is not a (working) ad1816 chip, */ --- 534 unchanged lines hidden --- |