http://linux-sound.bkbits.net/linux-sound perex@suse.cz|ChangeSet|20050113115708|28507 perex # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/13 11:29:26+01:00 perex@suse.cz # ALSA 1.0.8 # # include/sound/version.h # 2005/01/13 11:29:00+01:00 perex@suse.cz +2 -2 # ALSA 1.0.8 # # ChangeSet # 2005/01/12 20:33:29+01:00 perex@suse.cz # [ALSA] Add ac97_quirk option # # Documentation,ATIIXP driver # Added ac97_quirk option like intel and via drivers. # # Signed-off-by: Takashi Iwai # # sound/pci/atiixp.c # 2005/01/12 04:17:48+01:00 perex@suse.cz +10 -3 # [ALSA] Add ac97_quirk option # # D:2005/01/12 11:17:47 # C:Documentation,ATIIXP driver # F:Documentation/ALSA-Configuration.txt:1.61->1.62 # F:pci/atiixp.c:1.29->1.30 # L:Added ac97_quirk option like intel and via drivers. # Signed-off-by: Takashi Iwai # # Documentation/sound/alsa/ALSA-Configuration.txt # 2005/01/12 04:17:47+01:00 perex@suse.cz +2 -0 # [ALSA] Add ac97_quirk option # # D:2005/01/12 11:17:47 # C:Documentation,ATIIXP driver # F:Documentation/ALSA-Configuration.txt:1.61->1.62 # F:pci/atiixp.c:1.29->1.30 # L:Added ac97_quirk option like intel and via drivers. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 20:31:31+01:00 perex@suse.cz # [ALSA] Fix ctl_read/write ioctl wrappers # # IOCTL32 emulation # Fixed bugs with ctl_read/write ioctls. # The struct size mismatch due to alignment is fixed. # The code is also a bit optimized. # # Signed-off-by: Takashi Iwai # # sound/core/ioctl32/ioctl32.c # 2005/01/12 04:10:52+01:00 perex@suse.cz +15 -74 # [ALSA] Fix ctl_read/write ioctl wrappers # # D:2005/01/12 11:10:52 # C:IOCTL32 emulation # F:core/ioctl32/ioctl32.c:1.26->1.27 # L:Fixed bugs with ctl_read/write ioctls. # L:The struct size mismatch due to alignment is fixed. # L:The code is also a bit optimized. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 20:29:54+01:00 perex@suse.cz # [ALSA] Fix DMA pointer read # # ATIIXP driver # Try to reread DMA pointer register if the value is invalid. # The register shows bogus values on some broken hardwares. # # Signed-off-by: Takashi Iwai # # sound/pci/atiixp.c # 2005/01/12 03:50:24+01:00 perex@suse.cz +11 -12 # [ALSA] Fix DMA pointer read # # D:2005/01/12 10:50:24 # C:ATIIXP driver # F:pci/atiixp.c:1.28->1.29 # L:Try to reread DMA pointer register if the value is invalid. # L:The register shows bogus values on some broken hardwares. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:22:26+01:00 perex@suse.cz # [ALSA] Add suspend callback # # AC97 Codec Core # Add suspend callback for each codec patch. # # Signed-off-by: Takashi Iwai # # sound/pci/ac97/ac97_codec.c # 2005/01/11 10:44:52+01:00 perex@suse.cz +2 -0 # [ALSA] Add suspend callback # # D:2005/01/11 17:44:51 # C:AC97 Codec Core # F:include/ac97_codec.h:1.62->1.63 # F:pci/ac97/ac97_codec.c:1.167->1.168 # L:Add suspend callback for each codec patch. # Signed-off-by: Takashi Iwai # # include/sound/ac97_codec.h # 2005/01/11 10:44:51+01:00 perex@suse.cz +1 -0 # [ALSA] Add suspend callback # # D:2005/01/11 17:44:51 # C:AC97 Codec Core # F:include/ac97_codec.h:1.62->1.63 # F:pci/ac97/ac97_codec.c:1.167->1.168 # L:Add suspend callback for each codec patch. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:21:18+01:00 perex@suse.cz # [ALSA] Remove & from function pointers # # AC97 Codec Core # Remove & from function pointers (it works but not common to add it...) # # Signed-off-by: Takashi Iwai # # sound/pci/ac97/ac97_patch.c # 2005/01/11 08:57:20+01:00 perex@suse.cz +2 -2 # [ALSA] Remove & from function pointers # # D:2005/01/11 15:57:20 # C:AC97 Codec Core # F:pci/ac97/ac97_patch.c:1.67->1.68 # L:Remove & from function pointers (it works but not common to add it...) # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:20:14+01:00 perex@suse.cz # [ALSA] Fixed description about ac97_quirk # # Documentation # Fixed the description about ac97_quirk option. # Now it accepts string, too. # # Signed-off-by: Takashi Iwai # # Documentation/sound/alsa/ALSA-Configuration.txt # 2005/01/11 07:51:11+01:00 perex@suse.cz +15 -10 # [ALSA] Fixed description about ac97_quirk # # D:2005/01/11 14:51:11 # C:Documentation # F:Documentation/ALSA-Configuration.txt:1.60->1.61 # L:Fixed the description about ac97_quirk option. # L:Now it accepts string, too. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:19:00+01:00 perex@suse.cz # [ALSA] Adapt SPDIF Input selection for Realtek ALC658 # # AC97 Codec Core # This fixes the SPDIF Input selection for ALC658 as Realtek has # changed the meaning betweenALC655 and ALC658. # # Signed-off-by: Stefan Macher # Signed-off-by: Takashi Iwai # # sound/pci/ac97/ac97_patch.c # 2005/01/11 06:17:42+01:00 perex@suse.cz +4 -1 # [ALSA] Adapt SPDIF Input selection for Realtek ALC658 # # D:2005/01/11 13:17:42 # C:AC97 Codec Core # F:pci/ac97/ac97_patch.c:1.66->1.67 # L:This fixes the SPDIF Input selection for ALC658 as Realtek has # L:changed the meaning betweenALC655 and ALC658. # Signed-off-by: Stefan Macher # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:17:53+01:00 perex@suse.cz # [ALSA] Fix Oops at resume # # AC97 Codec Core # Fixed Oops at resume on certain codecs. # Set null ops when no patch exists or the patch doesn't set build_ops. # # Signed-off-by: Takashi Iwai # # sound/pci/ac97/ac97_codec.c # 2005/01/11 06:16:55+01:00 perex@suse.cz +10 -4 # [ALSA] Fix Oops at resume # # D:2005/01/11 13:16:55 # C:AC97 Codec Core # F:pci/ac97/ac97_codec.c:1.166->1.167 # L:Fixed Oops at resume on certain codecs. # L:Set null ops when no patch exists or the patch doesn't set build_ops. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:16:40+01:00 perex@suse.cz # [ALSA] remove compatibility code for 2.2.x kernels # # CA0106 driver # # # Signed-off-by: Clemens Ladisch # # sound/pci/ca0106/ca0106_proc.c # 2005/01/10 00:33:03+01:00 perex@suse.cz +0 -1 # [ALSA] remove compatibility code for 2.2.x kernels # # D:2005/01/10 07:33:03 # C:CA0106 driver # F:pci/ca0106/ca0106_mixer.c:1.1->1.2 # F:pci/ca0106/ca0106_proc.c:1.1->1.2 # L: # Signed-off-by: Clemens Ladisch # # sound/pci/ca0106/ca0106_mixer.c # 2005/01/10 00:33:03+01:00 perex@suse.cz +0 -1 # [ALSA] remove compatibility code for 2.2.x kernels # # D:2005/01/10 07:33:03 # C:CA0106 driver # F:pci/ca0106/ca0106_mixer.c:1.1->1.2 # F:pci/ca0106/ca0106_proc.c:1.1->1.2 # L: # Signed-off-by: Clemens Ladisch # # ChangeSet # 2005/01/12 11:15:36+01:00 perex@suse.cz # [ALSA] Add quirk for HP zv5000 # # Intel8x0 driver # Added the quirk for HP zv5000 (mute LED with EAPD). # # Signed-off-by: Takashi Iwai # # sound/pci/intel8x0.c # 2005/01/07 11:48:43+01:00 perex@suse.cz +6 -0 # [ALSA] Add quirk for HP zv5000 # # D:2005/01/07 18:48:43 # C:Intel8x0 driver # F:pci/intel8x0.c:1.187->1.188 # L:Added the quirk for HP zv5000 (mute LED with EAPD). # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:13:46+01:00 perex@suse.cz # [ALSA] Fix float format support # # MIXART driver # Fixed typos in float format support. # # Signed-off-by: Markus Bollinger # Signed-off-by: Takashi Iwai # # sound/pci/mixart/mixart.c # 2005/01/07 10:40:41+01:00 perex@suse.cz +2 -2 # [ALSA] Fix float format support # # D:2005/01/07 17:40:41 # C:MIXART driver # F:pci/mixart/mixart.c:1.23->1.24 # L:Fixed typos in float format support. # Signed-off-by: Markus Bollinger # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:12:00+01:00 perex@suse.cz # [ALSA] Fix description of ALSA/OSS device mapping # # Documentation # Fixed the description of ALSA/OSS device mapping. The direction # suffix was missing in ALSA devices. # # Signed-off-by: Takashi Iwai # # Documentation/sound/alsa/ALSA-Configuration.txt # 2005/01/07 09:02:20+01:00 perex@suse.cz +14 -11 # [ALSA] Fix description of ALSA/OSS device mapping # # D:2005/01/07 16:02:20 # C:Documentation # F:Documentation/ALSA-Configuration.txt:1.59->1.60 # L:Fixed the description of ALSA/OSS device mapping. The direction # L:suffix was missing in ALSA devices. # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:10:10+01:00 perex@suse.cz # [ALSA] ac97 quirk entries for HP xw6200 & xw8000 # # Intel8x0 driver # Add AC97 quick list entries to snd-intel8x0 for HP xw6200 and xw8000. # # Signed-off-by: John W. Linville # Signed-off-by: Takashi Iwai # # sound/pci/intel8x0.c # 2005/01/07 07:10:28+01:00 perex@suse.cz +13 -1 # [ALSA] ac97 quirk entries for HP xw6200 & xw8000 # # D:2005/01/07 14:10:28 # C:Intel8x0 driver # F:pci/intel8x0.c:1.186->1.187 # L:Add AC97 quick list entries to snd-intel8x0 for HP xw6200 and xw8000. # Signed-off-by: John W. Linville # Signed-off-by: Takashi Iwai # # ChangeSet # 2005/01/12 11:08:29+01:00 perex@suse.cz # [ALSA] Fix ioctl arguments # # RawMidi Midlevel # Fixed the wrong pointer types passed to get_user() for # DROP and DRAIN ioctls. # # Signed-off-by: Takashi Iwai # # sound/core/rawmidi.c # 2005/01/07 07:09:15+01:00 perex@suse.cz +2 -2 # [ALSA] Fix ioctl arguments # # D:2005/01/07 14:09:15 # C:RawMidi Midlevel # F:core/rawmidi.c:1.50->1.51 # L:Fixed the wrong pointer types passed to get_user() for # L:DROP and DRAIN ioctls. # Signed-off-by: Takashi Iwai # diff -Nru a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt --- a/Documentation/sound/alsa/ALSA-Configuration.txt 2005-01-13 16:33:17 -08:00 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt 2005-01-13 16:33:17 -08:00 @@ -184,6 +184,8 @@ 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,16 +682,21 @@ * 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 - buggy_irq - Enable workaround for buggy interrupts on some - motherboards (default off) + 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) Module supports autoprobe and multiple bus-master chips (max 8). @@ -1402,18 +1409,21 @@ 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 +/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. -The first number from /dev/snd/pcmC{X}D{Y} expression means soundcard number -and second means device number. Please note that the device mapping above may be varied via the module options of snd-pcm-oss module. diff -Nru a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h --- a/include/sound/ac97_codec.h 2005-01-13 16:33:17 -08:00 +++ b/include/sound/ac97_codec.h 2005-01-13 16:33:17 -08:00 @@ -426,6 +426,7 @@ 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 }; diff -Nru a/include/sound/version.h b/include/sound/version.h --- a/include/sound/version.h 2005-01-13 16:33:17 -08:00 +++ b/include/sound/version.h 2005-01-13 16:33:17 -08:00 @@ -1,3 +1,3 @@ /* 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)" diff -Nru a/sound/core/ioctl32/ioctl32.c b/sound/core/ioctl32/ioctl32.c --- a/sound/core/ioctl32/ioctl32.c 2005-01-13 16:33:17 -08:00 +++ b/sound/core/ioctl32/ioctl32.c 2005-01-13 16:33:17 -08:00 @@ -219,25 +219,10 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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; diff -Nru a/sound/core/rawmidi.c b/sound/core/rawmidi.c --- a/sound/core/rawmidi.c 2005-01-13 16:33:17 -08:00 +++ b/sound/core/rawmidi.c 2005-01-13 16:33:17 -08:00 @@ -747,7 +747,7 @@ 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 @@ 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: diff -Nru a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c --- a/sound/pci/ac97/ac97_codec.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/ac97/ac97_codec.c 2005-01-13 16:33:17 -08:00 @@ -1505,7 +1505,7 @@ 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 @@ /* 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 @@ } /* 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 @@ 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 @@ 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 @@ */ void snd_ac97_suspend(ac97_t *ac97) { + if (ac97->build_ops->suspend) + ac97->build_ops->suspend(ac97); snd_ac97_powerdown(ac97); } diff -Nru a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c --- a/sound/pci/ac97/ac97_patch.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/ac97/ac97_patch.c 2005-01-13 16:33:17 -08:00 @@ -910,7 +910,7 @@ 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 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 @@ /* 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, diff -Nru a/sound/pci/atiixp.c b/sound/pci/atiixp.c --- a/sound/pci/atiixp.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/atiixp.c 2005-01-13 16:33:17 -08:00 @@ -43,6 +43,7 @@ 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_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 @@ 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); - 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 { + while (timeout--) { + curptr = readl(chip->remap_addr + dma->ops->dt_cur); + 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; - } + if (curptr >= dma->buf_bytes) + continue; + return bytes_to_frames(runtime, curptr); } - spin_unlock(&chip->reg_lock); - 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 @@ * 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 @@ 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 @@ 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) diff -Nru a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c --- a/sound/pci/ca0106/ca0106_mixer.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/ca0106/ca0106_mixer.c 2005-01-13 16:33:17 -08:00 @@ -1,4 +1,3 @@ -#define __NO_VERSION__ /* * Copyright (c) 2004 James Courtier-Dutton * Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit diff -Nru a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c --- a/sound/pci/ca0106/ca0106_proc.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/ca0106/ca0106_proc.c 2005-01-13 16:33:17 -08:00 @@ -1,4 +1,3 @@ -#define __NO_VERSION__ /* * Copyright (c) 2004 James Courtier-Dutton * Driver CA0106 chips. e.g. Sound Blaster Audigy LS and Live 24bit diff -Nru a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c --- a/sound/pci/intel8x0.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/intel8x0.c 2005-01-13 16:33:17 -08:00 @@ -1766,10 +1766,22 @@ .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 }, { @@ -1782,6 +1794,12 @@ .vendor = 0x103c, .device = 0x12f1, .name = "HP xw8200", /* AD1981B*/ + .type = AC97_TUNE_HP_ONLY + }, + { + .vendor = 0x103c, + .device = 0x12f2, + .name = "HP xw6200", .type = AC97_TUNE_HP_ONLY }, { diff -Nru a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c --- a/sound/pci/mixart/mixart.c 2005-01-13 16:33:17 -08:00 +++ b/sound/pci/mixart/mixart.c 2005-01-13 16:33:17 -08:00 @@ -526,11 +526,11 @@ 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;