Deleted Added
full compact
es137x.c (59323) es137x.c (60958)
1/*
2 * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI
3 * boards based on the ES1370, ES1371 and ES1373 chips.
4 *
5 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com>
6 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
7 * Copyright (c) 1998 by Joachim Kuebart. All rights reserved.
8 *

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

33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39 * OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
1/*
2 * Support the ENSONIQ AudioPCI board and Creative Labs SoundBlaster PCI
3 * boards based on the ES1370, ES1371 and ES1373 chips.
4 *
5 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com>
6 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
7 * Copyright (c) 1998 by Joachim Kuebart. All rights reserved.
8 *

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

33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39 * OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * $FreeBSD: head/sys/dev/sound/pci/es137x.c 59323 2000-04-17 16:57:12Z cg $
41 * $FreeBSD: head/sys/dev/sound/pci/es137x.c 60958 2000-05-26 21:15:47Z cg $
42 */
43
44/*
45 * Part of this code was heavily inspired by the linux driver from
46 * Thomas Sailer (sailer@ife.ee.ethz.ch)
47 * Just about everything has been touched and reworked in some way but
48 * the all the underlying sequences/timing/register values are from
49 * Thomas' code.

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

360 return blocksize;
361}
362
363static int
364eschan_trigger(void *data, int go)
365{
366 struct es_chinfo *ch = data;
367 struct es_info *es = ch->parent;
42 */
43
44/*
45 * Part of this code was heavily inspired by the linux driver from
46 * Thomas Sailer (sailer@ife.ee.ethz.ch)
47 * Just about everything has been touched and reworked in some way but
48 * the all the underlying sequences/timing/register values are from
49 * Thomas' code.

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

360 return blocksize;
361}
362
363static int
364eschan_trigger(void *data, int go)
365{
366 struct es_chinfo *ch = data;
367 struct es_info *es = ch->parent;
368 unsigned cnt = ch->buffer->dl / ch->buffer->sample_size - 1;
368 unsigned ss, cnt;
369
369
370 if (go == PCMTRIG_EMLDMAWR) return 0;
370 if (go == PCMTRIG_EMLDMAWR || go == PCMTRIG_EMLDMARD)
371 return 0;
372
373 ss = 1;
374 ss <<= (ch->fmt & AFMT_STEREO)? 1 : 0;
375 ss <<= (ch->fmt & AFMT_16BIT)? 1 : 0;
376 cnt = ch->buffer->dl / ss - 1;
377
371 if (ch->dir == PCMDIR_PLAY) {
372 if (go == PCMTRIG_START) {
373 int b = (ch->fmt & AFMT_S16_LE)? 2 : 1;
374 es->ctrl |= CTRL_DAC2_EN;
375 es->sctrl &= ~(SCTRL_P2ENDINC | SCTRL_P2STINC |
376 SCTRL_P2LOOPSEL | SCTRL_P2PAUSE |
377 SCTRL_P2DACSEN);
378 es->sctrl |= SCTRL_P2INTEN | (b << SCTRL_SH_P2ENDINC);

--- 482 unchanged lines hidden ---
378 if (ch->dir == PCMDIR_PLAY) {
379 if (go == PCMTRIG_START) {
380 int b = (ch->fmt & AFMT_S16_LE)? 2 : 1;
381 es->ctrl |= CTRL_DAC2_EN;
382 es->sctrl &= ~(SCTRL_P2ENDINC | SCTRL_P2STINC |
383 SCTRL_P2LOOPSEL | SCTRL_P2PAUSE |
384 SCTRL_P2DACSEN);
385 es->sctrl |= SCTRL_P2INTEN | (b << SCTRL_SH_P2ENDINC);

--- 482 unchanged lines hidden ---