aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
AgeCommit message (Collapse)Author
2010-03-15ALSA: hda - Add an error message for invalid mapping NIDTakashi Iwai
Add an error message to snd_hda_add_nid() for invalid mapping NID to make easier to hunt the buggy code. Also added a missing space to the error message in snd_hda_build_controls() Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-02ALSA: sound/pci/hda/hda_codec.c: various coding style fixesNorberto Lopes
Signed-off-by: Norberto Lopes <nlopes.ml@gmail.com> Acked-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-24ALSA: hda - remove unnecessary msleep on power state transitionsZhang, Rui
This will save ~15ms boot time. The first 10ms sleep was introduced in commit d2595d86e5 for (buggy) Cxt codecs, so better to limit the sleep to the problem hardware. For the second 10ms sleep, the HDA spec says: Power State[1:0]: 00: Node Power state (D0) is fully on. 01: Node Power state (D1) allows for (does not require) the lowest possible power consuming state from which it can return to the "fully on" state (D0) within 10 ms, excepting analog pass through circuits (e.g., CD analog playback) which must remain fully on. 10: Node Power state (D2) allows for (does not require) the lowest possible power consuming state from which it can return to the "fully on" state (D0) within 10 ms. For modems, this is the "wake on ring" power state. 11: Node Power state (D3) allows for (does not require) lowest possible power consuming state under software control. Note that any low power state set by software must retain sufficient operational capability to properly respond to subsequent software Power State command. So 10ms is actually the max wait time. It should be safe to remove/reduce it and rely on the loop of 1ms-sleeps. CC: Marc Boucher <marc@linuxant.com> CC: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-28ALSA: hda - Define max number of PCM devices in hda_codec.hTakashi Iwai
Define the constant rather in the common header file. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-19Merge branch 'fix/hda' into topic/hdaTakashi Iwai
Conflicts: sound/pci/hda/patch_realtek.c
2009-12-27ALSA: hda - Add sanity check for storing the user-defined pin configsTakashi Iwai
Check whether the given NID is a pin widget before storing the user-defined pin configs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-27ALSA: hda - Add snd_hda_shutup_pins() helper functionTakashi Iwai
Add a common helper function for clearing pin controls before suspend. Use the pincfg array instead of looking through all widget tree. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25ALSA: hda - Disable tigger at pin-sensing on AD codecsTakashi Iwai
Analog Device codecs seem to have problems with the triggering of pin-sensing although their pincaps give the trigger requirements. Some reported that constant CPU load on HP laptops with AD codecs. For avoiding this regression, add a flag to codec struct to notify explicitly that the codec doesn't suppot the trigger at pin-sensing. Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2009-12-23ALSA: hda - Set mixer name after codec patchTakashi Iwai
Postpone the mixer name setup after the codec patch since the codec patch may change the codec name string in itself. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-23ALSA: hda - Fix NID association for capture mixersTakashi Iwai
Fix the wrong implementation of NID <-> kctl mapping for capture mixers introduced by the ocmmit 5b0cb1d850c26893b1468b3a519433a1b7a176be. So far, the driver returns an error at probe. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-15ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAGJaroslav Kysela
The HDA_SUBDEV_NID_FLAG is duplicate for amplifier control elements. Move get_amp_nid_() call to the snd_hda_ctl_add() function. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-15ALSA: hda - introduce HDA_SUBDEV_AMP_FLAG (ControlAmp in proc)Jaroslav Kysela
The purpose of this changeset is to show information about amplifier setting in the codec proc file. Something like: Control: name="Front Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Front Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=In, idx=2, ofs=0 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-15ALSA: hda - add more NID->Control mappingJaroslav Kysela
This set of changes add missing NID values to some static control elemenents. Also, it handles all "Capture Source" or "Input Source" controls. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-11-18ALSA: hda - introduce snd_hda_jack_detect() and snd_hda_pin_sense()Wu Fengguang
This helps merge duplicate code. v2: add snd_hda_jack_detect() and comments recommended by Takashi. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda - Fix build errors with CONFIG_SND_HDA_INPUT_BEEP=nTakashi Iwai
Disable beep-related codes when CONFIG_SND_HDA_INPUT_BEEP isn't set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda - Update / add kerneldoc comments to exported functionsTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda - Get rid of magic digits for subdev hackTakashi Iwai
Define a proper const for a magic 31bit flag for subdev / NID setup with a brief comment. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda - proc - add support for dynamic controls to mixer<->NID mappingJaroslav Kysela
This patch adds support for dynamically created controls to proc codec file (Control: lines). Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda - proc - introduce Control: lines to show mixer<->NID assignmentJaroslav Kysela
This is an initial patch to show universal control<->NID assigment in proc codec file. The change helps to debug codec related problems. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16ALSA: hda_intel: Digital PC Beep - change behaviour for input layerJaroslav Kysela
Original implementation was keeping registered input device for SND_BEEP and SND_TONE events all time. This patch changes this behaviour: If digital PC Beep is turned off using universal control switch, the input device is unregistered. Explanation: The kd_mksound() send SND_BEEP and SND_TONE only to last registered device acceping those events. It means that the HDA Intel audio driver blocks also the internal PC Speaker device (pcspkr.c driver) even if the HDA Beep is muted. The user can easy disable all beeps using 'setterm -blength 0' or 'xset b off' command. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-11ALSA: hda - Add power on/off counterTakashi Iwai
Added the power on/off counter and expose via sysfs files. The sysfs files, power_on_acct and power_off_acct, are created under each codec hwdep sysfs directory (e.g. /sys/class/sound/hwC0D0). The files show the msec length of the codec power-on and power-off, respectively. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10ALSA: hda - Add missing export for snd_hda_bus_reboot_notifyTakashi Iwai
... forgot to add for modules. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10ALSA: hda - proc - show which I/O NID is associated to PCM deviceJaroslav Kysela
Output something like: Node 0x02 [Audio Output] wcaps 0x11: Stereo Device: name="ALC888 Analog", type="Audio", device=0, substream=0 Converter: stream=0, channel=0 ... Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10ALSA: hda - Add reboot notifier to each codecTakashi Iwai
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-10-30ALSA: hda - allow up to 4 HDMI devicesWu Fengguang
The new Intel HDMI codec supports 2 independant HDMI/DisplayPort pipes. We'll be exporting them as 2 pcm devices. So bump up the allowed number of HDMI devices. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30ALSA: hda - vectorize get_empty_pcm_device()Wu Fengguang
This unifies the code and data structure, and makes it easy to add more HDMI devices. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-02ALSA: hda - Fix obsolete CONFIG_SND_DEBUG_DETECTTakashi Iwai
Fix the old dead CONFIG_SND_DEBUG_DETECT to CONFIG_SND_DEBUG_VERBOSE. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2009-08-03ALSA: hda: track CIRB/CORB command/response states for each codecWu Fengguang
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-07-30Merge branch 'topic/hda-cirrus' into topic/hdaTakashi Iwai
2009-07-27ALSA: hda - Add exception for volume-knob in snd_hda_get_connections()Takashi Iwai
Volume-knob widgets may have connections even if they have no CONN_LIST cap bit. Allow the query exceptionally in snd_hda_get_connections(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-27ALSA: hda - Introduce get_wcaps_type() macroTakashi Iwai
Add a helper macro to retrieve the widget type from wiget cap bits. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22ALSA: hda-intel: Cleanups for widget connection list handlingJaroslav Kysela
This patch adds a check to snd_hda_get_connections() routine for presence of AC_WCAP_CONN_LIST. Also, make sure that negative error codes from noted route are handled on all places as errors. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22ALSA: hda - Reduce click noise at power-savingTakashi Iwai
Add some tricks to reduce the click noise at powering down to D3 in the power saving mode on STAC/IDT codecs. The key seems to be to reset PINs before the power-down, and some delay before entering D3. The needed delay is significantly long, but I don't know why. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-19Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2009-07-19ALSA: hda_codec: Check for invalid zero connectionsJaroslav Kysela
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-17ALSA: hda - Fix the previous sanity check in make_codec_cmd()Takashi Iwai
The newly added sanity-check for a codec verb can be better written with logical ORs. Also, the parameter can be more than 8bit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-17ALSA: hda - add bounds checking for the codec command fieldsWu Fengguang
A recent bug involves passing auto detected >0x7f NID to codec command, creating an invalid codec addr field, and finally lead to cmd timeout and fall back into single command mode. Jaroslav fixed that bug in alc880_parse_auto_config(). It would be safer to further check the bounds of all cmd fields. Cc: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-10ALSA: hda - Check codec errors in snd_hda_get_connections()Takashi Iwai
The codec read errors in snd_hda_get_connections() are ignored so far, and it causes a problem like the bug in the commit 9d30937accf2c01e8b0bd59787409a7348cbbcb7 ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking Better to check errors in the function and returns a proper error code rather than passing bogus NID values. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-04Merge branch 'fix/hda' into topic/hdaTakashi Iwai
2009-07-03ALSA: hda - Don't override maxbps for FLOAT sharing with linear formatsTakashi Iwai
When FLOAT PCM format is available but together with other linear PCM formats, don't override maxbps value. For FLOAT format, it's always 32, thus it can be better checked in snd_hda_calc_stream_format(). Otherwise the maxbps 32 might be used wrongly even if the linear PCM doesn't support it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-03ALSA: hda - Avoid invalid formats and rates with shared SPDIFTakashi Iwai
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-01ALSA: hda - Add Cirrus Logic CS420x supportTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-01ALSA: hda - Allow FLOAT PCM formatTakashi Iwai
So far, the FLOAT PCM format is used only exclusivley set. But this can be a combination with other formats. This patch changes the parser to allow the FLOAT format in addition to other PCM formats. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-24ALSA: hda - Don't call snd_hda_codec_configure in snd_hda_codec_new()Takashi Iwai
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-17ALSA: hda - Fix memory leak at codec creationTakashi Iwai
The codec->modelname field is allocated twice in snd_hda_codec_new(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02ALSA: hda - Limit codec-verb retry to limited hardwaresTakashi Iwai
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-02ALSA: hda - Add codec bus reset and verb-retry at critical errorsTakashi Iwai
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-05-26ALSA: hda - Support sync after writing a verbTakashi Iwai
This patch adds a debug mode to make the codec communication synchronous. Define SND_HDA_SUPPORT_SYNC_WRITE in hda_codec.c, and the call of snd_hda_codec_write*() will become synchronous, i.e. wait for the reply from the codec at each time issuing a verb. Signed-off-by: Takashi Iwai <tiwai@suse.de>