From 3ccee69019d3b23f02204f4c2cb3085f436da252 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Fri, 16 May 2008 12:10:03 +0200 Subject: snd-pcsp: adjust help texts to frighten users Added the warning text to the help of snd-pcsp about the possible problem with this driver so that user can know of the problem in advance. Also, removed the obsoleted text about ancient pc-speaker patch in CONFIG_SOUND help. Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/Kconfig | 5 ----- sound/drivers/Kconfig | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/Kconfig b/sound/Kconfig index b2a2db47aff5..4247406160e7 100644 --- a/sound/Kconfig +++ b/sound/Kconfig @@ -28,11 +28,6 @@ config SOUND and read ; the module will be called soundcore. - I'm told that even without a sound card, you can make your computer - say more than an occasional beep, by programming the PC speaker. - Kernel patches and supporting utilities to do that are in the pcsp - package, available at . - source "sound/oss/dmasound/Kconfig" if !M68K diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index 379bcb074463..d7ff28809867 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig @@ -5,7 +5,7 @@ menu "Generic devices" config SND_PCSP - tristate "PC-Speaker support" + tristate "PC-Speaker support (READ HELP!)" depends on PCSPKR_PLATFORM && X86_PC && HIGH_RES_TIMERS depends on INPUT depends on SND @@ -18,11 +18,21 @@ config SND_PCSP You can compile this as a module which will be called snd-pcsp. + WARNING: if you already have a soundcard, enabling this + driver may lead to a problem. Namely, it may get loaded + before the other sound driver of yours, making the + pc-speaker a default sound device. Which is likely not + what you want. To make this driver play nicely with other + sound driver, you can add this into your /etc/modprobe.conf: + options snd-pcsp index=2 + You don't need this driver if you only want your pc-speaker to beep. You don't need this driver if you have a tablet piezo beeper in your PC instead of the real speaker. - It should not hurt to say Y or M here in all other cases. + Say N if you have a sound card. + Say M if you don't. + Say Y only if you really know what you do. config SND_MPU401_UART tristate -- cgit v1.2.3-59-g8ed1b From 4dfd79546dfed83bf756f5c912f686ebac187c16 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 17 May 2008 08:44:41 +0200 Subject: snd-pcsp: put back the compatibility code for the older alsa-libs The attached patch adds back the compatibility code, allowing the driver to work with older alsa-libs. The removal was premature, it breaks the real-life configs. Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp_lib.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index ac6238e93513..54253e9b4b02 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c @@ -18,6 +18,8 @@ module_param(nforce_wa, bool, 0444); MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround " "(expect bad sound)"); +#define DMIX_WANTS_S16 1 + static void pcsp_start_timer(unsigned long dummy) { hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL); @@ -47,7 +49,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) { unsigned long flags; unsigned char timer_cnt, val; - int periods_elapsed; + int fmt_size, periods_elapsed; u64 ns; size_t period_bytes, buffer_bytes; struct snd_pcm_substream *substream; @@ -92,8 +94,11 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) goto exit_nr_unlock2; runtime = substream->runtime; - /* assume it is u8 mono */ - val = runtime->dma_area[chip->playback_ptr]; + fmt_size = snd_pcm_format_physical_width(runtime->format) >> 3; + /* assume it is mono! */ + val = runtime->dma_area[chip->playback_ptr + fmt_size - 1]; + if (snd_pcm_format_signed(runtime->format)) + val ^= 0x80; timer_cnt = val * CUR_DIV() / 256; if (timer_cnt && chip->enable) { @@ -111,7 +116,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) period_bytes = snd_pcm_lib_period_bytes(substream); buffer_bytes = snd_pcm_lib_buffer_bytes(substream); - chip->playback_ptr += PCSP_INDEX_INC(); + chip->playback_ptr += PCSP_INDEX_INC() * fmt_size; periods_elapsed = chip->playback_ptr - chip->period_ptr; if (periods_elapsed < 0) { printk(KERN_WARNING "PCSP: playback_ptr inconsistent " @@ -270,7 +275,11 @@ static struct snd_pcm_hardware snd_pcsp_playback = { .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_HALF_DUPLEX | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), - .formats = SNDRV_PCM_FMTBIT_U8, + .formats = (SNDRV_PCM_FMTBIT_U8 +#if DMIX_WANTS_S16 + | SNDRV_PCM_FMTBIT_S16_LE +#endif + ), .rates = SNDRV_PCM_RATE_KNOT, .rate_min = PCSP_DEFAULT_SRATE, .rate_max = PCSP_DEFAULT_SRATE, -- cgit v1.2.3-59-g8ed1b From 2bc536a235382f2a14fbbefd4fa9cd6089c9d0d0 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 17 May 2008 08:46:55 +0200 Subject: snd-pcsp: depend on CONFIG_EXPERIMENTAL Considering all the feedbacks I got, depending snd-pcsp on CONFIG_EXPERIMENTAL looks like the only safe way to get out of all the troubles at one go. :) Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/drivers/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig index d7ff28809867..602b58e3b55d 100644 --- a/sound/drivers/Kconfig +++ b/sound/drivers/Kconfig @@ -8,6 +8,7 @@ config SND_PCSP tristate "PC-Speaker support (READ HELP!)" depends on PCSPKR_PLATFORM && X86_PC && HIGH_RES_TIMERS depends on INPUT + depends on EXPERIMENTAL depends on SND select SND_PCM help -- cgit v1.2.3-59-g8ed1b From 42ece6c1f8162cd782b44dc4863679e888531df5 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sun, 18 May 2008 18:30:03 +0200 Subject: snd-pcsp: silent misleading warning It appears that alsa allows a sound buffer with size not evenly devided by the period size. This triggers a warning in snd-pcsp and floods the log. As a quick fix, the warning should be disabled. Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index 54253e9b4b02..7ad4a1534b2b 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c @@ -119,9 +119,11 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) chip->playback_ptr += PCSP_INDEX_INC() * fmt_size; periods_elapsed = chip->playback_ptr - chip->period_ptr; if (periods_elapsed < 0) { - printk(KERN_WARNING "PCSP: playback_ptr inconsistent " +#if PCSP_DEBUG + printk(KERN_INFO "PCSP: buffer_bytes mod period_bytes != 0 ? " "(%zi %zi %zi)\n", chip->playback_ptr, period_bytes, buffer_bytes); +#endif periods_elapsed += buffer_bytes; } periods_elapsed /= period_bytes; -- cgit v1.2.3-59-g8ed1b From 4b7afb0d0d23b298a7e6d30eaba0679449542d2e Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Tue, 20 May 2008 11:47:29 +0200 Subject: snd-pcsp: use HRTIMER_CB_SOFTIRQ Change HRTIMER_CB_IRQSAFE to HRTIMER_CB_SOFTIRQ, as suggested by Thomas Gleixner. That solves the lock dependancy reported in Bug #10701. That also allows to call hrtimer_start() directly, tasklet "stupid hack" removed. Signed-off-by: Stas Sergeev Acked-by: Thomas Gleixner Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp.c | 2 +- sound/drivers/pcsp/pcsp_lib.c | 37 ++++--------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-) (limited to 'sound') diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 54a1f9036c66..1899cf0685bc 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c @@ -96,7 +96,7 @@ static int __devinit snd_card_pcsp_probe(int devnum, struct device *dev) return -EINVAL; hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - pcsp_chip.timer.cb_mode = HRTIMER_CB_IRQSAFE; + pcsp_chip.timer.cb_mode = HRTIMER_CB_SOFTIRQ; pcsp_chip.timer.function = pcsp_do_timer; card = snd_card_new(index, id, THIS_MODULE, 0); diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c index 7ad4a1534b2b..e341f3f83b6a 100644 --- a/sound/drivers/pcsp/pcsp_lib.c +++ b/sound/drivers/pcsp/pcsp_lib.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include "pcsp.h" @@ -20,34 +19,8 @@ MODULE_PARM_DESC(nforce_wa, "Apply NForce chipset workaround " #define DMIX_WANTS_S16 1 -static void pcsp_start_timer(unsigned long dummy) -{ - hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL); -} - -/* - * We need the hrtimer_start as a tasklet to avoid - * the nasty locking problem. :( - * The problem: - * - The timer handler is called with the cpu_base->lock - * already held by hrtimer code. - * - snd_pcm_period_elapsed() takes the - * substream->self_group.lock. - * So far so good. - * But the snd_pcsp_trigger() is called with the - * substream->self_group.lock held, and it calls - * hrtimer_start(), which takes the cpu_base->lock. - * You see the problem. We have the code pathes - * which take two locks in a reverse order. This - * can deadlock and the lock validator complains. - * The only solution I could find was to move the - * hrtimer_start() into a tasklet. -stsp - */ -static DECLARE_TASKLET(pcsp_start_timer_tasklet, pcsp_start_timer, 0); - enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) { - unsigned long flags; unsigned char timer_cnt, val; int fmt_size, periods_elapsed; u64 ns; @@ -66,9 +39,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) return HRTIMER_RESTART; } - /* hrtimer calls us from both hardirq and softirq contexts, - * so irqsave :( */ - spin_lock_irqsave(&chip->substream_lock, flags); + spin_lock_irq(&chip->substream_lock); /* Takashi Iwai says regarding this extra lock: If the irq handler handles some data on the DMA buffer, it should @@ -139,7 +110,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) chip->period_ptr %= buffer_bytes; } - spin_unlock_irqrestore(&chip->substream_lock, flags); + spin_unlock_irq(&chip->substream_lock); if (!atomic_read(&chip->timer_active)) return HRTIMER_NORESTART; @@ -153,7 +124,7 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) exit_nr_unlock2: snd_pcm_stream_unlock(substream); exit_nr_unlock1: - spin_unlock_irqrestore(&chip->substream_lock, flags); + spin_unlock_irq(&chip->substream_lock); return HRTIMER_NORESTART; } @@ -174,7 +145,7 @@ static void pcsp_start_playing(struct snd_pcsp *chip) atomic_set(&chip->timer_active, 1); chip->thalf = 0; - tasklet_schedule(&pcsp_start_timer_tasklet); + hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL); } static void pcsp_stop_playing(struct snd_pcsp *chip) -- cgit v1.2.3-59-g8ed1b From ebc7a406633acefc6d12c1ccc9441bfef69e0f33 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 20 May 2008 09:23:05 +0200 Subject: [ALSA] hda - Fix ALC262 fujitsu model Fixed the speaker auto-mute with two laptop and docking headphones. Signed-off-by: Takashi Iwai Acked-by: Tony Vroon --- sound/pci/hda/patch_realtek.c | 46 ++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6d4df45e81e0..ad2763c86bf5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -8757,35 +8757,39 @@ static struct hda_input_mux alc262_HP_D7000_capture_source = { }, }; -/* mute/unmute internal speaker according to the hp jack and mute state */ +/* mute/unmute internal speaker according to the hp jacks and mute state */ static void alc262_fujitsu_automute(struct hda_codec *codec, int force) { struct alc_spec *spec = codec->spec; unsigned int mute; if (force || !spec->sense_updated) { - unsigned int present_int_hp, present_dock_hp; + unsigned int present; /* need to execute and sync at first */ snd_hda_codec_read(codec, 0x14, 0, AC_VERB_SET_PIN_SENSE, 0); - present_int_hp = snd_hda_codec_read(codec, 0x14, 0, - AC_VERB_GET_PIN_SENSE, 0); - snd_hda_codec_read(codec, 0x1B, 0, AC_VERB_SET_PIN_SENSE, 0); - present_dock_hp = snd_hda_codec_read(codec, 0x1b, 0, - AC_VERB_GET_PIN_SENSE, 0); - spec->jack_present = (present_int_hp & 0x80000000) != 0; - spec->jack_present |= (present_dock_hp & 0x80000000) != 0; + /* check laptop HP jack */ + present = snd_hda_codec_read(codec, 0x14, 0, + AC_VERB_GET_PIN_SENSE, 0); + /* need to execute and sync at first */ + snd_hda_codec_read(codec, 0x1b, 0, AC_VERB_SET_PIN_SENSE, 0); + /* check docking HP jack */ + present |= snd_hda_codec_read(codec, 0x1b, 0, + AC_VERB_GET_PIN_SENSE, 0); + if (present & AC_PINSENSE_PRESENCE) + spec->jack_present = 1; + else + spec->jack_present = 0; spec->sense_updated = 1; } - if (spec->jack_present) { - /* mute internal speaker */ - snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, - HDA_AMP_MUTE, HDA_AMP_MUTE); - } else { - /* unmute internal speaker if necessary */ + /* unmute internal speaker only if both HPs are unplugged and + * master switch is on + */ + if (spec->jack_present) + mute = HDA_AMP_MUTE; + else mute = snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0); - snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, - HDA_AMP_MUTE, mute); - } + snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, + HDA_AMP_MUTE, mute); } /* unsolicited event for HP jack sensing */ @@ -8797,6 +8801,11 @@ static void alc262_fujitsu_unsol_event(struct hda_codec *codec, alc262_fujitsu_automute(codec, 1); } +static void alc262_fujitsu_init_hook(struct hda_codec *codec) +{ + alc262_fujitsu_automute(codec, 1); +} + /* bind volumes of both NID 0x0c and 0x0d */ static struct hda_bind_ctls alc262_fujitsu_bind_master_vol = { .ops = &snd_hda_bind_vol, @@ -9570,6 +9579,7 @@ static struct alc_config_preset alc262_presets[] = { .channel_mode = alc262_modes, .input_mux = &alc262_fujitsu_capture_source, .unsol_event = alc262_fujitsu_unsol_event, + .init_hook = alc262_fujitsu_init_hook, }, [ALC262_HP_BPC] = { .mixers = { alc262_HP_BPC_mixer }, -- cgit v1.2.3-59-g8ed1b From 186c3117f8aac0b2ac5290aaed254fcfdcc937de Mon Sep 17 00:00:00 2001 From: Travis Place Date: Tue, 20 May 2008 11:54:41 +0200 Subject: [ALSA] hda - Fix ASUS P5GD1 model Corrected the model assignment for the ASUS P5GD1 w/SPDIF after reports of surround sound not being possible. Signed-off-by: Travis Place Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ad2763c86bf5..864b2f598c38 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2981,7 +2981,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = { /* SND_PCI_QUIRK(0x1043, 0x1964, "ASUS", ALC880_ASUS_DIG), */ SND_PCI_QUIRK(0x1043, 0x1973, "ASUS", ALC880_ASUS_DIG), SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS", ALC880_ASUS_DIG), - SND_PCI_QUIRK(0x1043, 0x814e, "ASUS", ALC880_ASUS), + SND_PCI_QUIRK(0x1043, 0x814e, "ASUS P5GD1 w/SPDIF", ALC880_6ST_DIG), SND_PCI_QUIRK(0x1043, 0x8181, "ASUS P4GPL", ALC880_ASUS_DIG), SND_PCI_QUIRK(0x1043, 0x8196, "ASUS P5GD1", ALC880_6ST), SND_PCI_QUIRK(0x1043, 0x81b4, "ASUS", ALC880_6ST), -- cgit v1.2.3-59-g8ed1b From 5d99a8b814abd76e89ef2cf90e29bbb879d6d66c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 16 May 2008 17:55:12 -0700 Subject: SOUND: fix race in device_create There is a race from when a device is created with device_create() and then the drvdata is set with a call to dev_set_drvdata() in which a sysfs file could be open, yet the drvdata will be NULL, causing all sorts of bad things to happen. This patch fixes the problem by using the new function, device_create_drvdata(). Cc: Kay Sievers Cc: Jaroslav Kysela Signed-off-by: Greg Kroah-Hartman --- sound/core/sound.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/core/sound.c b/sound/core/sound.c index 812f91b3de5b..6c8ab48c689a 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -259,8 +259,9 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, return minor; } snd_minors[minor] = preg; - preg->dev = device_create(sound_class, device, MKDEV(major, minor), - "%s", name); + preg->dev = device_create_drvdata(sound_class, device, + MKDEV(major, minor), + private_data, "%s", name); if (IS_ERR(preg->dev)) { snd_minors[minor] = NULL; mutex_unlock(&sound_mutex); @@ -269,9 +270,6 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, return minor; } - if (preg->dev) - dev_set_drvdata(preg->dev, private_data); - mutex_unlock(&sound_mutex); return 0; } -- cgit v1.2.3-59-g8ed1b From e3428e2cf83ca47b66c194559b9e8a74af915947 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 21 May 2008 06:32:11 +0100 Subject: msnd_* is ISA-only Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- sound/oss/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index 857008bb7167..3be2dc1025b5 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig @@ -79,7 +79,7 @@ config SOUND_TRIDENT config SOUND_MSNDCLAS tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey" - depends on SOUND_PRIME && (m || !STANDALONE) + depends on SOUND_PRIME && (m || !STANDALONE) && ISA help Say M here if you have a Turtle Beach MultiSound Classic, Tahiti or Monterey (not for the Pinnacle or Fiji). @@ -143,7 +143,7 @@ config MSNDCLAS_IO config SOUND_MSNDPIN tristate "Support for Turtle Beach MultiSound Pinnacle, Fiji" - depends on SOUND_PRIME && (m || !STANDALONE) + depends on SOUND_PRIME && (m || !STANDALONE) && ISA help Say M here if you have a Turtle Beach MultiSound Pinnacle or Fiji. See for important information -- cgit v1.2.3-59-g8ed1b From 8c5330a505ca58013a65ce9c55953ff7ded79202 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 21 May 2008 06:32:11 +0100 Subject: caiaq endianness fix Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- sound/usb/caiaq/caiaq-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index e97d8b2ac16a..a972f77bd785 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c @@ -351,8 +351,8 @@ static struct snd_card* create_card(struct usb_device* usb_dev) dev = caiaqdev(card); dev->chip.dev = usb_dev; dev->chip.card = card; - dev->chip.usb_id = USB_ID(usb_dev->descriptor.idVendor, - usb_dev->descriptor.idProduct); + dev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor), + le16_to_cpu(usb_dev->descriptor.idProduct)); spin_lock_init(&dev->spinlock); snd_card_set_dev(card, &usb_dev->dev); -- cgit v1.2.3-59-g8ed1b From b9e16bc548600124da9d24186364ee8d06040569 Mon Sep 17 00:00:00 2001 From: Travis Place Date: Wed, 21 May 2008 16:57:20 +0200 Subject: [ALSA] hda - Add model for ASUS P5K-E/WIFI-AP Added a config table entry for the ASUS P5K-E/WIFI-AP mainboard (ID 1043:8227) to use AD1988_6STACK_DIG Signed-off-by: Travis Place Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_analog.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index e0a605adde42..ff1b922c610b 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -2858,6 +2858,7 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = { static struct snd_pci_quirk ad1988_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), + SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG), {} }; -- cgit v1.2.3-59-g8ed1b From bc9b56238eedda865070dcaed6694d65b517c8d6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 23 May 2008 17:50:27 +0200 Subject: [ALSA] hda - Fix noise on VT1708 codec We get quite noisy output on the right channel on VT1708 codec when 24bit samples are used. Suppress the 24bit support until any real fix is found. https://bugzilla.novell.com/show_bug.cgi?id=390473 Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_via.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 52b1d81a26f7..e7e43524f8c7 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -447,6 +447,23 @@ static struct hda_pcm_stream vt1708_pcm_analog_playback = { }, }; +static struct hda_pcm_stream vt1708_pcm_analog_s16_playback = { + .substreams = 1, + .channels_min = 2, + .channels_max = 8, + .nid = 0x10, /* NID to query formats and rates */ + /* We got noisy outputs on the right channel on VT1708 when + * 24bit samples are used. Until any workaround is found, + * disable the 24bit format, so far. + */ + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .ops = { + .open = via_playback_pcm_open, + .prepare = via_playback_pcm_prepare, + .cleanup = via_playback_pcm_cleanup + }, +}; + static struct hda_pcm_stream vt1708_pcm_analog_capture = { .substreams = 2, .channels_min = 2, @@ -899,6 +916,9 @@ static int patch_vt1708(struct hda_codec *codec) spec->stream_name_analog = "VT1708 Analog"; spec->stream_analog_playback = &vt1708_pcm_analog_playback; + /* disable 32bit format on VT1708 */ + if (codec->vendor_id == 0x11061708) + spec->stream_analog_playback = &vt1708_pcm_analog_s16_playback; spec->stream_analog_capture = &vt1708_pcm_analog_capture; spec->stream_name_digital = "VT1708 Digital"; -- cgit v1.2.3-59-g8ed1b From 20a3a05dd66ad0f678a587688cc85f0b36869876 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 23 May 2008 17:52:53 +0200 Subject: [ALSA] hda - Fix COEF and EAPD in ALC889 auto-configuration mode Fix the missing COEF and EAPD initialization in ALC889 auto-configuration mode. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 864b2f598c38..d42864a19893 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -853,6 +853,7 @@ do_sku: case 0x10ec0269: case 0x10ec0862: case 0x10ec0662: + case 0x10ec0889: snd_hda_codec_write(codec, 0x14, 0, AC_VERB_SET_EAPD_BTLENABLE, 2); snd_hda_codec_write(codec, 0x15, 0, @@ -877,6 +878,7 @@ do_sku: case 0x10ec0883: case 0x10ec0885: case 0x10ec0888: + case 0x10ec0889: snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 7); tmp = snd_hda_codec_read(codec, 0x20, 0, -- cgit v1.2.3-59-g8ed1b From 97ec710cab76f90a6bece76a04e76aa50096a470 Mon Sep 17 00:00:00 2001 From: Travis Place Date: Fri, 23 May 2008 18:31:46 +0200 Subject: [ALSA] hda - Added support for Foxconn P35AX-S mainboard Added IDs for the Foxconn P35AX-S mainboard to patch_realtek.c, so that ALC883_6ST_DIG is used by default. Signed-off-by: Travis Place Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d42864a19893..8f31247c52bd 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7745,6 +7745,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_3ST_HP), SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC883_6ST_DIG), SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG), + SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG), SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC883_6ST_DIG), SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), -- cgit v1.2.3-59-g8ed1b From 97e08f5d732bbfd5180f73aa7875d328421bee8a Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Sat, 24 May 2008 18:05:47 +0200 Subject: [ALSA] snd-pcsp - fix pcsp_treble_info() to honour an item number This solves the problem with mixers wrongly displaying the PWM freq. Signed-off-by: Stas Sergeev Signed-off-by: Takashi Iwai --- sound/drivers/pcsp/pcsp.h | 6 ++++-- sound/drivers/pcsp/pcsp_mixer.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h index f07cc1ee1fe7..1d661f795e8c 100644 --- a/sound/drivers/pcsp/pcsp.h +++ b/sound/drivers/pcsp/pcsp.h @@ -24,7 +24,8 @@ static DEFINE_SPINLOCK(i8253_lock); /* default timer freq for PC-Speaker: 18643 Hz */ #define DIV_18KHZ 64 #define MAX_DIV DIV_18KHZ -#define CUR_DIV() (MAX_DIV >> chip->treble) +#define CALC_DIV(d) (MAX_DIV >> (d)) +#define CUR_DIV() CALC_DIV(chip->treble) #define PCSP_MAX_TREBLE 1 /* unfortunately, with hrtimers 37KHz does not work very well :( */ @@ -36,7 +37,8 @@ static DEFINE_SPINLOCK(i8253_lock); #define PCSP_DEFAULT_SDIV (DIV_18KHZ >> 1) #define PCSP_DEFAULT_SRATE (PIT_TICK_RATE / PCSP_DEFAULT_SDIV) #define PCSP_INDEX_INC() (1 << (PCSP_MAX_TREBLE - chip->treble)) -#define PCSP_RATE() (PIT_TICK_RATE / CUR_DIV()) +#define PCSP_CALC_RATE(i) (PIT_TICK_RATE / CALC_DIV(i)) +#define PCSP_RATE() PCSP_CALC_RATE(chip->treble) #define PCSP_MIN_RATE__1 MAX_DIV/PIT_TICK_RATE #define PCSP_MAX_RATE__1 MIN_DIV/PIT_TICK_RATE #define PCSP_MAX_PERIOD_NS (1000000000ULL * PCSP_MIN_RATE__1) diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c index 64a695fef74e..caeb0f57fcca 100644 --- a/sound/drivers/pcsp/pcsp_mixer.c +++ b/sound/drivers/pcsp/pcsp_mixer.c @@ -50,7 +50,8 @@ static int pcsp_treble_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.items = chip->max_treble + 1; if (uinfo->value.enumerated.item > chip->max_treble) uinfo->value.enumerated.item = chip->max_treble; - sprintf(uinfo->value.enumerated.name, "%d", PCSP_RATE()); + sprintf(uinfo->value.enumerated.name, "%d", + PCSP_CALC_RATE(uinfo->value.enumerated.item)); return 0; } -- cgit v1.2.3-59-g8ed1b From 587755f1f6a983a9f0f3322d284034f4e146891a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 25 May 2008 18:20:06 +0200 Subject: [ALSA] hda - Fix capture mute Widget for stac9250/9251 Fix capture mute widget for STAC9250/9251 codecs. The widget 0x09 has no mute but 0x14 does actually. Signed-off-by: Mauro Carvalho Chehab --- sound/pci/hda/patch_sigmatel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 393f7fd2b1be..a4f44a00bae8 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -840,7 +840,7 @@ static struct snd_kcontrol_new stac92hd71bxx_mixer[] = { static struct snd_kcontrol_new stac925x_mixer[] = { STAC_INPUT_SOURCE(1), HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_OUTPUT), - HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_OUTPUT), + HDA_CODEC_MUTE("Capture Switch", 0x14, 0, HDA_OUTPUT), HDA_CODEC_VOLUME("Capture Mux Volume", 0x0f, 0, HDA_OUTPUT), { } /* end */ }; -- cgit v1.2.3-59-g8ed1b From e48d6d97bb6bd8c008045ea0522ea8278fdccc55 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 29 May 2008 08:16:56 +0200 Subject: [ALSA] ac97 - Fix ASUS A9T laptop output ASUS A9T laptop uses line-out pin as the real front-output while other devices use it as the surround. Signed-off-by: Takashi Iwai --- include/sound/ac97_codec.h | 1 + sound/pci/ac97/ac97_patch.c | 48 ++++++++++++++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 14 deletions(-) (limited to 'sound') diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 049edc5e6461..9c309daf492b 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -505,6 +505,7 @@ struct snd_ac97 { unsigned short pcmreg[3]; // PCM registers unsigned short codec_cfg[3]; // CODEC_CFG bits unsigned char swap_mic_linein; // AD1986/AD1986A only + unsigned char lo_as_master; /* LO as master */ } ad18xx; unsigned int dev_flags; /* device specific */ } spec; diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 2da89810ca10..1292dcee072d 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c @@ -1971,6 +1971,9 @@ static int snd_ac97_ad1888_lohpsel_get(struct snd_kcontrol *kcontrol, struct snd val = ac97->regs[AC97_AD_MISC]; ucontrol->value.integer.value[0] = !(val & AC97_AD198X_LOSEL); + if (ac97->spec.ad18xx.lo_as_master) + ucontrol->value.integer.value[0] = + !ucontrol->value.integer.value[0]; return 0; } @@ -1979,8 +1982,10 @@ static int snd_ac97_ad1888_lohpsel_put(struct snd_kcontrol *kcontrol, struct snd struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); unsigned short val; - val = !ucontrol->value.integer.value[0] - ? (AC97_AD198X_LOSEL | AC97_AD198X_HPSEL) : 0; + val = !ucontrol->value.integer.value[0]; + if (ac97->spec.ad18xx.lo_as_master) + val = !val; + val = val ? (AC97_AD198X_LOSEL | AC97_AD198X_HPSEL) : 0; return snd_ac97_update_bits(ac97, AC97_AD_MISC, AC97_AD198X_LOSEL | AC97_AD198X_HPSEL, val); } @@ -2031,7 +2036,7 @@ static void ad1888_update_jacks(struct snd_ac97 *ac97) { unsigned short val = 0; /* clear LODIS if shared jack is to be used for Surround out */ - if (is_shared_linein(ac97)) + if (!ac97->spec.ad18xx.lo_as_master && is_shared_linein(ac97)) val |= (1 << 12); /* clear CLDIS if shared jack is to be used for C/LFE out */ if (is_shared_micin(ac97)) @@ -2067,9 +2072,13 @@ static const struct snd_kcontrol_new snd_ac97_ad1888_controls[] = { static int patch_ad1888_specific(struct snd_ac97 *ac97) { - /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ - snd_ac97_rename_vol_ctl(ac97, "Master Playback", "Master Surround Playback"); - snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", "Master Playback"); + if (!ac97->spec.ad18xx.lo_as_master) { + /* rename 0x04 as "Master" and 0x02 as "Master Surround" */ + snd_ac97_rename_vol_ctl(ac97, "Master Playback", + "Master Surround Playback"); + snd_ac97_rename_vol_ctl(ac97, "Headphone Playback", + "Master Playback"); + } return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls)); } @@ -2088,16 +2097,27 @@ static int patch_ad1888(struct snd_ac97 * ac97) patch_ad1881(ac97); ac97->build_ops = &patch_ad1888_build_ops; - /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */ - /* it seems that most vendors connect line-out connector to headphone out of AC'97 */ + + /* + * LO can be used as a real line-out on some devices, + * and we need to revert the front/surround mixer switches + */ + if (ac97->subsystem_vendor == 0x1043 && + ac97->subsystem_device == 0x1193) /* ASUS A9T laptop */ + ac97->spec.ad18xx.lo_as_master = 1; + + misc = snd_ac97_read(ac97, AC97_AD_MISC); /* AD-compatible mode */ /* Stereo mutes enabled */ - misc = snd_ac97_read(ac97, AC97_AD_MISC); - snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | - AC97_AD198X_LOSEL | - AC97_AD198X_HPSEL | - AC97_AD198X_MSPLT | - AC97_AD198X_AC97NC); + misc |= AC97_AD198X_MSPLT | AC97_AD198X_AC97NC; + if (!ac97->spec.ad18xx.lo_as_master) + /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */ + /* it seems that most vendors connect line-out connector to + * headphone out of AC'97 + */ + misc |= AC97_AD198X_LOSEL | AC97_AD198X_HPSEL; + + snd_ac97_write_cache(ac97, AC97_AD_MISC, misc); ac97->flags |= AC97_STEREO_MUTES; return 0; } -- cgit v1.2.3-59-g8ed1b From 269ef19caa16650bf3a68fd33a6cb800683419dd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 30 May 2008 15:32:15 +0200 Subject: [ALSA] hda - Fix mic input on HP2133 The mic pins are wrongly assigned on AD1884A mobile model. The mic handling is fixed for the automatic mic selection, too. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_analog.c | 50 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index ff1b922c610b..a99e86d74278 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -3644,33 +3644,17 @@ static struct snd_kcontrol_new ad1884a_laptop_mixers[] = { { } /* end */ }; -static struct hda_input_mux ad1884a_mobile_capture_source = { - .num_items = 2, - .items = { - { "Mic", 0x1 }, /* port-C */ - { "Mix", 0x3 }, - }, -}; - static struct snd_kcontrol_new ad1884a_mobile_mixers[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT), HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT), - HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT), - HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT), HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT), HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT), - HDA_CODEC_VOLUME("Mic Boost", 0x15, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Mic Capture Volume", 0x14, 0x0, HDA_INPUT), + HDA_CODEC_VOLUME("Internal Mic Capture Volume", 0x15, 0x0, HDA_INPUT), HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT), - { - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Capture Source", - .info = ad198x_mux_enum_info, - .get = ad198x_mux_enum_get, - .put = ad198x_mux_enum_put, - }, { } /* end */ }; @@ -3687,14 +3671,31 @@ static void ad1884a_hp_automute(struct hda_codec *codec) present ? 0x00 : 0x02); } +/* switch to external mic if plugged */ +static void ad1884a_hp_automic(struct hda_codec *codec) +{ + unsigned int present; + + present = snd_hda_codec_read(codec, 0x14, 0, + AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; + snd_hda_codec_write(codec, 0x0c, 0, AC_VERB_SET_CONNECT_SEL, + present ? 0 : 1); +} + #define AD1884A_HP_EVENT 0x37 +#define AD1884A_MIC_EVENT 0x36 /* unsolicited event for HP jack sensing */ static void ad1884a_hp_unsol_event(struct hda_codec *codec, unsigned int res) { - if ((res >> 26) != AD1884A_HP_EVENT) - return; - ad1884a_hp_automute(codec); + switch (res >> 26) { + case AD1884A_HP_EVENT: + ad1884a_hp_automute(codec); + break; + case AD1884A_MIC_EVENT: + ad1884a_hp_automic(codec); + break; + } } /* initialize jack-sensing, too */ @@ -3702,6 +3703,7 @@ static int ad1884a_hp_init(struct hda_codec *codec) { ad198x_init(codec); ad1884a_hp_automute(codec); + ad1884a_hp_automic(codec); return 0; } @@ -3715,10 +3717,15 @@ static struct hda_verb ad1884a_laptop_verbs[] = { /* Port-F pin */ {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, + /* Port-C pin - internal mic-in */ + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */ /* analog mix */ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, /* unsolicited event for pin-sense */ {0x11, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT}, + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_MIC_EVENT}, { } /* end */ }; @@ -3878,7 +3885,6 @@ static int patch_ad1884a(struct hda_codec *codec) spec->mixers[0] = ad1884a_mobile_mixers; spec->init_verbs[spec->num_init_verbs++] = ad1884a_laptop_verbs; spec->multiout.dig_out_nid = 0; - spec->input_mux = &ad1884a_mobile_capture_source; codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; codec->patch_ops.init = ad1884a_hp_init; break; -- cgit v1.2.3-59-g8ed1b From 79d06432a27601f096e08716fee3f0a7d3b68d5f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 30 May 2008 16:54:49 +0200 Subject: [ALSA] hda - Fix model for LG LS75 laptop Set the proper model for LG LS75 with CM9880 codec. See ALSA bug#2105: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2105 Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_cmedia.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index c73ce074a6ea..6ef57fbfb6eb 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c @@ -611,6 +611,7 @@ static const char *cmi9880_models[CMI_MODELS] = { static struct snd_pci_quirk cmi9880_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", CMI_FULL_DIG), + SND_PCI_QUIRK(0x1854, 0x002b, "LG LS75", CMI_MINIMAL), SND_PCI_QUIRK(0x1854, 0x0032, "LG", CMI_FULL_DIG), {} /* terminator */ }; -- cgit v1.2.3-59-g8ed1b From 07bc76dfa19b10017b518dd9aa1b2719e8c863de Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 3 Jun 2008 14:46:34 +0200 Subject: [ALSA] hda - Fix resume of auto-config mode with Realtek codecs The auto-config mode of Realtek ALC codecs has a bug since 2.6.25 that it cannot resume properly. The problem was the wrong assignment of init_hook that overrides the whole initialization. Relevant bug reports: http://bugzilla.kernel.org/show_bug.cgi?id=10662 https://bugzilla.novell.com/show_bug.cgi?id=385473 Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8f31247c52bd..f46df68cd5b0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -942,7 +942,6 @@ do_sku: AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT); spec->unsol_event = alc_sku_unsol_event; - spec->init_hook = alc_sku_automute; } /* -- cgit v1.2.3-59-g8ed1b From 378bd6a5211f05d6d8eb3e78a92e2a197e456e4e Mon Sep 17 00:00:00 2001 From: Tony Vroon Date: Wed, 4 Jun 2008 12:08:30 +0200 Subject: [ALSA] hda - COMPAL IFL90/JFL-92 laptop quirk Use quirk table to assign ALC268_TOSHIBA to COMPAL IFL90/JFL-92 laptops. No analog output on autoprobe. Signed-off-by: Tony Vroon Tested-by: Guri Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index f46df68cd5b0..518b7cab5102 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10512,6 +10512,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = { SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA), + SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER), SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), -- cgit v1.2.3-59-g8ed1b From 868e15dbd2940f9453b4399117686f408dc77299 Mon Sep 17 00:00:00 2001 From: Jaroslav Franek Date: Fri, 6 Jun 2008 11:04:19 +0200 Subject: sound: emu10k1 - fix system hang with Audigy2 ZS Notebook PCMCIA card When the Linux kernel is compiled with CONFIG_DEBUG_SHIRQ=y, the Soundblaster Audigy2 ZS Notebook PCMCIA card causes the system hang during boot (udev stage) or when the card is hot-plug. The CONFIG_DEBUG_SHIRQ flag is by default 'y' with all Fedora kernels since 2.6.23. The problem was reported as https://bugzilla.redhat.com/show_bug.cgi?id=326411 The issue was hunted down to the snd_emu10k1_create() routine: /* pseudo-code */ snd_emu10k1_create(...) { ... request_irq(... IRQF_SHARED ...) { register the irq handler #ifdef CONFIG_DEBUG_SHIRQ call the irq handler: snd_emu10k1_interrupt() { poll I/O port // <---- !! system hangs ... } #endif } ... snd_emu10k1_cardbus_init(...) { initialize I/O ports } ... } The early access to I/O port in the interrupt handler causes the freeze. Obviously it is necessary to init the I/O ports before accessing them. This patch moves the registration of the irq handler after the initialization of the I/O ports. Signed-off-by: Jaroslav Franek Acked-by: James Courtier-Dutton Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emu10k1_main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index abde5b901884..548c9cc81af5 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1818,13 +1818,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card, } emu->port = pci_resource_start(pci, 0); - if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED, - "EMU10K1", emu)) { - err = -EBUSY; - goto error; - } - emu->irq = pci->irq; - emu->max_cache_pages = max_cache_bytes >> PAGE_SHIFT; if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 32 * 1024, &emu->ptb_pages) < 0) { @@ -1887,6 +1880,14 @@ int __devinit snd_emu10k1_create(struct snd_card *card, emu->fx8010.etram_pages.area = NULL; emu->fx8010.etram_pages.bytes = 0; + /* irq handler must be registered after I/O ports are activated */ + if (request_irq(pci->irq, snd_emu10k1_interrupt, IRQF_SHARED, + "EMU10K1", emu)) { + err = -EBUSY; + goto error; + } + emu->irq = pci->irq; + /* * Init to 0x02109204 : * Clock accuracy = 0 (1000ppm) -- cgit v1.2.3-59-g8ed1b From 7b1e8795ebfe1705153d1001f2a899119f4d9012 Mon Sep 17 00:00:00 2001 From: Akio Idehara Date: Mon, 9 Jun 2008 22:46:07 +0900 Subject: [ALSA] hda - Fix "alc262_sony_unsol[]" hda_verb array I think that hda_verb array must have "terminator (empty array)". But alc262_sony_unsol[] does not have it. And it causes gcc-4.3's buggy behavior with snd_hda_sequence_write(). Signed-off-by: Akio Idehara Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 518b7cab5102..b0a2a262ece2 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -8642,6 +8642,7 @@ static struct hda_verb alc262_sony_unsol_verbs[] = { {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {} }; /* mute/unmute internal speaker according to the hp jack and mute state */ -- cgit v1.2.3-59-g8ed1b From 9f9115d880ca550922434aee05ca18796c58eb99 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 16 Jun 2008 14:13:52 +0200 Subject: sound: oxygen: fix NULL pointer dereference when loading snd-oxygen Check that model->control_filter is set before trying to call it. Signed-off-by: Clemens Ladisch Signed-off-by: Takashi Iwai --- sound/pci/oxygen/oxygen_mixer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index cc0cddadd589..6facac5aed90 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c @@ -936,11 +936,13 @@ static int add_controls(struct oxygen *chip, for (i = 0; i < count; ++i) { template = controls[i]; - err = chip->model->control_filter(&template); - if (err < 0) - return err; - if (err == 1) - continue; + if (chip->model->control_filter) { + err = chip->model->control_filter(&template); + if (err < 0) + return err; + if (err == 1) + continue; + } if (!strcmp(template.name, "Master Playback Volume") && chip->model->dac_tlv) { template.tlv.p = chip->model->dac_tlv; -- cgit v1.2.3-59-g8ed1b From 44e051773da465f8c92127914bc784770e0e2a28 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Jun 2008 11:54:05 +0200 Subject: ALSA: aw2 - Fix Oops at initialization The irq handler may be called before the proper initialization of hardware. Call snd_aw2_saa7146_setup() before the irq handler registration. Signed-off-by: Takashi Iwai --- sound/pci/aw2/aw2-alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c index 56f87cd33c19..3f00ddf450f8 100644 --- a/sound/pci/aw2/aw2-alsa.c +++ b/sound/pci/aw2/aw2-alsa.c @@ -316,6 +316,8 @@ static int __devinit snd_aw2_create(struct snd_card *card, return -ENOMEM; } + /* (2) initialization of the chip hardware */ + snd_aw2_saa7146_setup(&chip->saa7146, chip->iobase_virt); if (request_irq(pci->irq, snd_aw2_saa7146_interrupt, IRQF_SHARED, "Audiowerk2", chip)) { @@ -329,8 +331,6 @@ static int __devinit snd_aw2_create(struct snd_card *card, } chip->irq = pci->irq; - /* (2) initialization of the chip hardware */ - snd_aw2_saa7146_setup(&chip->saa7146, chip->iobase_virt); err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); if (err < 0) { free_irq(chip->irq, (void *)chip); -- cgit v1.2.3-59-g8ed1b From 3e14b50dd4a3178f4f635267a2706b5d4f8c61ee Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Jun 2008 11:58:06 +0200 Subject: ALSA: sb - Fix wrong assertions snd_assert() in save_mixer() and restore_mixer() in sb_mixer.c is just wrong. The debug code wasn't tested at all, obviously... Signed-off-by: Takashi Iwai --- sound/isa/sb/sb_mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index 91d14224f6b3..73d4572d136b 100644 --- a/sound/isa/sb/sb_mixer.c +++ b/sound/isa/sb/sb_mixer.c @@ -925,7 +925,7 @@ static unsigned char als4000_saved_regs[] = { static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) { unsigned char *val = chip->saved_regs; - snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return); + snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); for (; num_regs; num_regs--) *val++ = snd_sbmixer_read(chip, *regs++); } @@ -933,7 +933,7 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) { unsigned char *val = chip->saved_regs; - snd_assert(num_regs > ARRAY_SIZE(chip->saved_regs), return); + snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); for (; num_regs; num_regs--) snd_sbmixer_write(chip, *regs++, *val++); } -- cgit v1.2.3-59-g8ed1b