summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* ALSA: hda - Split codec->name to vendor and chip name stringsTakashi Iwai2009-05-161-12/+24
| | | | | | | | | Split the name string in hda_codec struct to vendor_name and chip_name strings to be stored directly from the preset name. Since mostly only the chip name is referred in many patch_*.c, this results in the reduction of many codes in the end. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - minor optimization in hda_set_power_state()Takashi Iwai2009-04-211-2/+3
| | | | | | | Check the target power-state before checking EAPD exception to reduce unneeded verb executions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/hda-cache' into topic/hdaTakashi Iwai2009-04-211-40/+74
|\
| * ALSA: hda - Retry codec-verbs at errorsTakashi Iwai2009-04-211-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The current error-recovery scheme for the codec communication errors doesn't work always well. Especially falling back to the single-command mode causes the fatal problem on many systems. In this patch, the problematic verb is re-issued again after the error (even with polling mode) instead of the single-cmd mode. The single-cmd mode will be used only when specified via the command option explicitly, mainly just for testing. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda - Cache PCM and STREAM parameters queriesTakashi Iwai2009-04-211-36/+61
| | | | | | | | | | | | | | | | Cache quries for PCM and STREAM parameters as well as ampcap and pincap sharing the hash table. This will reduce the superfluous access of the same codec verbs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-04-211-3/+5
|\ \
| * | ALSA: hda - Set function_id only on FG nodesTakashi Iwai2009-04-171-3/+5
| | | | | | | | | | | | | | | | | | | | | (Re)set function_id only from the value on FG nodes. The current code overrides the value with the last widget. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: hda - Check strcpy lengthTakashi Iwai2009-04-161-0/+2
| | | | | | | | | | | | | | | | | | | | | Check the length to copy via strlen() beforehand to avoid the stack corruption, or use strlcpy() to be safe in HD-audio codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: hda - Add Creative CA0110-IBG supportTakashi Iwai2009-04-161-0/+1
|/ / | | | | | | | | | | | | | | Added the support for Creative SB X-Fi boards with UAA (HD-audio) mode. In the HD-audio mode, no multiple streams are supported by just it behaves like a normal HD-audio device. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Fix the cmd cache keys for amp verbsTakashi Iwai2009-04-151-1/+5
|/ | | | | | | | | | | | | Fix the key value generation for get/set amp verbs. The upper bits of the parameter have to be combined with the verb value to be unique for each direction/index of amp access. This fixes the resume problem on some hardwares like Macbook after the channel mode is changed. Tested-by: Johannes Berg <johannes@sipsolutions.net> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Use cached calls to get widget caps and pin capsTakashi Iwai2009-03-231-2/+1
| | | | | | | | | | Replace with the standard function calls to use caches for reading the widget caps and pin caps. hda_proc.c is still using the direct verbs to get raw values as much as possible. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Cache pin-cap valuesTakashi Iwai2009-03-231-0/+16
| | | | | | | Added snd_hda_query_pin_caps() to read and cache pin-cap values to avoid too frequently issuing the same verbs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Add function id to proc outputPascal de Bruijn2009-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | This patch does two things: Output Intel HDA Function Id in /proc/asound/cardX/codec#X Align Vendor/Subsystem/Revision Ids to 8 characters, front-padded with zeros Before: Vendor Id: 0x11d41884 Subsystem Id: 0x103c281a Revision Id: 0x100100 After: Function Id: 0x1 Vendor Id: 0x11d41884 Subsystem Id: 0x103c281a Revision Id: 0x0100100 As report on the Kernel Bugzilla #12888 Signed-off-by: Pascal de Bruijn <pascal@unilogicnetworks.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-hda-intel - add checks for invalid values to *query_supported_pcm()Jaroslav Kysela2009-03-181-8/+25
| | | | | | | | | | If ratesp or formatsp values are zero, wrong values are passed to ALSA's the PCM midlevel code. The bug is showed more later than expected. Also, clean a bit the code. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - power up before codec initializationTakashi Iwai2009-03-131-7/+8
| | | | | | | | | Change the power state of each widget before starting the initialization work so that all verbs are executed properly. Also, keep power-up during hwdep reconfiguration. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Allow slave controls with non-zero indicesTakashi Iwai2009-03-061-8/+13
| | | | | | Fix snd_hda_add_vmaster() to check the non-zero indices of slave controls. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Fix gcc compile warningTakashi Iwai2009-03-031-6/+4
| | | | | | | | It's false positive, but annoying. sound/pci/hda/hda_codec.c: In function ‘get_empty_pcm_device’: sound/pci/hda/hda_codec.c:2772: warning: ‘dev’ may be used uninitialized in this function Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Don't return a fatal error at PCM-creation errorsTakashi Iwai2009-03-021-5/+17
| | | | | | | | Don't return a fatal error to the driver but continue to probe when any error occurs at creating PCM streams for each codec. It's often non-fatal and keeping it would help debugging. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Revert the codec probe at control-creation errorsTakashi Iwai2009-03-021-4/+10
| | | | | | | | | Revert the codec probe instead of returning the error to the driver when any error occurs at creating the control elements. The control element conflict can be non-fatal in many cases, especially if it comes from the digital-only codec. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Intialize more codec fields in snd_hda_codec_reset()Takashi Iwai2009-03-021-0/+3
| | | | | | Initiailize forgotten fields in snd_hda_codec_reset(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Add pseudo device-locking for clear/reconfigTakashi Iwai2009-02-231-4/+50
| | | | | | | Added the pseudo device-locking using card->shutdown flag to avoid the crash via clear/reconfig during operations. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Make user_pin overriding the driver setupTakashi Iwai2009-02-231-4/+12
| | | | | | | Make user_pin overriding even the driver pincfg, e.g. the static / fixed pin config table in patch_sigmatel.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Rename {override,cur}_pin with {user,driver}_pinTakashi Iwai2009-02-231-9/+9
| | | | | | | Rename from override_pin and cur_pin with user_pin and driver_pin, respectively, to be a bit more intuitive. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Use snd_hda_codec_get_pincfg() in the rest placesTakashi Iwai2009-02-231-2/+1
| | | | | | Replace with snd_hda_codec_get_pincfg() in the places where available. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: hda - Add generic pincfg initializationTakashi Iwai2009-02-201-9/+142
| | | | | | | Added the generic pincfg cache and save/restore functions. Also introduced the pin-overriding via hwdep sysfs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-02-131-0/+10
|\
| * ALSA: hda - Add snd_hda_multi_out_dig_cleanup()Takashi Iwai2009-02-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Added the helper function snd_hda_multi_out_dig_cleanup() to clean up the digital outputs with multi setup. This call is needed in cases the codec supports multiple digital outputs as slaves. Otherwise the slave widgets aren't properly cleaned up. For a single digital output (e.g. in patch_conexant.c), this call isn't needed. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Detect multiple digital-out pinsTakashi Iwai2009-02-121-7/+10
| | | | | | | | | | | | | | | | | | Detect multiple digital-out pins in snd_hda_parse_pin_defconfig(). The dig_out_pin and dig_out_type fields become arrays. The codec parser still doesn't use this multiple pins detection, though. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Fix a wrong pin check in snd_hda_parse_pin_def_config()Takashi Iwai2009-02-111-1/+1
| | | | | | | | | | | | Fixed a wrong pin check (a typo) for debug print of digital input pin. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add missing NULL check in snd_hda_create_spdif_in_ctls()Takashi Iwai2009-02-061-0/+2
| | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'fix/hda' into topic/hdaTakashi Iwai2009-02-051-4/+5
|\ \ | |/
| * ALSA: hda - Fix misc workqueue issuesTakashi Iwai2009-02-051-4/+5
| | | | | | | | | | | | | | | | | | | | Some fixes regarding snd-hda-intel workqueue: - Use create_singlethread_workqueue() instead of create_workqueue() as per-CPU work isn't required. - Allocate workq name string properly - Renamed the workq name to "hd-audio*" to be more obvious. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'test/hda-vol-ofs' into next/hdaTakashi Iwai2009-01-221-8/+37
|\ \
| * | ALSA: hda - Add extra volume offset to standard volume amp macrosTakashi Iwai2009-01-201-8/+37
| |/ | | | | | | | | | | | | | | Added the volume offset to base for the standard volume controls to handle elements with too big volume scales like -96dB..0dB. For such elements, you can set the base volume to reduce the range. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Check HDMI jack types in the auto configurationTakashi Iwai2009-01-201-0/+8
| | | | | | | | | | | | | | | | Add dig_out_type and dig_in_type fields to autocfg struct. A proper HDA_PCM_TYPE_* value is assigned to these fields according to the pin-jack location type value. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Don't break the PCM creation loopTakashi Iwai2009-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Don't break the loop in snd_hda_codec_build_pcms() even if the item has no substreams. It's possible that it's an empty item and the next item containing the valid substreams (e.g. realtek codecs may create the analog and alt-analog but no digitl streams). Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Detect non-SPDIF digital I/OTakashi Iwai2009-01-201-0/+2
| | | | | | | | | | | | | | Accept non-SPDIF digital I/O pins as the digital pins. These are usually corresponding to HDMI I/O. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add debug prints for digital I/O pin detectionsTakashi Iwai2009-01-201-0/+4
|/ | | | | | | Add the debug prints for digital I/O pin detections in snd_hda_parse_pin_def_config() function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/hda-gateway' into topic/hdaTakashi Iwai2009-01-131-0/+61
|\
| * ALSA: hda - Add a new function to seek for a codec IDMauro Carvalho Chehab2008-11-301-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gateway notebooks have their ID inside codec vendor ID, not at PCI ID. Due to that, model auto-detection were not possible with the standard seek method. This is what is found at lspci -vnn: 00:14.2 Audio device [0403]: ATI Technologies Inc SB450 HDA Audio [1002:437b] (rev 01) Subsystem: ATI Technologies Inc SB450 HDA Audio [1002:437b] Yet, autodetection is possible, since the codec properly reflects the vendor at the Subsystem ID: $ cat /proc/asound/card0/codec#0 |head -4 Codec: SigmaTel STAC9250 Address: 0 Vendor Id: 0x83847634 Subsystem Id: 0x107b0367 This patch adds a new autodetection function that seeks for codec subsystem ID. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Use queue_delayed_work()Takashi Iwai2009-01-131-1/+1
| | | | | | | | | | | | | | Replaced the old schedule_work() with queue_delayed_work() where overlooked in the previous patches. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Use own workqueueTakashi Iwai2009-01-121-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | snd-hda-intel driver used schedule_work() fot the delayed DMA pointer updates, but this has several potential problems: - it may block other eventsd works longer - it may deadlock when probing fails and flush_scheduled_work() is called during probe callback (as probe callback itself could be invoked from eventd) This patch adds an own workq for each driver instance to solve these problems. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - create hda_codec.control_mutex for kcontrol->private_valueWu Fengguang2009-01-091-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following lockdep warning by not reusing the hda_codec.spdif_mutex. ALSA sound/pci/hda/hda_codec.c:882: hda_codec_cleanup_stream: NID=0x2 ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.28-next-20090102 #33 ------------------------------------------------------- mplayer/3151 is trying to acquire lock: (&pcm->open_mutex){--..}, at: [<ffffffffa004ced3>] snd_pcm_release+0x43/0xd0 [snd_pcm] but task is already holding lock: (&mm->mmap_sem){----}, at: [<ffffffff810c0252>] sys_munmap+0x42/0x80 which lock already depends on the new lock. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add probe_only optionTakashi Iwai2008-12-191-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Added probe_only module option to hd-audio driver. This option specifies whether the driver creates and initializes the codec-parser after probing. When this option is set, the driver skips the codec parsing and initialization but gives you proc and other accesses. It's useful to see the initial codec state for debugging. The default of this value is off, so the default behavior is as same as before. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add missing initializations of amp and verb cachesTakashi Iwai2008-12-191-0/+2
| | | | | | | | | | | | | | The re-initializations of codec amp and verb caches are missing at reconfig, which may cause Oops occasionally. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: hda - Add Intel vendor id stringTakashi Iwai2008-12-181-0/+1
| | | | | | | | | | | | | | Added Intel codec vendor id string (0x8086). Also fixed Intel-HDMI codec name strings, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
OpenPOWER on IntegriCloud