Deleted Added
full compact
es137x.c (197404) es137x.c (206033)
1/*-
2 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com>
3 * Copyright (c) 1998 Joachim Kuebart <joachim.kuebart@gmx.net>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

83
84#include <dev/pci/pcireg.h>
85#include <dev/pci/pcivar.h>
86
87#include <sys/sysctl.h>
88
89#include "mixer_if.h"
90
1/*-
2 * Copyright (c) 1999 Russell Cattelan <cattelan@thebarn.com>
3 * Copyright (c) 1998 Joachim Kuebart <joachim.kuebart@gmx.net>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

83
84#include <dev/pci/pcireg.h>
85#include <dev/pci/pcivar.h>
86
87#include <sys/sysctl.h>
88
89#include "mixer_if.h"
90
91SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/es137x.c 197404 2009-09-22 13:23:59Z joel $");
91SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/es137x.c 206033 2010-04-01 11:30:46Z joel $");
92
93#define MEM_MAP_REG 0x14
94
95/* PCI IDs of supported chips */
96#define ES1370_PCI_ID 0x50001274
97#define ES1371_PCI_ID 0x13711274
98#define ES1371_PCI_ID2 0x13713274
99#define CT5880_PCI_ID 0x58801274

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

350
351 if (!mixtable[dev].avail)
352 return (-1);
353 l = left;
354 r = (mixtable[dev].stereo) ? right : l;
355 if (mixtable[dev].left == 0xf)
356 rl = (l < 2) ? 0x80 : 7 - (l - 2) / 14;
357 else
92
93#define MEM_MAP_REG 0x14
94
95/* PCI IDs of supported chips */
96#define ES1370_PCI_ID 0x50001274
97#define ES1371_PCI_ID 0x13711274
98#define ES1371_PCI_ID2 0x13713274
99#define CT5880_PCI_ID 0x58801274

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

350
351 if (!mixtable[dev].avail)
352 return (-1);
353 l = left;
354 r = (mixtable[dev].stereo) ? right : l;
355 if (mixtable[dev].left == 0xf)
356 rl = (l < 2) ? 0x80 : 7 - (l - 2) / 14;
357 else
358 rl = (l < 10) ? 0x80 : 15 - (l - 10) / 6;
358 rl = (l < 7) ? 0x80 : 31 - (l - 7) / 3;
359 es = mix_getdevinfo(m);
360 ES_LOCK(es);
361 if (dev == SOUND_MIXER_PCM && (ES_SINGLE_PCM_MIX(es->escfg)) &&
362 ES_DAC1_ENABLED(es->escfg))
363 set_dac1 = 1;
364 else
365 set_dac1 = 0;
366 if (mixtable[dev].stereo) {
359 es = mix_getdevinfo(m);
360 ES_LOCK(es);
361 if (dev == SOUND_MIXER_PCM && (ES_SINGLE_PCM_MIX(es->escfg)) &&
362 ES_DAC1_ENABLED(es->escfg))
363 set_dac1 = 1;
364 else
365 set_dac1 = 0;
366 if (mixtable[dev].stereo) {
367 rr = (r < 10) ? 0x80 : 15 - (r - 10) / 6;
367 rr = (r < 7) ? 0x80 : 31 - (r - 7) / 3;
368 es1370_wrcodec(es, mixtable[dev].right, rr);
369 if (set_dac1 && mixtable[SOUND_MIXER_SYNTH].stereo)
370 es1370_wrcodec(es,
371 mixtable[SOUND_MIXER_SYNTH].right, rr);
372 }
373 es1370_wrcodec(es, mixtable[dev].left, rl);
374 if (set_dac1)
375 es1370_wrcodec(es, mixtable[SOUND_MIXER_SYNTH].left, rl);

--- 1575 unchanged lines hidden ---
368 es1370_wrcodec(es, mixtable[dev].right, rr);
369 if (set_dac1 && mixtable[SOUND_MIXER_SYNTH].stereo)
370 es1370_wrcodec(es,
371 mixtable[SOUND_MIXER_SYNTH].right, rr);
372 }
373 es1370_wrcodec(es, mixtable[dev].left, rl);
374 if (set_dac1)
375 es1370_wrcodec(es, mixtable[SOUND_MIXER_SYNTH].left, rl);

--- 1575 unchanged lines hidden ---