Commit Graph

490 Commits

Author SHA1 Message Date
David Henningsson 4cb3631084 ALSA: HDA: Add position_fix=3 module option, and refactor related code
What was previously known as via_dmapos_patch, and hard-coded to be
used for VIA and ATI controllers, is now configurable through a module
option. The background is that some VIA controllers seem to prefer
via_dmapos_patch to be turned off.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-30 14:16:11 +02:00
Otavio Salvador e35d4b1195 ALSA: hda: add Vortex86MX PCI ids
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-27 07:57:31 +02:00
Takashi Iwai b686453543 ALSA: hda - Reduce pci id list for Intel with class id
Most of Intel controllers work as generic HD-audio without quirks,
and it'll be hopefully so in future.  Let's mark pci id with the
PCI_CLASS_MULTIMEDIA_HD_AUDIO for Intel so that the driver will work
with any new control chips in future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-16 07:35:46 +02:00
Seth Heasley cea310e8f8 ALSA: hda_intel: ALSA HD Audio patch for Intel Patsburg DeviceIDs
This patch adds the Intel Patsburg (PCH) HD Audio Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-13 08:37:27 +02:00
Takashi Iwai eb541337b7 ALSA: hda - Make converter setups sticky
So far, we reset the converter setups like the stream-tag, the
channel-id and format-id in prepare callbacks, and clear them in
cleanup callbacks.  This often causes a silence of the digital
receiver for a couple of seconds.

This patch tries to delay the converter setup changes as much as
possible.  The converter setups are cached and aren't reset as long
as the same values are used.  At suspend/resume, they are cleared
to be recovered properly, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-06 13:48:11 +02:00
Takashi Iwai 08af495f22 ALSA: hda - More relax for pending period handling
Since the pending periods are often bogus and take long time until
actually processed, it often results in a high CPU usage of the hd-audio
workq.  Overall it's better to have low CPU consumption by avoiding a
too tight loop rather than the wake-up timing accuracy.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-03 14:43:07 +02:00
Anssi Hannula 32c168c892 ALSA: hda - Set Stream Type in Stream Format according to AES0
Set bit 15 (Stream Type) of HDA Stream Format to 1 (Non-PCM) when IEC958
channel status bit 1 (AES0 & 0x02) is set to 1 (non-audio).

This is a prequisite for HDMI HBR passthrough.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-03 12:53:27 +02:00
Takashi Iwai e4caa8bab3 Merge branch 'master' of git.alsa-project.org:alsa-kernel into fix/hda 2010-06-02 14:15:10 +02:00
Jaroslav Kysela edb39935c8 ALSA: hda-intel - fix wallclk variable update and condition
This patch fixes thinko introduced in "last minutes" before commiting
of the last wallclk patch.

It also fixes the condition checking if the first period after last
wallclk update is processed. There is a little rounding error in
period_wallclk.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-06-02 13:34:01 +02:00
Daniel T Chen 9f75c1b12c ALSA: hda: Use LPIB for ASUS M2V
BugLink: https://launchpad.net/bugs/587546

Symptom: On the reporter's ASUS M2V, using PulseAudio in Ubuntu 10.04 LTS
results in the PA daemon crashing shortly after attempting playback of an
audio file.

Test case: Using Ubuntu 10.04 LTS (Linux 2.6.32.12), Linux 2.6.33, or
Linux 2.6.34, attempt playback of an audio file while PulseAudio is
active.

Resolution: add SSID for this machine to the position_fix quirk table,
explicitly specifying the LPIB method.

Reported-and-Tested-By: D Tangman
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-01 07:48:43 +02:00
Daniel T Chen b90c076424 ALSA: hda: Use LPIB for another mainboard
BugLink: https://launchpad.net/bugs/580749

Symptom: on the original reporter's VIA VT1708-based board, the
PulseAudio daemon dies shortly after the user attempts to play an audio
file.

Test case: boot from Ubuntu 10.04 LTS live cd; attempt to play an audio
file.

Resolution: add SSID for the original reporter's hardware to the
position_fix quirk table, explicitly specifying the LPIB method.

Reported-and-Tested-By: Harald
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-31 09:23:25 +02:00
Daniel T Chen dd37f8e865 ALSA: hda: Use LPIB for an ASUS device
BugLink: https://launchpad.net/bugs/465942

Symptom: On the reporter's ASUS device, using PulseAudio in Ubuntu 10.04
LTS results in the PA daemon crashing shortly after attempting to select
capture or to configure the audio hardware profile.

Test case: Using Ubuntu 10.04 LTS (Linux 2.6.32.12), Linux 2.6.33, or
Linux 2.6.34, adjust the HDA device's capture volume with PulseAudio.

Resolution: add SSID for this machine to the position_fix quirk table,
explicitly specifying the LPIB method.

Reported-and-Tested-By: Irihapeti
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-31 09:22:28 +02:00
Daniel T Chen 61bb42c37d ALSA: hda: Use LPIB for a Shuttle device
BugLink: https://launchpad.net/bugs/551949

Symptom: On the reporter's Shuttle device, using PulseAudio in Ubuntu
10.04 LTS results in "popping clicking" audio with the PA crashing
shortly thereafter.

Test case: Using Ubuntu 10.04 LTS (Linux 2.6.32.12), Linux 2.6.33, or
Linux 2.6.34, adjust the HDA device's volume with PulseAudio.

Resolution: add SSID for this machine to the position_fix quirk table,
explicitly specifying the LPIB method.

Reported-and-Tested-By: Christian Mehlis <mehlis@inf.fu-berlin.de>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-29 21:47:59 +02:00
Daniel T Chen e96d312776 ALSA: hda: Use LPIB for Sony VPCS11V9E
BugLink: https://launchpad.net/bugs/586347

Symptom: On the Sony VPCS11V9E, using GStreamer-based applications with
PulseAudio in Ubuntu 10.04 LTS results in stuttering audio. It appears
to worsen with increased I/O.

Test case: use Rhythmbox under increased I/O pressure. This symptom is
reproducible in the current daily stable alsa-driver snapshots (at least
up until 21 May 2010; later snapshots fail to build from source due to
missing preprocessor directives when compiled against 2.6.32).

Resolution: add SSID for this machine to the position_fix quirk table,
explicitly specifying the LPIB method.

Reported-and-Tested-By: Lauri Kainulainen <lauri@sokkelo.net>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-28 07:51:17 +02:00
Clemens Ladisch 9ef04066b3 ALSA: hda_intel: fix handling of non-completion stream interrupts
Check that the interrupt raised for a stream is actually a buffer
completion interrupt before handling it as one.  Otherwise, memory
errors or FIFO xruns would be interpreted as a pointer update and could
break the stream timing.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-25 20:23:15 +02:00
Daniel T Chen 4e0938dba7 ALSA: hda: Use LPIB for Toshiba A100-259
BugLink: https://launchpad.net/bugs/549560

Symptom: on a significant number of hardware, booting from a live cd
results in capture working correctly, but once the distribution is
installed, booting from the install results in capture not working.

Test case: boot from Ubuntu 10.04 LTS live cd; capture works correctly.
Install to HD and reboot; capture does not work. Reproduced with 2.6.32
mainline build (vanilla kernel.org compile)

Resolution: add SSID for Toshiba A100-259 to the position_fix quirk
table, explicitly specifying the LPIB method.

I'll be sending additional patches for these SSIDs as bug reports are
confirmed.

This patch also trivially sorts the quirk table in ascending order by
subsystem vendor.

Reported-and-Tested-by: <davide.molteni@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-25 08:40:50 +02:00
Daniel T Chen 7a68be94e2 ALSA: hda: Use LPIB for Acer Aspire 5110
BugLink: https://launchpad.net/bugs/583983

Symptom: on a significant number of hardware, booting from a live cd
results in capture working correctly, but once the distribution is
installed, booting from the install results in capture not working.

Test case: boot from Ubuntu 10.04 LTS live cd; capture works correctly.
Install to HD and reboot; capture does not work. Reproduced with 2.6.32
mainline build (vanilla kernel.org compile).

Resolution: add SSID for Acer Aspire 5110 to the position_fix quirk
table, explicitly specifying the LPIB method.

I'll be sending additional patches for these SSIDs as bug reports are
confirmed.

Reported-and-Tested-By: Leo
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-25 08:40:14 +02:00
Jaroslav Kysela f48f606d9f [ALSA] snd-hda-intel: Improve azx_position_ok()
Add back the zero return value (activate workqueue) when
bdl_pos_adj is nonzero for position check.

Do the position related check only for first next period
using wallclk counter.

Return -1 value (ignore interrupt) when period_bytes
variable is zero.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-05-11 12:17:55 +02:00
Jaroslav Kysela e54637205b [ALSA] snd-hda-intel: use WALLCLK register to check for early irqs
Use 24Mhz WALLCLK register to ignore too early interrupts and
wrong interrupt status. The bad timing confuses the higher ALSA
layer and causes audio skipping. More information about behaviour
and debugging can be found in kernel bz#15912.

https://bugzilla.kernel.org/show_bug.cgi?id=15912

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-05-11 10:21:46 +02:00
Shahin Ghazinouri beaffc3993 ALSA: hda - Fixes distorted recording on US15W chipset
The HDA controller in US15W (Poulsbo) reports inaccurate position values
for capture streams when using the LPIB read method, resulting in
distorted recordings.

However, using the position buffer is broken for playback streams,
resulting in a fallback to the LPIB method with the current driver.
This patch works around the issue by independently detecting the read
position method for capture and playback streams.

The patch will not have any effect if the position fix method is
explicitly set.

[Code simplified by tiwai]

Signed-off-by: Shahin Ghazinouri <shahin.ghazinouri@pelagicore.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-11 08:21:33 +02:00
Takashi Iwai 20d157aef2 Merge branch 'fix/hda' into topic/hda 2010-05-06 08:39:43 +02:00
Daniel T Chen 0e0280dc2b ALSA: hda: Use LPIB quirk for DG965OT board version AAD63733-203
BugLink: https://launchpad.net/bugs/459083

The OR has verified with 2.6.32.11 and the latest alsa-driver stable
daily snapshot that position_fix=1 is necessary for the external mic
to work and for PulseAudio not to crash constantly.

This patch is necessary also for 2.6.32.11 and 2.6.33.2.

Reported-by: <imwithid@yahoo.com>
Tested-by: <imwithid@yahoo.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-23 08:00:43 +02:00
Takashi Iwai 039f0f3a5b Merge branch 'fix/hda' into topic/hda 2010-04-15 09:09:02 +02:00
Takashi Iwai 8815cd030f ALSA: hda - Add position_fix quirk for Biostar mobo
The Biostar mobo seems to give a wrong DMA position, resulting in
stuttering or skipping sounds on 2.6.34.  Since the commit
7b3a177b0d, "ALSA: pcm_lib: fix "something
must be really wrong" condition", makes the position check more strictly,
the DMA position problem is revealed more clearly now.

The fix is to use only LPIB for obtaining the position, i.e. passing
position_fix=1.  This patch adds a static quirk to achieve it as default.

Reported-by: Frank Griffin <ftg@roadrunner.com>
Cc: Eric Piel <Eric.Piel@tremplin-utc.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-15 09:02:41 +02:00
Takashi Iwai 92ab7b8f38 Merge branch 'fix/hda' into topic/hda 2010-04-07 08:38:47 +02:00
Takashi Iwai 3815595e78 ALSA: hda - Add MSI blacklist for Aopen MZ915-M
The device needs MSI disablement.  Added to the quirk list.

Reported-by: Harald Dunkel <harri@afaics.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-04 12:14:03 +02:00
Takashi Iwai 55440e4e37 Merge branch 'fix/hda' into topic/hda 2010-03-29 09:20:32 +02:00
Daniel T Chen 9ec8ddad59 ALSA: hda: Use LPIB for ga-ma770-ud3 board
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575669

The OR states that position_fix=1 is necessary to work around glitching
during volume adjustments using PulseAudio.

Reported-by: Carlos Laviola <claviola@debian.org>
Tested-by: Carlos Laviola <claviola@debian.org>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-29 08:26:05 +02:00
Jaroslav Kysela 079e683ebd ALSA: hda-intel - probe_only module option is int type now
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-26 11:16:59 +01:00
Jaroslav Kysela 10e77ddac0 ALSA: hda-intel - remove model=hwio , use probe_only=3 instead
The probe_only module parameter skips the codec initialization, too.
Remove the model=hwio code and use second bit in probe_only to
skip the HDA codec reset procedure.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-26 11:08:43 +01:00
Jaroslav Kysela cd508fe58b ALSA: hda-intel - add special 'hwio' model to bypass initialization
Using the 'model=hwio' option, the driver bypasses any codec
initialization and the reset procedure for codecs is also
bypassed. This mode is usefull to enable direct access using
hwdep interface (using hdaverb or hda-analyzer tools) and
retain codec setup from BIOS.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-26 10:37:39 +01:00
Takashi Iwai e04dd2d21b Merge branch 'fix/hda' into for-linus 2010-03-17 09:01:38 +01:00
Daniel T Chen 572c0e3c73 ALSA: hda: Use LPIB and 6stack-dig for eMachines T5212
BugLink: https://bugs.launchpad.net/bugs/538895

The OR has verified that both position_fix=1 and model=6stack-dig are
necessary to have capture function properly. (The existing 3stack-6ch
model quirk seems to be incorrect.)

Reported-by: Reuben Bailey <reuben.e.bailey@gmail.com>
Tested-by: Reuben Bailey <reuben.e.bailey@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-16 07:46:31 +01:00
Takashi Iwai 80c43ed724 ALSA: hda - Disable MSI for Nvidia controller
Judging from the member of enable_msi white-list, Nvidia controller
seems to cause troubles with MSI enabled, e.g. boot hang up or other
serious issue may come up.  It's safer to disable MSI as default for
Nvidia controllers again for now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
2010-03-15 15:51:53 +01:00
Vitaliy Kulikov c602c8ad45 ALSA: hda - New Intel HDA controller
Added a PCI controller id on new Dell laptops.

Signed-off-by: Vitaliy Kulikov <Vitaliy.Kulikov@idt.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-15 09:01:26 +01:00
Takashi Iwai 7d39cf6224 Merge branch 'topic/hda' into for-linus 2010-03-10 09:01:25 +01:00
Ralf Gerbig ecd216260f ALSA: hda - Sound MSI fallout on a Asus mobo NVIDIA MCP55
without the following patch audio ssttuutteerrs on
ASUS M2N32-SLI PREMIUM ACPI BIOS Revision 1304
the sound device is:
00:0e.1 Audio device: nVidia Corporation MCP55 High Definition Audio (rev a2)
worked with 2.6.32

Signed-off-by: Ralf Gerbig <rge@quengel.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-09 18:29:01 +01:00
Takashi Iwai f1cf9a666d Merge branch 'topic/hda' into for-linus 2010-03-08 09:35:43 +01:00
Michele Ballabio 4193d13b2c ALSA: hda - Add ASRock mobo to MSI blacklist
This avoids a lockup at boot.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-07 09:29:39 +01:00
Takashi Iwai 7484399fe2 Merge branch 'fix/hda' into topic/hda 2010-03-07 09:29:29 +01:00
Daniel T Chen 0321b69569 ALSA: hda: Use LPIB for a Biostar Microtech board
BugLink: https://launchpad.net/bugs/523953

The OR has verified that position_fix=1 is necessary to work around
errors on his machine.

Reported-by: MMarking
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 16:06:01 +01:00
Daniel T Chen 9919c7619c ALSA: hda: Use LPIB for Dell Latitude 131L
BugLink: https://launchpad.net/bugs/530346

The OR has verified that position_fix=1 is necessary to work around
errors on his machine.

Reported-by: Tom Louwrier
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-04 16:32:01 +01:00
Wei Ni 7445dfc159 ALSA: hda - Support max codecs to 8 for nvidia hda controller
Support max codecs to 8 for nvidia hda controller.
Change AZX_MAX_CODECS to 8, and add
"#define AZX_DEFAULT_CODECS 4" for default driver.
Set azx_max_codecs to 8 for nvidia controller.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-04 15:53:56 +01:00
Takashi Iwai a91a4aa1ee Merge branch 'topic/hda' into for-linus 2010-03-01 12:38:54 +01:00
Takashi Iwai 12c2a682b5 Merge branch 'topic/misc' into for-linus 2010-03-01 12:38:49 +01:00
Seth Heasley 32679f95ca ALSA: hda - enable snoop for Intel Cougar Point
This patch enables snoop, eliminating static during playback.
This patch supersedes the previous Cougar Point audio patch.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:15:37 +01:00
Paul Menzel 0708cc582f ALSA: hda-intel: Add position_fix quirk for ASUS M2V-MX SE.
With PulseAudio and an application accessing an input device like `gnome-volume-manager` both have high CPU load as reported in [1].

Loading `snd-hda-intel` with `position_fix=1` fixes this issue. Therefore add a quirk for ASUS M2V-MX SE.

The only downside is, when now exiting for example MPlayer when it is playing an audio file a high pitched sound is outputted by the speaker.

$ lspci -vvnn | grep -A10 Audio
20:01.0 Audio device [0403]: VIA Technologies, Inc. VT1708/A [Azalia HDAC] (VIA High Definition Audio Controller) [1106:3288] (rev 10)
	Subsystem: ASUSTeK Computer Inc. Device [1043:8290]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 17
	Region 0: Memory at fbffc000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: HDA Intel

[1] http://sourceforge.net/mailarchive/forum.php?thread_name=1265550675.4642.24.camel%40mattotaupa&forum_name=alsa-user

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 08:37:15 +01:00
Paul Menzel 2448158ed2 ALSA: Typo. s/distrubs/disturbs/
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 08:36:56 +01:00
Takashi Iwai 7fb3a069bc Merge branch 'fix/misc' into topic/misc
Conflicts:
	sound/pci/hda/patch_realtek.c
2010-02-17 14:24:46 +01:00
Takashi Iwai 0a27fcfaaf ALSA: hda - Correct ASUA blacklist for MSI brokenness
The MSI blacklist entry for ASUS mobo added in the commit
8ce28d6abf was based on the alsa-info
output wrongly posted.  Fix the id to the right one now.

Reported-by: Sid Boyce <sboyce@blueyonder.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-15 17:05:28 +01:00
Takashi Iwai d6d8bf5493 ALSA: hda - use WARN_ON_ONCE() for zero-division detection
Replace the zero-division warning message with WARN_ON_ONCE() per the
advice by Linus.  This shouldn't happen, but if it happens, it's
possible that the bug happens often due to buggy IRQs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-12 18:20:04 +01:00
Takashi Iwai b2d6efe7fa Merge branch 'fix/hda' into topic/hda 2010-02-09 21:34:18 +01:00
Jody Bruchon fed08d036f ALSA: hda-intel: Avoid divide by zero crash
On my AMD780V chipset, hda_intel.c can crash the kernel with a divide by
zero
for as-yet unknown reasons. A simple check for zero prevents it, though
the problem that causes it remains. Since the workaround is harmless and
won't affect anyone except victims of this bug, it should be safe;
moreover,
because this crash can be triggered by a user-mode application, there are
denial of service implications on the systems affected by the bug without
the patch.

Signed-off-by: Jody Bruchon <jody@nctritech.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-09 21:33:33 +01:00
Alexey Dobriyan cebe41d4b8 sound: use DEFINE_PCI_DEVICE_TABLE
Use DEFINE_PCI_DEVICE_TABLE() to make PCI device ids go to
.devinit.rodata section, so they can be discarded in some cases,
and make them const.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-09 11:08:33 +01:00
Takashi Iwai 794d620650 Merge branch 'fix/hda' into topic/hda 2010-02-05 09:09:25 +01:00
Maxim Levitsky 9492837a6f ALSA: cosmetic: make hda intel interrupt name consistent with others
This renames the interrupt name in /proc/interrupt.
HDA Intel -> hda_intel

This also eliminates space from the name, probably helping some
parsers.
Don't think anybody depends on this name in userspace

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-05 09:08:14 +01:00
Maxim Levitsky 1eb6dc7dab ALSA: hda - Delay switching to polling mode if an interrupt was missing
My sound codec seems sometimes (very rarely) to omit interrupts (ALC268)
However, interrupt mode still works.
Thus if we get timeout, poll the codec once.

If we get 3 such polls in a row, then switch to polling mode.

This patch is maybe an bandaid, but this might be a workaround for hardware bug.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-05 09:07:21 +01:00
Takashi Iwai c893622251 ALSA: hda - Define max number of PCM devices in hda_codec.h
Define the constant rather in the common header file.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-28 17:08:53 +01:00
Wei Ni 7b36ea967c ALSA: hda - Change the AZX_MAX_PCMS to 10
In hda_codec.c, it has define
"[HDA_PCM_TYPE_HDMI]  = { 3, 7, 8, 9, -1 },",
it support up to device 9 for HDMI.
But in hda_intel.c, it only define AZX_MAX_PCMS as 8.
So if it have 4 hdmi codecs, when run azx_attach_pcm_stream(),
it will show error "Invalid PCM device number 8", and "... number 9",
and return "-EINVAL".
We should change the AZX_MAX_PCMS to 10.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-28 17:06:19 +01:00
Takashi Iwai 8ce28d6abf ALSA: hda - Add an ASUS mobo to MSI blacklist
Sid Boyce reported that his machine locks up without enable_msi=0 option.
This looks like another ASUS mobo with Nvidia combo.

Reported-by: Sid Boyce <sboyce@blueyonder.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-27 20:26:08 +01:00
Wei Ni ccc5df058d ALSA: hda - Add support for more the 8 streams
In azx_stream_start() and azx_stream_stop(),
it use azx_readb/azx_writeb to read/write SIE,
it just enable/disable 8 streams.
But according to the HDA spec, it support 30 streams,
and the new HDA controller will support more then 8
streams. So we should use azx_readl/azx_writel to
read/write SIE.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-26 10:40:03 +01:00
Seth Heasley d2f2fcd254 ALSA: hda_intel: ALSA HD Audio patch for Intel Cougar Point DeviceIDs
This patch adds the Intel Cougar Point (PCH) HD Audio Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-13 08:34:34 +01:00
Takashi Iwai 15e7f8b92a Merge branch 'fix/hda' into topic/hda 2009-12-25 14:17:48 +01:00
Wu Fengguang ef18beded8 ALSA: hda - HDMI sticky stream tag support
When we run the following commands in turn (with
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0),

	speaker-test -Dhw:0,3 -c2 -twav  # HDMI
	speaker-test -Dhw:0,0 -c2 -twav  # Analog

The second command will produce sound in the analog lineout _as well as_
HDMI sink. The root cause is, device 0 "reuses" the same stream tag that
was used by device 3, and the "intelhdmi - sticky stream id" patch leaves
the HDMI codec in a functional state. So the HDMI codec happily accepts
the audio samples which reuse its stream tag.

The proposed solution is to remember the last device each azx_dev was
assigned to, and prefer to
1) reuse the azx_dev (and hence the stream tag) the HDMI codec last used
2) or assign a never-used azx_dev for HDMI

With this patch and the above two speaker-test commands,
HDMI codec will use stream tag 8 and Analog codec will use 5.

The stream tag used by HDMI codec won't be reused by others, as long
as we don't run out of the 4 playback azx_dev's. The legacy Analog
codec will continue to use stream tag 5 because its device id is 0
(this is a bit tricky).

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25 14:17:36 +01:00
Takashi Iwai 524027916e Merge branch 'fix/hda' into topic/hda 2009-12-23 08:38:23 +01:00
Takashi Iwai 9dc8398bab ALSA: hda - Add MSI blacklist
A machine with AMD CPU with Nvidia board doesn't work with MSI.

Reported-by: Robert J. King <peritus@gurunetwork.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-22 08:15:01 +01:00
Takashi Iwai 0c2fd1bf4c ALSA: hda - Check class to identify Nvidia controller chips
Instead of listing all individual PCI IDs, check the matching with
the PCI class together with the vendor id for Nvidia.
This simplifies the pci id entries.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-18 16:41:39 +01:00
Stefan Ringel 6dd7dc767e ALSA: hda - Add PCI IDs for Nvidia G2xx-series
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-14 11:27:11 +01:00
Wu Fengguang 0287d97065 intelhdmi - dont power off HDA link
For codecs without EPSS support (G45/IbexPeak), the hotplug event will
be lost if the HDA is powered off during the time. After that the pin
presence detection verb returns inaccurate info.

So always power-on HDA link for !EPSS codecs.

KarL offers the fact and Takashi recommends to flag hda_bus. Thanks!

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-11 14:06:18 +01:00
Jaroslav Kysela 396087eaea ALSA: hda - Terradici HDA controllers does not support 64-bit mode
Confirmed from vendor and tests in RedHat bugzilla #536782 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-09 12:29:25 +01:00
Takashi Iwai 2f703e7a2e ALSA: hda - Add position_fix quirk for HP dv3
HP dv3 requires position_fix=1.

Reference: Novell bnc#555935
	https://bugzilla.novell.com/show_bug.cgi?id=555935

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-01 14:17:37 +01:00
Takashi Iwai 45d4ebf1a6 ALSA: hda - Add a position_fix quirk for MSI Wind U115
MSI Wind U115 seems to require position_fix=1 explicitly.
Otherwise it screws up PulseAudio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-30 11:59:17 +01:00
Jaroslav Kysela 2dca0bba70 ALSA: hda - add beep_mode module parameter
The beep_mode parameter for snd-hda-intel module allows to choose among
different digital beep device registation to the input layer.

0 = do not register to the input layer
1 = register to the input layer all time
2 = use "Beep Switch" control exported to user space mixer applications

Also, introduce CONFIG_SND_HDA_INPUT_BEEP_MODE for default value.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16 11:35:10 +01:00
Takashi Iwai 7d1794e81b Merge branch 'fix/hda' into topic/hda 2009-11-16 11:33:35 +01:00
Takashi Iwai fb8d1a344d ALSA: hda - Add reboot notifier to each codec
Add reboot notifier to each codec so that it can do some workarounds
needed for reboot.

So far, patch_sigmatel.c calls its shutup routine for avoiding noises
at reboot on some HP machines.

References: Novell bnc#544779
	http://bugzilla.novell.com/show_bug.cgi?id=544779

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10 16:02:29 +01:00
Takashi Iwai 1a6969788e ALSA: hda - Don't initialize CORB/RIRB for single_cmd mode
So far, CORB/RIRB still remains even if the driver is switched to the
single_cmd mode.  The specification says that this should be disabled,
but I hoped this isn't the case; indeed most devices worked together with
CORB/RIRB.

However, Poulsbo (US15W) seems problematic with this setup, and it
requires to disable CORB/RIRB when single_cmd is used.

Now this patch disables CORB/RIRB initialization when the single_cmd
mode is used.  Also the unsolicited event is disabled because it can't
work without RIRB.

Reported-and-tested-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-07 09:49:04 +01:00
Takashi Iwai 7d5ab41870 Merge branch 'fix/hda' into topic/hda 2009-11-05 08:56:20 +01:00
Takashi Iwai 23c4a8812a ALSA: hda - Switch to polling mode before disabling MSI
When any codec communication error happens, try to switch to the polling
mode first before turning off MSI.  MSI gets more stable nowadays, thus
we should keep it on as much as possible.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 13:21:49 +01:00
peer chen db32f99816 ALSA: hda_intel: Add the Linux device ID for NVIDIA HDA controller
Add the generic device ID for NVIDIA HDA controller.

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 11:59:12 +01:00
Takashi Iwai 71623855e2 ALSA: hda - Enable MSI as default
Since the recent kernel can handle MSI properly on non-Intel platforms,
let's enable MSI as default.

If any borken device is found, we can add the quirk entry to the list,
which is currently empty.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28 13:15:30 +02:00
Daniel T Chen 3d80dcaca1 ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547994

Enable MSI by default for this Pavilion model.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-24 12:14:37 +02:00
Takashi Iwai 4d8e22e0f6 ALSA: hda - Add a white-list for MSI option
Created a white-list to enable MSI since some devices require MSI
explicitly due to BIOS/ACPI problems.  Simply using a quirk list.
As the first case, take HP Compaq CQ40.

Reference: Novell bnc#529971
	https://bugzilla.novell.com/show_bug.cgi?id=529971

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-11 14:25:46 +02:00
Takashi Iwai e44d4e4cee Merge branch 'fix/hda' into topic/hda 2009-08-03 08:37:17 +02:00
Wu Fengguang e310bb0646 ALSA: hda: warn on spurious response
To help disclose hardware bugs.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:53 +02:00
Wu Fengguang feb273404f ALSA: hda: remember last command for each codec
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:39 +02:00
Wu Fengguang c32649feb4 ALSA: hda: read CORBWP inside reg_lock
This converts the last CORBWP access outside of reg_lock.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:26:55 +02:00
Wu Fengguang cdb1fbf231 ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
Just for safety.  azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:26:42 +02:00
Wu Fengguang a678cdee25 ALSA: hda: take cmd_mutex in probe_codec()
Now that each codec will have its own module, it is possible
for the user to load one codec while another one is running.

So cmd_mutex would be a safe addition to probe_codec().

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:26:23 +02:00
Wu Fengguang deadff1665 ALSA: hda: track CIRB/CORB command/response states for each codec
Recently we hit a bug in our dev board, whose HDMI codec#3 may emit
redundant/spurious responses, which were then taken as responses to
command for another onboard Realtek codec#2, and mess up both codecs.

Extend the azx_rb.cmds and azx_rb.res to array and track each codec's
commands/responses separately. This helps keep good codec safe from
broken ones.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:26:13 +02:00
Andiry Brienza 9176b672c2 ALSA: hda - Add support for new AMD HD audio devices
Add support for new AMD HD audio devices. Use generic driver to detect HD audio
devices with Vendor ID AMD.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-17 11:16:51 +02:00
Takashi Iwai 305355aad8 Merge branch 'fix/hda' into topic/hda
Conflicts:
	sound/pci/hda/patch_realtek.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-09 18:48:38 +02:00
Andiry Brienza dc4c2e6bde ALSA: hda - Disable AMD SB600 64bit address support only
HDA driver disabled HD audio 64bit address support for all AMD
SB600/SB700/SB800 platforms with commit
09240cf429 due to one SB600 issue
reported by community, but we do not see the similar issue on
SB700/SB800 platforms.
This patch is to refine the workaround for SB600 only.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-08 08:01:47 +02:00
Takashi Iwai aba6653617 ALSA: hda - Fix error path in the sanity check in azx_pcm_open()
Release resources cleanly after errors in the sanity check in
azx_pcm_open().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-05 11:44:46 +02:00
Takashi Iwai 1475ef0f03 Merge branch 'fix/hda' into topic/hda 2009-07-04 12:20:25 +02:00
Takashi Iwai c470331e69 ALSA: hda - Add sanity check in PCM open callback
Add some sanity checks of struct snd_pcm_hardware fields in the PCM
open callback of hda driver.  This makes a bit easier to debug any PCM
setup errors in the codec side.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-03 23:10:23 +02:00
Takashi Iwai 70d321e638 ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback
The PCM rates bit field may have been changed by the codec open callback.
In that case, we need to reset rate_min and rate_max.  So, simply call
snd_pcm_lib_hw_rates() again after the codec open callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-03 23:06:45 +02:00
Takashi Iwai 4ea6fbc8eb ALSA: hda - Add patch module option
Added the patch module option to apply a "patch" as a firmware to
modify pin configurations or give additional hints to the driver
before actually initializing and configuring the codec.

This can be used as a workaround when the BIOS doesn't give sufficient
information or give wrong information that doesn't match with the real
hardware setup, until it's fixed statically in the driver via a quirk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-24 11:53:43 +02:00
Takashi Iwai a1e21c9078 ALSA: hda - Don't call snd_hda_codec_configure in snd_hda_codec_new()
The codec setup call via snd_hda_codec_configure() isn't necessarily
called in snd_hda_codec_new().  For the later added feature, it's better
to change the code flow like:
 - create all codec instances
 - configure each codec

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-24 11:52:59 +02:00
Alexander Beregalov 65f7598311 ALSA: hda_intel: fix build error when !PM
Fix this build error when CONFIG_PM is not set:
ound/pci/hda/hda_intel.c: In function 'azx_bus_reset':
sound/pci/hda/hda_intel.c:1270: error: implicit declaration of function 'snd_pcm_suspend_all'
sound/pci/hda/hda_intel.c:1271: error: implicit declaration of function 'snd_hda_suspend'
sound/pci/hda/hda_intel.c:1272: error: implicit declaration of function 'snd_hda_resume'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-04 14:21:11 +02:00
Takashi Iwai b20f3b8346 ALSA: hda - Limit codec-verb retry to limited hardwares
The reset of a BUS controller during operations is somehow risky and
shouldn't be done inevitably for devices that have apparently no such
codec-communication problems.

This patch adds the check of the hardware and limits the bus-reset
capability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 01:21:30 +02:00
Takashi Iwai 8dd783304e ALSA: hda - Add codec bus reset and verb-retry at critical errors
Some machines machine cause a severe CORB/RIRB stall in certain
weird conditions, such as PA access at the start up together with
fglrx driver.  This seems unable to be recovered without the controller
reset.

This patch allows the bus controller reset at critical errors so
that the communication gets recovered again.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 01:21:23 +02:00
Takashi Iwai 8a933ece41 ALSA: hda - Fix a typo in the previous patch
ICH6_GCTL_RESET was wrongly set to another bit by the commit
b21fadb9c1.  This caused a problem when
the codec needs really a reset (e.g. recovering from the communication
error at probe).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-31 09:28:12 +02:00
Takashi Iwai b21fadb9c1 ALSA: hda - Add more register bits definitions
Added some missing register bits definitions to reduce magic numbers.
Also renamed some to follow the names on the datasheet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-28 12:26:15 +02:00
Takashi Iwai b05a7d4fed ALSA: hda - Always sync writes in single_cmd mode
In the single_cmd mode, the hardware cannot store the multiple replies
like on RIRB, thus each verb has to sync and wait for the response no
matter whether the return value is needed or not.  Otherwise it may
result in a wrong return value from the previous verb.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-28 12:01:24 +02:00
Takashi Iwai 8174086167 ALSA: hda - Allow concurrent RIRB access in single_cmd mode
In the single_cmd mode, the current driver code doesn't do any update
for RIRB just for any safety reason.  But, actually the RIRB and
single_cmd mode don't conflict.  Unsolicited events can be delivered
even while using the single_cmd mode.

This patch allows the handling of unsolicited events with single_cmd
mode, just always checking RIRB independent from single_cmd flag.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-26 15:22:00 +02:00
Takashi Iwai 20e91c5750 Merge branch 'fix/hda' into topic/hda 2009-05-26 15:19:56 +02:00
Takashi Iwai 4fcd39207f ALSA: hda - Reset CORB/RIRB at retrying the verb communication
When a codec communication error occurs, the CORB/RIRB counters should
be reset first before re-issuing the verb.  Simply call azx_free_cmd_io()
and azx_init_cmd_io() to achieve that.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-25 18:34:52 +02:00
Ozan Çağlayan 93574844bc ALSA: hda - Add forced codec-slots for ASUS W5Fm
ASUS W5Fm needs the fixed codec-slots to probe to override the BIOS
problem like W5F.

Tested-by: Alp Kılıç <kilic.alp@gmail.com>
Signed-off-by: Ozan Çağlayan <ozan@pardus.org.tr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-24 18:45:28 +02:00
Takashi Iwai 4abc1cc2f9 ALSA: hda - Add prefix to kernel messages
Add proper prefix to each kernel message in hda_intel.c.
Also, avoid the unneeded prefix when CONFIG_SND_VERBOSE_PRINTK is used
together with snd_print*().

Reference: bko#13207
	http://bugzilla.kernel.org/show_bug.cgi?id=13207

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-19 12:16:46 +02:00
Takashi Iwai 313f6e2d40 ALSA: hda - Avoid conflicts with snd-ctxfi driver
The PCI entries of Creative with HD-audio class can be the devices
with emu20k1/emu20k2 chips.  These are supported better by snd-ctxfi
driver.  With that driver, the device will mutate from HD-audio to
its native class.

This patch adds a simple ifdef to avoid the conflict of device probe
between snd-hda-intel and snd-ctxfi drivers.  1102:0009 seems still
OK to be added as it has no emu20kx chip, and is a pure HD-audio
device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-18 12:40:52 +02:00
Takashi Iwai b97bedcded Merge branch 'topic/hda-cache' into topic/hda 2009-04-21 11:11:54 +02:00
Takashi Iwai b613291fb2 ALSA: hda - Retry codec-verbs at errors
The current error-recovery scheme for the codec communication errors
doesn't work always well.  Especially falling back to the
single-command mode causes the fatal problem on many systems.

In this patch, the problematic verb is re-issued again after the error
(even with polling mode) instead of the single-cmd mode.  The
single-cmd mode will be used only when specified via the command
option explicitly, mainly just for testing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-21 11:10:44 +02:00
Takashi Iwai 18cb7109d3 ALSA: hda - Check strcpy length
Check the length to copy via strlen() beforehand to avoid the stack
corruption, or use strlcpy() to be safe in HD-audio codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-16 10:22:24 +02:00
Takashi Iwai 4e01f54bfd ALSA: hda - Add Creative CA0110-IBG support
Added the support for Creative SB X-Fi boards with UAA (HD-audio) mode.
In the HD-audio mode, no multiple streams are supported by just it
behaves like a normal HD-audio device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-16 08:54:53 +02:00
Joe Perches d523b0c808 ALSA: hda_intel.c - Consolidate bitfields
Commit fa00e046b4
added a new bitfield not adjacent to other
bitfields in the same struct.  Moved the new one.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-16 08:24:02 +02:00
Takashi Iwai 45c27fc8c8 Merge branch 'master' of git://git.alsa-project.org/alsa-kernel into for-linus
* 'master' of git://git.alsa-project.org/alsa-kernel:
  [ALSA] intel8x0: add one retry to the ac97_clock measurement routine
  [ALSA] intel8x0: fix wrong conditions in ac97_clock measure routine
  [ALSA] intel8x0: do not use zero value from PICB register
  [ALSA] intel8x0: an attempt to make ac97_clock measurement more reliable
  [ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffies
  [ALSA] hda_intel: fix unexpected ring buffer positions
2009-04-15 11:21:13 +02:00
Yang Hongyang e930438c42 Replace all DMA_nBIT_MASK macro with DMA_BIT_MASK(n)
This is the second go through of the old DMA_nBIT_MASK macro,and there're not
so many of them left,so I put them into one patch.I hope this is the last round.
After this the definition of the old DMA_nBIT_MASK macro could be removed.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Greg KH <greg@kroah.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-13 15:04:33 -07:00
Jaroslav Kysela fa00e046b4 [ALSA] hda_intel: fix unexpected ring buffer positions
I found two issues with ICH7-M (it should be related to other HDA chipsets
as well):

- the ring buffer position is not reset when stream restarts (after xrun) -
  solved by moving azx_stream_reset() call from open() to prepare() callback
  and reset posbuf to zero (it might be filled with hw later than position()
  callback is called)
- irq_ignore flag should be set also when ring buffer memory area is not
  changed in prepare() callback - this patch replaces irq_ignore with
  more universal check based on jiffies clock

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-04-10 12:20:45 +02:00
Takashi Iwai e7bfbb0215 Merge branch 'topic/hda' into for-linus 2009-03-24 00:36:09 +01:00
Takashi Iwai dec14f8c0e Merge branch 'topic/snd_card_new-err' into for-linus 2009-03-24 00:35:35 +01:00
Takashi Iwai 1dddab400b ALSA: hda - Don't reset stream at each prepare callback
Don't reset the stream at each prepare callback but do it only once
after the open.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-19 12:54:23 +01:00
Takashi Iwai 97b71c94d6 ALSA: hda - Don't reset BDL unnecessarily
So far, the prepare callback is called multiple times, BDL entries
are reset and re-programmed at each time.

This patch adds the check to avoid the reset of BDL entries when the
same parameters are used.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-19 12:53:58 +01:00
Takashi Iwai 4a10079345 Merge branch 'fix/hda' into topic/hda 2009-03-18 07:50:56 +01:00
Takashi Iwai c673ba1c23 ALSA: hda - Workaround for buggy DMA position on ATI controllers
The position-buffer on ATI controllers are unreliable as well as
on VIA chips, thus the same workaround for DMA position reading as
VIA is useful for ATI.

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-18 07:46:21 +01:00
Takashi Iwai 09240cf429 ALSA: hda - Fix DMA mask for ATI controllers
ATI controllers (at least some SB0600 models) appear buggy to handle
64bit DMA.  As a workaround, reset GCAP bit0 and let the driver to
use only 32bit DMA on these controllers.

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-18 07:45:41 +01:00
Takashi Iwai 4c4531d64d ALSA: hda - Remove Toshiba probe_mask quirk
Revert the Toshiba probe_mask quirk for 2.6.29 kernel
(commit 38f1df27e3).
In the current tree, the digital-only codec is handled properly so
no codec conflict should occur.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-02 08:06:11 +01:00
Takashi Iwai b31b43e9fb Merge branch 'fix/hda' into topic/hda
Conflicts:
	sound/pci/hda/hda_intel.c
2009-03-02 08:04:10 +01:00
Takashi Iwai 38f1df27e3 ALSA: hda - Add probe_mask default for Toshiba laptop with ALC268
Some Toshiba laptops have another ALC268 codec on slot#3 that conflicts
with the primary codec.  The codec#3 is for the digital I/O, and should
be fixed by the driver, but it'd need a bunch of changes.

So, let's fix the probe problem temporarily by setting the default
probe_mask value.

Reference: kernel bugzilla #12735
	http://bugzilla.kernel.org/show_bug.cgi?id=12735

Tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-02 07:55:52 +01:00
peerchen bedfcebb4f ALSA: hda - Add the Device IDs for MCP89 and remove IDs of MCP7B
Added the Device IDs for MCP89 HD audio controller.
Removed the IDs of MCP7B cause this chipset had been cancelled.

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-27 10:22:55 +01:00
Takashi Iwai e23573d7e3 Merge branch 'fix/hda' into topic/hda 2009-02-16 10:23:35 +01:00
Takashi Iwai d14a7e0bfc Revert "Sound: hda - Restore PCI configuration space with interrupts off"
This reverts commit 32e176c14d.

That commit caused a regression with suspend on Thinkpad SL300.

Reference: kernel bug#12711
	http://bugzilla.kernel.org/show_bug.cgi?id=12711

Tested-by:  Alexandre Rostovtsev <tetromino@gmail.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-16 10:16:27 +01:00
Takashi Iwai 20db7cb0ac ALSA: hda - Add forced codec-slots for ASUS W5F
ASUS W5F needs the fixed codec-slots to probe to override the BIOS
problem.

Tested-by: Giovanni Moser Frainer <giovanni@redix.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-13 08:19:30 +01:00
Takashi Iwai f1eaaeec11 ALSA: hda - Allow fixed codec-probe mask
Some devices have broken BIOS and they don't set the codec probe-bit
properly after cleared by the driver.  This makes the driver skipping
the necessary codec slots.

Since BIOS update isn't always easy, now the semantics of probe_mask
option is changed a bit.  When it contains the bit 8 (0x100), the
lower bits are used to probe that slots regardless of codec-probe bits
returned by the hardware.

For example, probe_mask=0x103 will force to probe the codec slot #0
and #1.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-13 08:16:55 +01:00
Takashi Iwai e58de7baf7 ALSA: Convert to snd_card_create() in sound/pci/*
Convert from snd_card_new() to the new snd_card_create() function
in sound/pci/*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12 15:20:55 +01:00
Takashi Iwai 6acaed38a3 ALSA: hda - Use own workqueue
snd-hda-intel driver used schedule_work() fot the delayed DMA pointer
updates, but this has several potential problems:
- it may block other eventsd works longer
- it may deadlock when probing fails and flush_scheduled_work() is
  called during probe callback (as probe callback itself could be
  invoked from eventd)

This patch adds an own workq for each driver instance to solve these
problems.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12 10:33:56 +01:00
Takashi Iwai 8326e32c1e Merge branch 'topic/hda-resume-fix' into topic/hda 2008-12-20 23:41:18 +01:00
Takashi Iwai d4d9cd0338 ALSA: hda - Add probe_only option
Added probe_only module option to hd-audio driver.
This option specifies whether the driver creates and initializes the
codec-parser after probing.  When this option is set, the driver skips
the codec parsing and initialization but gives you proc and other
accesses.  It's useful to see the initial codec state for debugging.

The default of this value is off, so the default behavior is as same
as before.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-19 15:19:11 +01:00
Takashi Iwai 0ff555192a Merge branch 'fix/hda' into topic/hda 2008-12-19 08:22:57 +01:00
Takashi Iwai 5c0b9bec46 ALSA: hda - Fix a compile warning when CONFIG_PM=n
Fixed the compile warning regarding the unused function when built
with CONFIG_PM=n:
  sound/pci/hda/hda_intel.c:1905: warning: ‘snd_hda_codecs_inuse’ defined but not used

snd_hda_codecs_inuse() is used only in the resume callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-11 11:48:33 +01:00
Rafael J. Wysocki 32e176c14d Sound: hda - Restore PCI configuration space with interrupts off
Move the restoration of the standard PCI configuration registers
in the snd_hda_intel driver to a ->resume_early() callback executed
with interrupts disabled, since doing that with interrupts enabled
may lead to problems in some cases.

This patch addresses the regression from 2.6.26 tracked as
http://bugzilla.kernel.org/show_bug.cgi?id=12121 .

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-07 10:45:32 +01:00
Takashi Iwai 11cd41b893 ALSA: hda - Fix build error with CONFIG_SND_HDA_POWER_SAVE
Moved power_save field initialization inside a proper ifdef
to fix a build error without CONFIG_SND_HDA_POWER_SAVE.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-28 07:22:18 +01:00
Takashi Iwai fee2fba358 ALSA: hda - Move power_save option to hda_intel.c
Move power_save option into hda_intel.c, and make a field in hda_bus,
instead of keeping module parameters in separate files.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-27 12:43:28 +01:00
Takashi Iwai 986862bdf1 ALSA: hda - make some functions static
Minor clean ups: move snd_hda_codecs_inuse() into hda_intel.c and
make static.  Also, make snd_hda_query_supported_pcm() static
as it's used only in hda_codec.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-27 12:40:13 +01:00
Takashi Iwai ef1681d82f ALSA: hda - Add probe_mask quirk for Medion MD96630
Medion MD96630 has ALC268 codec on slot#2 although it's not used
for any purpose.  This codec conflicts with the primiary codec ALC888
on slot#0, and gives mixer errors.

This patch adds a corresponding entry to probe_mask blacklist.

Reference: Novell bnc#412528
	https://bugzilla.novell.com/show_bug.cgi?id=412528

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-24 17:29:28 +01:00
Wu Fengguang 41dda0fdd2 ALSA: azx_probe() cleanup
Replace 5 free-and-return-err blocks with goto-out-free ones.
This makes the main logic more outstanding.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-20 08:17:15 +01:00
Yang, Libin c4da29ca08 ALSA: hda - support detecting HD Audio devices with PCI class code
The patch uses HD Audio PCI class code to detect AMD HD Audio cards.

Signed-off-by: Libin Yang <libin.yang@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-13 11:07:07 +01:00
Takashi Iwai 0edb945430 ALSA: hda - Fix probe errors on Dell Studio Desktop
BIOS on Dell Studio Desktop tells wrong codec probe masks.
This patch gives the preset mask value to avoid invalid access.
Reference: Novell bug#440907
	https://bugzilla.novell.com/show_bug.cgi?id=440907

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-07 14:53:09 +01:00
Takashi Iwai 6ce4a3bc1b ALSA: hda - Make codec-probing more robust
When an error occurs during the codec probing, typically accessing to an
non-existing codec slot, the controller chip gets often screwed up and
can no longer communicate with the codecs.

This patch adds a preparation phase just to probe codec addresses before
actually creating codec instances.  If any error occurs during this
probing phase, the driver resets the controller to recover.

This will (hopefully) fix the famous "single_cmd" errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-06 17:29:48 +01:00
Takashi Iwai 33fa35ed0d ALSA: hda - simplify hda_bus ops callbacks
The hda_bus ops callback take struct hda_bus pointer.
Also, the command callback takes the composed command word, instead of
each small bits in arguments.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-06 16:50:40 +01:00
Takashi Iwai afecd78cd2 Merge branch 'topic/fix/hda' into topic/hda 2008-10-31 17:24:01 +01:00
Takashi Iwai 0552f29795 Merge branches 'topic/fix/hda' and 'topic/fix/misc' into for-linus 2008-10-29 16:40:00 +01:00
Takashi Iwai 0cbf00980f ALSA: hda - Add reboot notifier
The current snd-hda-intel driver seems blocking the power-off on some
devices like eeepc.  Although this is likely a BIOS problem, we can add
a workaround by disabling IRQ lines before power-off operation.
This patch adds the reboot notifier to achieve it.

The detailed problem description is found in bug#11889:
    http://bugme.linux-foundation.org/show_bug.cgi?id=11889

Tested-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-29 16:21:16 +01:00
Takashi Iwai 34c25350ac ALSA: hda - Remove old codec-probe limitation
Removed the old workaround to avoid the non-existing codec slot.
The current code should work without that workaround.  If any,
we can add a quirk table.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-28 11:44:34 +01:00
Arjan van de Ven 2f5ad54ea6 pci: use pci_ioremap_bar() in sound/
Use the newly introduced pci_ioremap_bar() function in sound/.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-21 09:31:10 +02:00
Takashi Iwai 176d5335fe ALSA: hda - Add infrastructure for dynamic stream allocation
Added the infrastructure for dynamic stream allocation on HD-audio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-13 02:42:58 +02:00
Wei Ni dc9c8e218d ALSA: Fix for reading RIRB buffer on NVIDIA aza controller with AMD Phenom cpu
When read RIRB buffer immediately after RIRB interrupt received,
sometimes the data will be "0x0". If we wait for some time, the data
in buffer will be correct. This issue only occurred with AMD Phenom cpu.
So we set this "needs_damn_long_delay" flag.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-10 13:41:36 +02:00
Takashi Iwai 2f5983f2aa ALSA: hda - allow probing of 4 codecs
Allow probing of 4 codecs on known good situations.
On some known bad situations, it should be avoided.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 09:10:49 +02:00
Joseph Chan 0e153474f4 ALSA: hda - Fix VIA recording problem
Add a workaround for bad DMA-position reporting on VIA chipset.

Signed-off-by: Joseph Chan <josephchan@via.com.tw>
[modified and cleaned up by tiwai]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-29 10:06:12 +02:00
Takashi Iwai fc4abee811 ALSA: hda - check page continuity
Check the continuity of allocated pages to reduce the BDL size as much
as possible so that it can use more than 1MB buffers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25 09:57:40 +02:00
Takashi Iwai 77a23f2695 ALSA: Clean up SG-buffer helper functions and macros
Clean up SG-buffer helper functions and macros.  Helpers take substream
as arguments now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25 09:57:18 +02:00
Takashi Iwai a62741cf77 ALSA: hda - disable delayed period-ack with bdl_pos_adj=0
When bdl_pos_adj=0 is given, disable the position-check and the delayed
period update mechanism.  Usually bdl_pos_adj=0 is set only for the
debugging purpose on really broken hardwares.  It's better to disable
the extra complexity in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-25 09:57:07 +02:00
Takashi Iwai da3cec35dd ALSA: Kill snd_assert() in sound/pci/*
Kill snd_assert() in sound/pci/*, either removed or replaced with
if () with snd_BUG_ON().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-13 11:46:38 +02:00
Peer Chen 320dcc30f4 ALSA: hda_intel: enable snoop for nvidia HDA controller
Enable the snoop for nvidia hda controller to avoid data coherence issue.

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-21 10:46:46 +02:00
Libin Yang 9e6dd47bf3 ALSA: hda - support new AMD HDMI Audio (1002:970f)
Signed-off-by: Libin Yang <libin.yang@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-12 15:33:44 +02:00
Seth Heasley b29c2360f1 ALSA: hda_intel: ALSA HD Audio patch for Intel Ibex Peak DeviceIDs
This patch adds the Intel Ibex Peak (PCH) HD Audio Controller DeviceIDs.

Signed-off by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-12 12:30:43 +02:00
Takashi Iwai e785d3d8fb ALSA: hda - Align BDL position adjustment parameter
It seems NVidia and other hardwares require the alignment for period
update timing.  For satisfying this condition, align the position
adjustment for delayed wake-up to the initial bdl_pos_adj value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-16 12:03:24 +02:00
Takashi Iwai 766979e09d ALSA: hda - use upper_32_bits()
Use the standard upper_32_bits() instead of own macro.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-16 09:32:36 +02:00
Takashi Iwai 0c6341ace5 ALSA: hda - bdl_pos_adj=32 as default
Use bdl_pos_adj=32 as default except for Intel hardwares confirmed
to work with bdl_pos_adj=1.  Looks like ATI and NVidia require this
higher value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-16 09:32:34 +02:00
Takashi Iwai a6a950a8a8 ALSA: hda - Add a warning if pending IRQ is found
The pending IRQ handling is a very hackish workaround and should be
avoided as much as possible via a larger bdl_pos_adj option value.
Put a warning message if this situation occurs so that the user may have
a chance to notice that something is wrong.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-13 16:47:23 +02:00
Takashi Iwai 5c0d7bc103 ALSA: hda - Fix bdl_pos_adj value for ATI SB chipsets
ATI SB controllers seem to report the DMA ahead in the amount of FIFO.
Thus bdl_pos_adj should be 32 for them as default.

Also, the default value is set to -1, which means to make the driver
to choose the appropriate value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-13 16:34:25 +02:00
Takashi Iwai 555e219ffa ALSA: hda - bdl_pos_adj option to each instance
The option bdl_pos_adj should be provided for each card instance instead of
a global one because the value depends rather on each controller-chip.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-13 16:34:19 +02:00
Takashi Iwai d2e1c97331 ALSA: hda - remove position_fix=3
position_fix=3 is the option to correct the DMA position with the
FIFO size.  But, it never worked correctly, and we have now more other
workarounds for the DMA position fixes.  Thus better to remove it.

Also, change POS_FIX_NONE to POS_FIX_LPIB to represent its real role
better.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-13 16:30:43 +02:00
Takashi Iwai 675f25d4d3 ALSA: hda - Add bdl_pos_adj option
Added a new option, bdl_pos_adj, to adjust the delay of IRQ-wakeup
timing.

Most HD-audio hardwares have a problem that a BDL IRQ is issued before
actually the data and the DMA pointer are updated.
We have already a mechanism to force to delay snd_pcm_period_elapsed()
calls via workq, but this costs much CPU, and typically the delay is
within one sample.  Thus, it's more clever to adjust the BDL entries
instead.

The new option adds the size of the delay in frames.  As default,
it's set to 1 -- that is, one sample delay.  Even the hardware is
really correct, one sample delay is relatively harmless in comparison
with reporting wrong positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-13 16:30:20 +02:00
Takashi Iwai 607d982bbe [ALSA] hda - increase max_codecs of ICH to 4
It turned out that some ICH9-based boards use SD3 for the audio codec
where the current driver code doesn't probe.  Since we have a better
codec slot check now, it must be safe to increase this to 4.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 11:54:13 +02:00
Kailang Yang abbc9d1b25 [ALSA] hda - Add ICH9 controller support (8086:2911)
Added the missing PCI ID for ICH9 controller (8086:2911)

Signed-off-by: Kailang Yang <kailang@realtek.com.tw>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-05-27 15:56:21 +02:00
Kailang Yang f269002e61 [ALSA] hda - Add support of Teradici controller
Add the new PCI ID 0x6549 0x1200 Teradici controller.

Signed-off-by: Kailang Yang <kailang@realtek.com.tw>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-05-27 15:56:21 +02:00
Takashi Iwai 9ad593f6d3 [ALSA] hda - Fix DMA position inaccuracy
Many HD-audio controllers seem inaccurate about the IRQ timing of
PCM period updates.  This has caused problems on audio quality; e.g.
JACK doesn't work with two periods.

This patch fixes the problem by checking the current DMA position
at IRQ handler and delays the period-update via a workq if it's
inaccurate.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-05-19 13:19:19 +02:00
Jeff Garzik f000fd8093 [ALSA] Fix synchronize_irq() bugs, redundancies
free_irq() calls synchronize_irq() for you, so there is no need for
drivers to manually do the same thing (again).  Thus, calls where
sync-irq immediately precedes free-irq can be simplified.

However, during this audit several bugs were noticed, where free-irq is
preceded by a "irq >= 0" check... but the sync-irq call is not covered
by the same check.

So, where sync-irq could not be eliminated completely, the missing check
was added.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:40 +02:00
Takashi Iwai 850f0e5212 [ALSA] hda-intel - Add sync support
Addded the support of sync streams to hda-intel driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:27 +02:00
Takashi Iwai 2add9b9253 [ALSA] hda-intel - Add barrier
Add proper barriers in the RIRB communication code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:26 +02:00
Takashi Iwai ee9d6b9a30 [ALSA] hda-intel - Fix power-off hang on ASUS P5AD2
The hda-intel driver has a problem at power-off on ASUS P5AD2.
It's caused when the position-buffer is enabled -- most likely a
hardware-specific problem.

This patch adds a quirk to avoid the unnecessary enablement of
position-buffer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:24 +02:00
Peer Chen 487145a198 [ALSA] hda_intel: Add the DIDs of nvidia MCP79 HD audio controller to hda_intel.c
Add the Device IDs of nvidia MCP79 HD audio controller to hda_intel.c

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:22 +02:00
Andrew Morton 24982c5f7f [ALSA] hda_intel needs dma-mapping.h
sparc32:

sound/pci/hda/hda_intel.c: In function 'azx_create':
sound/pci/hda/hda_intel.c:1838: error: 'DMA_64BIT_MASK' undeclared (first use in this function)
sound/pci/hda/hda_intel.c:1838: error: (Each undeclared identifier is reported only once
sound/pci/hda/hda_intel.c:1838: error: for each function it appears in.)

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:20 +02:00
Takashi Iwai 87218e9c6e [ALSA] hda-intel - Use PCI_DEVICE() macro
Clean up the pci id table using PCI_DEVICE() macro.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:14 +02:00
Takashi Iwai 8b6ed8e70d [ALSA] hda-intel - Clean up stream definitions
Clean up the code to define playback/capture streams.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:12 +02:00
Libin Yang 814b1a5ce6 [ALSA] HDA-Intel - Patch to support RV7xx HDMI Audio
This patch is to add R7xx HDMI audio support.

Signed-off-by: Libin Yang <Libin.yang@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:10 +02:00
Takashi Iwai 21c7b0819f [ALSA] hda-intel - Fix a compile error with CONFIG_SND_DEBUG_DETECT=y
Forgot to get rid of the obsolete fragsize field from a debug print.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:08 +02:00
Takashi Iwai cf7aaca8ba [ALSA] hda-intel - Support 64bit buffer allocation
The HD-audio hardware usually supports 64bit address for DMA and other
buffers.  The patch enables the feature if supported.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:08 +02:00
Takashi Iwai 4ce107b990 [ALSA] hda-intel - Use SG buffer
Use SG buffers for the HD-audio instead of linear buffers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:08 +02:00
Takashi Iwai 7ba72ba1fe [ALSA] hda-intel - Fix PCM device number assignment
In the current scheme, PCM device numbers are assigned incrementally
in the order of codecs.  This causes problems when the codec number
is irregular, e.g. codec #0 for HDMI and codec #1 for analog.  Then
the HDMI becomes the first PCM, which is picked up as the default
output device.  Unfortuantely this doesn't work well with normal
setups.

This patch introduced the fixed device numbers for the PCM types,
namely, analog, SPDIF, HDMI and modem.  The PCM devices are assigned
according to the corresponding PCM type.  After this patch, HDMI will
be always assigned to PCM #3, SPDIF to PCM #1, and the first analog
to PCM #0, etc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-04-24 12:00:07 +02:00
Takashi Iwai c6cd7d7efe [ALSA] hda-intel - Fix Oops with ATI HDMI devices
The driver gets Oops with ATI HDMI devices due to the wrong calculation
of index for playback streams.  This patch fixes it.  Reference:
	https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3746

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-22 14:20:09 -08:00
Takashi Iwai 90a5ad52bf [ALSA] HDA - enable snoop on SCH
This patch enables snoop on Intel SCH chipset, eliminating static during
playback.

Signed-off-by: Tobin Davis <tdavis@dsl-only.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-22 14:20:08 -08:00
Tobin Davis 4979bca9dc [ALSA] HDA-Intel - Add support for Intel SCH
This patch adds support for Intel's SCH mobile chipset.

Signed-off-by: Tobin Davis <tdavis@dsl-only.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:23 +01:00
Jason Gaston c34f5a0469 [ALSA] hda_intel: ALSA HD Audio patch for Intel ICH10 DeviceID's
This patch adds the Intel ICH10 HD Audio Controller DeviceID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:21 +01:00
Marc Boucher 1cfd52bc1a [ALSA] hda-intel - Add ratelimit to timeout messages
Signed-off-by: Marc Boucher <marc@linuxant.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:10 +01:00
Takashi Iwai 28a0d9df07 [ALSA] hda-intel - Make azx_get_response() a bit more robust
In azx_[rirb_]get_response(), the timeout is checked at the end of the loop.
It's better to be checked just after the check of the RIRB index to avoid
a bogus error with a too long msleep().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:05 +01:00
Takashi Iwai 52987656fb [ALSA] hda-intel - Add workarounds for STAC codecs
Some machines with STAC codecs seem to have problems (e.g. no audible
playback) when the delay in codec-read routine is too short.
I still don't figure out which command sequence causes this problem
(due to lack of test hardware), but it's known that increasing the
delay fixes.  So, added a stupid workaround here temporarily...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:02 +01:00
Tobin Davis bcd7200394 [ALSA] HDA: Enable chipset gcap usage
This patch removes hardcoded values for the number of streams supported
by the southbridge in most chipsets, and reads these values from the
chipset directly.  Most systems are hardwired for 4 streams in each
direction, but newer chipsets change that capability.

Signed-off-by: Tobin Davis <tdavis@dsl-only.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:58 +01:00
Andrew Paprocki e25bcdba19 [ALSA] hda_intel: Fix multiple device support by incrementing device count
Fixes multiple device support by incrementing the static device counter
at the end of the azx_probe() call. Without this, subsequent probes would
always use the index specified for the first card.

Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:55 +01:00
Takashi Iwai 9004acc70e [ALSA] Remove sound/driver.h
This header file exists only for some hacks to adapt alsa-driver
tree.  It's useless for building in the kernel.  Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it.  This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:48 +01:00
Takashi Iwai 5aba4f8ec7 [ALSA] hda-intel - Support multiple devices
It turned out that there can be multiple HD-audio devices on a single
machine (e.g. on-board audio and HDMI on graphic cards), so we need to
support multiple devices with snd-hda-intel driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:45 +01:00
Ingo Molnar 9b1fffddc8 [ALSA] snd hda suspend latency: shorten codec read
not sleeping for every codec read/write but doing a short udelay and
a conditional reschedule has cut suspend+resume latency by about 1
second on my T60.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:26 +01:00
Wolke Liu 27da183402 [ALSA] HDA-Intel - Add support for RV6xx HDMI audio
This patch is to add R6xx HDMI audio support. Meanwhile, the device ID
in the previous patch is changed.
I have checked the patch from Herton Ronaldo Krzesinski, it's right as
our spec said. :)

Signed-off-by: Wolke Liu <Wolke.Liu@amd.com>
Signed-off-by: Andrea Zhang <Andrea.Zhang@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:26 +01:00
Herton Ronaldo Krzesinski 2797f724cd [ALSA] HDA-Intel - Add support for RV610/RV630 HDMI audio
The Audio interface on HD2400/HD2600 cards isn't currently detected by
snd-hda-intel. I added missing pci device ids for RV610 and RV630, but
I only had a HD2400 pro card to test, where now the audio interface is
detected (and no need to change patch_atihdmi.c, as the codec vendor id
remains 0x1002aa01 for which we already have an entry there). I also
couldn't test if sound pass-trough is ok (and I don't know how to), but
at least now the device is detected.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:29:16 +01:00
Linus Torvalds d238998fbf Revert "hda_intel suspend latency: shorten codec read"
This reverts commit 57a04513cb.

Harald Dunkel reports that it broke sound for him:
  "Alsa stopped working for me.  I still can access /dev/dsp, change the
   volume and so on, but the speakers are quiet."

Reverting it fixed things for him.

Reported-and-tested-by: Harald Dunkel <harald.dunkel@t-online.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-08 11:46:37 -08:00
Ingo Molnar 57a04513cb hda_intel suspend latency: shorten codec read
not sleeping for every codec read/write but doing a short udelay and
a conditional reschedule has cut suspend+resume latency by about 1
second on my T60.

The patch also fixes the unexpected codec-connection errors that
happen more often in the new power-save mode:
    http://lkml.org/lkml/2007/11/8/255
    http://bugzilla.kernel.org/show_bug.cgi?id=9332

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-06 12:35:56 -08:00
Peer Chen c107106767 [ALSA] alsa: Add the MCP79 support to hda_intel driver
Add the MCP79 support to hda driver.
The patch base on kernel 2.6.23-rc7

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 16:51:02 +02:00
Rene Herman d86d01935a [ALSA] alsa-kernel: schedule_timeout() fixes
Fix schedule_timeout() use in alsa-kernel. Mostly just
	schedule_timeout(1) --> schedule_timeout_uninterruptible(1)
The wavefront_synth one fixes the surrounding loop as well. In ymfpci_main,
delete a superfluous set_current_state() and in soc/soc-dapm.c replace an
_interruptible with _uninterruptible in some debug code; it's not waiting
for signals.

Signed-off-by: Rene Herman <rene.herman>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 16:50:54 +02:00
Matthias Kaehlcke 33206e862e [ALSA] Intel HD Audio: Use list_for_each_entry(_safe)
Intel HD Audio: Use list_for_each_entry(_safe) instead of
list_for_each(_safe)

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 16:50:42 +02:00
Danny Tholen e8a7f136f5 [ALSA] hda-intel - Improve HD-audio codec probing robustness
When modem is disabled in the BIOS, detection of the number of codecs
always fails after booting if STATESTS is not cleared first.
This patch fixes this problem and also adds an error check in a place
where a read error would lead to a very large number of pointless loops.

Signed-off-by: Danny Tholen <obiwan@mailmij.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 16:50:20 +02:00
Maxim Levitsky d804ad9258 [ALSA] hda-intel - Fix resume logic, when dynamic power managment is on
Comment in hda_intel.c states that 'the explicit resume is needed only
when POWER_SAVE isn't set', but this is not true.
There is no code that will automaticly power up the codec on resume,
but only code that powers it up when user accesses it. So if user
leaves a sound playing, codec will not be powered
To fix that I check if there are any codecs that should be powered
codec->power_count, and if so I power them up together with main
controller.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:59:47 +02:00
Takashi Iwai 669ba27a6e [ALSA] hda-intel - Add probe_mask blacklist
Added the black-list of probe_mask option to set the default value for
known non-working devices.  Currently, Thinkpad *60 and *61 series are set.
I'm afraid more will be added to the list in near future...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:59:15 +02:00
Takashi Iwai 0cb65f2262 [ALSA] hda-intel - Add position_fix quirk for Dell Precision 390
Dell Precision 390 needs position_fix=1 as default (ALSA bug#3295).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:59:02 +02:00
Takashi Iwai 0b7a2e9cef [ALSA] hda-intel - Don't do suspend if already powered down
In the power-saving mode, the suspend is done dynamically at power-down.
So we don't have to call suspend stuff explicitly if it's already
powered down.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:55 +02:00
Takashi Iwai dee1b66ce4 [ALSA] hda-intel - Add power_save_controller module option
Add power_save_controller module option instead of define flag.
Also, added descriptions of new module options in ALSA-Configuration.txt.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:50 +02:00
Takashi Iwai 95e99fdadb [ALSA] hda-intel - Fix resume with power save
The controller power wasn't turned on properly at resume due to the
power-saving patch.  Now fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:49 +02:00
Takashi Iwai cb53c626e1 [ALSA] hda-intel - Add POWER_SAVE option
Added CONFIG_SND_HDA_POWER_SAVE kconfig.  It's an experimental option
to achieve an aggressive power-saving.  With this option, the driver
will turn on/off the power of each codec and controller chip dynamically
on demand.
The patch introduces a new module option 'power_save'.  It specifies
the second of time-out for automatic power-down.  As default, it's
10 seconds.  Setting 0 means to suppress the power-saving feature.
The codec may have analog-input loopbacks, which are usually represented
by mixer elements such as 'Mic Playback Switch' or 'CD Playback Switch'.
When these are on, we cannot turn off the mixer and the codec chip has
to be kept on.  For bookkeeping these states, a new codec-callback is
introduced.
For the bus-controller side, a new callback pm_notify is introduced,
which can be used to turn on/off the contoller appropriately.
Note that this power-saving might cause slight click-noise at
power-on/off.  Also, it might take some time to wake up the codec, and
might even drop some tones at the very beginning.  This seems to be the
side-effect of turning off the controller chip.
This turn-off of the controller can be disabled by undefining
HDA_POWER_SAVE_RESET_CONTOLLER in hda_intel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:46 +02:00
Takashi Iwai d01ce99fc5 [ALSA] hda-intel - Coding style fixes
Fix codes to follow more to the standard kernel coding style.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-10-16 15:58:09 +02:00
Takashi Iwai 43bbb6ccc6 [ALSA] hda-intel - Show the last command in warning messages
Show the last issued command in warning messages when any communication
error with CORB/RIRB occurs.
Also, a bit code clean-up for composing the command value in
*_send_cmd().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-20 11:11:47 +02:00
Takashi Iwai e65365de5b [ALSA] Fix invalid schedule_timeout_interruptible()
Fixed the invalid use of schedule_timeout_interruptible() without
checking pending signals.  Simply replaced with schedule_timeout().
Suggestions thanks to Jeff Garzik.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-20 11:11:36 +02:00
Peer Chen 15cc4458c5 [ALSA] Add the MCP73/77 support to hda_intel driver
Add the MCP73/MCP77 support to hda driver.
The patch base on kernel 2.6.22-rc4

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-07-20 11:11:27 +02:00
Wolke Liu e6db111931 [ALSA] hda-intel - Add ATI RS780,R600 HDMI audio support
This patch is for ATI RS780 and R600 HDMI support.

Signed-off-by: Wolke Liu <wolke.liu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11 16:56:12 +02:00
Takashi Iwai bccad14e9a [ALSA] hda-intel - Fix detection of audio codec on Toshiba A100
Some boards have the audio codec on slot #3 while the modem codec
on slot #0.  The driver should continue to probe the slots when
no audio codec is found.
This fixes the problem of no device on Toshiba A100 (and some other
ATI SB450 devices).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11 16:56:09 +02:00
Takashi Iwai 19a982b694 [ALSA] hda-intel - Probe additional slots only if necessary
Probing the codec slots on ATI controller causes problems on some
devices like Acer laptops.  On these devices, reading from codec
slot 3 results in the communication failure with the codec chip.
Meanwhile, some laptops (e.g. Gateway) have the codec connection
only on slot 3, and probing this slot is mandatory for them.
The patch improves the probing robustness.  The additional slots
are now checked only when no codecs are found in the primary three
slots.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11 16:55:52 +02:00
Ralf Baechle 623ec04798 [ALSA] hda_intel: build fix
CC [M]  sound/pci/hda/hda_intel.o
sound/pci/hda/hda_intel.c:1508: error: position_fix_list causes a section type conflict
Gcc like its __devinitdata readable not const, it seems.  An alternative
fix would be to remove the __devinitdata attribute but that would result
in slight runtime bloat.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-05-11 16:55:49 +02:00
Joachim Deguara 5f1545bc45 [ALSA] hda-intel - Fix HDA buffer alignment
From the HDA spec it appears that the buffers written to the BDL and
sent to a codec must be 128 byte aligned (section 4.5.1).  The alignment
was not happening especially when playing 6 channels.  This patch set
the alignment of buffers and periods to 128 bytes.

Signed-off-by: Joachim Deguara <joachim.deguara@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-03-16 15:02:15 +01:00
Takashi Iwai a9995a3557 [ALSA] hda-intel - Fix codec probe with ATI contorllers
ATI controllers may have up to 4 codecs while ICH up to 3.
Thus the earlier fix to change AZX_MAX_CODECS to 3 cause a regression
on some devices that have the audio codec at bit#3.
Now max codecs is defined according to the driver type, either 3 or 4.
Currently 4 is set only to ATI chips.  Other might need the same
change, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-03-14 08:24:17 +01:00
Takashi Iwai 3372a153c2 [ALSA] hda-intel - Add black/whitelist for position_fix option
Some devices are known to require position_fix=1 or 2 to make the
driver working correctly.  Otherwise the sound gets weird effects,
such as stutters.
Now a black/whitelist is introduced to indicate the position_fix
value explicitly for such misbehaving hardwares.  As a first example,
Dell D820 is listed there.  More will come later likely...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09 09:03:32 +01:00
Takashi Iwai 7ed07a740b [ALSA] hda-intel - Don't try to probe invalid codecs
Fix the max number of codecs detected by HD-intel (and compatible)
controllers to 3.  Some hardware reports extra bits as if
connected, and the driver gets confused to probe unexisting codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09 09:03:05 +01:00
Takashi Iwai 69e1341897 [ALSA] hda-intel - Disable INTX when MSI is used
Call pci_intx() to disable/enable INTX when MSI is used/unused.
Nvidia and AMD boards seem to have problems with MSI when INTX
isn't disabled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09 09:01:41 +01:00
Jaroslav Kysela b66b3cfe6c [ALSA] hda_intel: increase maximum DMA buffer size to 1024MB
See ALSA bug#2481 .

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09 09:00:12 +01:00
Jason Gaston f9cc8a8b18 [ALSA] hda_intel: ALSA HD Audio patch for Intel ICH9
This patch adds the Intel ICH9 HD Audio controller DID's for ALSA.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-01-09 09:06:16 +01:00
Peer Chen 5b005a0126 [ALSA] Audio: Add nvidia HD Audio controllers of MCP67 support to hda_intel.c
Add the support for HD audio controllers of MCP51,MCP55,MCP61,MCP65 & MCP67.

Signed-off-by: Peer Chen <pchen@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-01-09 09:06:12 +01:00
Takashi Iwai 437a5a4606 [ALSA] Remove IRQF_DISABLED for shared PCI irqs
Fix IRQ flags for PCI devices.
The shared IRQs for PCI devices shouldn't be allocated with
IRQF_DISABLED.  Also, when MSI is enabled, IRQF_SHARED shouldn't
be used.
The patch removes unnecessary cast in request_irq and free_irq,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-12-20 08:55:57 +01:00
Takashi Iwai 134a11f0c3 [PATCH] ALSA: hda-intel - Disable MSI support by default
Disable MSI support on HD-audio driver as default since there are too
many broken devices.

The module option is changed from disable_msi to enable_msi, too.  For
turning MSI support on, pass enable_msi=1, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-14 16:04:27 -08:00
Takashi Iwai 68e7fffc0f [ALSA] hda-intel - Add check of MSI availabity
Check the availability of MSI and turn off MSI automatically when it's
not available on the hardware.  MSI seems broken on some hardwares
but the kernel doesn't know exactly, thus we have to turn the MSI
feature off on the sound driver manually.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-23 14:10:34 +02:00
Felix Kuehling 5b15c95f88 [ALSA] hda_intel: add ATI RS690 HDMI audio support
This patch adds support for the HDMI codec of the ATI RS690 IGP northbridge.

Signed-off-by: Felix Kuehling <fkuehlin@ati.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-22 10:51:12 +02:00
Takashi Iwai 30b35399ce [ALSA] Various fixes for suspend/resume of ALSA PCI drivers
- Check the return value of pci_enable_device() and request_irq()
  in the suspend.  If any error occurs there, disable the device
  using snd_card_disconnect().
- Call pci_set_power_state() properly with pci_choose_state().
- Fix the order to call pci_set_power_state().
- Removed obsolete house-made PM codes in some drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-22 10:51:10 +02:00
Dan Cyr f3838ba920 [ALSA] hda-intel - New pci id for Nvidia MCP61
Added the new PCI id to support Nvidia MCP61 in snd-hda-intel driver.

Signed-off-by: Dan Cyr <rabidfly@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-06 20:22:57 +02:00
David Howells 7d12e780e0 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 15:10:12 +01:00
Takashi Iwai 5c79b1f887 [ALSA] hda-intel - A slight cleanup of timeout check in azx_get_response()
A slight cleanup of timeout check in azx_get_response() to check
jiffies for HZ-independent timeout.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:48:06 +02:00
Takashi Iwai 43001c9515 [ALSA] hda-intel - Fix suspend/resume with MSI
Fixed suspend/resume with MSI enablement.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:47:00 +02:00
Takashi Iwai e08a007d10 [ALSA] hda-codec - Fix SPDIF device number of ALC codecs
Assign the SPDIF always to the secondary device (dev#1) to keep
the same configuration.  Move the optional capture device to the
third device (dev#2).
hda_intel now just ignores the NULL entries in the pcm arrays
from codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:46:46 +02:00
Takashi Iwai dafbbb1fdb [ALSA] hda-intel - Fix pci_disable_msi() call
Fix the order to call pci_disable_msi() to be after free_irq().
(Otherwise pci_disable_msi() bugs you.)
Also, added a description of disable_msi option to documentation.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:46:42 +02:00
Pavel Machek 927fc86602 [ALSA] sound/pci/hda/intel_hda: small cleanups
Cleanup whitespace.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:45:28 +02:00
Takashi Iwai 929861c669 [ALSA] hda-intel - Remove volatile
Removed volatile from the position buffer pointer.
Also, use synchronize_irq() instead of unreliable msleep(1)
in the driver remove callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:45:22 +02:00
Stephen Hemminger 7376d013fc [ALSA] intel_hda: MSI support
Simple patch to enable Message Signalled Interrupts for the HDA Intel
audio controller.  Tested with:
 Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)
MSI is better because it means audio doesn't end up sharing IRQ with USB.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:42:47 +02:00
Takashi Iwai e96224ae97 [ALSA] hda-intel - Switch to polling mode for CORB/RIRB communication
Automatically switch to polling mode for CORB/RIRB communication
if the irq-driven mode seems not working well.  If the polling
mode still doesn't work, switch to single_cmd mode as fallback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23 10:42:10 +02:00
Takashi Iwai f40b68903c [ALSA] Fix section mismatch errors in ALSA PCI drivers
Fixed 'section mismatch' errors in ALSA PCI drivers:
- removed invalid __devinitdata from pci id tables
- fix/remove __devinit of functions called in suspend/resume

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-07-12 20:08:01 +02:00
Thomas Gleixner 65ca68b300 [PATCH] irq-flags: sound: Use the new IRQF_ constants
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-02 13:58:54 -07:00