summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_controller.c
AgeCommit message (Collapse)Author
2015-02-24ALSA: hda: controller code - do not export static functionsJaroslav Kysela
It is a bad idea to export static functions. GCC for some platforms shows errors like: error: __ksymtab_azx_get_response causes a section type conflict Signed-off-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> # v3.15+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-09ALSA: hda: read trigger_timestamp immediately after starting DMAPierre-Louis Bossart
Make sure wallclock counter and trigger timestamp are read very close to each other for better alignment. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-03Merge branch 'topic/snd-device' into for-nextTakashi Iwai
2015-02-02ALSA: pcm: Embed struct deviceTakashi Iwai
Like previous patches, at this time we embed the struct device into PCM object. However, this needs a bit more caution: struct snd_pcm doesn't own one device but two, for both playback and capture! Thus not struct snd_pcm but struct snd_pcm_str object contains the device. Along with this change, pcm->dev field is dropped for avoiding confusion. It was meant to point to a non-standard parent. But, since now we can touch each struct device directly, we can manipulate the parent field easily there, too. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-15ALSA: hda - Fix typo in hda_controller.cMasanari Iida
This patch fix spelling typo in hda_controller.c. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-26ALSA: hda_controller: Separate stream_tag for input and output streams.Rafal Redzimski
Implemented separate stream_tag assignment for input and output streams. According to hda specification stream tag must be unique throughout the input streams group, however an output stream might use a stream tag which is already in use by an input stream. This change is necessary to support HW which provides a total of more than 15 stream DMA engines which with legacy implementation causes an overflow on SDxCTL.STRM field (and the whole SDxCTL register) and as a result usage of Reserved value 0 in the SDxCTL.STRM field which confuses HDA controller. Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com> Signed-off-by: Jayachandran B <jayachandran.b@intel.com> Signed-off-by: Libin Yang <libin.yang@intel.com> Reviewed-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-13sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under sound/. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Acked-by: Mark Brown <broonie@kernel.org>
2014-07-15Merge branch 'for-linus' into for-nextTakashi Iwai
Since init_failed flag was moved to struct hda_intel, its access in the commit [4da63c6f: ALSA: hda - Fix broken PM due to incomplete i915 initialization] is also replaced with hda->init_failed appropriately.
2014-07-14ALSA: hda - Revert stream assignment order for Intel controllersTakashi Iwai
We got a regression report for 3.15.x kernels, and this turned out to be triggered by the fix for stream assignment order. On reporter's machine with Intel controller (8086:1e20) + VIA VT1802 codec, the first playback slot can't work with speaker outputs. But the original commit was actually a fix for AMD controllers where no proper GCAP value is returned, we shouldn't revert the whole commit. Instead, in this patch, a new flag is introduced to determine the stream assignment order, and follow the old behavior for Intel controllers. Fixes: dcb32ecd9a53 ('ALSA: hda - Do not assign streams in reverse order') Reported-and-tested-by: Steven Newbury <steve@snewbury.org.uk> Cc: <stable@vger.kernel.org> [v3.15+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-26ALSA: hda - Replace ICH6_ prefixTakashi Iwai
ICH6_ prefix doesn't mean that it's specific to ICH6 chipset but rather its generic for all HD-audio (or "Azalia") devices. Use AZX_ prefix instead to align with other constants. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-26ALSA: hda - Use common reboot notifierTakashi Iwai
The very same notifier code is used in both hda_intel.c and hda_tegra.c. Move it to the generic code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-26ALSA: hda - Make position_fix as generic callbackTakashi Iwai
... and move most parts into hda_intel.c from the generic controller code. This is a clean up, and there should be no functional change by this patch. Now, struct azx obtains the generic callbacks for getting the position and the delay. As default NULL, posbuf is read. These replace the old position_fix[], and each is implemented as a callback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-25ALSA: hda - Kill the rest of snd_print*() usagesTakashi Iwai
Pass the codec object so that we can replace all the rest of snd_print*() usages with the proper device-specific print helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29ALSA: hda - Suppress CORBRP clear on Nvidia controller chipsTakashi Iwai
The recent commit (ca460f86521) changed the CORB RP reset procedure to follow the specification with a couple of sanity checks. Unfortunately, Nvidia controller chips seem not following this way, and spew the warning messages like: snd_hda_intel 0000:00:10.1: CORB reset timeout#1, CORBRP = 0 This patch adds the workaround for such chips. It just skips the new reset procedure for the known broken chips. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-09ALSA: hda - Make full_reset booleanThierry Reding
The full_reset argument to azx_init_chip() carries boolean rather than numerical information, so update the type to reflect that. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-09ALSA: hda - Use runtime helper to check active state.Dylan Reid
From azx_interrupt, use the helper to check if the device is active instead of checking the state. This will do the right thing if runtime pm is disabled in addition to if the device is suspended. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-08ALSA: hda - Do not assign streams in reverse orderAnssi Hannula
Currently stream numbers are assigned in reverse order. Unfortunately commit 7546abfb8e1f9933b5 ("ALSA: hda - Increment default stream numbers for AMD HDMI controllers") assumed this was not the case (specifically, it had the "old cards had single device only" => "extra unused stream numbers do not matter" assumption), causing non-working audio regressions for AMD Radeon HDMI users. Change the stream numbers to be assigned in forward order. The benefit is that regular audio playback will still work even if the assumed stream count is too high, downside is that a too high stream count may remain hidden. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77002 Reported-by: Christian Güdel <cg@dmesg.ch> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Tested-by: Christian Güdel <cg@dmesg.ch> # 3.14 Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-03ALSA: hda - Make azx_attach_pcm_stream staticDylan Reid
It is only used in hda_controller.c now. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Move codec create to hda_controllerDylan Reid
Codec creation and stream initialization can be shared between hda_intel and hda platform drivers. Move it and the static functions it depends on to hda_controller.c. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Move azx_interrupt to hda_controllerDylan Reid
This code will be reused by an hda_platform driver as it has no PCI dependencies. This allows update_rirb to be static as all users are now in hda_controller.c. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Move low level functions to hda_controllerDylan Reid
Share more code from hda_intel. This moves the link control and initialization to hda_controller. The code will also be used by an hda platform driver. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - move alloc_cmd_io to hda_controllerDylan Reid
Combining the call to alloc_cmd_io with the allocate pages function removes an extra interface between hda_intel and hda_controller. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Relocate RIRB/CORB interface to hda_controllerDylan Reid
This is done to allow an HDA platform driver to reuse the code. A few of the interfaces added to hda_controller will disappear in following commits as their users are also moved to hda_controller. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Move the dsp loader to hda_controllerDylan Reid
Moving the DSP loading functionality to hda_controller.c means that the dsp lock doesn't need to be shared in hda_intel and hda_controller. The forthcoming platform driver doesn't need the DSP loading code, but sharing it doesn't hurt. Tested on Chromebook Pixel's ca0132 that uses the DSP loader. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Pull pages allocation to hda_controllerDylan Reid
Pull allocation from first_init to a new function in hda_controller.c. Short term this will allow the dsp loader to be moved as well. In later commits it will allow the same allocation to be used by the platform hda driver. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01ALSA: hda - Add hda_controller.c and move pcm ops from hda_intelDylan Reid
Pull the pcm_ops and the functions they use into a new hda_controller file. This is done to allow for other hda implementations besides PCI to use the same ops. The hda_controller file will house functionality related to HDA but independent of the bus used to talk to the controller. This currently shares dsp locking across the two files. This will be remedied in a following commit. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>