Takashi Iwai [Thu, 11 Dec 2008 10:47:17 +0000 (11:47 +0100)]
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.
Takashi Iwai [Fri, 5 Dec 2008 12:09:27 +0000 (13:09 +0100)]
ALSA: hda - Proper power-map toggling for input pins
The current code overrides the event type on input pins always to
PWR_EVENT. Although this still works (PWR_EVENT and INSERT_EVENT
are handled samely), it'd be better to avoid such overrides.
Also, currently the unsol events are registered even for fixed pins
which will never raise the pin-detection event.
Takashi Iwai [Mon, 1 Dec 2008 10:54:35 +0000 (11:54 +0100)]
ALSA: hda - Remove unnecessary caches for power states in patch_sigmatel.c
The power-state changes in patch_sigmatel.c are accessed via *_cached()
but they shouldn't be really cached. Fixed to the normal write.
Also, stac92hd71xx_suspend and resume are no longer necessary as the
power-state changes are handled properly in the common routine.
Removed these hacks now.
Takashi Iwai [Mon, 1 Dec 2008 10:42:09 +0000 (11:42 +0100)]
ALSA: hda - Use amp cache for SPDIF mute controls in patch_sigmatel.c
The amp switch of SPDIF outputs have to be cached in the amp cache
instead of codec cache. Otherwise it conflicts with the IEC958
playback switch control in hda_codec.c.
Takashi Iwai [Fri, 28 Nov 2008 14:17:06 +0000 (15:17 +0100)]
ALSA: hda - Don't export symbols when built-in kernel
The global functions in hda_codec.c and other core parts are only
for HD-audio codec and controller drivers. When the HD-audio driver
is built in kernel, all stuff have to be statically linked, thus
we don't need any exports.
This patch introduces a conditional macro to do export only
when needed.
Takashi Iwai [Thu, 27 Nov 2008 14:47:11 +0000 (15:47 +0100)]
ALSA: hda - Modularize HD-audio driver
Split the monolithc HD-audio driver into several pieces:
- snd-hda-intel HD-audio PCI controller driver; loaded via udev
- snd-hda-codec HD-audio codec bus driver
- snd-hda-codec-* Specific HD-audio codec drivers
When built as modules, snd-hda-codec (that is invoked by snd-hda-intel)
looks up the codec vendor ID and loads the corresponding codec module
automatically via request_module().
When built in a kernel, each codec drivers are statically hooked up
before probing the PCI.
This patch adds appropriate EXPORT_SYMBOL_GPL()'s and the module
information for each driver, and driver-linking codes between
codec-bus and codec drivers.
TODO:
- Avoid EXPORT_SYMBOL*() when built-in kernel
- Restore __devinit appropriately depending on the condition
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
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.
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.
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.
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.
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().
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.
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>
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.
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.
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.
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.
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>
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.
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>
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>
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.
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.
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
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.
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.
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.
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>
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.