summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: hda - Add an error message for invalid mapping NIDTakashi Iwai2010-03-151-1/+3
| | | | | | | | | 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>
* ALSA: sound/pci/hda/hda_codec.c: various coding style fixesNorberto Lopes2010-03-021-31/+38
| | | | | | 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>
* ALSA: hda - remove unnecessary msleep on power state transitionsZhang, Rui2010-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ALSA: hda - Define max number of PCM devices in hda_codec.hTakashi Iwai2010-01-281-0/+2
| | | | | | Define the constant rather in the common header file. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'fix/hda' into topic/hdaTakashi Iwai2010-01-191-4/+6
|\ | | | | | | | | Conflicts: sound/pci/hda/patch_realtek.c
| * ALSA: hda - Disable tigger at pin-sensing on AD codecsTakashi Iwai2009-12-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ALSA: hda - Add sanity check for storing the user-defined pin configsTakashi Iwai2009-12-271-0/+3
| | | | | | | | | | | | | | Check whether the given NID is a pin widget before storing the user-defined pin configs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add snd_hda_shutup_pins() helper functionTakashi Iwai2009-12-271-0/+19
| | | | | | | | | | | | | | 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>
* | Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-12-251-5/+5
|\ \ | |/
| * ALSA: hda - Set mixer name after codec patchTakashi Iwai2009-12-231-5/+5
| | | | | | | | | | | | | | 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>
* | ALSA: hda - Fix NID association for capture mixersTakashi Iwai2009-12-231-26/+0
| | | | | | | | | | | | | | | | 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>
* | ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAGJaroslav Kysela2009-12-151-2/+5
| | | | | | | | | | | | | | 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>
* | ALSA: hda - introduce HDA_SUBDEV_AMP_FLAG (ControlAmp in proc)Jaroslav Kysela2009-12-151-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ALSA: hda - add more NID->Control mappingJaroslav Kysela2009-12-151-2/+62
|/ | | | | | | | 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>
* ALSA: hda - introduce snd_hda_jack_detect() and snd_hda_pin_sense()Wu Fengguang2009-11-181-0/+34
| | | | | | | | | 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>
* ALSA: hda - Fix build errors with CONFIG_SND_HDA_INPUT_BEEP=nTakashi Iwai2009-11-161-0/+2
| | | | | | Disable beep-related codes when CONFIG_SND_HDA_INPUT_BEEP isn't set. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Update / add kerneldoc comments to exported functionsTakashi Iwai2009-11-161-41/+391
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Get rid of magic digits for subdev hackTakashi Iwai2009-11-161-1/+1
| | | | | | | 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>
* ALSA: hda - proc - add support for dynamic controls to mixer<->NID mappingJaroslav Kysela2009-11-161-1/+6
| | | | | | | | 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>
* ALSA: hda - proc - introduce Control: lines to show mixer<->NID assignmentJaroslav Kysela2009-11-161-15/+17
| | | | | | | | 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>
* ALSA: hda_intel: Digital PC Beep - change behaviour for input layerJaroslav Kysela2009-11-161-0/+12
| | | | | | | | | | | | | | | | 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>
* ALSA: hda - Add power on/off counterTakashi Iwai2009-11-111-0/+16
| | | | | | | | | | 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>
* ALSA: hda - Add missing export for snd_hda_bus_reboot_notifyTakashi Iwai2009-11-101-0/+1
| | | | | | ... forgot to add for modules. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - proc - show which I/O NID is associated to PCM deviceJaroslav Kysela2009-11-101-4/+5
| | | | | | | | | | | | 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>
* ALSA: hda - Add reboot notifier to each codecTakashi Iwai2009-11-101-0/+17
| | | | | | | | | | | | | 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>
* ALSA: hda - allow up to 4 HDMI devicesWu Fengguang2009-10-301-1/+1
| | | | | | | | | 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>
* ALSA: hda - vectorize get_empty_pcm_device()Wu Fengguang2009-10-301-33/+16
| | | | | | | | 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>
* ALSA: hda - Fix obsolete CONFIG_SND_DEBUG_DETECTTakashi Iwai2009-09-021-1/+1
| | | | | | Fix the old dead CONFIG_SND_DEBUG_DETECT to CONFIG_SND_DEBUG_VERBOSE. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-08-031-1/+1
|\
| * ALSA: hda: track CIRB/CORB command/response states for each codecWu Fengguang2009-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'topic/hda-cirrus' into topic/hdaTakashi Iwai2009-07-301-0/+1
|\ \
| * | ALSA: hda - Add Cirrus Logic CS420x supportTakashi Iwai2009-07-011-0/+1
| | | | | | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: hda - Add exception for volume-knob in snd_hda_get_connections()Takashi Iwai2009-07-271-1/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - Introduce get_wcaps_type() macroTakashi Iwai2009-07-271-6/+3
| | | | | | | | | | | | | | | | | | Add a helper macro to retrieve the widget type from wiget cap bits. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: hda-intel: Cleanups for widget connection list handlingJaroslav Kysela2009-07-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - Reduce click noise at power-savingTakashi Iwai2009-07-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-07-191-0/+6
|\ \ \ | | |/ | |/|
| * | ALSA: hda_codec: Check for invalid zero connectionsJaroslav Kysela2009-07-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - Fix the previous sanity check in make_codec_cmd()Takashi Iwai2009-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - add bounds checking for the codec command fieldsWu Fengguang2009-07-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - Check codec errors in snd_hda_get_connections()Takashi Iwai2009-07-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-07-041-4/+10
|\ \ \ | |/ /
| * | ALSA: hda - Avoid invalid formats and rates with shared SPDIFTakashi Iwai2009-07-031-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ALSA: hda - Don't override maxbps for FLOAT sharing with linear formatsTakashi Iwai2009-07-031-2/+3
| |/ |/| | | | | | | | | | | | | | | | | 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>
* | ALSA: hda - Allow FLOAT PCM formatTakashi Iwai2009-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
* | ALSA: hda - Don't call snd_hda_codec_configure in snd_hda_codec_new()Takashi Iwai2009-06-241-6/+2
|/ | | | | | | | | | 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>
* ALSA: hda - Fix memory leak at codec creationTakashi Iwai2009-06-171-2/+0
| | | | | | The codec->modelname field is allocated twice in snd_hda_codec_new(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Limit codec-verb retry to limited hardwaresTakashi Iwai2009-06-021-10/+2
| | | | | | | | | | | 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>
* ALSA: hda - Add codec bus reset and verb-retry at critical errorsTakashi Iwai2009-06-021-16/+16
| | | | | | | | | | | | 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>
* ALSA: hda - Support sync after writing a verbTakashi Iwai2009-05-261-52/+61
| | | | | | | | | 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>
OpenPOWER on IntegriCloud