safe/jmp/linux-2.6
15 years agoALSA: hda - Remove EXPERIMENTAL from CONFIG_SND_HDA_POWER_SAVE
Takashi Iwai [Fri, 28 Nov 2008 14:27:11 +0000 (15:27 +0100)]
ALSA: hda - Remove EXPERIMENTAL from CONFIG_SND_HDA_POWER_SAVE

It's mature enough now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add quirk for Sony VAIO VGN-SR19XN
Takashi Iwai [Fri, 28 Nov 2008 13:46:28 +0000 (14:46 +0100)]
ALSA: hda - Add quirk for Sony VAIO VGN-SR19XN

Added model=sony-assamd for Sony VAIO VGN-SR19XN with ALC262 codec.
Reference: Novell bnc#450080
https://bugzilla.novell.com/show_bug.cgi?id=450080

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Clear codec->proc_widget_hook at reset
Takashi Iwai [Fri, 28 Nov 2008 13:36:23 +0000 (14:36 +0100)]
ALSA: hda - Clear codec->proc_widget_hook at reset

Clear the remaining pointer at snd_hda_codec_reset() to avoid Oops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add IDT/STAC-specific proc output
Takashi Iwai [Fri, 28 Nov 2008 13:35:16 +0000 (14:35 +0100)]
ALSA: hda - Add IDT/STAC-specific proc output

Added power-map and analog-loopback information to proc output for
IDT/STAC codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Remove unused proc entry in hda_bus struct
Takashi Iwai [Fri, 28 Nov 2008 11:57:38 +0000 (12:57 +0100)]
ALSA: hda - Remove unused proc entry in hda_bus struct

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add codec-specific proc hook
Takashi Iwai [Fri, 28 Nov 2008 11:55:36 +0000 (12:55 +0100)]
ALSA: hda - Add codec-specific proc hook

Added a hook for proc outputs of codec-specific stuff.

Moved realtek-specific coeff output into patch_realtek.c as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix build error with CONFIG_SND_HDA_POWER_SAVE
Takashi Iwai [Fri, 28 Nov 2008 06:22:18 +0000 (07:22 +0100)]
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>
15 years agoALSA: hda - Fix creation of automatic capture mixers
Takashi Iwai [Thu, 27 Nov 2008 14:25:34 +0000 (15:25 +0100)]
ALSA: hda - Fix creation of automatic capture mixers

Fixed a wrong boundary check of num_adc_nids in set_capture_mixer()
in patch_realtek.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix PCM reconfigure
Takashi Iwai [Thu, 27 Nov 2008 13:17:01 +0000 (14:17 +0100)]
ALSA: hda - Fix PCM reconfigure

The reconfiguration of PCM affected all PCM streams on the bus, but
this this should be done rather only for the target codec.

This patch does the following:
- introduce bitmap indicating the PCM device usages on a hda_bus
- refactor the PCM build functions
- fix __devinit prefix in some fucntions
- add a proper ifdef around HDA-reconfig-specific functions

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Move power_save option to hda_intel.c
Takashi Iwai [Thu, 27 Nov 2008 11:43:28 +0000 (12:43 +0100)]
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>
15 years agoALSA: hda - make some functions static
Takashi Iwai [Thu, 27 Nov 2008 11:40:13 +0000 (12:40 +0100)]
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>
15 years agoALSA: sound/pci/hda/hda_codec.c: cleanup kernel-doc
Qinghuang Feng [Tue, 25 Nov 2008 15:24:49 +0000 (23:24 +0800)]
ALSA: sound/pci/hda/hda_codec.c: cleanup kernel-doc

There is no argument named @state in snd_hda_resume,
remove its' comment.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Really fix bits value in proc output
Takashi Iwai [Tue, 25 Nov 2008 15:07:01 +0000 (16:07 +0100)]
ALSA: hda - Really fix bits value in proc output

The fix in 82894b6f6f109722070d4d78730fe50cdaba9443 resulted in zero
due to wrong mask and bit shifts.  Now fixed really.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Tue, 25 Nov 2008 14:20:57 +0000 (15:20 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda - Check model for Dell 92HD73xx laptops
Takashi Iwai [Tue, 25 Nov 2008 14:18:29 +0000 (15:18 +0100)]
ALSA: hda - Check model for Dell 92HD73xx laptops

Check the model type instead of PCI SSID for detection of the mic types
on Dell laptops with IDT 92HD73xx codecs.  In this way, a new laptop
can be tested via model module option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - mark Dell studio 1535 quirk
Takashi Iwai [Fri, 21 Nov 2008 17:01:44 +0000 (18:01 +0100)]
ALSA: hda - mark Dell studio 1535 quirk

Fixed the quirk string for Dell studio 1535 (the product name wasn't
published at the time the patch was made).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - No 'Headphone as Line-out' swich without line-outs
Takashi Iwai [Mon, 24 Nov 2008 06:51:11 +0000 (07:51 +0100)]
ALSA: hda - No 'Headphone as Line-out' swich without line-outs

STAC/IDT driver creates "Headphone as Line-Out" switch even if there
is no line-out pins on the machine.  For devices only with headpohnes
and speaker-outs, this switch shouldn't be created.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add quirk for MSI 7260 mobo
Takashi Iwai [Tue, 25 Nov 2008 14:03:38 +0000 (15:03 +0100)]
ALSA: hda - Add quirk for MSI 7260 mobo

Added preset model=targa-dig for MSI 7260 mobo.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Assign unsol tags dynamically in patch_sigmatel.c
Takashi Iwai [Tue, 25 Nov 2008 10:58:19 +0000 (11:58 +0100)]
ALSA: hda - Assign unsol tags dynamically in patch_sigmatel.c

Since we need to handle many unsolicited events assigned to different
widgets, allocate the event dynamically using the existing events
array, and use the tag appropriately instead of combination of fixed
number and widget nid.  (Note that widget nid can be over 4 bits!)

Also, replaced the call of unsol_event handler with a dedicated
function to be more readable.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Tue, 25 Nov 2008 10:56:25 +0000 (11:56 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda - Fix AFG power management on IDT 92HD* codecs
Takashi Iwai [Tue, 25 Nov 2008 07:21:51 +0000 (08:21 +0100)]
ALSA: hda - Fix AFG power management on IDT 92HD* codecs

The AFG pin power-mapping isn't properly set for the fixed I/O pins
on IDT 92HD* codecs.  This resulted in the low power mode after the
boot until any jack detection is executed, thus no output from the
speaker.

This patch fixes the power mapping for the fixed pins, and also fixes
the GPIO bits and digital I/O pin settings properly in stac92xx_ini().

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix proc pcm rate bits
Takashi Iwai [Tue, 25 Nov 2008 10:42:54 +0000 (11:42 +0100)]
ALSA: hda - Fix proc pcm rate bits

Show only the relevant bits in the PCM rate bits as in the earlier version.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix caching of SPDIF status bits
Takashi Iwai [Tue, 25 Nov 2008 07:17:20 +0000 (08:17 +0100)]
ALSA: hda - Fix caching of SPDIF status bits

SPDIF status bits controls are written via snd_hda_codec_write()
without caching.  This causes a regression at resume that the bits
are lost.

Simply replacing it with the cached version fixes the problem.

Reference:
http://lkml.org/lkml/2008/11/24/324

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add probe_mask quirk for Medion MD96630
Takashi Iwai [Mon, 24 Nov 2008 16:29:28 +0000 (17:29 +0100)]
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>
15 years agoALSA: hda: Added an ALC888 model entry for Fujitsu-Siemens Amilo Xa3530
Vincent Petry [Sun, 23 Nov 2008 03:31:41 +0000 (11:31 +0800)]
ALSA: hda: Added an ALC888 model entry for Fujitsu-Siemens Amilo Xa3530

This patch fixes the bug 0004240: ALC888 - Intel HDA - Headphone Controlling.
It is made against the 2008-11-23 snapshot.

Added Realtek ALC888 model entry for the Fujitsu-Siemens Amilo Xa3530
laptop. It has 4 jacks: HP out, Mic-in, Line-in and Line-out/Side/SPDIF
(this one is on the laptop side, the other ones are on the rear).

Model detection works.
Headphone jack sense works now.
Front mic works now, was same as Acer Aspire 4930G.
Added channel mode from 2 to 8 channels.

In 2ch and 4ch modes, the front is also sent to the Line-out/side jack
for convenience instead of just muting the Line-out/side jack like other
models do.

When using the Mic-in jack as CLFE, the sound is very low (bug?). To
work it around, in 6ch mode the CLFE channel is duplicated to the
Line-out/side jack because this one has a better amp.

Cc: manu@frogged.de
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - No 'Headphone as Line-out' swich without line-outs
Takashi Iwai [Mon, 24 Nov 2008 06:51:11 +0000 (07:51 +0100)]
ALSA: hda - No 'Headphone as Line-out' swich without line-outs

STAC/IDT driver creates "Headphone as Line-Out" switch even if there
is no line-out pins on the machine.  For devices only with headpohnes
and speaker-outs, this switch shouldn't be created.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - fix build warning when CONFIG_PROC_FS=n
Wu Fengguang [Sat, 22 Nov 2008 01:40:57 +0000 (09:40 +0800)]
ALSA: hda - fix build warning when CONFIG_PROC_FS=n

Fix "defined but not used" build warning by moving eld_versoin_names[]
and cea_edid_version_names[] into hdmi_print_eld_info().

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - fix DisplayPort naming
Wu Fengguang [Sat, 22 Nov 2008 01:40:56 +0000 (09:40 +0800)]
ALSA: hda - fix DisplayPort naming

DisplayPort is a digital display interface standard put forth by
the Video Electronics Standards Association (VESA). It defines a
new license-free, royalty-free, digital audio/video interconnect,
intended to be used primarily between a computer and its display monitor,
or a computer and a home-theater system.

- From Wikipedia, the free encyclopedia

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - document the ELD proc interface
Wu Fengguang [Sat, 22 Nov 2008 01:40:55 +0000 (09:40 +0800)]
ALSA: hda - document the ELD proc interface

Describe what ELD proc interface provides and how to fix incorrect values.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - ELD proc interface write updates
Wu Fengguang [Sat, 22 Nov 2008 01:40:54 +0000 (09:40 +0800)]
ALSA: hda - ELD proc interface write updates

- rename ELD proc write routine to hdmi_write_eld_info()
- support modifying WMAPro's profile

Write to some ELD fields (monitor_name, manufacture_id, product_id,
eld_version, edid_version) are deliberately not supported, since that
won't correct wrong behaviors and only leads to confusions.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - make HDMI messages more user friendly
Wu Fengguang [Sat, 22 Nov 2008 01:40:53 +0000 (09:40 +0800)]
ALSA: hda - make HDMI messages more user friendly

- make some messages more user friendly
- add message prefix "HDMI:" to indicate the problem's domain
  (also easier to do `dmesg | grep HDMI` ;-)

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - report selected CA index for Audio InfoFrame
Wu Fengguang [Sat, 22 Nov 2008 01:40:52 +0000 (09:40 +0800)]
ALSA: hda - report selected CA index for Audio InfoFrame

Print some CA selecting info, which could be valuable for debugging when
something goes wrong.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - minor HDMI code cleanups
Wu Fengguang [Sat, 22 Nov 2008 01:40:51 +0000 (09:40 +0800)]
ALSA: hda - minor HDMI code cleanups

Some minor code cleanups.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix build without CONFIG_PROC_FS
Takashi Iwai [Fri, 21 Nov 2008 20:24:03 +0000 (21:24 +0100)]
ALSA: hda - Fix build without CONFIG_PROC_FS

snd_print_pcm_rates() and snd_print_pcm_bits() are used by both
hda_proc.c and hda_eld.c, thus they have to be defined in the common
place.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Fri, 21 Nov 2008 17:02:57 +0000 (18:02 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

15 years agoALSA: hda - mark Dell studio 1535 quirk
Takashi Iwai [Fri, 21 Nov 2008 17:01:44 +0000 (18:01 +0100)]
ALSA: hda - mark Dell studio 1535 quirk

Fixed the quirk string for Dell studio 1535 (the product name wasn't
published at the time the patch was made).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - fix sparse warning
Hannes Eder [Fri, 21 Nov 2008 15:03:24 +0000 (16:03 +0100)]
ALSA: hda - fix sparse warning

Fix the following sparse warning:

sound/pci/hda/patch_nvhdmi.c:161:25: warning: symbol
'snd_hda_preset_nvhdmi' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Move HD-audio Kconfig items to sound/pci/hda/Kconfig
Takashi Iwai [Fri, 21 Nov 2008 08:32:40 +0000 (09:32 +0100)]
ALSA: hda - Move HD-audio Kconfig items to sound/pci/hda/Kconfig

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Make CONFIG_SND_HDA_RECONFIG for codec reconfiguration
Takashi Iwai [Fri, 21 Nov 2008 08:26:20 +0000 (09:26 +0100)]
ALSA: hda - Make CONFIG_SND_HDA_RECONFIG for codec reconfiguration

Make the codec re-configuration feature selectable via Kconfig,
CONFIG_SND_HDA_RECONFIG.
Also mark it as experimental (as it really is).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Release ELD proc file
Takashi Iwai [Fri, 21 Nov 2008 08:11:50 +0000 (09:11 +0100)]
ALSA: hda - Release ELD proc file

Release ELD proc file when reconfigured so that no leak occurs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix double free of jack instances
Takashi Iwai [Fri, 21 Nov 2008 08:08:06 +0000 (09:08 +0100)]
ALSA: hda - Fix double free of jack instances

The jack instances created in patch_sigmatel.c may be double-freed.
The device management code checks the invalid element, and thus there
is no real breakage, but it spews annoying warning messages.
But, we can't simply remove the release calls of these jack instances
because they have to be freed when the codec is re-configured.

Now, a new flag, bus->shutdown is introduced to indicate that the bus
is really being unloaded, i.e. the objects managed by the device
manager will be automatically deleted.  We release these objects only
when this flag isn't set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add missing static for snd_hda_eld_proc_new() inline funciton
Takashi Iwai [Fri, 21 Nov 2008 07:54:54 +0000 (08:54 +0100)]
ALSA: hda - Add missing static for snd_hda_eld_proc_new() inline funciton

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add a quirk for Dell Studio 15
Takashi Iwai [Fri, 21 Nov 2008 07:37:03 +0000 (08:37 +0100)]
ALSA: hda - Add a quirk for Dell Studio 15

Added the matching model=dell-m6 for Dell Studio 15 laptop.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - support writing to the ELD proc file
Wu Fengguang [Fri, 21 Nov 2008 03:41:50 +0000 (11:41 +0800)]
ALSA: hda - support writing to the ELD proc file

Allow users to fix quicks of ELD ROMs by writing new values to the ELD proc
interface. The format is one or more lines of "name hex_value".

Users can add/remove/modify up to 32 SAD(Short Audio Descriptor) entries.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: modify monitor name to be consistent with other ELD proc items
Wu Fengguang [Fri, 21 Nov 2008 04:34:05 +0000 (12:34 +0800)]
ALSA: hda: modify monitor name to be consistent with other ELD proc items

Rename "monitor name" to "monitor_name" to conform with the keyword style.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - properly print ELD sample bits
Wu Fengguang [Fri, 21 Nov 2008 01:42:59 +0000 (09:42 +0800)]
ALSA: hda - properly print ELD sample bits

Fix bugs on printing the ELD sample bits.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Fri, 21 Nov 2008 07:27:04 +0000 (08:27 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda: Add STAC_DELL_M4_3 quirk
Matthew Ranostay [Fri, 21 Nov 2008 02:21:43 +0000 (21:21 -0500)]
ALSA: hda: Add STAC_DELL_M4_3 quirk

Added STAC_DELL_M4_3 quirk for Dell systems, also reorganized the
board config switch to assign number of digital muxes, microphones,
and SPDIF muxes via the PCI quirk defined.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - make laptop-eapd model back for AD1986A
Takashi Iwai [Fri, 21 Nov 2008 01:25:48 +0000 (02:25 +0100)]
ALSA: hda - make laptop-eapd model back for AD1986A

The changes specific for Samsung laptops seem unapplicable to other
hardware models like ASUS.  The mic inputs are lost on such hardware
by the change 5d5d5f43f1b835c375de9bd270cce030d16e2871.

This patch adds back the old laptop-eapd model, and create a new
model "samsung" for the new one specific to Samsung laptops with
automatic mic selection feature.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: STAC_DELL_M6 EAPD
Matthew Ranostay [Sun, 16 Nov 2008 16:42:34 +0000 (11:42 -0500)]
ALSA: hda: STAC_DELL_M6 EAPD

Add support for EAPD on system suspend and disabling EAPD on headphone jack
detection for STAC_DELL_M6 laptops.

This patch fixes the regressions, the silent output on HP of some Dell
laptops (see Novell bnc#446025):
https://bugzilla.novell.com/show_bug.cgi?id=446025

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: Added Realtek ALC888 model entry for Acer Aspire 4930G laptop
Vincent Petry [Tue, 18 Nov 2008 14:21:57 +0000 (22:21 +0800)]
ALSA: hda: Added Realtek ALC888 model entry for Acer Aspire 4930G laptop

Added Realtek ALC888 model entry for the Acer Aspire 4930G laptop that
fixes the following features:
- internal microphone
- heaphone jack sense
- channel mode

Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: azx_probe() cleanup
Wu Fengguang [Thu, 20 Nov 2008 01:24:52 +0000 (09:24 +0800)]
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>
15 years agoALSA: hda - Show missing GPIO unsol bits
Takashi Iwai [Wed, 19 Nov 2008 13:14:50 +0000 (14:14 +0100)]
ALSA: hda - Show missing GPIO unsol bits

The GPIO unsolicited event bits are read but not shown in the proc file.
Let's fix it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: compact ELD output messages
Wu Fengguang [Wed, 19 Nov 2008 07:14:03 +0000 (15:14 +0800)]
ALSA: hda: compact ELD output messages

Strip out some ELD printk messages that end user won't care,
and make the output compact.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: make global snd_print_pcm_bits()
Wu Fengguang [Wed, 19 Nov 2008 07:14:02 +0000 (15:14 +0800)]
ALSA: hda: make global snd_print_pcm_bits()

Introduce a global function snd_print_pcm_bits() and use it in the ELD code.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: minor output message cleanups
Wu Fengguang [Wed, 19 Nov 2008 07:14:01 +0000 (15:14 +0800)]
ALSA: hda: minor output message cleanups

Some minor user visible message cleanups.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: rename sink_eld to hdmi_eld
Wu Fengguang [Wed, 19 Nov 2008 07:14:00 +0000 (15:14 +0800)]
ALSA: hda: rename sink_eld to hdmi_eld

Rename struct sink_eld to hdmi_eld.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: minor code cleanups
Wu Fengguang [Wed, 19 Nov 2008 07:13:59 +0000 (15:13 +0800)]
ALSA: hda: minor code cleanups

Some minor code cleanups.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: EAPD mute on suspend
Matthew Ranostay [Wed, 19 Nov 2008 01:54:17 +0000 (20:54 -0500)]
ALSA: hda: EAPD mute on suspend

Moved support for EAPD mute on suspend from stac92hd71xx_suspend
to the generic stac92xx_suspend function.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: HDMI channel mapping cleanups
Wu Fengguang [Wed, 19 Nov 2008 00:56:18 +0000 (08:56 +0800)]
ALSA: hda: HDMI channel mapping cleanups

Refactor the channel mapping code for consistent naming
and make it more informed about channel allocations.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: HDMI channel allocations for audio infoframe
Wu Fengguang [Wed, 19 Nov 2008 00:56:17 +0000 (08:56 +0800)]
ALSA: hda: HDMI channel allocations for audio infoframe

To play a 3+ channels LPCM/DSD stream via HDMI,

- HDMI sink must tell HDMI source about its speaker placements
  (via ELD, speaker-allocation field)
- HDMI source must tell the HDMI sink about channel allocation
  (via audio infoframe, channel-allocation field)

(related docs: HDMI 1.3a spec section 7.4, CEA-861-D section 7.5.3 and 6.6)

This patch attempts to set the CA(channel-allocation) byte in the audio infoframe
according to
- the number of channels in the current stream
- the speakers attached to the HDMI sink

A channel_allocations[] line must meet the following two criteria to be
considered as a valid candidate for CA:
1) its number of allocated channels = substream->runtime->channels
2) its speakers are a subset of the available ones on the sink side

If there are multiple candidates, the first one is selected.  This simple
policy shall cheat the sink into playing music, but may direct data to the
wrong speakers.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: make global snd_print_channel_allocation()
Wu Fengguang [Wed, 19 Nov 2008 00:56:16 +0000 (08:56 +0800)]
ALSA: hda: make global snd_print_channel_allocation()

code refactor: make a global function snd_print_channel_allocation().

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: make standalone hdmi_fill_audio_infoframe()
Wu Fengguang [Wed, 19 Nov 2008 00:56:15 +0000 (08:56 +0800)]
ALSA: hda: make standalone hdmi_fill_audio_infoframe()

code refactor: make a standalone function hdmi_fill_audio_infoframe().

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Allow multiple imux for matrix-type mixers of ALC codecs
Takashi Iwai [Tue, 18 Nov 2008 11:36:33 +0000 (12:36 +0100)]
ALSA: hda - Allow multiple imux for matrix-type mixers of ALC codecs

Allow the multiple imux instances for matrix-type mixers like ALC882.
So far, only ALC260 used this feature, but other codecs may need a
similar stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Tue, 18 Nov 2008 09:57:07 +0000 (10:57 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

15 years agoALSA: hda - Fix resume of GPIO unsol event for STAC/IDT
Takashi Iwai [Tue, 18 Nov 2008 09:55:36 +0000 (10:55 +0100)]
ALSA: hda - Fix resume of GPIO unsol event for STAC/IDT

Use cached write for setting the GPIO unsolicited event mask to be
restored properly at resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add quirks for HP Pavilion DV models
Takashi Iwai [Tue, 18 Nov 2008 09:48:41 +0000 (10:48 +0100)]
ALSA: hda - Add quirks for HP Pavilion DV models

Added the quirk entries for HP Pavilion DV5 and DV7 with model=hp-m4.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix GPIO initialization in patch_stac92hd71bxx()
Takashi Iwai [Tue, 18 Nov 2008 09:45:15 +0000 (10:45 +0100)]
ALSA: hda - Fix GPIO initialization in patch_stac92hd71bxx()

Fixed the GPIO mask and co initialization in patch_stac92hd71bxx()
so that the gpio_maks for HP_M4 model is set properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix restore of pin configs at resume for STAC/IDT codecs
Takashi Iwai [Tue, 18 Nov 2008 09:38:56 +0000 (10:38 +0100)]
ALSA: hda - Fix restore of pin configs at resume for STAC/IDT codecs

Fixed the restore of pin configs at resume for some STAC/IDT codec
models.  These models set explicitly the pin configs after the default
init configs, and these aren't restored properly at resume.

This patch introduces two changes:
- Allocate always pin_configs array in stac_spec so that the driver
  can overwrite the value freely
- Introduce stac_change_pin_config() to change the pin config value

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Use init callback in stac92xx_resume()
Takashi Iwai [Tue, 18 Nov 2008 08:36:55 +0000 (09:36 +0100)]
ALSA: hda - Use init callback in stac92xx_resume()

Call the init callback and remove duplicated codes in stac92xx_resume().
This also fixes the missing initialization such as digital I/O pins.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Create jack detection elements in build_controls
Takashi Iwai [Tue, 18 Nov 2008 08:32:42 +0000 (09:32 +0100)]
ALSA: hda - Create jack detection elements in build_controls

The jack detection input elements should be created in build_controls
callback instead of init callback because init can be called multiple
times by suspend/resume and power-saving.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: ELD proc interface for HDMI sinks
Wu Fengguang [Tue, 18 Nov 2008 03:47:53 +0000 (11:47 +0800)]
ALSA: ELD proc interface for HDMI sinks

Create /proc/asound/card<card_no>/eld#<codec_no> to reflect the audio
configurations and capabilities of the attached HDMI sink.

Some notes:

- Shall we show an empty file if the ELD content is not valid?
  Well it's not that simple. There could be partially populated ELD,
  and there may be malformed ELD provided by buggy drivers/monitors.
  So expose ELD as it is.

- The ELD retrieval routines rely on the Intel HDA interface,
  others are/could be universal and independent ones.

- How do we name the proc file?
  If there are going to be two HDMI pins per codec, then the current naming
  scheme (eld#<codec no>) will fail. Luckily the user space dependencies should
  be minimal, so it would be trivial to do the rename if that happens.

- The ELD proc file content is designed to be easy for scripts and human reading.
  Its lines all have the pattern:
  <item_name>\t[\t]*<item_value>
  where <item_name> is a keyword in c language, while <item_value> could be any
  contents, including white spaces. <item_value> could also be a null value.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: create hda_eld.c for ELD routines and proc interface
Wu Fengguang [Tue, 18 Nov 2008 03:47:52 +0000 (11:47 +0800)]
ALSA: create hda_eld.c for ELD routines and proc interface

ELD handling routines can be shared by all HDMI codecs,
and they are large enough to make a standalone source file.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: introduce snd_print_pcm_rates()
Wu Fengguang [Tue, 18 Nov 2008 03:47:51 +0000 (11:47 +0800)]
ALSA: introduce snd_print_pcm_rates()

We want to share some code with print_pcm_rates(),
so extract a common routine snd_print_pcm_rates() from it.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: remove redundant get_amp_nid()
Wu Fengguang [Tue, 18 Nov 2008 02:21:55 +0000 (10:21 +0800)]
ALSA: hda: remove redundant get_amp_nid()

Remove get_amp_nid(): it duplicates the one defined in hda_local.h

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda-intel: reorder HDMI audio enabling sequence
Wu Fengguang [Mon, 17 Nov 2008 08:57:33 +0000 (16:57 +0800)]
ALSA: hda-intel: reorder HDMI audio enabling sequence

Reorder HDMI audio enabling sequence so that
1) the sink knows about the coming audio stream
2) unmute
3) start transferring audio samples

The theory is that in the path A=>B=>C, we first make C ready, and then
enable B, and lastly allow A to send audio samples.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: STAC_DELL_M6 EAPD
Matthew Ranostay [Sun, 16 Nov 2008 16:42:34 +0000 (11:42 -0500)]
ALSA: hda: STAC_DELL_M6 EAPD

Add support for EAPD on system suspend and disabling EAPD on headphone jack
detection for STAC_DELL_M6 laptops.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda: alc883 model for ASUS P5Q-EM boards
Wu Fengguang [Mon, 17 Nov 2008 08:51:09 +0000 (09:51 +0100)]
ALSA: hda: alc883 model for ASUS P5Q-EM boards

Add a new alc883 model ALC1200_ASUS_P5Q for ASUS P5Q-EM boards.
It is the same as ALC883_6ST_DIG except that the SPDIF digital
output nid is 0x10.

Tested-by: Andrei Tanas <andrei@tanas.ca>
Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Check model type instead of SSID in patch_92hd71bxx()
Takashi Iwai [Sat, 15 Nov 2008 18:28:54 +0000 (19:28 +0100)]
ALSA: hda - Check model type instead of SSID in patch_92hd71bxx()

Check board preset model instead of codec->subsystem_id in
patch_92hd71bxx() so that other hardwares configured via the model
option work like the given model.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Sat, 15 Nov 2008 18:05:21 +0000 (19:05 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda: STAC_VREF_EVENT value change
Matthew Ranostay [Fri, 14 Nov 2008 22:46:22 +0000 (17:46 -0500)]
ALSA: hda: STAC_VREF_EVENT value change

Changed value for STAC_VREF_EVENT from 0x40 to 0x00 because the
unsol response value is only 6-bits width and the former value
was 1<<6 which is an overrun.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Support Headphone and Speaker volumes control on VAIO
Takashi Iwai [Fri, 14 Nov 2008 13:03:33 +0000 (14:03 +0100)]
ALSA: hda - Support Headphone and Speaker volumes control on VAIO

Split the bound Master control to individual Headphone and Speaker
volume controls for VAIO with STAC982x codecs.
The Master controls is still created as a vmaster.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Thu, 13 Nov 2008 13:38:00 +0000 (14:38 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda - Missing NULL check in hda_beep.c
Takashi Iwai [Thu, 13 Nov 2008 12:08:56 +0000 (13:08 +0100)]
ALSA: hda - Missing NULL check in hda_beep.c

Added a NULL check of input_allocate_device() in hda_beep.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add digital beep playback switch for STAC/IDT codecs
Takashi Iwai [Wed, 12 Nov 2008 15:45:04 +0000 (16:45 +0100)]
ALSA: hda - Add digital beep playback switch for STAC/IDT codecs

The digital beep widget may have no mute control, and always enabling
the beep is ofen pretty annoying, especially on laptops.

This patch adds a mixer control "PC Beep Playback Switch" when there
is no mixer amp mute is found, and controls it on software.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - support detecting HD Audio devices with PCI class code
Yang, Libin [Thu, 13 Nov 2008 10:07:07 +0000 (11:07 +0100)]
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>
15 years agoALSA: handle SiI1392 HDMI codec in patch_intelhdmi.c
Wu Fengguang [Thu, 13 Nov 2008 02:19:38 +0000 (10:19 +0800)]
ALSA: handle SiI1392 HDMI codec in patch_intelhdmi.c

Move the handling of SiI1392 HDMI codec from patch_atihdmi.c to
patch_intelhdmi.c, which makes our ASUS P5E-VM HDMI board work.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Wed, 12 Nov 2008 09:02:04 +0000 (10:02 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

Conflicts:
sound/pci/hda/patch_sigmatel.c

15 years agoALSA: hda - Fix IDT/STAC multiple HP detection
Takashi Iwai [Wed, 12 Nov 2008 08:48:04 +0000 (09:48 +0100)]
ALSA: hda - Fix IDT/STAC multiple HP detection

Due to the recent change for multiple HP as line-out switch, only
one of the multiple headphons (usually a wrong one) is toggled
and the other pins are still disabled.  This causes the silent output
problem on some Dell laptops.

Also, the hp_switch check is screwed up when a line-in or a mic-in
jack exists.  This is added as an additional output, but hp_switch
check doesn't take it into account.

This patch fixes these issues: simplify hp_switch check by using
the NID instead of bool, and clean up / fix the toggle of HP pins
in unsol event handler code.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix input pin initialization for STAC/IDT codecs
Takashi Iwai [Tue, 11 Nov 2008 15:47:24 +0000 (16:47 +0100)]
ALSA: hda - Fix input pin initialization for STAC/IDT codecs

The input pins are sometimes not initialized properly because
of the optimization check of the current pinctl code.

Force to initialize the mic input pins so that they can be set up
properly even if they were in a weird state.  But keep other input
pins if already set up as input, since this could be an extra mic
pin.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add missing analog-mux mixer creation for STAC9200
Takashi Iwai [Tue, 11 Nov 2008 15:46:19 +0000 (16:46 +0100)]
ALSA: hda - Add missing analog-mux mixer creation for STAC9200

The creation of analog-mux mixer element is missing in
patch_stac9200() due to the dynamic allocation patch.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Make the HP EliteBook 8530p use AD1884A model laptop
Travis Place [Mon, 10 Nov 2008 16:56:23 +0000 (17:56 +0100)]
ALSA: hda - Make the HP EliteBook 8530p use AD1884A model laptop

Added a QUIRK to patch_analog.c for the HP Elitebook 8530p
(IDs 0x103c:0x30e7) to use AD1884A model 'laptop' by default.
Playback and Capture confirmed working.

Signed-off-by: Travis Place <wishie@wishie.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix another cache list management
Takashi Iwai [Mon, 10 Nov 2008 15:24:26 +0000 (16:24 +0100)]
ALSA: hda - Fix another cache list management

Fix another silly bug in the amp cache list management.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add another HP model (6730s) for AD1884A
Michel Marti [Sat, 8 Nov 2008 10:33:32 +0000 (11:33 +0100)]
ALSA: hda - Add another HP model (6730s) for AD1884A

Added model=laptop for another HP machine (103c:3614) with AD1884A
codec.

Signed-off-by: Michel Marti <mma@objectxp.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Fix probe errors on Dell Studio Desktop
Takashi Iwai [Fri, 7 Nov 2008 13:53:09 +0000 (14:53 +0100)]
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>
15 years agoALSA: hda - Fix ALC260 hp3013 master switch
Takashi Iwai [Fri, 7 Nov 2008 13:49:28 +0000 (14:49 +0100)]
ALSA: hda - Fix ALC260 hp3013 master switch

The master switch doesn't influence on NID 0x15, the headphone jack
on HP 3013 model because alc260_hp_master_update() ignores the passed
arguments.

Also, corrected the wrong arguments of hp3013 (0x10 and 0x15) although
this doesn't change any behavior.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoMerge branch 'topic/fix/hda' into topic/hda
Takashi Iwai [Fri, 7 Nov 2008 08:06:45 +0000 (09:06 +0100)]
Merge branch 'topic/fix/hda' into topic/hda

15 years agoALSA: hda - Fix broken hash chain allocation
Takashi Iwai [Thu, 6 Nov 2008 23:49:48 +0000 (00:49 +0100)]
ALSA: hda - Fix broken hash chain allocation

The chaining for amp hash got broken due to the rewrite with
snd_array.  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add max allocation check in array allocator
Takashi Iwai [Thu, 6 Nov 2008 23:26:52 +0000 (00:26 +0100)]
ALSA: hda - Add max allocation check in array allocator

Added a check for max allocation size in snd_array_new() for a
debugging purpose.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 years agoALSA: hda - Add missing NULL check in amp hash allocation
Takashi Iwai [Thu, 6 Nov 2008 23:23:30 +0000 (00:23 +0100)]
ALSA: hda - Add missing NULL check in amp hash allocation

Added the missing NULL check from allocator in get_alloc_hash().

Signed-off-by: Takashi Iwai <tiwai@suse.de>