Commit Graph

490 Commits

Author SHA1 Message Date
Mike Travis 49d9e77e72 ALSA: hda - Fix system panic when DMA > 40 bits for Nvidia audio controllers
The audio driver mistakenly allows 64 bit addresses to be created for
the audio driver on Nvidia GPUs.  Unfortunately, the hardware normally
only supports up to 40 bits of DMA.  This can cause system panics as
well as misdirected data when the address is > 40 bits as the upper
part the address is truncated.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-03 11:56:18 +02:00
Dylan Reid ae03bbb8f9 ALSA: hda - Add codec delay to the capture time stamp.
For capture, the delay through the codec contributes to the time stamp
of the sample recorded at the A to D.  Rename the codec time stamp
function appropriately.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-16 07:15:31 +02:00
Takashi Iwai ad2109d7d2 ASoC: Updates for v3.10
A bunch of changes here, the most interesting one subsystem wise being
 Morimoto-san's work to create snd_soc_component which doesn't do much
 for now but will be pretty important going forwards:
 
  - Add a new component object type which will form the basis of moving
    to a more generic handling of SoC and off-SoC components, contributed
    by Kuninori Morimoto.
  - A fairly large set of cleanups for the dmaengine integration from
    Lars-Peter Clausen, starting to move towards being able to have a
    generic driver based on the library.
  - Performance optimisations to DAPM from Ryo Tsutsui.
  - Support for mixer control sharing in DAPM from Stephen Warren.
  - Multiplatform ARM cleanups from Arnd Bergmann.
  - New CODEC drivers for AK5385 and TAS5086 from Daniel Mack.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRa//sAAoJELSic+t+oim95J8P/A0ia+ergNHjM7VuV89XyDxJ
 qT+hciD2F7HGiGqCluyIxWTWY4NCG8JUMVj4j+qDltc+DZA7DGX654gUXOlyYIFb
 Otbt7s8CNGIGRuUkRAzoSCewL2B/veFjOdnw6XW2w9YcYHeYbjl9BOlXOdCJtPRb
 yroKHl6mzD99eD8y26QVjk7z3bJGmdBkckilYz+Fws+NACGZqu5KpzF11+DnrAL+
 0Bl3F/fafDEUwFqDvWaQD2728aXxJL1pg0aR8mueRCcGBPnk3qWycj9kQZqVFBpV
 i8Q+xNEnIVECfDKclT0j0bAL+2ftcg2Jm2lryupMtopGxR3Uii1kgGKSMwYHz82E
 bvQ8y3phLc6u5VtIIJj0iPE7ZE5H/2///KgFEj6z/P2tZPWobMkURb+9bGQTJ8Qv
 pUYGiOV0S/+59WAv0qnN4XpomA69EPPu5AuiPd30T+iNna998OjFEBRmIc/wJ519
 QYlhj1ThWsa3Uoi1V0hmhAPHCXVtOKHnZfj95cyaD4Vq8zdqUmptJI+UvUJFgRUm
 30eVVNwcIb0XE+0K4skMbVbpCkRA4m+pBGE7+Z+x72kYTfmg6uVET1T/sGgDFIAG
 XCZ8QOXXYxpmpXMDqTKO30oBHdN6V0tClkSCuQ6H2PoICi0VYX3ZZWT8/Qno3JuN
 bBxyWhz3gYL/MII6qJpE
 =lx37
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v3.10

A bunch of changes here, the most interesting one subsystem wise being
Morimoto-san's work to create snd_soc_component which doesn't do much
for now but will be pretty important going forwards:

 - Add a new component object type which will form the basis of moving
   to a more generic handling of SoC and off-SoC components, contributed
   by Kuninori Morimoto.
 - A fairly large set of cleanups for the dmaengine integration from
   Lars-Peter Clausen, starting to move towards being able to have a
   generic driver based on the library.
 - Performance optimisations to DAPM from Ryo Tsutsui.
 - Support for mixer control sharing in DAPM from Stephen Warren.
 - Multiplatform ARM cleanups from Arnd Bergmann.
 - New CODEC drivers for AK5385 and TAS5086 from Daniel Mack.
2013-04-15 19:45:16 +02:00
Dylan Reid 78daea29f2 ALSA: hda - Apply codec delay to wallclock.
For playback add the codec-side delay to the timestamp, for capture
subtract it.  This brings the timestamps in line with the time that
was recently added to the delay reporting.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-09 08:03:22 +02:00
Takashi Iwai 21229613ef ALSA: hda - Introduce get_delay codec PCM ops
Add a new codec PCM ops, get_delay(), to obtain the codec/stream-
specific PCM delay count.  When it's NULL, nothing changes.

This new feature was requested for CA0132, which has significant
delays in the path depending on the running DSP code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05 07:33:32 +02:00
Takashi Iwai 8fc24426f1 Revert "ALSA: hda - Allow power_save_controller option override DCAPS"
This reverts commit 6ab317419c.

The commit [6ab317419c: ALSA: hda - Allow power_save_controller option
override DCAPS] changed the behavior of power_save_controller so that
it can override the driver capability.  This assumed that this option
is rarely changed dynamically unlike power_save option.  Too naive.

It turned out that the user-space power-management tool tries to set
power_save_controller option to 1 together with power_save option
without knowing what's actually doing.  This enabled forcibly the
runtime PM of the controller,  which is known to be broken om many
chips thus disabled as default.

So, the only sane fix is to revert this commit again.  It was intended
to ease debugging/testing for runtime PM enablement, but obviously we
need another way for it.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=56171
Reported-and-tested-by: Nikita Tsukanov <keks9n@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04 15:35:39 +02:00
Takashi Iwai eb49faa6a4 ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loader
The current DSP loader code abuses snd_hda_lock_devices() for ensuring
the DSP loader not conflicting with the other normal operations.  But
this trick obviously doesn't work for the PM resume since the streams
are kept opened there where snd_hda_lock_devices() returns -EBUSY.
That means we need another lock mechanism instead of abuse.

This patch provides the new lock state to azx_dev.  Theoretically it's
possible that the DSP loader conflicts with the stream that has been
already assigned for another PCM.  If it's running, the DSP loader
should simply fail.  If not -- it's the case for PM resume --, we
should assign this stream temporarily to the DSP loader, and take it
back to the PCM after finishing DSP loading.  If the PCM is operated
during the DSP loading, it should get an error, too.

Reported-and-tested-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20 18:36:06 +01:00
Takashi Iwai 2c1350fdea ALSA: hda - Disable runtime PM for Intel 5 Series/3400
We've got a regression report wrt the IRQ issue related with the
power-save on a Dell machine, and disabling runtime PM works around.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=53441

Cc: <stable@vger.kernel.org> [v3.7+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-14 09:44:55 +01:00
Takashi Iwai b3667bd757 ALSA: hda - Fix memory leak and error handling in CA0132 DSP loader
This patch fixes a few obvious bugs in DSP loader stuff:
- Fix possible memory leaks in the error path
- Avoid double-free calls in dma_reset()
- Properly set/unset WC bits for DMA buffers
- Add missing error status checks

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-10 11:58:40 +01:00
James Ralston 884b088f61 ALSA: hda_intel: Add Device IDs for Intel Wellsburg PCH
This patch adds the HD Audio Device IDs for the Intel Wellsburg PCH

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-10 11:38:29 +01:00
Takashi Iwai c1279f8787 ALSA: hda - Set non-snoop for Creative HD-audio controllers
... looks like we need this for stable operations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:36:22 +01:00
Takashi Iwai 45acc86b2e Merge branch 'topic/hda-ca0132-dsp' into for-next 2013-02-07 12:34:36 +01:00
Takashi Iwai 2faea5274f Merge branch 'for-linus' into for-next
Merge pending fixes that haven't pulled into 3.8.
2013-02-05 14:48:03 +01:00
Wang Xingchao 4a7c516bf0 ALSA - HDA: New PCI ID for Haswell ULT
Add new PCI ID 0x0a0c for Haswell ULT platform.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-01 12:57:01 +01:00
Takashi Iwai 9ddf1aeb21 ALSA: hda - Fix non-snoop page handling
For non-snoop mode, we fiddle with the page attributes of CORB/RIRB
and the position buffer, but also the ring buffers.  The problem is
that the current code blindly assumes that the buffer is contiguous.
However, the ring buffers may be SG-buffers, thus a wrong vmapped
address is passed there, leading to Oops.

This patch fixes the handling for SG-buffers.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=800701

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-29 18:18:00 +01:00
Takashi Iwai f748abcc5b ALSA: hda - Enable LPIB delay count for Poulsbo / Oaktrail
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-29 10:15:35 +01:00
Takashi Iwai 2cf215bfaa Merge branch 'topic/hda-gen-parser' into for-next
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-23 08:34:12 +01:00
Takashi Iwai e152f18027 Merge branch 'for-linus' into for-next
This is a preliminary merge before the upcoming merge of generic parser
branch.
2013-01-23 08:31:34 +01:00
Takashi Iwai 3bcce5c0d9 ALSA: hda - Check CORB overflow
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-12 08:33:56 +01:00
Takashi Iwai 6ab317419c ALSA: hda - Allow power_save_controller option override DCAPS
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-09 11:15:13 +01:00
Takashi Iwai d7dab4dbbb ALSA: hda - Disable runtime D3 for Intel CPT & co
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>
2013-01-09 11:00:08 +01:00
Daniel J Blueman 44728e97c3 ALSA: HDA: Fix sound resume hang
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-18 17:07:11 +01:00
Takashi Iwai 6eb827d235 ALSA: hda - Move runtime PM check to runtime_idle callback
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-12 14:22:13 +01:00
Takashi Iwai c5c215232d ALSA: hda - Avoid doubly suspend after vga switcheroo
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-12 11:32:56 +01:00
Takashi Iwai cc5ede3efd ALSA: hda - Check validity of CORB/RIRB WP reads
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-12 11:32:33 +01:00
Mengdong Lin fa348da53b ALSA: hda - use usleep_range in link reset and change timeout check
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-12 11:03:12 +01:00
Takashi Iwai 48c8b0eb6d ALSA: hda - Remove superfluous DELAYED_INIT*_MARK
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-07 07:40:35 +01:00
Bill Pemberton e23e7a1436 ALSA: pci: remove __dev* attributes
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-07 07:20:55 +01:00
Daniel J Blueman 445a51b353 ALSA: hda: Add PCI device prefix for clarity
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-05 16:09:49 +01:00
Takashi Iwai f4c482a4d0 ALSA: hda - Fix yet another race of vga_switcheroo registration
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-12-04 16:00:40 +01:00
Takashi Iwai 1d1a4564d8 ALSA: hda - Add new DSP loader callback routines
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-28 08:47:03 +01:00
Takashi Iwai e39ae85644 ALSA: hda - Don't release firmware when CONFIG_PM is set
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-22 17:48:03 +01:00
Takashi Iwai 87af0b80c9 Merge branch 'for-linus' into for-next
Merge the recent HD-audio codec change for fixing recursive suspend
calls.

Conflicts:
	sound/pci/hda/hda_codec.c
2012-11-19 21:25:27 +01:00
Takashi Iwai 2ea3c6a2c7 ALSA: hda - Limit runtime PM support only to known Intel chips
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-19 21:23:57 +01:00
Takashi Iwai 17a4adbe68 Merge branch 'for-linus' into for-next 2012-11-08 15:58:25 +01:00
Lars R. Damerow f0b3da9843 ALSA: hda - support Teradici 2200 host card audio
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-11-04 09:24:08 +01:00
Takashi Iwai a5d00dc3a4 Merge branch 'for-linus' into for-next
... for migrating the core changes for USB-audio disconnection fixes
2012-10-30 11:08:25 +01:00
Takashi Iwai 1a8506d440 ALSA: hda - Add tracepoints to HD-audio controller driver
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-30 10:39:59 +01:00
Pierre-Louis Bossart 5d890f591d ALSA: hda: support for wallclock timestamps
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-23 16:13:52 +02:00
Wei Yongjun 86a778a78d ALSA: hda - remove unused variable in azx_position_ok()
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-22 10:47:48 +02:00
Takashi Iwai 9e3d352b3f ALSA: hda - Print PCI device name at "spurious message" warnings
... to make it clear to see from which device it comes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-17 08:39:37 +02:00
Takashi Iwai 1f04661fde ALSA: hda - Stop LPIB delay counting on broken hardware
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-16 18:01:36 +02:00
David Henningsson 26a6cb6cca ALSA: hda - Implement a poll loop for jacks as a module parameter
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-15 09:58:28 +02:00
Takashi Iwai 128960a9ad ALSA: hda - Fix registration race of VGA switcheroo
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-15 09:55:48 +02:00
Takashi Iwai e73fa21b4e ALSA: hda - Clean up superfluous position_fix list entries
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-15 09:55:48 +02:00
Takashi Iwai 7fd5b1eb82 ALSA: hda - Remove AZX_DCAPS_POSFIX_COMBO
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-10-10 09:24:09 +02:00
Takashi Iwai 3d98c21d06 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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQXdwSAAoJEOoSHmUN5Tg4wxcP/i9EMF61pXgVPG7V+2/+irtr
 n8mw7gFOISK88ay7j/ZZ+ePzfnU1+YzKyhGTbYYn9fdU7/dkj3ME5tLL4s2NWe2w
 G1YDrQ16ttyNx5c53tZM7dmjbsv1UILaVmXcKSmMqbQrgSUS1UvjG1qsLErOSz02
 bTSCW2GpwmLWBChe4vnDyCAJxfUI+TZ1XrsW4oLvIt8SKnHU9GItQOw8XUlV2DZc
 Ylf8L7nLlPx3jkiwjTp2kDHK4MG8yH2ljam4cFXoDQxW3PWkrws9ATpHZjsQhpmd
 vQDa4Wd1OhxPogXZCKh9cLC5B3CTKoFPbyVEJbpmAI04lYJCgxF8amRX+/dmDmS3
 mH38Czv+8rKg76jfOn3bENUNBTL3Q1cPAvoGtwLZX+5MRZyy3kTdkU+N8l4vxrbj
 P7wSgz2KLTJr/im3Lta6YkgbAFCttvZoFfD1jOiUgv00KfBgomY3yWWdgPq/tK/L
 J1J9rJdN8iretaPYrG6ae32V+77HNFYPuUFkPn6vXn+/sTYfoTWw6XSFavK3p9Hg
 kyfuLK/j+SjPVvoNAIOUvwHkYtBDseZe3APGbN/CuIdyzbQVp0v0SGOok2z4S9ZY
 3Ivy2cpeYYqtLuig1IuZEEMUi0Xxp5GfRtITlwrst9BBRQLKdswdh4JOxGPipguM
 vtYzpPeNT622xBtWzMNg
 =JSSt
 -----END PGP SIGNATURE-----

Merge tag 'asoc-3.7' of 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-22 18:31:08 +02:00
Pierre-Louis Bossart 99df18b31d ALSA: hda - add PCI identifier for Intel 5 Series/3400
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-22 09:32:47 +02:00
Pierre-Louis Bossart 90accc58a6 ALSA: hda - use LPIB for delay estimation
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-22 09:31:09 +02:00
Pierre-Louis Bossart 172d3b2096 ALSA: hda - force use of SSYNC bits
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-22 09:28:10 +02:00
Wang Xingchao d279fae8a4 ALSA: hda - Add another pci id for Haswell board
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-17 10:35:07 +02:00
Takashi Iwai 64f1e00d8e ALSA: hda - Yet another position_fix quirk for ASUS machines
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-13 16:56:13 +02:00
Takashi Iwai 1dac6695c6 ALSA: hda - Allow to pass position_fix=0 explicitly
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-13 15:03:10 +02:00
Takashi Iwai 0528842690 Merge branch 'for-linus' into for-next
To merge HD-audio fixes back to 3.7 development line
2012-09-11 16:46:36 +02:00
Takashi Iwai 915bf29eb9 ALSA: hda - Avoid BDL position workaround when no_period_wakeup is set
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-11 15:19:10 +02:00
Catalin Iacob c302d6133c ALSA: hda_intel: add position_fix quirk for Asus K53E
Commit c20c5a841c 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
c20c5a841c 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-09-11 14:28:45 +02:00
Takashi Iwai 83012a7ccb ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE
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-30 07:50:13 -07:00
Takashi Iwai 68467f51c1 ALSA: hda - Fix runtime PM leftover refcounts
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-30 07:48:49 -07:00
Mengdong Lin 5d6147f101 ALSA: hda - bug fix on references without checking CONFIG_SND_HDA_POWER_SAVE
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-24 07:22:42 +02:00
Mengdong Lin b8dfc46241 ALSA: hda - add runtime PM support
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-23 14:21:32 +02:00
Takashi Iwai ddf83485d7 Merge branch 'for-linus' into for-next
Conflicts:
	sound/pci/hda/hda_codec.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 22:14:26 +02:00
Takashi Iwai 65fcd41d37 ALSA: hda - Check the power state when power_save option is changed
... 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-20 11:46:06 +02:00
Takashi Iwai 7ccbde57ce ALSA: hda - Fix possible compile warnings regarding CONFIG_PM
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-14 18:11:51 +02:00
James Ralston 144dad99ef ALSA: hda_intel: Add Device IDs for Intel Lynx Point-LP PCH
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-09 18:42:42 +02:00
Takashi Iwai 97c6a3d17b ALSA: hda - Fix forgotten ifdef CONFIG_SND_HDA_PATCH_LOADER
The firmware callback must be protected by that ifdef.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 17:41:01 +02:00
Takashi Iwai 5cb543dba9 ALSA: hda - Deferred probing with request_firmware_nowait()
For processing the firmware handling properly for built-in kernels,
implement an asynchronous firmware loading with
request_firmware_nowait().  This means that the codec probing is
deferred when the patch option is specified.

Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 16:28:51 +02:00
Takashi Iwai 4918cdab49 ALSA: hda - Load firmware in hda_intel.c
This is a preliminary work for the deferred probing for
request_firmware() errors at init.

This patch moves the call of request_firmware() to hda_intel.c, and
call it in the earlier stage of probing rather than
azx_probe_continue().

Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-09 16:28:19 +02:00
Takashi Iwai 1558eb838f Merge branch 'topic/pm-convert' into for-next
This merges the changes for converting to new PM ops for platform
and some other drivers.
Also move some header files to local places from the public
include/sound.
2012-07-19 08:21:57 +02:00
Takashi Iwai bdbe34dece ALSA: hda - Fix driver type of Haswell controller to AZX_DRIVER_SCH
According to Xingchao,
  This works for HDMI audio, otherwise there's blocking issue.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 16:17:10 +02:00
Wang Xingchao e926f2c850 ALSA: hda - Add DeviceID for Haswell HDA
this patch add proper id for Haswell HDA Controller.

[Added AZX_DCAPS_POSFIX_COMBO flag by tiwai]

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-16 16:01:57 +02:00
Takashi Iwai f68d891d85 Merge branch 'topic/hda-beep' into topic/hda 2012-07-04 09:12:50 +02:00
Takashi Iwai 0920c9b4c4 ALSA: hda - Remove beep_mode=2
The beep_mode=2 option was introduced to make the beep mixer
controlling the beep input allocation/deallocation dynamically, so
that a user can switch between HD-audio codec digital beep and the
system beep only via mixer API.  This was necessary because the
keyboard driver took only the first input beep instance at that time.

However, the recent keyboard driver already processes the multiple
input instances, thus there is no point to keep this mode.

Let's remove it.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 18:31:20 +02:00
Takashi Iwai 68cb2b5592 ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:03 +02:00
Takashi Iwai 1ade819181 Merge branch 'fix/hda' into topic/hda
The fix for power sequence needs to be merged back to topic branch.
2012-06-20 14:43:20 +02:00
Dylan Reid b4a91cf05c ALSA: hda - Handle open while transitioning to D3.
This addresses an issue encountered when a pcm is opened while
transitioning to low power state (codec->power_on == 1 &&
codec->power_transition == -1).  Add snd_pcm_power_up_d3wait to
hda_codec.  This function is used to power up from azx_open as opposed
to snd_hda_power_up used from codec_exec_verb. When powering up from
azx_open, wait for pending power downs to complete, avoiding the power
up continuing in parallel with the power down on the work queue.

The specific issue seen was with the CS4210 codec, it powers off the ADC
and DAC nid in its suspend handler.  If it is re-opened before the
~100ms power down process completes, the ADC and DAC nid are initialized
while powered down and audio is lost until another suspend/resume cycle.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18 09:35:21 +02:00
Seth Heasley c20c5a841c ALSA: hda_intel: activate COMBO mode for Intel client chipsets
This patch activates the COMBO position_fix for recent Intel client chipsets.
COMBO mode is the recommended setting for Intel chipsets and eliminates HD
audio warnings in dmesg.  This patch has been tested on Lynx Point, Panther
Point, and Cougar Pont.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-15 10:28:16 +02:00
Takashi Iwai f2a8ecaf6d ALSA: hda - Fix detection of Creative SoundCore3D controllers
The PCI ID entries of Creative SoundCore3D HD-audio controllers should
be before the wildcard for vendor = Creative.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11 15:51:54 +02:00
Annie Liu 754fdff86f ALSA: hda - add support for HD-Audio of VIA HDMI GFX Cards
This is patch supporting HD-Audio function of VIA GFX cards which
support HDMI.
Those are integrated graphics of chipsets VX900 and VX11 separately.

Signed-off-by: Annie Liu <annieliu@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11 12:47:15 +02:00
Steven Newbury 8393ec4a13 ALSA: hda - HDMI Audio init all connectors when VGA-switcheroo is off
When VGA_SWITCHEROO support is enabled hda_intel initialises the HDMI
audio device on the current VGA device.  When it's not enabled it only
initialises the HDMI device on the default VGA adaptor, this means
secondary cards get no audio support which is very unhelpful for
multi-seat!

With this patch, when SUPPORT_VGA_SWITCHEROO is disabled hda_intel
initialises all HDMI audio devices, not just the default VGA.

[minor optimizations by tiwai]

Signed-off-by: Steven Newbury <steve@snewbury.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08 13:07:41 +02:00
Takashi Iwai 12b78a7f67 ALSA: hda - Fix uninitialized HDMI controllers with VGA-switcheroo
When VGA-switcheroo is built in but unused on systems with multiple
graphics cards, the initializations of non-default graphics cards are
skipped and never enabled (because the switcheroo is activated only
when the controller supports).  The current behavior is for avoiding
the system lockup by accessing the disabled GPU, but due to the recent
change in VGA-switcheroo, it determines the state simply by checking
with the default VGA device.  This is the culprit.

Now with the new vga_switcheroo_get_client_state(), we can know the
initial state of the bound GPU, thus can determine the initial audio
client state more correctly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08 11:24:19 +02:00
Linus Torvalds 58823de9d2 Add the support of VGA-switcheroo audio client for HD-audio
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPvzw3AAoJEGwxgFQ9KSmksMoP/i2gSvr4mCqFlFN1RbHLB7cg
 SZ1bccn3SoX72n2zGFUoBiqvup8lwK1Bp9NMOiC2X1rhdPrEvmXP2f/6SoK/aGOM
 K/dQ04KmwCNsYmuJMYTexEKOdWL2ufHRfNDfuIppUxHkl4IDSex0ggzDpnzYq4ba
 Ufod7K1Cgjt/64ofo/1asLiE6nB0B9p7xafd2GDRipU9bbgO7KGsLMSn8guA711h
 Ez1sAjHVOVgzI/D1G/zjqfNTeMrrDQIe5lbbv+1UlECIv9A5E/7CMoO8ofHGFy2K
 BePS6rrMsN5xaADR4LyNjoSqGomnvI+fWvrraWU6sJGl0qzdUgBr8BG7aF5U6Qg1
 9EokC9M3S+UKSEHhhqFNGIPEdBeDiK8LlcxtDNP3zyU6nEcouKt+1C/dUmNnJK2b
 ZYV6JWEs/PhJB9z4LHp0lgDL51H3pNSKkRtZCPnulEGa64wNnqWUWkHQw4rDvbSZ
 fscwNMHNXoXg2QfqCQaUBgxjpKqm9jMPOZbx5P4NoEOBYGXjOEDmQsknyh8zbilN
 B4nOZyfexMgTaPSwRhMs4ttn2xDaJ//oUjQl6wCHT4S8C/mmFGYtWFzTMTtn0NGh
 dFk1g0nv649gjtyitaWAXgDxee6Lgxu0YtvnrHecJcJyS1PYt4sh9vaOrURPlm+A
 sj66LuFKtLOj8qkOY273
 =to5n
 -----END PGP SIGNATURE-----

Merge tag 'hda-switcheroo' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull VGA-switcheroo audio client support for HD-audio from Takashi Iwai.

This depended on the recent drm pull.

* tag 'hda-switcheroo' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - unlock on error in azx_interrupt()
  ALSA: hda - Support VGA-switcheroo
  ALSA: hda - Export snd_hda_lock_devices()
  ALSA: hda - Check the dead HDMI audio controller by vga-switcheroo
2012-05-25 08:38:26 -07:00
Takashi Iwai 382e6a859e Merge branch 'topic/misc' into for-linus 2012-05-21 12:51:35 +02:00
Dan Carpenter 6091106297 ALSA: hda - unlock on error in azx_interrupt()
There is an spin_unlock() missing on this error path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-18 15:44:10 +02:00
Takashi Iwai f153c6af87 Merge branch 'fix/hda' into topic/hda 2012-05-15 08:58:49 +02:00
Jaroslav Kysela f3af90517d ALSA: hda - add probe_mask=0x101 automatically for WinFast VP200 H
This patch just sets the codec probe_mask=0x101 value for the WinFast VP200 H
PCoIP card based on Teradici hardware matching the PCI subsystem vendor/device
IDs 3a21:040d. The user reported no codec detection issues without this
explicit codec configuration.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-15 08:34:48 +02:00
Takashi Iwai a82d51ed24 ALSA: hda - Support VGA-switcheroo
Add the support for VGA-switcheroo in the HD-audio controller side.
When the graphics controller is disabled, the HD-audio driver also delays
the initialization until it's activated by VGA-switcheroo.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43155

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-14 14:55:18 +02:00
Takashi Iwai 9121947d69 ALSA: hda - Check the dead HDMI audio controller by vga-switcheroo
When a discrete-GPU is disabled by the VGA switcheroo, the
corresponding HD-audio controller for HDMI output is also disabled.
Such a dead controller still appears in the PCI device list, but you
can't access properly any longer (even calling pci_read_config_*()
triggers Oops!) which leads the stall of the whole communication of
the driver.

This patch adds a check of graphics controller at the probe time to
see whether it's disabled by vga-switcheroo.  If disabled, skip the
whole initialization of this controller.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43155

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-14 14:49:17 +02:00
Takashi Iwai 5ae763b1bc ALSA: hda - Add the support for Creative SoundCore3D
The controller is compatible with HD-audio 1.0a with some specific
restrictions.
- The BDLE entries can't be over 4k boundary
- No position-buffer and no MSI

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-10 08:53:34 +02:00
David Henningsson 32cf4023e6 ALSA: HDA: Lessen CPU usage when waiting for chip to respond
When an IRQ for some reason gets lost, we wait up to a second using
udelay, which is CPU intensive. This patch improves the situation by
waiting about 30 ms in the CPU intensive mode, then stepping down to
using msleep(2) instead. In essence, we trade some granularity in
exchange for less CPU consumption when the waiting time is a bit longer.

As a result, PulseAudio should no longer be killed by the kernel
for taking up to much RT-prio CPU time. At least not for *this* reason.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Tested-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-09 10:22:06 +02:00
Takashi Iwai 7f30830b7b ALSA: hda - Always resume the codec immediately
This is a fix for the problem in commit 785f857d1c, the pop noise
issue on some machines with ALC269.  The problem was the uninitialized
state after the resume due to the delayed resume of the codec chips.
In that commit, we tried to fix by forcibly putting the codec to D3 at
suspend.  But, this still also leaves the uninitialized state after
resume, and it _might_ be still problematic with some BIOS.  Since the
commit turned out to regress another issues, we reverted it in the
end.

Now, in this fix, try to fix by turning on the codec immediately at
the resume path.  We need to take care of the power-saving in this
case.  When the device is woken up at the power-saved state, it should
go power-saving again after the resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08 18:00:47 +02:00
Takashi Iwai 619a341b78 Revert "ALSA: hda - Set codec to D3 forcibly even if not used"
This reverts commit 785f857d1c.

The commit causes a problem with the wrong D3 state after suspend
because the call of hda_set_power_state() involves with the power-up
sequence, which changes the power_count, and this confuses the resume
sequence that checks the power_count as well.

Originally, this go-to-D3 sequence should be a simple task without the
power-up sequence.  But, it'd need some proper sanity checks in the
case of power-saved state, so it's not too easy to write now in the
3.4-rc cycle.

In short, the safest option now is to revert this affecting commit.

Of course, we need to clean up and robustify the power-saving code
better for 3.5 kernel.

Reported-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08 16:35:42 +02:00
Takashi Iwai e9f66d9b9c ALSA: pci: clean up using module_pci_driver()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24 12:25:00 +02:00
Takashi Iwai 785f857d1c ALSA: hda - Set codec to D3 forcibly even if not used
We've seen a problem with a pop-noise at suspend/resume on a HP
machine with ALC269, and it turned out to be an issue that the
controller going to D3 while the codec is unused.

When the device is once suspended and resumed and kept unused, the
driver doesn't initialize the codecs.  Instead, the codec chips are
set up dynamically at the first usage.  Now, suppose the device going
to suspend again before the codec is set up.  The controller is turned
off to D3 while the codec chips are untouched.  This caused a pop
noise because the codec chip might have been turned on implicitly by
the hardware.

As a workaround, the codec chip needs to be set to D3 when going to
suspend no matter whether it was used or not.  Also, for making it
happening, the controller has to be always set up in the resume path.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-07 11:52:50 +01:00
Takashi Iwai a6f2fd557f ALSA: hda - Add position_fix=4 (COMBO) option
This patch adds a new position_fix option value, 4, as a combo mode
to use LPIB for playbacks and POSBUF for captures.  It's the way
recommended by Intel hardware guys.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-28 12:18:15 +01:00
Seth Heasley 8bc039a1e1 ALSA: hda - Add Lynx Point HD Audio Controller DeviceIDs
This patch adds the HD Audio DeviceIDs for the Intel Lynx Point PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-08 09:29:10 +01:00
Takashi Iwai 7bfe059e38 ALSA: hda - explicitly set buffer-align flag for Nvidia controllers
It turned out that Nvidial (HDMI) controllers require the buffer
alignment.  Thus it's better to mark it requiring the alignment, so that
we can switch to non-aligned behavior as default in future.

Also, change the module paramter to be bint, in order to let user
overriding the default value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-23 17:53:39 +01:00
Takashi Iwai 633544a8e2 Merge branch 'fix/hda' into topic/hda
The fix for buffer-alignment is required for further works.
2012-01-23 17:48:39 +01:00
Takashi Iwai 52409aa6a0 ALSA: hda - Fix buffer-alignment regression with Nvidia HDMI
The commit 2ae66c2655
    ALSA: hda: option to enable arbitrary buffer/period sizes
introduced a regression on machines with Intel controller and Nvidia
HDMI.  The reason is that the driver modifies the global variable
align_buffer_size when an Intel controller is found, and the Nvidia
HDMI controller is probed after Intel although Nvidia chips require
the aligned buffers.

This patch fixes the problem by moving the flag into the local struct
so that it's not affected by other controllers.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42567

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-23 17:15:03 +01:00
Takashi Iwai ac9ef6cf91 ALSA: hda - Use bint for enable_msi option
The new bint module option type suits well with this one.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-20 12:08:44 +01:00
David Henningsson b01de4fb40 ALSA: HDA: Use LPIB position fix for Macbook Pro 7,1
Several users have reported "choppy" audio under the 3.2 kernel,
and that changing position_fix to 1 has resolved their problem.
The chip is an nVidia Corporation MCP89 High Definition Audio,
[10de:0d94] (rev a2).

Cc: stable@kernel.org (v3.2+)
BugLink: https://bugs.launchpad.net/bugs/909419
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-01-13 09:50:23 +01:00