Commit c7d96eae authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update

D:2003/07/30 11:54:03
A:Takashi Iwai <tiwai@suse.de>
F:include/ac97_codec.h:1.30->1.31 
F:pci/intel8x0.c:1.85->1.86 
F:pci/via82xx.c:1.43->1.44 
F:pci/ac97/ac97_codec.c:1.99->1.100 
F:pci/ac97/ac97_patch.c:1.17->1.18 
F:pci/ac97/ac97_patch.h:1.8->1.9 
L:- added quirk type AC97_TUNE_AD_SHARING.
L:- added mask field to snd_ac97_quirk.
L:- new patch for AD1985.  set more config bits for line/mic sharing.
L:- rewritten quirk table in C99 init style.
L:- more quirks for intel ICH5/AD1985 boards.
parent a54d7c42
......@@ -345,13 +345,20 @@ void snd_ac97_suspend(ac97_t *ac97);
void snd_ac97_resume(ac97_t *ac97);
#endif
enum { AC97_TUNE_HP_ONLY, AC97_TUNE_SWAP_HP, AC97_TUNE_SWAP_SURROUND };
/* quirk types */
enum {
AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */
AC97_TUNE_SWAP_HP, /* swap headphone and master controls */
AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */
AC97_TUNE_AD_SHARING /* for AD1985, turn on OMS bit and use headphone */
};
struct ac97_quirk {
unsigned short vendor;
unsigned short device;
const char *name;
int type;
unsigned short vendor; /* PCI vendor id */
unsigned short device; /* PCI device id */
unsigned short mask; /* device id bit mask, 0 = accept all */
const char *name; /* name shown as info */
int type; /* quirk type above */
};
int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk);
......
......@@ -103,7 +103,7 @@ static const ac97_codec_id_t snd_ac97_codec_ids[] = {
{ 0x41445370, 0xffffffff, "AD1980", patch_ad1980, NULL },
{ 0x41445372, 0xffffffff, "AD1981A", patch_ad1881, NULL },
{ 0x41445374, 0xffffffff, "AD1981B", patch_ad1881, NULL },
{ 0x41445375, 0xffffffff, "AD1985", patch_ad1980, NULL },
{ 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL },
{ 0x414c4300, 0xfffffff0, "RL5306", NULL, NULL },
{ 0x414c4310, 0xfffffff0, "RL5382", NULL, NULL },
{ 0x414c4320, 0xfffffff0, "RL5383", NULL, NULL },
......@@ -2235,6 +2235,14 @@ static int swap_surround(ac97_t *ac97)
return 0;
}
static int tune_ad_sharing(ac97_t *ac97)
{
unsigned short scfg;
/* Turn on OMS bit to route microphone to back panel */
scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x0200);
return swap_headphone(ac97, 1);
}
/**
* snd_ac97_tune_hardware - tune up the hardware
......@@ -2253,7 +2261,10 @@ int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk)
snd_assert(quirk, return -EINVAL);
for (; quirk->vendor; quirk++) {
if (quirk->vendor == ac97->subsystem_vendor && quirk->device == ac97->subsystem_device) {
if (quirk->vendor != ac97->subsystem_vendor)
continue;
if ((! quirk->mask && quirk->device == ac97->subsystem_device) ||
quirk->device == (quirk->mask & ac97->subsystem_device)) {
snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device);
switch (quirk->type) {
case AC97_TUNE_HP_ONLY:
......@@ -2262,6 +2273,8 @@ int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk)
return swap_headphone(ac97, 0);
case AC97_TUNE_SWAP_SURROUND:
return swap_surround(ac97);
case AC97_TUNE_AD_SHARING:
return tune_ad_sharing(ac97);
}
snd_printk(KERN_ERR "invalid quirk type %d for %s\n", quirk->type, quirk->name);
return -EINVAL;
......
......@@ -759,6 +759,19 @@ int patch_ad1980(ac97_t * ac97)
return 0;
}
int patch_ad1985(ac97_t * ac97)
{
unsigned short misc;
patch_ad1881(ac97);
ac97->build_ops = &patch_ad1980_build_ops;
misc = snd_ac97_read(ac97, AC97_AD_MISC);
/* switch front/surround line-out/hp-out */
/* center/LFE, surround in High-Z mode */
snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | 0x1c28);
return 0;
}
static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0),
......
......@@ -42,6 +42,7 @@ int patch_ad1881(ac97_t * ac97);
int patch_ad1885(ac97_t * ac97);
int patch_ad1886(ac97_t * ac97);
int patch_ad1980(ac97_t * ac97);
int patch_ad1985(ac97_t * ac97);
int patch_alc650(ac97_t * ac97);
int patch_cm9738(ac97_t * ac97);
int patch_cm9739(ac97_t * ac97);
......
......@@ -1555,13 +1555,98 @@ static struct _ac97_rate_regs ali_ac97_rate_regs[] __devinitdata = {
};
static struct ac97_quirk ac97_quirks[] __devinitdata = {
{ 0x1028, 0x0126, "Dell Optiplex GX260", AC97_TUNE_HP_ONLY },
{ 0x1734, 0x0088, "Fujitsu-Siemens D1522", AC97_TUNE_HP_ONLY },
{ 0x10f1, 0x2665, "Fujitsu-Siemens Celcius", AC97_TUNE_HP_ONLY },
{ 0x110a, 0x0056, "Fujitsu-Siemens Scenic", AC97_TUNE_HP_ONLY },
{ 0x8086, 0x4d44, "Intel D850EMV2", AC97_TUNE_HP_ONLY },
/* { 0x4144, 0x5360, "AMD64 Motherboard", AC97_TUNE_HP_ONLY }, */ /* FIXME: this seems invalid */
{ 0x1043, 0x80b0, "ASUS P4PE Mobo", AC97_TUNE_SWAP_SURROUND },
{
.vendor = 0x1028,
.device = 0x0126,
.name = "Dell Optiplex GX260",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x1043,
.device =0x80b0,
.name = "ASUS P4PE Mobo",
.type = AC97_TUNE_SWAP_SURROUND
},
{
.vendor = 0x10f1,
.device = 0x2665,
.name = "Fujitsu-Siemens Celcius",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x110a,
.device = 0x0056,
.name = "Fujitsu-Siemens Scenic",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x11d4,
.device = 0x5375,
.name = "ADI AD1985 (discrete)",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x1734,
.device = 0x0088,
.name = "Fujitsu-Siemens D1522",
.type = AC97_TUNE_HP_ONLY
},
#if 0
/* FIXME: this seems invalid */
{
.vendor = 0x4144,
.device = 0x5360,
.type = "AMD64 Motherboard",
.name = AC97_TUNE_HP_ONLY
},
#endif
{
.vendor = 0x8086,
.device = 0x2000,
.mask = 0xfff0,
.name = "Intel ICH5/AD1985 (discrete)",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x8086,
.device = 0x4000,
.mask = 0xfff0,
.name = "Intel ICH5/AD1985",
.type = AC97_TUNE_AD_SHARING
},
{
.vendor = 0x8086,
.device = 0x4d44,
.name = "Intel D850EMV2",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x8086,
.device = 0x6000,
.mask = 0xfff0,
.name = "Intel ICH5/AD1985",
.type = AC97_TUNE_AD_SHARING
},
{
.vendor = 0x8086,
.device = 0xe000,
.mask = 0xfff0,
.name = "Intel ICH5/AD1985",
.type = AC97_TUNE_AD_SHARING
},
{
.vendor = 0x8086,
.device = 0xa000,
.mask = 0xfff0,
.name = "Intel ICH5/AD1985 (discrete)",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x80f3,
.device = 0x1043,
.name = "ASUS ICH5/AD1985",
.type = AC97_TUNE_AD_SHARING
},
{ } /* terminator */
};
......
......@@ -886,9 +886,11 @@ static int snd_via8233_playback_prepare(snd_pcm_substream_t *substream)
snd_ac97_set_rate(chip->ac97, AC97_PCM_LFE_DAC_RATE, runtime->rate);
snd_ac97_set_rate(chip->ac97, AC97_SPDIF, runtime->rate);
}
#if 0
if (chip->revision == VIA_REV_8233A)
rbits = 0;
else
#endif
rbits = (0xfffff / 48000) * runtime->rate + ((0xfffff % 48000) * runtime->rate) / 48000;
snd_assert((rbits & ~0xfffff) == 0, return -EINVAL);
snd_via82xx_channel_reset(chip, viadev);
......@@ -928,9 +930,12 @@ static int snd_via8233_multi_prepare(snd_pcm_substream_t *substream)
fmt = (runtime->format == SNDRV_PCM_FORMAT_S16_LE) ? VIA_REG_MULTPLAY_FMT_16BIT : VIA_REG_MULTPLAY_FMT_8BIT;
fmt |= runtime->channels << 4;
outb(fmt, VIADEV_REG(viadev, OFS_MULTPLAY_FORMAT));
#if 0
if (chip->revision == VIA_REV_8233A)
slots = 0;
else {
else
#endif
{
/* set sample number to slot 3, 4, 7, 8, 6, 9 (for VIA8233/C,8235) */
/* corresponding to FL, FR, RL, RR, C, LFE ?? */
switch (runtime->channels) {
......@@ -1501,7 +1506,12 @@ static void snd_via82xx_mixer_free_ac97(ac97_t *ac97)
}
static struct ac97_quirk ac97_quirks[] = {
{ 0x1106, 0x4161, "ASRock K7VT2", AC97_TUNE_HP_ONLY },
{
.vendor = 0x1106,
.device = 0x4161,
.name = "ASRock K7VT2",
.type = AC97_TUNE_HP_ONLY
},
{ } /* terminator */
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment