Commit 576dd6f6 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-sound.bkbits.net/linux-sound

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 633d7b7e 872b8f81
......@@ -184,6 +184,8 @@ Module parameters
Module for ATI IXP 150/200/250 AC97 controllers.
ac97_clock - AC'97 clock (defalut = 48000)
ac97_quirk - AC'97 workaround for strange hardware
See the description of intel8x0 module for details.
spdif_aclink - S/PDIF transfer over AC-link (default = 1)
This module supports up to 8 cards and autoprobe.
......@@ -680,14 +682,19 @@ Module parameters
* ALi m5455
ac97_clock - AC'97 codec clock base (0 = auto-detect)
ac97_quirk - AC'97 workaround for strange hardware (-1 = default)
-1 = default, don't override
0 = disable
1 = use headphone control as master
2 = swap headphone and master controls
3 = for AD1985, turn on OMS bit and use headphone
4 = for ALC65x, turn on the jack sense mode
5 = inverted EAPD implementation
ac97_quirk - AC'97 workaround for strange hardware
The following strings are accepted:
default = don't override the default setting
disable = disable the quirk
hp_only = use headphone control as master
swap_hp = swap headphone and master controls
swap_surround = swap master and surround controls
ad_shring = for AD1985, turn on OMS bit and use headphone
alc_jack = for ALC65x, turn on the jack sense mode
inv_eapd = inverted EAPD implementation
mute_led = bind EAPD bit for turning on/off mute LED
For backward compatibility, the corresponding integer
value -1, 0, ... are accepted, too.
buggy_irq - Enable workaround for buggy interrupts on some
motherboards (default off)
......@@ -1402,18 +1409,21 @@ In this example, the interwave card is always loaded as the first card
ALSA PCM devices to OSS devices mapping
=======================================
/dev/snd/pcmC0D0 -> /dev/audio0 (/dev/audio) -> minor 4
/dev/snd/pcmC0D0 -> /dev/dsp0 (/dev/dsp) -> minor 3
/dev/snd/pcmC0D1 -> /dev/adsp0 (/dev/adsp) -> minor 12
/dev/snd/pcmC1D0 -> /dev/audio1 -> minor 4+16 = 20
/dev/snd/pcmC1D0 -> /dev/dsp1 -> minor 3+16 = 19
/dev/snd/pcmC1D1 -> /dev/adsp1 -> minor 12+16 = 28
/dev/snd/pcmC2D0 -> /dev/audio2 -> minor 4+32 = 36
/dev/snd/pcmC2D0 -> /dev/dsp2 -> minor 3+32 = 39
/dev/snd/pcmC2D1 -> /dev/adsp2 -> minor 12+32 = 44
The first number from /dev/snd/pcmC{X}D{Y} expression means soundcard number
and second means device number.
/dev/snd/pcmC0D0[c|p] -> /dev/audio0 (/dev/audio) -> minor 4
/dev/snd/pcmC0D0[c|p] -> /dev/dsp0 (/dev/dsp) -> minor 3
/dev/snd/pcmC0D1[c|p] -> /dev/adsp0 (/dev/adsp) -> minor 12
/dev/snd/pcmC1D0[c|p] -> /dev/audio1 -> minor 4+16 = 20
/dev/snd/pcmC1D0[c|p] -> /dev/dsp1 -> minor 3+16 = 19
/dev/snd/pcmC1D1[c|p] -> /dev/adsp1 -> minor 12+16 = 28
/dev/snd/pcmC2D0[c|p] -> /dev/audio2 -> minor 4+32 = 36
/dev/snd/pcmC2D0[c|p] -> /dev/dsp2 -> minor 3+32 = 39
/dev/snd/pcmC2D1[c|p] -> /dev/adsp2 -> minor 12+32 = 44
The first number from /dev/snd/pcmC{X}D{Y}[c|p] expression means
soundcard number and second means device number. The ALSA devices
have either 'c' or 'p' suffix indicating the direction, capture and
playback, respectively.
Please note that the device mapping above may be varied via the module
options of snd-pcm-oss module.
......
......@@ -426,6 +426,7 @@ struct snd_ac97_build_ops {
int (*build_spdif) (ac97_t *ac97);
int (*build_post_spdif) (ac97_t *ac97);
#ifdef CONFIG_PM
void (*suspend) (ac97_t *ac97);
void (*resume) (ac97_t *ac97);
#endif
};
......
/* include/version.h. Generated by configure. */
#define CONFIG_SND_VERSION "1.0.8rc2"
#define CONFIG_SND_DATE " (Wed Jan 05 06:44:40 2005 UTC)"
#define CONFIG_SND_VERSION "1.0.8"
#define CONFIG_SND_DATE " (Thu Jan 13 09:39:32 2005 UTC)"
......@@ -219,25 +219,10 @@ struct sndrv_ctl_elem_value32 {
struct sndrv_ctl_elem_id id;
unsigned int indirect; /* bit-field causes misalignment */
union {
union {
s32 value[128];
u32 value_ptr;
} integer;
union {
s64 value[64];
u32 value_ptr;
} integer64;
union {
u32 item[128];
u32 item_ptr;
} enumerated;
union {
unsigned char data[512];
u32 data_ptr;
} bytes;
struct sndrv_aes_iec958 iec958;
s32 integer[128]; /* integer and boolean need conversion */
unsigned char data[512]; /* others should be compatible */
} value;
unsigned char reserved[128];
unsigned char reserved[128]; /* not used */
};
......@@ -269,7 +254,7 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
struct sndrv_ctl_elem_value *data;
struct sndrv_ctl_elem_value32 __user *data32;
snd_ctl_file_t *ctl;
int err, i;
int err, i, indirect;
int type;
/* sanity check */
......@@ -281,7 +266,7 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
return -ENOTTY;
data32 = compat_ptr(arg);
data = kmalloc(sizeof(*data), GFP_KERNEL);
data = kcalloc(1, sizeof(*data), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
......@@ -289,12 +274,12 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
err = -EFAULT;
goto __end;
}
if (__get_user(data->indirect, &data32->indirect)) {
if (__get_user(indirect, &data32->indirect)) {
err = -EFAULT;
goto __end;
}
/* FIXME: indirect access is not supported */
if (data->indirect) {
if (indirect) {
err = -EINVAL;
goto __end;
}
......@@ -309,7 +294,7 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
case SNDRV_CTL_ELEM_TYPE_INTEGER:
for (i = 0; i < 128; i++) {
int val;
if (__get_user(val, &data32->value.integer.value[i])) {
if (__get_user(val, &data32->value.integer[i])) {
err = -EFAULT;
goto __end;
}
......@@ -317,33 +302,12 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
}
break;
case SNDRV_CTL_ELEM_TYPE_INTEGER64:
if (__copy_from_user(data->value.integer64.value,
data32->value.integer64.value,
sizeof(data->value.integer64.value))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
if (__copy_from_user(data->value.enumerated.item,
data32->value.enumerated.item,
sizeof(data32->value.enumerated.item))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_BYTES:
if (__copy_from_user(data->value.bytes.data,
data32->value.bytes.data,
sizeof(data32->value.bytes.data))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_IEC958:
if (__copy_from_user(&data->value.iec958,
&data32->value.iec958,
sizeof(data32->value.iec958))) {
if (__copy_from_user(data->value.bytes.data,
data32->value.data,
sizeof(data32->value.data))) {
err = -EFAULT;
goto __end;
}
......@@ -367,43 +331,20 @@ static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd,
for (i = 0; i < 128; i++) {
int val;
val = data->value.integer.value[i];
if (__put_user(val, &data32->value.integer.value[i])) {
if (__put_user(val, &data32->value.integer[i])) {
err = -EFAULT;
goto __end;
}
}
break;
case SNDRV_CTL_ELEM_TYPE_INTEGER64:
if (__copy_to_user(data32->value.integer64.value,
data->value.integer64.value,
sizeof(data32->value.integer64.value))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
if (__copy_to_user(data32->value.enumerated.item,
data->value.enumerated.item,
sizeof(data32->value.enumerated.item))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_BYTES:
if (__copy_to_user(data32->value.bytes.data,
default:
if (__copy_to_user(data32->value.data,
data->value.bytes.data,
sizeof(data32->value.bytes.data))) {
sizeof(data32->value.data))) {
err = -EFAULT;
goto __end;
}
break;
case SNDRV_CTL_ELEM_TYPE_IEC958:
if (__copy_to_user(&data32->value.iec958,
&data->value.iec958,
sizeof(data32->value.iec958))) {
err = -EFAULT;
goto __end;
}
break;
}
err = 0;
......
......@@ -747,7 +747,7 @@ static inline int _snd_rawmidi_ioctl(struct inode *inode, struct file *file,
case SNDRV_RAWMIDI_IOCTL_DROP:
{
int val;
if (get_user(val, (long __user *) argp))
if (get_user(val, (int __user *) argp))
return -EFAULT;
switch (val) {
case SNDRV_RAWMIDI_STREAM_OUTPUT:
......@@ -761,7 +761,7 @@ static inline int _snd_rawmidi_ioctl(struct inode *inode, struct file *file,
case SNDRV_RAWMIDI_IOCTL_DRAIN:
{
int val;
if (get_user(val, (long __user *) argp))
if (get_user(val, (int __user *) argp))
return -EFAULT;
switch (val) {
case SNDRV_RAWMIDI_STREAM_OUTPUT:
......
......@@ -1505,7 +1505,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, ~AC97_GP_DRSS_MASK, 0x0000);
/* build 3D controls */
if (ac97->build_ops && ac97->build_ops->build_3d) {
if (ac97->build_ops->build_3d) {
ac97->build_ops->build_3d(ac97);
} else {
if (snd_ac97_try_volume_mix(ac97, AC97_3D_CONTROL)) {
......@@ -1528,14 +1528,14 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
/* build S/PDIF controls */
if (ac97->ext_id & AC97_EI_SPDIF) {
if (ac97->build_ops && ac97->build_ops->build_spdif) {
if (ac97->build_ops->build_spdif) {
if ((err = ac97->build_ops->build_spdif(ac97)) < 0)
return err;
} else {
for (idx = 0; idx < 5; idx++)
if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_spdif[idx], ac97))) < 0)
return err;
if (ac97->build_ops && ac97->build_ops->build_post_spdif) {
if (ac97->build_ops->build_post_spdif) {
if ((err = ac97->build_ops->build_post_spdif(ac97)) < 0)
return err;
}
......@@ -1548,7 +1548,7 @@ static int snd_ac97_mixer_build(ac97_t * ac97)
}
/* build chip specific controls */
if (ac97->build_ops && ac97->build_ops->build_specific)
if (ac97->build_ops->build_specific)
if ((err = ac97->build_ops->build_specific(ac97)) < 0)
return err;
......@@ -1811,6 +1811,9 @@ int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops,
return 0;
}
/* build_ops to do nothing */
static struct snd_ac97_build_ops null_build_ops;
/**
* snd_ac97_mixer - create an Codec97 component
* @bus: the AC97 bus which codec is attached to
......@@ -2050,6 +2053,9 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97)
bus->ops->init(ac97);
snd_ac97_get_name(ac97, ac97->id, name, !ac97_is_audio(ac97));
snd_ac97_get_name(NULL, ac97->id, name, !ac97_is_audio(ac97)); // ac97->id might be changed in the special setup code
if (! ac97->build_ops)
ac97->build_ops = &null_build_ops;
if (ac97_is_audio(ac97)) {
char comp[16];
if (card->mixername[0] == '\0') {
......@@ -2157,6 +2163,8 @@ static void snd_ac97_powerdown(ac97_t *ac97)
*/
void snd_ac97_suspend(ac97_t *ac97)
{
if (ac97->build_ops->suspend)
ac97->build_ops->suspend(ac97);
snd_ac97_powerdown(ac97);
}
......
......@@ -910,7 +910,7 @@ static void patch_ad1881_chained(ac97_t * ac97, int unchained_idx, int cidx1, in
static struct snd_ac97_build_ops patch_ad1881_build_ops = {
#ifdef CONFIG_PM
.resume = &ad18xx_resume
.resume = ad18xx_resume
#endif
};
......@@ -993,7 +993,7 @@ static int patch_ad1885_specific(ac97_t * ac97)
static struct snd_ac97_build_ops patch_ad1885_build_ops = {
.build_specific = &patch_ad1885_specific,
#ifdef CONFIG_PM
.resume = &ad18xx_resume
.resume = ad18xx_resume
#endif
};
......@@ -1605,7 +1605,10 @@ int patch_alc655(ac97_t * ac97)
/* adjust default values */
val = snd_ac97_read(ac97, 0x7a); /* misc control */
val |= (1 << 1); /* spdif input pin */
if (ac97->id == 0x414c4780) /* ALC658 */
val &= ~(1 << 1); /* Pin 47 is spdif input pin */
else /* ALC655 */
val |= (1 << 1); /* Pin 47 is spdif input pin */
val &= ~(1 << 12); /* vref enable */
snd_ac97_write_cache(ac97, 0x7a, val);
/* set default: spdif-in enabled,
......
......@@ -43,6 +43,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int ac97_clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 48000};
static char *ac97_quirk[SNDRV_CARDS];
static int spdif_aclink[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
module_param_array(index, int, NULL, 0444);
......@@ -53,6 +54,8 @@ module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable audio part of ATI IXP controller.");
module_param_array(ac97_clock, int, NULL, 0444);
MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
module_param_array(ac97_quirk, charp, NULL, 0444);
MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
module_param_array(spdif_aclink, bool, NULL, 0444);
MODULE_PARM_DESC(spdif_aclink, "S/PDIF over AC-link.");
......@@ -630,21 +633,20 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(snd_pcm_substream_t *substream)
snd_pcm_runtime_t *runtime = substream->runtime;
atiixp_dma_t *dma = (atiixp_dma_t *)runtime->private_data;
unsigned int curptr;
int timeout = 1000;
spin_lock(&chip->reg_lock);
while (timeout--) {
curptr = readl(chip->remap_addr + dma->ops->dt_cur);
if (curptr < dma->buf_addr) {
snd_printdd("curptr = %x, base = %x\n", curptr, dma->buf_addr);
curptr = 0;
} else {
if (curptr < dma->buf_addr)
continue;
curptr -= dma->buf_addr;
if (curptr >= dma->buf_bytes) {
snd_printdd("curptr = %x, size = %x\n", curptr, dma->buf_bytes);
curptr = 0;
}
}
spin_unlock(&chip->reg_lock);
if (curptr >= dma->buf_bytes)
continue;
return bytes_to_frames(runtime, curptr);
}
snd_printd("atiixp: invalid DMA pointer read 0x%x (buf=%x)\n",
readl(chip->remap_addr + dma->ops->dt_cur), dma->buf_addr);
return 0;
}
/*
......@@ -1329,7 +1331,11 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id, struct pt_regs *r
* ac97 mixer section
*/
static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
static struct ac97_quirk ac97_quirks[] __devinitdata = {
{ } /* terminator */
};
static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock, const char *quirk_override)
{
ac97_bus_t *pbus;
ac97_template_t ac97;
......@@ -1376,7 +1382,7 @@ static int __devinit snd_atiixp_mixer_new(atiixp_t *chip, int clock)
return -ENODEV;
}
/* snd_ac97_tune_hardware(chip->ac97, ac97_quirks); */
snd_ac97_tune_hardware(chip->ac97[0], ac97_quirks, quirk_override);
return 0;
}
......@@ -1569,7 +1575,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
chip->spdif_over_aclink = spdif_aclink[dev];
if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev])) < 0)
if ((err = snd_atiixp_mixer_new(chip, ac97_clock[dev], ac97_quirk[dev])) < 0)
goto __error;
if ((err = snd_atiixp_pcm_new(chip)) < 0)
......
#define __NO_VERSION__
/*
* Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
......
#define __NO_VERSION__
/*
* Copyright (c) 2004 James Courtier-Dutton <James@superbug.demon.co.uk>
* Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit
......
......@@ -1766,10 +1766,22 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
.name = "Dell", /* which model? AD1981B*/
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x103c,
.device = 0x006d,
.name = "HP zv5000",
.type = AC97_TUNE_MUTE_LED /*AD1981B*/
},
{ /* FIXME: which codec? */
.vendor = 0x103c,
.device = 0x00c3,
.name = "Hewlett-Packard onboard",
.name = "HP xw6000",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x103c,
.device = 0x129d,
.name = "HP xw8000",
.type = AC97_TUNE_HP_ONLY
},
{
......@@ -1784,6 +1796,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
.name = "HP xw8200", /* AD1981B*/
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x103c,
.device = 0x12f2,
.name = "HP xw6200",
.type = AC97_TUNE_HP_ONLY
},
{
.vendor = 0x103c,
.device = 0x3008,
......
......@@ -526,11 +526,11 @@ static int mixart_set_format(mixart_stream_t *stream, snd_pcm_format_t format)
stream_param.sample_type = ST_INTEGER_24BE;
stream_param.sample_size = 24;
break;
case SNDRV_PCM_FMTBIT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_LE:
stream_param.sample_type = ST_FLOATING_POINT_32LE;
stream_param.sample_size = 32;
break;
case SNDRV_PCM_FMTBIT_FLOAT_BE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
stream_param.sample_type = ST_FLOATING_POINT_32BE;
stream_param.sample_size = 32;
break;
......
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