Commit graph

2836 commits

Author SHA1 Message Date
Linus Torvalds
6ce90c430b Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Read buffer overflow
  ALSA: hda: Correct EAPD for Dell Inspiron 1525
  ALSA: hda: warn on spurious response
  ALSA: hda: remember last command for each codec
  ALSA: hda: read CORBWP inside reg_lock
  ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
  ALSA: hda: take cmd_mutex in probe_codec()
  ALSA: hda: track CIRB/CORB command/response states for each codec
  ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
2009-08-04 15:39:55 -07:00
Roel Kluin
4b35d2ca23 ALSA: hda - Read buffer overflow
Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:34:06 +02:00
Chengu Wang
84d3dc200f ALSA: hda: Correct EAPD for Dell Inspiron 1525
The commit 24918b61b5 statically changes
the model from dell-bios to dell-3stack to solve the sound decreasing
regression (http://lkml.org/lkml/2008/9/12/203), however it leads to another
problem that the 2nd headphone jack doesn't work
(https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3987). So I think
the commit 249**2dc is just a workaround. I would like to give a true solution
here.

The datasheet for STAC9228 says, GPIO2 is the same pin as VOL DOWN, and
the EAPD pin is GPIO0. This is why the sound decreases if we set EAPD as
GPIO2. This patch changes EAPD to GPIO0 to solve the problem.

Signed-off-by: Chengu Wang <wangchengu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:30:56 +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
Takashi Iwai
ce577e8cf5 ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
Use model=lenovo instead of model=dallas for Toshiba Satellite A135-S4527
with ALC861-VD codec.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:23:52 +02:00
Takashi Iwai
6280b61af5 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Increase PCM stream name buf in patch_realtek.c
  ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
  ALSA: hda - Add quirk for Dell Studio 1555
2009-07-31 10:17:42 +02:00
Takashi Iwai
aa563af763 ALSA: hda - Increase PCM stream name buf in patch_realtek.c
The name buf with size 16 is too short for some codec names, e.g.
truncated like "ALC861-VD Analo".  Now the size is doubled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-31 10:06:34 +02:00
Roel Kluin
78735cffc2 ALSA: hda: fix out-of-bound hdmi_eld.sad[] write
e->sad[] is declared with size ELD_MAX_SAD=16, but the guard
allows range 0-31.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-29 14:35:20 +02:00
Takashi Iwai
626f5cefc6 ALSA: hda - Add quirk for Dell Studio 1555
Added a quirk entry for Dell Studio 1555.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-28 00:54:39 +02:00
Takashi Iwai
de5d674c02 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Fix mute control with some ALC262 models
  ALSA: hda - Restore GPIO1 properly at resume with AD1984A
  ALSA: hda - Use snprintf() to be safer
2009-07-26 11:07:06 +02:00
Takashi Iwai
f35e2965b2 Merge branch 'fix/ctxfi' into for-linus
* fix/ctxfi:
  ALSA: ctxfi - Fix uninitialized error checks
2009-07-26 11:07:05 +02:00
Takashi Iwai
8de56b7deb ALSA: hda - Fix mute control with some ALC262 models
The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted.  This patch fixes
the issue.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
2009-07-24 16:54:31 +02:00
Takashi Iwai
4012ade933 ALSA: hda - Restore GPIO1 properly at resume with AD1984A
The commit 099db17e66 introduced a
regression at suspend/resume where the GPIO1 bit isn't properly
restored, thus the speaker output gets muted initially after resume.

The fix is simple, use the cached write for storing GPIO data.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22 18:15:10 +02:00
Takashi Iwai
68110661e8 ALSA: ctxfi - Fix uninitialized error checks
Fix a few uninitialized error checks that were introduced recently
mistakenlly during the clean-up:
  sound/pci/ctxfi/ctamixer.c: In function ‘get_amixer_rsc’:
  sound/pci/ctxfi/ctamixer.c:261: warning: ‘err’ may be used uninitialized in this function
  sound/pci/ctxfi/ctamixer.c: In function ‘get_sum_rsc’:
  sound/pci/ctxfi/ctamixer.c:415: warning: ‘err’ may be used uninitialized in this function
  sound/pci/ctxfi/ctsrc.c: In function ‘get_srcimp_rsc’:
  sound/pci/ctxfi/ctsrc.c:742: warning: ‘err’ may be used uninitialized in this function

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22 17:05:15 +02:00
Takashi Iwai
86de741660 ALSA: hda - Use snprintf() to be safer
Use snprint() for creating the jack name string instead of sprintf()
in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22 16:02:46 +02:00
Takashi Iwai
44f167d376 Merge branch 'fix/misc' into for-linus
* fix/misc:
  ALSA: ca0106 - Fix the max capture buffer size
  ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
  ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
2009-07-21 19:03:22 +02:00
Takashi Iwai
a9d90c81b5 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
  ALSA: hda - Add quirk for Gateway T6834c laptop
  ALSA: hda_codec: Check for invalid zero connections
2009-07-21 19:03:20 +02:00
Takashi Iwai
36766835ed Merge branch 'fix/ctxfi' into for-linus
* fix/ctxfi:
  ALSA: ctxfi: Swapped SURROUND-SIDE channels on emu20k2
2009-07-21 19:03:19 +02:00
Frank Roth
55fe27f7e2 ALSA: ctxfi: Swapped SURROUND-SIDE channels on emu20k2
On Soundblaster X-FI Titanium with emu20k2 the SIDE and SURROUND
channels were swapped and wrong. 
I double checked it with connector colors and creative soundblaster
windows drivers.

So I swapped them to the true order.
Now "speaker-test -c6" and "speaker-test -c8" are working fine.

Signed-off-by: Frank Roth <frashman@freenet.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-20 17:07:10 +02:00
Takashi Iwai
34fdeb2d07 ALSA: ca0106 - Fix the max capture buffer size
The capture buffer size with 64kB seems broken with CA0106.
At least, either the update timing or the DMA position is wrong,
and this screws up pulseaudio badly.

This patch restricts the max buffer size less than that to make life
a bit easier.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
2009-07-20 15:49:46 +02:00
Takashi Iwai
b04add9566 ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
The recent rewrite of the codec parser for STAC9872 caused a regression
for some Sony VAIO models that don't give proper pin default configs
by BIOS.  Even using model=vaio doesn't work because the pin definitions
are set after the pin overrides.

This patch fixes the pin definitions in patch_stac9872() to be put
in the right place before the pin overrides.  Also the patch adds the
new quirk entry for VAIO F/S to have the correct pin default configs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
2009-07-20 15:12:41 +02:00
Hao Song
42b95f0c6b ALSA: hda - Add quirk for Gateway T6834c laptop
Gateway T6834c laptops need EAPD always on while the default behavior
for the STAC9205 reference board is to turn it off upon every HP plug.
By using the special "eapd" model, which is first introduced for Gateway
T1616 laptops for this same reason, this peculiarity can be properly
handled.

Signed-off-by: Hao Song <baritono.tux@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-20 09:05:53 +02:00
Jaroslav Kysela
2e9bf24706 ALSA: hda_codec: Check for invalid zero connections
To prevent "Too many connections" message and the error path for some HDMI
codecs (which makes onboard audio unusable), check for invalid zero
connections for CONNECT_LIST verb.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-19 13:51:45 +02:00
Takashi Iwai
9d79b13691 Merge branch 'fix/misc' into for-linus
* fix/misc:
  ALSA: riptide -  proper handling of pci_register_driver for joystick
2009-07-16 16:35:48 +02:00
Takashi Iwai
26887793b6 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
2009-07-16 16:35:47 +02:00
Jaswinder Singh Rajput
cb65c8732a ALSA: riptide - proper handling of pci_register_driver for joystick
We need to check returning error for pci_register_driver(&joystick_driver)

On failure, we should unregister formerly registered audio drivers

This also fixed the compiler warning :

  CC [M]  sound/pci/riptide/riptide.o
 sound/pci/riptide/riptide.c: In function ‘alsa_card_riptide_init’:
 sound/pci/riptide/riptide.c:2200: warning: ignoring return value of ‘__pci_register_driver’, declared with attribute warn_unused_result

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-15 14:00:40 +02:00
Linus Torvalds
f00caa7629 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - targa and targa-2ch fix
  ALSA: hda - fix beep tone calculation for IDT/STAC codecs
  ALSA: hda - Missing volume controls for Intel HDA (ALC269/EeePC)
  ALSA: hda - Disable AMD SB600 64bit address support only
  ALSA: hda - Check widget types while parsing capture source in patch_via.c
  ALSA: hda - Fix capture source selection in patch_via.c
  ALSA: hda - Add missing EAPD initialization for VIA codecs
  ALSA: hda - Clean up VT170x dig-in initialization code
  ALSA: hda - Fix error path in the sanity check in azx_pcm_open()
  ALSA: hda - move 8086:fb30 quirk (stac9205) to the proper section
  ASoC: Fix wm8753 register cache size and initialization
  ASoC: add locking to mpc5200-psc-ac97 driver
  ASoC: Fix mpc5200-psc-ac97 to ensure the data ready bit is cleared
  ASoC: Fix register cache initialisation for WM8753
2009-07-10 19:19:09 -07:00
Jaroslav Kysela
9d30937acc ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
On some IbexPeak systems with ALC889A errors like "azx_get_response
timeout, switching to polling mode: last cmd=0xaf9f000b" are produced,
because non-existent codec #10 is wrongly accessed.

The problem is that snd_hda_get_connections() returns out-of-range result
for NID 0x1c (something like 0xf8f9 or 0xffff).

This patch adds a check to alc880_parse_auto_config() to avoid using
of this out-of-range NIDs. A better fix maybe to improve
snd_hda_get_connections() routine to check for valid NID ranges if
NIDs are expected as result.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-10 12:55:49 +02:00
Takashi Iwai
3ae3079666 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - targa and targa-2ch fix
  ALSA: hda - fix beep tone calculation for IDT/STAC codecs
  ALSA: hda - Missing volume controls for Intel HDA (ALC269/EeePC)
  ALSA: hda - Disable AMD SB600 64bit address support only
  ALSA: hda - Check widget types while parsing capture source in patch_via.c
  ALSA: hda - Fix capture source selection in patch_via.c
  ALSA: hda - Add missing EAPD initialization for VIA codecs
  ALSA: hda - Clean up VT170x dig-in initialization code
  ALSA: hda - Fix error path in the sanity check in azx_pcm_open()
  ALSA: hda - move 8086:fb30 quirk (stac9205) to the proper section
2009-07-10 11:17:12 +02:00
David Heidelberger
005b10769c ALSA: hda - targa and targa-2ch fix
Simplify ALC882_TARGA and return gpio3 to ALC883_TARGA_DIG and
ALC883_TARGA_2ch_DIG, which I accidentally removed in commit id
64a8be7435

Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-09 18:45:46 +02:00
Paul Vojta
369693dc93 ALSA: hda - fix beep tone calculation for IDT/STAC codecs
In the beep tone calculation for IDT/STAC codecs, lower numbers correspond
to higher frequencies and vice versa.  The current code has this backwards,
resulting in beep frequencies which are way too high (and sound bad on
tinny laptop speakers, resulting in complaints).

[Also added hz <= 0 check by tiwai]

Signed-off-by: Paul Vojta <vojta@math.berkeley.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-09 09:14:29 +02:00
Joe Perches
ad361c9884 Remove multiple KERN_ prefixes from printk formats
Commit 5fd29d6ccb ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.

<level> is now included in the output on each additional use.

Remove all uses of multiple KERN_<level>s in formats.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-08 10:30:03 -07:00
Darren Salt
508f711090 ALSA: hda - Missing volume controls for Intel HDA (ALC269/EeePC)
There is a regression, introduced in aa202455ee
(in alsa-kernel) which I noticed when trying to use the headphone socket on
my EeeCPC 901: the output was *very* quiet, practically silent.

This patch corrects the control types to that which was obviously intended in
the referenced commit.

Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-08 16:37:45 +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
1c55d521f4 ALSA: hda - Check widget types while parsing capture source in patch_via.c
Check the widget type and don't take invalid widgets while parsing
the capture source in patch_via.c.

Also, fixed some compile warnings introduced in the previous commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-08 07:45:46 +02:00
Takashi Iwai
337b9d02b4 ALSA: hda - Fix capture source selection in patch_via.c
The fixed widget NIDs in patch_via.c seem wrong for some codecs,
and it resulted in the invalid capture source selection.

This patch adds the code to parse the topology instead of using
fixed numbers in order to get the right MUX widget id corresponding
to the ADCs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-07 18:20:23 +02:00
Takashi Iwai
d3a11e601a ALSA: hda - Add missing EAPD initialization for VIA codecs
If the output pin is used and EAPD capability is present, turn on
the EAPD bit.  This fixes the silent output problem on ASUS laptops
with VT1708S codec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-07 13:44:29 +02:00
Takashi Iwai
55d1d6c1ef ALSA: hda - Clean up VT170x dig-in initialization code
Minor clean up for initializing the digital-in pin.
No functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-07 13:39:03 +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
Herton Ronaldo Krzesinski
02358fcfa5 ALSA: hda - move 8086:fb30 quirk (stac9205) to the proper section
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-04 12:20:16 +02:00
Takashi Iwai
854ace9c40 Merge branch 'fix/hda' into for-linus
* fix/hda:
  ALSA: hda - Add sanity check in PCM open callback
  ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback
  ALSA: hda - Avoid invalid formats and rates with shared SPDIF
  ALSA: hda - Improve ASUS eeePC 1000 mixer
  ALSA: hda - Add GPIO1 control at muting with HP laptops
2009-07-03 23:50:45 +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
022b466fc3 ALSA: hda - Avoid invalid formats and rates with shared SPDIF
Check whether formats and rates don't result in zero due to the
restriction of SPDIF sharing.  If any of them can be zero, disable
the SPDIF sharing mode instead.  Otherwise it will lead to a PCM
configuration error.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-03 23:03:30 +02:00
Takashi Iwai
aa202455ee ALSA: hda - Improve ASUS eeePC 1000 mixer
The mixer elements created for ASUS eeePC 1000 with ALC269 aren't
standard but strange words like "LineOut".  Rename the element names
to follow the standard one like "Headphone" and "Speaker".
Also, split the volumes to each so that the virtual master can control
them.

The alc269_fujitsu_mixer is removed because it's now identical with
the new eeepc mixer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-03 15:00:54 +02:00