aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_intel.c
AgeCommit message (Collapse)Author
2013-01-29ALSA: hda - Enable LPIB delay count for Poulsbo / OaktrailTakashi Iwai
Currently we use LPIB forcibly for both playback and capture for Poulsbo and Oaktrail devices, and this seems rather problematic. The recent fix for LPIB delay count seems working well with these devices, so let's enable it instead. Reported-by: Martin Weishart <martin.weishart@telosalliance.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23Merge branch 'topic/hda-gen-parser' into for-nextTakashi Iwai
This is a merge of really big changes: the generic parser is heavily enhanced for handling all cases, based on the former Realtek codec driver code. And all codec drivers except for a few ones (CA0132, HDMI and modem) have been converted to use the new generic driver. Conflicts: sound/pci/hda/patch_realtek.c
2013-01-23Merge branch 'for-linus' into for-nextTakashi Iwai
This is a preliminary merge before the upcoming merge of generic parser branch.
2013-01-12ALSA: hda - Check CORB overflowTakashi Iwai
Add an overflow check of CORB in HD-audio controller and codec drivers so that flood of sequential writes would work properly. In the controller side, add a check of CORB read-pointer to make returning -EAGAIN when it's full. Meanwhile in the codec side, when -EAGAIN error is received, it retries the write after flushing the pending verbs (calling get_response() essentially does it). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-09ALSA: hda - Allow power_save_controller option override DCAPSTakashi Iwai
Change the power_save_controller option to bint from bool so that user can override the runtime PM capability bit and force to enable or disable the runtime PM. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-09ALSA: hda - Disable runtime D3 for Intel CPT & coTakashi Iwai
We've got a few bug reports that the runtime D3 results in the dead HD-audio controller. It seems that the problem is in a deeper level than the sound driver itself, so as a temporal solution, disable the feature for these controllers again. Reported-and-tested-by: Vincent Blut <vincent.debian@free.fr> Reported-and-tested-by: Maurizio Avogadro <mavoga@gmail.com> Cc: <stable@vger.kernel.org> [v3.7] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-18ALSA: HDA: Fix sound resume hangDaniel J Blueman
Resuming a switcheroo'd HDA controller hangs since the completion is one-shot (thus works the first time). Fix by using completions that explictly need rearming, so remain fired before. Signed-off-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12ALSA: hda - Move runtime PM check to runtime_idle callbackTakashi Iwai
The runtime_idle callback is the right place to check the suspend capability, but currently we do it wrongly in the runtime_suspend callback. This leads to a kernel error message like: pci_pm_runtime_suspend(): azx_runtime_suspend+0x0/0x50 [snd_hda_intel] returns -11 and the runtime PM core would even repeat the attempts. Reported-and-tested-by: Borislav Petkov <bp@alien8.de> Cc: <stable@vger.kernel.org> [v3.7] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12ALSA: hda - Avoid doubly suspend after vga switcherooTakashi Iwai
The HD-audio driver artificially calls the suspend and the resume code path in the VGA switcheroo state changes. When a machine goes to suspend, it tries to suspend the device again, and it stalls at snd_power_wait(). This patch adds checks whether the devices were already in (forced) suspend in PM callbacks for avoiding the doubly suspend. Reported-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12ALSA: hda - Check validity of CORB/RIRB WP readsTakashi Iwai
When the HD-audio controller is disabled (e.g. via vga switcheroo) but the driver is still accessing it, it spews floods of "spurious response" kernel messages. It's because CORB/RIRB WP reads 0xff, and the driver tries to fill up until this number. This patch changes the CORB/RIRB WP reads to word instead of byte, and add the check of the read value. If it's 0xffff, the controller is supposed to be disabled, so the further action will be skipped. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12ALSA: hda - use usleep_range in link reset and change timeout checkMengdong Lin
Reducing the time on HDA link reset can help to reduce the driver loading time. So we replace msleep with usleep_range to get more accurate time control and change the value to a smaller one. And a 100ms timeout is set for both entering and exiting the link reset. Signed-off-by: Xingchao Wang <xingchao.wang@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07ALSA: hda - Remove superfluous DELAYED_INIT*_MARKTakashi Iwai
Since __devinit* have been removed completely, DELAYED_INIT*_MARK in hda_intel.c became NOP. Let's rip them off. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07ALSA: pci: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-05ALSA: hda: Add PCI device prefix for clarityDaniel J Blueman
When printing, use a prefix of the PCI domain, bus, device and function as in other drivers, to differentiate multiple devices. Important for reporting and debugging. A future step is to tidy this up with dev_printk et al. v2: Move conversion specifier into call site, preventing build issues v3: Refactor for Takashi's for-next branch Signed-off-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-04ALSA: hda - Fix yet another race of vga_switcheroo registrationTakashi Iwai
The recent fix for vga switcheroo race in commit 128960a9 opened yet another race. At the time the audio driver starts probing, user may turn off D-GPU off. But at this moment, the audio driver still doesn't register the vga switcheroo client, thus the switching isn't notified. Then the hardware gets off out of sudden, resulting in invalid reads and lots of "spurious response" error messages. For solving this situation, the following changes have been done in this patch: - Move again vga switcheroo registration to the very early stage of the probing; this also requires to set pci drvdata properly before registration - Introduce the completion to synchronize the driver probe at vga switcheroo callbacks; this assures that the whole probing finished before executing the callbacks Reported-by: Daniel J Blueman <daniel@quora.org> Tested-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-28ALSA: hda - Add new DSP loader callback routinesTakashi Iwai
Pass DMA buffer pointers in calls to setup_bdle(). Add DSP loader callback routines to controller. Add new DSP loader switch to Kconfig to turn off DSP firmware. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-22ALSA: hda - Don't release firmware when CONFIG_PM is setTakashi Iwai
The new firmware code tries to re-read the formerly read firmware files before suspend. Thus it's wiser to keep the "patch" firmware in the driver for avoiding this unnecessary re-reading. Of course, this will consume a bit of memory for unused stuff, but the patch fw is supposed to be fairly small, so it's more benefit in the end. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-19Merge branch 'for-linus' into for-nextTakashi Iwai
Merge the recent HD-audio codec change for fixing recursive suspend calls. Conflicts: sound/pci/hda/hda_codec.c
2012-11-19ALSA: hda - Limit runtime PM support only to known Intel chipsTakashi Iwai
We've got a report that the runtime PM may make the codec the unresponsive on AMD platforms. Since the feature has been tested only on the recent Intel platforms, it's safer to limit the support to such devices for now. This patch adds a new DCAPS bit flag indicating the runtime PM support, and mark it for Intel controllers. Reported-and-tested-by: Julian Wollrath <jwollrath@web.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08Merge branch 'for-linus' into for-nextTakashi Iwai
2012-11-04ALSA: hda - support Teradici 2200 host card audioLars R. Damerow
The audio chipset used in Teradici's Tera2 host cards is the same as that in the 1200 host cards. This patch allows ALSA to recognize the Tera2 cards. Signed-off-by: Lars R. Damerow <lars@pixar.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30Merge branch 'for-linus' into for-nextTakashi Iwai
... for migrating the core changes for USB-audio disconnection fixes
2012-10-30ALSA: hda - Add tracepoints to HD-audio controller driverTakashi Iwai
Add a couple of tracepoints to snd-hda-intel for tracing the position and the trigger timings. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-23ALSA: hda: support for wallclock timestampsPierre-Louis Bossart
Reuse code from clocksource to handle wall clock counter. Since wrapparound occurs, the audio timestamp is reinitialized to zero on a trigger. Synchronized linked devices will start counting from same reference to avoid any drift. Max buffer time is limited to 178 seconds to make sure wall clock counter does not overflow Wallclock timestamps are disabled on capture streams until we figure out how to handle digital inputs. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-22ALSA: hda - remove unused variable in azx_position_ok()Wei Yongjun
The variable stream is initialized but never used otherwise, so remove the unused variable. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-17ALSA: hda - Print PCI device name at "spurious message" warningsTakashi Iwai
... to make it clear to see from which device it comes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-16ALSA: hda - Stop LPIB delay counting on broken hardwareTakashi Iwai
If LPIB reports a pretty bad value, we can't trust such hardware for calculating the PCM delay. Automatically turn off the delay counting when such a problem is encountered. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=48911 Cc: <stable@vger.kernel.org> [v3.6] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-15ALSA: hda - Implement a poll loop for jacks as a module parameterDavid Henningsson
Now that we have a generic unsol mechanism, we can implement a generic poll loop, which can be used for debugging, or if a codec's unsol mechanism is broken. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-15ALSA: hda - Fix registration race of VGA switcherooTakashi Iwai
Delay the registration of VGA switcheroo client to the end of the probing. Otherwise a too quick switching may result in Oops during probing. Also add the check of the return value from snd_hda_lock_devices(). Reported-and-tested-by: Daniel J Blueman <daniel@quora.org> Cc: <stable@vger.kernel.org> [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-15ALSA: hda - Clean up superfluous position_fix list entriesTakashi Iwai
The white-list entries of position_fix for ASUS laptops have been added just as a workaround for broken COMBO mode. Now the combo mode itself is disabled, we can safely remove these entries. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-10ALSA: hda - Remove AZX_DCAPS_POSFIX_COMBOTakashi Iwai
It turned out that the COMBO position fix mode is rather more harmful, and it got reverted (with the replacement of runtime->delay calculation) recently. Hence we can get rid of AZX_DCAPS_POSFIX_COMBO as well. It's still possible to pass this mode via position_fix module option, in case where this really helps on weird machines (who knows). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-22Merge tag 'asoc-3.7' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.7 Lots and lots of driver specific cleanups and enhancements but the only substantial framework feature this time round is the compressed API binding: - Addition of ASoC bindings for the compressed API, used by the mid-x86 drivers. - Lots of cleanups and API refreshes for CODEC drivers and DaVinci. - Conversion of OMAP to dmaengine. - New machine driver for Wolfson Microelectronics Bells. - New CODEC driver for Wolfson Microelectronics WM0010.
2012-09-22ALSA: hda - add PCI identifier for Intel 5 Series/3400Pierre-Louis Bossart
Tested with LPIB delay without any issues. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-22ALSA: hda - use LPIB for delay estimationPierre-Louis Bossart
DMA Position in Buffer (DPIB) should be used for ring buffer management, while LPIB register provides information on the number of samples transfered on the link. The difference between the two pieces of information corresponds to hardware/DMA buffering. This patch reports this difference in runtime->delay, and removes the use of the COMBO mode on recent Intel hardware. Credits to Takashi Iwai for an initial patch. [rebased to for-next branch and replaced snd_printk() with snd_printdd() by tiwai] Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-22ALSA: hda - force use of SSYNC bitsPierre-Louis Bossart
SSYNC bits are typically used to start multiple streams synchronously. It makes sense to use them for a single stream for a more predictable startup sequence. The transfers only start once the DMA and FIFOs are ready. This results in a better correlation between timestamps and number of samples played. Credits to Kar Leong Wang for suggesting this improvement. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-17ALSA: hda - Add another pci id for Haswell boardWang Xingchao
A new PCI id 0x0d0c for Haswell HDA Controller. [root@SKBM04SDP ~]# lspci |grep Audio 00:03.0 Audio device: Intel Corporation Device 0d0c (rev 02) 00:1b.0 Audio device: Intel Corporation Lynx Point HD Audio Controller Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13ALSA: hda - Yet another position_fix quirk for ASUS machinesTakashi Iwai
ASUS X53S also suffers from the same issue as in commit c302d6133. Use POS_FIX_POSBUF for this hardware, too. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47461 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13ALSA: hda - Allow to pass position_fix=0 explicitlyTakashi Iwai
Set the default value of position_fix -1, and allow user passing position_fix=0 explicitly to set the "auto" position-fix mode. Otherwise the auto mode may be switched to others like COMBO of VIACOMBO when the controller prefers it, thus user can't set the auto mode any longer. Also updated the documentation appropriately, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11Merge branch 'for-linus' into for-nextTakashi Iwai
To merge HD-audio fixes back to 3.7 development line
2012-09-11ALSA: hda - Avoid BDL position workaround when no_period_wakeup is setTakashi Iwai
Originally the bogus period at BDL head was introduced as a workaround for the mismatching position update at the period boundary, typically seen on dmix. However, for applications like PulseAudio that don't require period wake ups, this workaround is just superfluous. Thus better to disable it when no_period_wakeup is given in hw_params. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11ALSA: hda_intel: add position_fix quirk for Asus K53ECatalin Iacob
Commit c20c5a841cbe47f5b7812b57bd25397497e5fbc0 changed some chipsets to default to POS_FIX_COMBO so they now use POS_FIX_LPIB instead of POS_FIX_POSBUF. Since then I've been getting artifacts on playback, including repeated sounds on my Asus laptop. My hardware is Cougar Point which the commit log of c20c5a841cbe47f5b7812b57bd25397497e5fbc0 mentions as tested so POS_FIX_COMBO probably works in general but apparently it doesn't on Asus K53E therefore the need for the quirk. Signed-off-by: Catalin Iacob <iacobcatalin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVETakashi Iwai
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its behavior can be well controlled via the default value and module parameter. Let's just replace it with the standard CONFIG_PM. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Fix runtime PM leftover refcountsTakashi Iwai
When the HD-audio is removed, it leaves the refcounts when codecs are powered up (usually yes) in the destructor. For fixing the unbalance, and cleaning up the code mess, this patch changes the following: - change pm_notify callback to take the explicit power on/off state, - check of D3 stop-clock and keep_link_on flags is moved to the caller side, - call pm_notify callback in snd_hda_codec_new() and snd_hda_codec_free() so that the refcounts are proprely updated. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-24ALSA: hda - bug fix on references without checking CONFIG_SND_HDA_POWER_SAVEMengdong Lin
The patch to support runtime PM introduced a bug: Module parameter 'power_save_controller', and the codec flag 'd3_stop_clk' 'd3_stop_clk_ok' are defined only when HDA power save is enabled in config. But there are references to them without checking macro CONFIG_SND_HDA_POWER_SAVE. This patch is to fix the bug. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-23ALSA: hda - add runtime PM supportMengdong Lin
Runtime PM can bring more power saving: - When the controller is suspended, its parent device will also have a chance to suspend. - PCI subsystem can choose the lowest power state the controller can signal wake up from. This state can be D3cold on platforms with ACPI PM support. And runtime PM can provide a gerneral sysfs interface for a system policy manager. Runtime PM support is based on current HDA power saving implementation. The user can enable runtime PM on platfroms that provide acceptable latency on transition from D3 to D0. Details: - When both power saving and runtime PM are enabled: -- If a codec supports 'stop-clock' in D3, it will request suspending the controller after it enters D3 and request resuming the controller before back to D0. Thus the controller will be suspended only when all codecs are suspended and support stop-clock in D3. -- User IO operations and HW wakeup signal can resume the controller back to D0. - If runtime PM is disabled, power saving just works as before. - If power saving is disabled, the controller won't be suspended because the power usage counter can never be 0. More about 'stop-clock' feature: If a codec can support targeted pass-through operations in D3 state when there is no BCLK present on the link, it will set CLKSTOP flag in the supported power states and report PS-ClkStopOk when entering D3 state. Please refer to HDA spec section 7.3.3.10 Power state and 7.3.4.12 Supported Power State. [Fixed CONFIG_PM_RUNTIME dependency in hda_intel.c by tiwai] Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20Merge branch 'for-linus' into for-nextTakashi Iwai
Conflicts: sound/pci/hda/hda_codec.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: hda - Check the power state when power_save option is changedTakashi Iwai
... by calling the newly introduced snd_hda_power_sync(). I had to reimplement a wheel for adding the trigger at changing the parameter -- the parameter set ops is overwritten to pass the integer parameter, then trigger the power-state sync. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14ALSA: hda - Fix possible compile warnings regarding CONFIG_PMTakashi Iwai
Replace with a proper ifdef check of CONFIG_PM_SLEEP in hda_intel.c. But other places in HD-audio driver are still marked with CONFIG_PM, since these can be called for power-saving even without CONFIG_PM_SLEEP. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09ALSA: hda_intel: Add Device IDs for Intel Lynx Point-LP PCHJames Ralston
This patch adds the Intel HD Audio Device IDs for the Intel Lynx Point-LP PCH Signed-off-by: James Ralston <james.d.ralston@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09ALSA: hda - Fix forgotten ifdef CONFIG_SND_HDA_PATCH_LOADERTakashi Iwai
The firmware callback must be protected by that ifdef. Signed-off-by: Takashi Iwai <tiwai@suse.de>