Commit Graph

4167 Commits

Author SHA1 Message Date
Sumit Bhattacharya 9674678633 ALSA: hda/hdmi - Add Nvidia Tegra124 HDMI support
Add the Tegra12x HDA codec id to patch_hdmi.

Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-20 09:38:27 +02:00
Dan Carpenter d576422eda ALSA: hda - if statement not indented
The "break;" should be indented.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-14 16:47:27 +02:00
Mengdong Lin 7189eb9b8f ALSA: hda - mask buggy stream DMA0 for Broadwell display controller
Broadwell display controller has 3 stream DMA engines. DMA0 cannot update DMA
postion buffer properly while DMA1 and DMA2 can work well. So this patch masks
the buggy DMA0 by keeping it as opened.

This is a tentative workaround, so keep the change small as Takashi suggested.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-13 12:11:58 +02:00
Aaron Plattner ec5fe98886 ALSA: hda - Add new GPU codec ID to snd-hda
Vendor ID 0x10de0071 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-13 09:14:13 +02:00
Hui Wang a1f3b5fa11 ALSA: hda - add headset mic detect quirks for three Dell laptops
When we plug a 3-ring headset on the Dell machines (VID: 0x10ec0255,
SID: 0x1028065c; VID: 0x10ec0255, SID: 0x10280680; VID: 0x10ec0292,
SID: 0x10280684), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

And on the machine with SID 0x10280684, and the Lineout and external
microphone should be routed to docking, this patch also fix this
problem.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-09 07:25:44 +02:00
Takashi Iwai 1c37c22332 ALSA: hda - Add dock pin setups for Thinkpad T440
The headphone and mic jacks on Thinkpad T440 are assigned to pins NID
0x16 and 0x19, respectively.  These need to be set up manually by a
fixup.

Reported-and-tested-by: Joschi Brauchle <joschi.brauchle@tum.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-07 11:40:27 +02:00
Anssi Hannula 561a7d6e85 ALSA: hda - hdmi: Set infoframe and channel mapping even without sink
Currently infoframe contents and channel mapping are only set when a
sink (monitor) is present.

However, this does not make much sense, since
1) We can make a very reasonable guess on CA after 18e391862c ("ALSA:
   hda - hdmi: Fallback to ALSA allocation when selecting CA") or by
   relying on a previously valid ELD (or we may be using a
   user-specified channel map).
2) Not setting infoframe contents and channel count simply means they
   are left at a possibly incorrect state - playback is still allowed
   to proceed (with missing or wrongly mapped channels).

Reasons for monitor_present being 0 include disconnected cable, video
driver issues, or codec not being spec-compliant. Note that in
actual disconnected-cable case it should not matter if these settings
are wrong as they will be re-set after jack detection, though.

Change the behavior to allow the infoframe contents and the channel
mapping to be set even without a sink/monitor, either based on the
previous valid ELD contents, if any, or based on sensible defaults
(standard channel layouts or provided custom map, sink type HDMI).

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Stephan Raue <stephan@openelec.tv>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-05 16:55:34 +02:00
Takashi Iwai 59991da498 Merge branch 'for-linus' into for-next
... for applying the further HDMI fixes.
2014-05-05 16:54:33 +02:00
Anssi Hannula f06ab794af ALSA: hda - hdmi: Set converter channel count even without sink
Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel
count") channel count is no longer being set if monitor_present is 0.
This is because setting the count was moved after the CA value is
determined, which is only after the monitor_present check in
hdmi_setup_audio_infoframe().

Unfortunately, in some cases, such as with a non-spec-compliant codec or
with a problematic video driver, monitor_present is always 0. As a
specific example, this seems to happen with gen1 ATV (SiI1390 codec),
causing left-channel-only stereo playback (multi-channel playback has
apparently never worked with this codec despite it reporting 8 channels,
reason unknown).

Simply setting converter channel count without setting the pin infoframe
and channel mapping as well does not theoretically make much sense as
this will just mean they are out-of-sync and multichannel playback will
have a wrong channel mapping.

However, adding back just setting the converter channel count even in
no-monitor case is the safest change which at least fixes the stereo
playback regression on SiI1390 codec. Do that.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Reported-by: Stephan Raue <stephan@openelec.tv>
Tested-by: Stephan Raue <stephan@openelec.tv>
Cc: <stable@vger.kernel.org> # 3.12+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-05 16:28:10 +02:00
Hui Wang 91943954e3 ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
SID: 0x1028067e), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-30 12:36:48 +02:00
Takashi Iwai 6ba736dd02 ALSA: hda - Suppress CORBRP clear on Nvidia controller chips
The recent commit (ca460f8652) 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-29 18:41:22 +02:00
Kailang Yang a22aa26f75 ALSA: hda/realtek - Add new codec ALC293/ALC3235 UAJ supported
New codec ALC293/ALC3235 support multifunction jacks.
It used for menual select the input device.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:17:53 +02:00
Kailang Yang 193177de4f ALSA: hda/realtek - Add two codecs alias name for Dell
Add ALC3235 ALC3263.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:17:50 +02:00
Hui Wang e32dfbed8c ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
SID: 0x10280674), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:15:02 +02:00
Kailang Yang 8dc9abb93d ALSA: hda/realtek - Add headset Mic support for Dell machine
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-16 10:30:46 +02:00
Hui Wang 67807ce55f ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
SID: 0x1028067f), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-16 07:47:50 +02:00
Kailang Yang 7c66593286 ALSA: hda/realtek - Add support of ALC288 codec
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-14 10:42:39 +02:00
Thierry Reding 17c3ad0302 ALSA: hda - Make full_reset boolean
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-09 14:48:07 +02:00
Hui Wang 137bcc33c6 ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0283,
SID: 0x10280667), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-09 10:05:51 +02:00
Dylan Reid 7b0a48f340 ALSA: hda - Use runtime helper to check active state.
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-09 09:33:03 +02:00
Anssi Hannula dcb32ecd9a ALSA: hda - Do not assign streams in reverse order
Currently stream numbers are assigned in reverse order.

Unfortunately commit 7546abfb8e ("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-04-08 11:44:21 +02:00
Kailang Yang 0435b3ffba ALSA: hda/realtek - Add eapd shutup to ALC283
Add eapd shutup function to alc283_shutup.
It could avoid pop noise from speaker.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-08 11:27:29 +02:00
Kailang Yang be8ef16a25 ALSA: hda/realtek - Change model name alias for ChromeOS
Chrome OS was use model name of alc283-dac-wcaps for loading model as default.
Change the model name to same as model name of Chrome OS for future support.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-08 10:38:56 +02:00
Kailang Yang de9481cb40 ALSA: hda/realtek - Improve HP depop when system change power state on Chromebook
It is better to change Mic2-Vref to manual mode.
Manual control Mic2-Vref will solve pop noise issue.
It will improve pop noise for power on, power off, S3 and resume.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-07 12:32:52 +02:00
Takashi Iwai 415d555e6b ALSA: hda - Fix silent speaker output due to mute LED fixup
The recent fixups for HP laptops to support the mute LED made the
speaker output silent on some machines.  It turned out that they use
the NID 0x18 for the speaker while it's also used for controlling the
LED via VREF bits although the current driver code blindly assumes
that such a node is a mic pin (where 0x18 is usually so).

This patch fixes the problem by only changing the VREF bits and
keeping the other pin ctl bits.

Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-03 11:51:21 +02:00
Kailang Yang 8314f22589 ALSA: hda/realtek - Fixed single output machine get empty hp sense
If it only has single output of HP out of machine.
The driver parser will copy hp_pins to line_out_pins.
hp_pins will empty for alc283_init and alc283_shutup functions.
This will cause not have value for hp_pin_sense.
Add check line_out_type code will solve it .

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-03 11:48:33 +02:00
W. Trevor King a4b7f21d7b ALSA: hda - Enable beep for ASUS 1015E
The `lspci -nnvv` output contains (wrapped for line length):

  00:1b.0 Audio device [0403]:
    Intel Corporation 7 Series/C210 Series Chipset Family
    High Definition Audio Controller [8086:1e20] (rev 04)
        Subsystem: ASUSTeK Computer Inc. Device [1043:115d]

Signed-off-by: W. Trevor King <wking@tremily.us>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-31 10:47:22 +02:00
Hui Wang a870593bab ALSA: hda - add headset mic detect quirks for three Dell laptops
When we plug a 3-ring headset on the Dell machines (VID: 0x10ec0255,
SID: 0x10280632; VID: 0x10ec0293, SID: 0x1028062c; VID: 0x10ec0293,
SID: 0x1028062e), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-26 08:03:52 +01:00
Takashi Iwai 9b7564a649 ALSA: hda - Inform the unexpectedly ignored pins by auto-parser
The auto-parser may ignore some pins that could be valid when they
don't match with the assumption or if there are way too many pins
assigned to the same output type.  So far, such a pin has been
silently ignored, but it's better to leave a message, which would help
for debugging and understanding the problem.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-25 10:02:01 +01:00
Mengdong Lin 2df6742f61 ALSA: hda - verify pin:cvt connection on preparing a stream for Intel HDMI codec
This is a temporary fix for some Intel HDMI codecs to avoid no sound output for
a resuming playback after S3.

After S3, the audio driver restores pin:cvt connection selections by
snd_hda_codec_resume_cache(). However this can happen before the gfx side is
ready and such connect selection is overlooked by HW. After gfx is ready, the
pins make the default selection again. And this will cause multiple pins share
a same convertor and mute control will affect each other. Thus a resumed audio
playback become silent after S3.

This patch verifies pin:cvt connection on preparing a stream, to assure the pin
selects the right convetor and an assigned convertor is not shared by other
unused pins. Apply this fix-up on Haswell, Broadwell and Valleyview (Baytrail).

We need this temporary fix before a reliable software communication channel is
established between audio and gfx, to sync audio/gfx operations.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-20 07:36:17 +01:00
Takashi Iwai 67b2fb48cb Merge branch 'topic/alc28x' into for-next 2014-03-18 09:56:07 +01:00
Kailang Yang cb149cb3a7 ALSA: hda/realtek - Restore default value for ALC282
Restore the registers to prevent the abnormal digital power supply
rising ratio/sequence to the codec and causing the incorrect default
codec register restoration during initialization.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-18 09:55:54 +01:00
Takashi Iwai 376f94c339 Merge branch 'topic/alc28x' into for-next 2014-03-18 09:51:06 +01:00
Kailang Yang 7b5c7a0240 ALSA: hda/realtek - Fix the noise after suspend and resume on ALC282 codec
When the power state of ALC283 codec goes to D3 or return back to D0,
it gives a noise via headphone output. To follow the depop procedure,
it will be better.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-18 09:49:27 +01:00
Kailang Yang 6bd55b04fe ALSA: hda/realtek - Restore default value for ALC283
Restore the registers to prevent the abnormal digital power supply
rising ratio/sequence to the codec and causing the incorrect default
codec register restoration during initialization.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=71861
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-18 07:14:42 +01:00
Takashi Iwai 5fdb83f190 ASoC: Updates for v3.15
Quite a busy release for ASoC this time, more on janitorial work than
 exciting new features but welcome nontheless:
 
  - Lots of cleanups from Takashi for enumerations; the original API for
    these was error prone so he's refactored lots of code to use more
    modern APIs which avoid issues.
  - Elimination of the ASoC level wrappers for I2C and SPI moving us
    closer to converting to regmap completely and avoiding some
    randconfig hassle.
  - Provide both manually and transparently locked DAPM APIs rather than
    a mix of the two fixing some concurrency issues.
  - Start converting CODEC drivers to use separate bus interface drivers
    rather than having them all in one file helping avoid dependency
    issues.
  - DPCM support for Intel Haswell and Bay Trail platforms.
  - Lots of work on improvements for simple-card, DaVinci and the Renesas
    rcar drivers.
  - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the
    CSR SiRF SoC.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTIOhJAAoJELSic+t+oim90CoP/3CVTm9cWv1qhPSU6jjn6RJG
 /djmhntJfHd/GXo+0TiiwNK9WmZjFrJUr+5ofkDTCqSzFz1Suc90B6oHxY4dFbgF
 IyIpTexGwTLv3H6yDjadYAfmGDSsE9sM2dkID9oXy6aEzjNby/a1VEiBnRgx16X1
 YGvMVK8AGFn/AyC/zOV6EcKJxUjdDogqZ5wkR2XHzwDoYjl9ufxK9BnSIygYABOW
 ABAjyrZf3xx97AH82BB6iqcZMh5GxGNTvI3hQd/vjx0r7RFUDNLqmF2cPZAMTRW/
 bXWxVmtNHie1+lCldyMFm8pV/Pv09zuqDAQKbPY2TeHj2zF8CM548NlkFHqwHlp0
 S9K5E1N+/2wcXMjQa1wBELohUdl6dVh1OFOAz7M8o0TJdSOZyR6PJ9r0NprP8NgS
 67FBU+ZqnWIK159m9rKkFfPhnaDuDzk+rpwyK0fQxQgpdGGjLyv7OK3GhS30oTnA
 Z2GjEyUySM1BcEEWAtfUD5fHbjN28e1Icn53q5q4JK4gvx4DXBy08uY/vumvjXjO
 8oum3q3RjRvqIhzMrJoVgs+c8RHwS/bZQhlu9Q3qNTsDNDyMnaZWHFAnP8RDqHjv
 ojZiMJkJdpqceZ3z1k5ZG8GWJ2JaZBikSbeNk2Ltg17/0nackq2r8ekrIoEUPVk2
 ph4DJNC2s1qCFtx7tzQj
 =C5oo
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v3.15

Quite a busy release for ASoC this time, more on janitorial work than
exciting new features but welcome nontheless:

 - Lots of cleanups from Takashi for enumerations; the original API for
   these was error prone so he's refactored lots of code to use more
   modern APIs which avoid issues.
 - Elimination of the ASoC level wrappers for I2C and SPI moving us
   closer to converting to regmap completely and avoiding some
   randconfig hassle.
 - Provide both manually and transparently locked DAPM APIs rather than
   a mix of the two fixing some concurrency issues.
 - Start converting CODEC drivers to use separate bus interface drivers
   rather than having them all in one file helping avoid dependency
   issues.
 - DPCM support for Intel Haswell and Bay Trail platforms.
 - Lots of work on improvements for simple-card, DaVinci and the Renesas
   rcar drivers.
 - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the
   CSR SiRF SoC.
2014-03-13 09:53:25 +01:00
Mengdong Lin caaf5ef949 ALSA: hda - initialize audio InfoFrame to be all zero
This patch initialized the local audio InfoFrame variable 'ai' to be all zero,
thus the data bytes will indicate "Refer to Stream Header" by default.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-11 09:15:39 +01:00
Takashi Iwai 9b745ab897 ALSA: hda - Fix loud click noise with IdeaPad 410Y
Lenovo IdeaPad 410Y with ALC282 codec makes loud click noises at boot
and shutdown.  Also, it wrongly misdetects the acpi_thinkpad hook.
This patch adds a device-specific fixup for disabling the shutup
callback that is the cause of the click noise and also avoiding the
thinpad_helper calls.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=71511
Reported-and-tested-by: Guilherme Amadio <guilherme.amadio@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-07 08:37:19 +01:00
Takashi Iwai f3e9b59cb9 ALSA: hda - Use analog beep for Thinkpads with AD1984 codecs
For making the driver behavior compatible with the earlier kernels,
use the analog beep in the loopback path instead of the digital beep.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-05 12:00:29 +01:00
Takashi Iwai c5eda4c1bf ALSA: hda - Add missing loopback merge path for AD1884/1984 codecs
The mixer widget (NID 0x20) of AD1884 and AD1984 codecs isn't
connected directly to the actual I/O paths but only via another mixer
widget (NID 0x21).  We need a similar fix as we did for AD1882.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-05 11:52:24 +01:00
Hui Wang 3b44675226 ALSA: hda - add automute fix for another dell AIO model
When plugging a headphone or headset, lots of noise is heard from
internal speaker, after changing the automute via amp instead of
pinctl, the noise disappears.

BugLink: https://bugs.launchpad.net/bugs/1268468
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-04 10:25:25 +01:00
Kailang Yang 31278997ad ALSA: hda/realtek - Add headset quirk for Dell DT
This quirk is needed for the headset microphone to work.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-03 10:48:55 +01:00
Marius Knaust a6b92b6650 ALSA: hda - Added inverted digital-mic handling for Acer TravelMate 8371
Signed-off-by: Marius Knaust <marius.knaust@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-03 09:55:43 +01:00
Dylan Reid db291e36a4 ALSA: hda - Mark reg op args as iomem
The ops to read and write registers should take pointers labeled as
__iomem.  Thanks to the sparse bot for catching this.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-03 09:53:28 +01:00
Dylan Reid 778bde6f59 ALSA: hda - Rename reg access ops in hda_controller_ops
Using readl, writel, etc. resulted in some architectures, such as
s390, expanding the member names into zpci_writel.  Obviously not the
intended result.

Fixes s390 build breakage introduced by "4083081 - ALSA: hda - Allow
different ops to read/write registers"

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-03 09:53:21 +01:00
Dylan Reid 7c3e438add ALSA: hda - Make azx_attach_pcm_stream static
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-03 09:53:14 +01:00
Dylan Reid 78e34f34ac ALSA: hda - remove PCI dependency in Kconfig
Remove the dependency on CONFIG_PCI for building hda codec drivers so
that platforms with HDA attach via means other than PCI can use them.
This was as suggested by tiwai.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:23:55 +01:00
Dylan Reid 154867cf4e ALSA: hda - Move codec create to hda_controller
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-01 11:23:33 +01:00
Dylan Reid f0b1df8871 ALSA: hda - Move azx_interrupt to hda_controller
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-01 11:23:24 +01:00
Dylan Reid 7ca954a86b ALSA: hda - Add position_check op
This op will be used by hda_intel to do the position check.  Takashi
wisely suggested adding this before moving the interrupt handler to
common HDA code.  Having this callback prevents the need to move the
hda_intel specific delayed interrupt handling with the irq.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:23:16 +01:00
Dylan Reid f43923ff2c ALSA: hda - Move low level functions to hda_controller
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-01 11:23:06 +01:00
Dylan Reid f19c3ec21b ALSA: hda - move alloc_cmd_io to hda_controller
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-01 11:22:58 +01:00
Dylan Reid 6e85dddc1c ALSA: hda - Relocate RIRB/CORB interface to hda_controller
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-01 11:22:46 +01:00
Dylan Reid 2b5fd6c2e9 ALSA: hda - Move the dsp loader to hda_controller
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-01 11:22:38 +01:00
Dylan Reid 6790899443 ALSA: hda - Pull pages allocation to hda_controller
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-01 11:22:30 +01:00
Dylan Reid 05e848788e ALSA: hda - Add hda_controller.c and move pcm ops from hda_intel
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>
2014-03-01 11:22:17 +01:00
Dylan Reid 8769b27861 ALSA: hda - Add pcm_mmap_prepare op.
Adding this op allows the X86 specific mmap operation to help in
hda_intel without needing a CONFIG_X86 in future non-PCI hda drivers.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:22:02 +01:00
Dylan Reid b419b35be4 ALSA: hda - Move snd page allocation to ops
Break out the allocation of pages for DMA and PCM buffers to ops in
the chip structure.  This is done to allow for architecture specific
work-arounds to be added.  Currently mark_pages_wc is used by
hda_intel.  This avoids needing to move that x86-specific code to a
common area shared with hda platform drivers.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:51 +01:00
Dylan Reid e62a42aebd ALSA: hda - Pass max_slots and power_save to codec_create
Passing the max slots and power save arguments to codec_create will
allow for its reuse by an hda_platform driver. It makes the function
independent of the module params in hda_intel and ready to move to
hda_shared in a following commit.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:43 +01:00
Dylan Reid 749ee287fc ALSA: hda - Add jackpoll_ms to struct azx
Keeping a pointer to the jackpoll_ms array in the chip will allow
azx_codec_create to be shared between hda_intel and hda_platform
drivers.  Also modify get_jackpoll_ms to make the jackpoll_ms member
optional, this way a platform driver can leave it out if it's not
needed.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:29 +01:00
Dylan Reid f563bf65d9 ALSA: hda - remove unused clear of STATESTS
Although the code was updated last year the "#if 0" surrounding it
dates back to the original git commit.  The function will be moved to
a new file, no need to carry the dead code.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:19 +01:00
Dylan Reid f46ea609d1 ALSA: hda - Add function pointer for disabling MSI
This is a PCI-only feature, but adding a callback for it in the chip
structure breaks the PCI dependency in the RIRB code allowing the
logic there to be re-used by the platform HDA driver.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:13 +01:00
Dylan Reid 8928756dbd ALSA: hda - Use device pointer from the card instead of pci
This removes calls to get the device via PCI from other parts of the
code that will be able to be re-used by the platform driver.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:21:04 +01:00
Dylan Reid 9cdc0115e4 ALSA: hda - Keep pointer to bdl_pos_fix in chip struct
This will allow for a platform hda driver to use it as well.  It
removes the dependency on the module param from hda_intel, which will
allow for azx_setup_periods to be shared.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:20:51 +01:00
Dylan Reid 4083081333 ALSA: hda - Allow different ops to read/write registers
The forthcoming platform hda driver needs to override the way
registers are read and written.  In preparation for that, introduce a
reg_ops struct that can be implemented differently by the new driver.
Change the existing macros to use the new structure, and move them to
hda_priv.h where they will be accessible to both PCI and platform
drivers.

Start with register access, but later commits will add more ops that
differ between PCI and platform.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:20:37 +01:00
Dylan Reid 2538a4f583 ALSA: hda - Move some definitions to new hda_priv.h
Later commits adding support for hda platform drivers will want to use
the same defines and structures. Put them in a place reachable by both
hda_intel and the new platform driver.

This is a mostly a direct copy with a few whitespace and comment
changes to make checkpatch happy.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-03-01 11:20:19 +01:00
David Henningsson ca460f8652 ALSA: hda - Fix CORB reset to follow specification
According to the HDA spec, we must write 1 to bit 15 on a CORBRP
reset, read back 1, then write 0, then read back 0. This must be
done while the DMA is not running.

We accidentaly ended up writing back the 0 by using a writel
instead of a writew to CORBWP.

This caused occasional controller failure on Bay Trail hardware.

[replaced error messages with dev_err() by tiwai]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-28 14:03:30 +01:00
Takashi Iwai d604b39908 ALSA: hda - Fix registration of beep input device
The beep input device is registered via input_register_device(), but
this is called in snd_hda_attach_beep_device() where the sound devices
aren't registered yet.  This leads to the binding to non-existing
object, thus results in failure.  And, even if the binding worked
(against the PCI object), it's still racy; the input device appears
before the sound objects.

For fixing this, register the input device properly at dev_register
ops of the codec object it's bound with.  Also, call
snd_hda_detach_beep_device() at dev_disconnection so that it's
detached at the right timing.  As a bonus, since it's called in the
codec's ops, we can get rid of the further call from the other codec
drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-28 14:02:21 +01:00
Takashi Iwai e8b99a1dcb ALSA: hda/sigmatel - Allow auto-switching for dock line-in of HP laptops
Many HP laptops with STAC codecs have a docking station port and BIOS
sets the pins for the input on the dock as a line in.  Because the
generic parser doesn't handle a line in pin as auto-switchable, this
resulted in the manual capture source selection on these laptops.

However, from the usability POV, the automatic switching is easier.
This patch adds the line_in_auto_switch hint in the fixup function for
these laptops.  Even if no dock port is present, this should be
harmless as the generic parser allows the auto-switching only in a
limited situation (all three pins are located in different
positions).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-27 16:24:53 +01:00
Takashi Iwai f2606a8079 ALSA: hda - Make codec object as a parent for input beep devices
Instead of the controller, the new codec object is assigned as a
parent for the hd-audio beep input devices, just like already done for
PCM and hwdep.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-27 09:33:00 +01:00
Kailang Yang fce0a0c726 ALSA: hda/realtek - Add more entry for enable HP mute led
I lost this SSID. Add it into the fixup table.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26 10:05:56 +01:00
Takashi Iwai 4e76a8833f ALSA: hda - Replace with standard printk
Use dev_err() and co for messages from HD-audio controller and codec
drivers.  The codec drivers are mostly bound with codec objects, so
some helper macros, codec_err(), codec_info(), etc, are provided.
They merely wrap the corresponding dev_xxx().

There are a few places still calling snd_printk() and its variants
as they are called without the codec or device context.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:27:32 +01:00
Takashi Iwai b989d0444b ALSA: hda - Enable sysfs attributes without CONFIG_SND_HDA_RECONFIG
Some sysfs attributes like init_pin_configs or vendor_name are really
basic and should be available no matter whether the codec driver is
re-configurable or not.  Put them out of #ifdef
CONFIG_SND_HDA_RECONFIG and allow the read-only accesses.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:55 +01:00
Takashi Iwai 648a8d276e ALSA: hda - Add sysfs to codec object, too
We have currently sysfs attributes for each hwdep, but basically these
should belong to the codec itself, per se.  Let's add them to the
codec object while keeping them for hwdep as is for compatibility.

While we are at it, split the sysfs-related stuff into a separate
source file, hda_sysfs.c, and keep only the stuff necessary for hwdep
in hda_hwdep.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:54 +01:00
Takashi Iwai 13aeaf6801 ALSA: hda - Create own device struct for each codec
As the HD-audio is treated individually in each codec driver, it's
more convenient to assign an own struct device to each codec object.
Then we'll be able to use dev_err() more easily for each codec, for
example.

For achieving it, this patch just creates an object "hdaudioCxDy".
It belongs to sound class instead of creating a new bus, just for
simplicity, at this stage.  No pm ops is implemented in the device
struct level but currently it's merely a container.  The PCM and hwdep
devices are now children of this codec device.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:54 +01:00
Takashi Iwai 2565c89908 ALSA: hda - Manage each codec instance individually
Now each snd_hda_codec instance is managed via the device chain, the
registration and release are done by its callback instead of calling
from bus.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:53 +01:00
Takashi Iwai f806bdb2f7 ALSA: hwdep: Take private_data as drvdata for sysfs
For referring to a different object from sysfs ops, take hwdep
private_data as stored via dev_set_drvdata() at creating the device
object.  In that way, the same sysfs ops can be used by different
device types.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:50 +01:00
Takashi Iwai caa751bad4 ALSA: Create sysfs attribute files via groups
Instead of calling each time device_create_file(), create the groups
of sysfs attribute files at once in a normal way.  Add a new helper
function, snd_get_device(), to return the associated device object,
so that we can handle the sysfs addition locally.

Since the sysfs file addition is done differently now,
snd_add_device_sysfs_file() helper function is removed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:12:49 +01:00
Takashi Iwai d01a838c86 Merge branch 'for-linus' into HEAD 2014-02-25 12:12:17 +01:00
Takashi Iwai bf68665d7a ALSA: hda - Avoid codec D3 for keeping mute LED up on Lenovo Yxx0
The GPIO line used for the mute LED control on Lenovo Yxx0 laptops is
cleared unexpectedly when the codec goes to D3, typically by
power-saving.  For avoiding it, add a power filter in the fixup.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16373
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 08:39:54 +01:00
Takashi Iwai 37c367ecdb ALSA: hda - Add a fixup for HP Folio 13 mute LED
HP Folio 13 may have a broken BIOS that doesn't set up the mute LED
GPIO properly, and the driver guesses it wrongly, too.  Add a new
fixup entry for setting the GPIO pin statically for this laptop.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70991
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 07:27:36 +01:00
Kailang Yang c60666bd22 ALSA: hda/realtek - Add more entry for enable HP mute led
More HP machine need mute led support.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-21 12:04:44 +01:00
Hui Wang 1de7ca5e84 ALSA: hda - Enable front audio jacks on one HP desktop model
The front headphone and mic jackes on a HP desktop model (Vendor Id:
0x111d76c7 Subsystem Id: 0x103c2b17) can not work, the codec on this
machine has 8 physical ports, 6 of them are routed to rear jackes
and all of them work very well, while the remaining 2 ports are
routed to front headphone and mic jackes, but the corresponding
pin complex node are not defined correctly.

After apply this fix, the front audio jackes can work very well.

[trivial fix of enum definition by tiwai]

BugLink: https://bugs.launchpad.net/bugs/1282369
Cc: David Henningsson <david.henningsson@canonical.com>
Tested-by: Gerald Yang <gerald.yang@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-20 08:14:57 +01:00
Takashi Iwai dff86f86d4 ALSA: hda - Add QEMU codec vendor ID
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-19 11:11:20 +01:00
Hsin-Yu Chao 13c12dbe3a ALSA: hda/ca0132 - Fix recording from mode id 0x8
Incorrect ADC is picked in ca0132_capture_pcm_prepare(),
where it assumes multiple streams while there is one stream
per ADC. Note that ca0132_capture_pcm_cleanup() already does
the right thing.

The Chromebook Pixel has a microphone under the keyboard that
is attached to node id 0x8. Before this fix, recording would
always go to the main internal mic (node id 0x7).

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-19 07:50:34 +01:00
Hsin-Yu Chao 28fba95087 ALSA: hda/ca0132 - setup/cleanup streams
When a HDMI stream is opened with the same stream tag
as a following opened stream to ca0132, audio will be
heard from two ports simultaneously.
Fix this issue by change to use snd_hda_codec_setup_stream
and snd_hda_codec_cleanup_stream instead, so that an
inactive stream can be marked as 'dirty' when found
with a conflict stream tag, and then get purified.

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-19 07:50:16 +01:00
Hui Wang 4913e0bf23 ALSA: hda - add headset mic detect quirks for two Dell laptops
When we plug a 3-ring headset on the Dell machines (Vendor ID:
0x10ec0255, Subsystem ID: 0x10280657; Vendor ID: 0x10ec0255,
Subsystem ID: 0x1028065f), the headset mic can't be
detected, after apply this patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1260303
Cc: David Henningsson <david.henningsson@canonical.com>
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-18 07:59:57 +01:00
Takashi Iwai 1f85a0f0cc ALSA: hda - Remove superfluous inclusion of linux/pci.h
Some codec drivers still have it since using PCI_VENDOR_ID_*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-15 10:12:12 +01:00
Takashi Iwai 5100cd07d4 ALSA: hda/realtek - Allow NULL bus->pci
Realtek codec driver contains some codes referring to the PCI
subdevice IDs, but most of them are optional, typically for checking
the codec name variants.  Add NULL checks appropriately so that it can
work without PCI assignment.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-15 10:11:56 +01:00
Takashi Iwai ed9d0b626e ALSA: hda - Remove dependency on bus->pci in hda_beep.c
The default parent device can be obtained directly via card object, so
we don't need to rely on pci->dev.parent.  Since there is no access to
pci_dev, we can reduce the inclusion of linux/pci.h, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-15 10:05:35 +01:00
Martin Kepplinger 2078600b1f ALSA: Revert "ALSA: hda/realtek - Avoid invalid COEFs for ALC271X"
This reverts commit d3c56568f4.

The reverted commit breaks audio through headphone line out on
the Acer TravelMate B113 (Type1Sku0) Notebook, my main work
machine. I don't know much about it but this fixes my problem.
Bisected and tested.

Fixes: d3c56568f4 ('ALSA: hda/realtek - Avoid invalid COEFs for ALC271X')
Cc: <stable@vger.kernel.org>
Tested-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12 17:37:46 +01:00
Takashi Iwai 60c5772b50 ALSA: pci: Convert to snd_card_new() with a device pointer
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12 11:17:52 +01:00
Takashi Iwai c4d1489390 Merge branch 'for-linus' into for-next 2014-02-12 10:34:27 +01:00
Takashi Iwai a8dca4604a ALSA: hda - Make snd_hda_gen_spec_free() static
The last user of snd_hda_gen_spec_free() is patch_via.c, and we can
rewrite it safely with snd_hda_gen_free(), so that
snd_hda_gen_spec_free() can be a local function in hda_generic.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 18:23:57 +01:00
Takashi Iwai 998caa4dcc ALSA: hda - Disable static quirks for C-Media codecs
According to alsa-info.sh outputs, all three entries with static
quirks have the correct pin configs, so it's safe to remove static
quirks.  For now, turn the static quirks off via ifdef.  The dead
codes will be removed in later release.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 18:18:17 +01:00
Takashi Iwai 8a02c0cc4a ALSA: hda - Move HDA_FIXUP_ACT_FREE call in snd_hda_gen_free()
Now Realtek and Conexant codec parsers just call snd_hda_gen_free().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 18:09:45 +01:00
Takashi Iwai ef8e39b51f ALSA: hda - Fix undefined symbol due to builtin/module mixup
Even after the fix for leftover kconfig handling (commit f8f1becf),
the current code still doesn't handle properly the builtin/module
mixup case between the core snd-hda-codec and other codec drivers.
For example, when CONFIG_SND_HDA_INTEL=y and
CONFIG_SND_HDA_CODEC_HDMI=m, it'll end up with an unresolved symbol
snd_hda_parse_hdmi_codec.  This patch fixes the issue.

Now codec->parser points to the parser object *only* when a module
(either generic or HDMI parser) is loaded and bound.  When a builtin
symbol is used, codec->parser still points to NULL.  This is the
difference from the previous versions.

Fixes: f8f1becfa4 ('ALSA: hda - Fix leftover ifdef checks after modularization')
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 11:50:01 +01:00
Takashi Iwai 8eeaa2f9e0 ALSA: Replace with IS_ENABLED()
Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the
new IS_ENABLED() macro.

The patch still doesn't cover all ifdefs.  For example, the dependency
on CONFIG_GAMEPORT is still open-coded because this also has an extra
dependency on MODULE.  Similarly, an open-coded ifdef in pcm_oss.c and
some sequencer-related stuff are left untouched.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 11:42:00 +01:00
David Henningsson 61a75f138a ALSA: hda - Add subwoofer quirks for Asus UX51VZH and N55SF
Bug reporter report that the -mode4 makes the subwoofer work.
I have simplified the quirk a bit to avoid possible regressions
with the microphones.

BugLink: https://bugs.launchpad.net/bugs/871808
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:51 +01:00
David Henningsson 8e54b4accd ALSA: hda - Rename ASUS subwoofer quirks
Just a small refactoring to make the next patch slightly simpler.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:50 +01:00
Takashi Iwai f88abaa0d0 ALSA: hda - Fix mic capture on Sony VAIO Pro 11
The very same fixup is needed to make the mic on Sony VAIO Pro 11
working as well as VAIO Pro 13 model.

Reported-and-tested-by: Hendrik-Jan Heins <hjheins@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:26 +01:00
David Henningsson f47e5dc464 ALSA: hda - Add a headset quirk for Dell XPS 13
This quirk is needed for the headset microphone to work.

Alsa-info at http://www.alsa-project.org/db/?f=8c7dfe857ceff462ca2de133e67023c0f68de9cb

Cc: stable@vger.kernel.org (3.10+)
Reported-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:25 +01:00
Takashi Iwai 7fe307117d ALSA: hda - Fix inconsistent Mic mute LED
The current code for controlling mic mute LED in patch_sigmatel.c
blindly assumes that there is a single capture switch.  But, there can
be multiple multiple ones, and each of them flips the state, ended up
in an inconsistent state.

For fixing this problem, this patch adds kcontrol to be passed to the
hook function so that the callee can check which switch is being
accessed.  In stac_capture_led_hook(), the state is checked as a
bitmask, and turns on the LED when all capture switches are off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:25 +01:00
Takashi Iwai f8f1becfa4 ALSA: hda - Fix leftover ifdef checks after modularization
Since the commit [595fe1b702c3: ALSA: hda - Make
CONFIG_SND_HDA_CODEC_* tristate], the kconfig variables for the
generic parser and codec drivers can be "m" instead of boolean, but
some codes are left unchanged to check only #ifdef
CONFIG_SND_HDA_CODEC_XXX, which is no longer true for modules.
This patch fixes them by replacing with IS_ENABLED() macros.

Fixes: 595fe1b702 ('ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate')
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70161
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:25 +01:00
Takashi Iwai 276ab336b4 ALSA: hda - Improve loopback path lookups for AD1983
AD1983 has flexible loopback routes and the generic parser would take
wrong path confusingly instead of taking individual paths via NID 0x0c
and 0x0d.  For avoiding it, limit the connections at these widgets so
that the parser can think more straightforwardly.  This fixes the
regression of the missing line-in loopback on Dell machine.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70011
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-05 08:49:41 +01:00
Takashi Iwai c20f31ec42 ALSA: hda - Fix missing VREF setup for Mac Pro 1,1
Mac Pro 1,1 with ALC889A codec needs the VREF setup on NID 0x18 to
VREF50, in order to make the speaker working.  The same fixup was
already needed for MacBook Air 1,1, so we can reuse it.

Reported-by: Nicolai Beuermann <mail@nico-beuermann.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-05 07:38:07 +01:00
Takashi Iwai c7579fed1f ALSA: hda - Add missing mixer widget for AD1983
The mixer widget on AD1983 at NID 0x0e was missing in the commit
[f2f8be43c5c9: ALSA: hda - Add aamix NID to AD codecs].

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70011
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-05 07:30:50 +01:00
Takashi Iwai d3c56568f4 ALSA: hda/realtek - Avoid invalid COEFs for ALC271X
We've seen often problems after suspend/resume on Acer Aspire One
AO725 with ALC271X codec as reported in kernel bugzilla, and it turned
out that some COEFs doesn't work and triggers the codec communication
stall.

Since these magic COEF setups are specific to ALC269VB for some PLL
configurations, the machine works even without these manual
adjustment.  So, let's simply avoid applying them for ALC271X.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-05 07:17:49 +01:00
Takashi Iwai 4528eb19b0 ALSA: hda - Fix silent output on Toshiba Satellite L40
Toshiba Satellite L40 with AD1986A codec requires the EAPD of NID 0x1b
to be constantly on, otherwise the output doesn't work.
Unlike most of other AD1986A machines, EAPD is correctly implemented
in HD-audio manner (that is, bit set = amp on), so we need to clear
the inv_eapd flag in the fixup, too.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=67481
Cc: <stable@vger.kernel.org> [v3.11+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-04 07:39:06 +01:00
Takashi Iwai 3e887f379d ALSA: hda - Add mute LED support to Lenovo Ideapad
Lenovo Ideapad with ALC272 has a mute LED that is controlled via
GPIO1.  Add a simple vmaster hook for it.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16373
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-03 10:15:58 +01:00
Takashi Iwai 63f4b3a475 Merge branch 'topic/hda' into for-next
The updates of HD-audio drivers for 3.15
2014-02-03 09:47:03 +01:00
Stephen Warren 75fae117a5 ALSA: hda/hdmi - allow PIN_OUT to be dynamically enabled
Commit 384a48d715 "ALSA: hda: HDMI: Support codecs with fewer cvts
than pins" dynamically enabled each pin widget's PIN_OUT only when the
pin was actively in use. This was required on certain NVIDIA CODECs for
correct operation. Specifically, if multiple pin widgets each had their
mux input select the same audio converter widget and each pin widget had
PIN_OUT enabled, then only one of the pin widgets would actually receive
the audio, and often not the one the user wanted!

However, this apparently broke some Intel systems, and commit
6169b67361 "ALSA: hda - Always turn on pins for HDMI/DP" reverted the
dynamic setting of PIN_OUT. This in turn broke the afore-mentioned NVIDIA
CODECs.

This change supports either dynamic or static handling of PIN_OUT,
selected by a flag set up during CODEC initialization. This flag is
enabled for all recent NVIDIA GPUs.

Reported-by: Uosis <uosisl@gmail.com>
Cc: <stable@vger.kernel.org> # v3.13
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-31 17:57:02 +01:00
David Henningsson 3d692451ea ALSA: hda - Do not accept responses from non-existing codecs
While looking into some spurious responses, I found that the addr value was
treated a bit inconsistent: values 8..0xf will be treated as codec 0 and
values 0..7 will be treated as no error regardless of whether there is a codec
there, or not.

With this patch, all non-existing codecs will be treated equally.
In addition, printing rp and wp could help figuring out if the wp value is
reported wrongly from the controller or if something else is wrong.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:15 +01:00
Takashi Iwai 3760bc7483 ALSA: hda/conexant - Disable static quirks
Now all weird setups have been converted to fixups for the generic
parser, and we can disable the static quirks.  This commit just turns
the build off.  The bulky static quirk code still remains for a while,
in case we get an overlooked regression.  It'll be removed at the next
kernel version.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai d50ce6c0b8 ALSA: hda/conexant - Enable stereo mix input for CX20549 and CX20551
Both CX20549 and CX20551 codecs have a mixer widget and it can be
connected as the ADC source.  Like AD and VIA codecs, enable the
add_stereo_mix_input flag for these codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai 70540e245c ALSA: hda/conexant - Add analog loopback mixing to CX20549
CX20549 has an aamixer widget at NID 0x17.  Let's enable it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai ea30e7dfe8 ALSA: hda/conexant - Apply cap of mix amp volume on CX20551 codec
For the generic parser, use the standard fixup matching.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:13 +01:00
Takashi Iwai e5eac90d4a ALSA: hda/conexant - Use generic parser for HP 530
This laptop with CX20549 codec misses the internal mic at NID 0x12.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:13 +01:00
Takashi Iwai 6dcbadef22 ALSA: hda/conexant - Use generic parser for Toshiba P105
We need to fix bogus pincfgs on this machine, but it works well else.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai ad7725d31b ALSA: hda/conexant - Apply the amp cap override for CX20549 mixer
Apply the amp cap override for CX20549 mixer widget in case where the
generic parser is used, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai 3a00c6605b ALSA: hda/conexant - Re-implement OLPC XO workarounds via fixup
OLPC XO needs a few special handling.  Now these are implemented as a
fixup to the generic parser.

Obviously, the DC BIAS mode had to be added manually.  This is mainly
implemented in the mic_autoswitch hook, where the mic pins are
overwritten depending on the DC bias mode.  This also required the
override of the mic boost control, since the mic boost is applied only
when the DC mode is disabled.

In addition, the mic pins must be set dynamically at recording time
because these also control the LED.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai 8f0972dfa9 ALSA: hda - Avoid unnecessary verbs write in snd_hda_activate_path()
... by using snd_Hda_codec_update_cache() instead of *_write_cache().
Since all path elements should have been updated by this function,
we are safe to assume that the cache contents are consistent.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:11 +01:00
Takashi Iwai a2dd933d01 ALSA: hda - Add fixup name lookup for CX5051 and 5066 codecs
Like other codecs, apply a specific fixup given by a model string.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:11 +01:00
Hui Wang 5e87d58071 ALSA: hda - add headset mic detect quirks for another Dell laptop
When we plug a 3-ring headset on the Dell machine (Vendor ID:
0x10ec0255, Subsystem ID: 0x1028064d), the headset mic can't be
detected, after apply this patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1260303
Cc: David Henningsson <david.henningsson@canonical.com>
Tested-by: Doro Wu <fan-cheng.wu@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:21:30 +01:00
David Henningsson cd262518a3 ALSA: hda - Add parameter for dumping processing coefficients
Processing coefficients are often a vital part of the codec's configuration,
so dumping them can be important. However, because they are undocumented and
secret, we do not want to enable this for all codecs by default.

Therefore instead add this as a debugging parameter.

I have prepared for codecs that want to enable this by default by the extra
dump_coef bitfield, but unsure if we want to do that as long as the
(unlikely, but still) race remains.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-29 16:39:13 +01:00
Adrien Vergé e7729a4153 ALSA: hda - Fix silent output on MacBook Air 1,1
Similarly to other Apple products, MBA 1,1 needs a specific quirk.
Pin 0x18 must be set to VREF_50 to have sound output.  This was no
longer done since commit 1a97b7f, resulting in a mute built-in speaker.

This patch corrects the regression by creating a fixup for the MBA 1,1.

Fixes: 1a97b7f227 ("ALSA: hda/realtek - Remove the last static quirks for ALC882")
Cc: <stable@vger.kernel.org> [v3.4+]
Tested-by: Adrien Vergé <adrienverge@gmail.com>
Signed-off-by: Adrien Vergé <adrienverge@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-25 09:17:34 +01:00
Takashi Iwai 2387083157 ALSA: hda - Apply +5dB output amp on ASUS Zenbook UX31A
ASUS Zenbook UX31A has yet another problem -- softer output level than
others.  According to the measurement, the peak output difference
between 31A and 31E is 5dB.  As ALC269VB has a COEF for the class-D
pre-amp, let's apply it for +5dB.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-22 08:32:02 +01:00
Hui Wang c48ae0ab37 ALSA: hda - add headset mic detect quirks for some Dell machines
When we plug a 3-ring headset on some Dell machines, the headset
mic can't be detected, after apply this patch, the headset mic
can work well on all those machines.

On the machine with the Subsytem ID 0x10280610, if we use
ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, the headset mic can be
detected and work well, but the sound can't be outputed via
headphone anymore, use ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
can fix this problem.

BugLink: https://bugs.launchpad.net/bugs/1260303
Cc: David Henningsson <david.henningsson@canonical.com>
Tested-by: David Chen <david.chen@canonical.com>
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Tested-by: Shawn Wang <shawn.wang@canonical.com>
Tested-by: Chih-Hsyuan Ho <chih.ho@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-16 12:43:15 +01:00
Takashi Iwai cf67c8e71b ALSA: hda - Fix endless vmaster hook call in thinkpad_helper.c
The new vmaster hook, update_tpacpi_mute_led(), calls the original
vmaster hook, but I forgot to save the original hook function but keep
calling the updated one, which of course results in a stupid endless
loop.  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-14 14:56:55 +01:00
Hui Wang 493a52a9b6 ALSA: hda - automute via amp instead of pinctl on some AIO models
On some AIO (All In One) models with the codec alc668
(Vendor ID: 0x10ec0668) on it, when we plug a headphone into the jack,
the system will switch the output to headphone and set the speaker to
automute as well as change the speaker Pin-ctls from 0x40 to 0x00,
this will bring loud noise to the headphone.

I tried to disable the corresponding EAPD, but it did not help to
eliminate the noise.

According to Takashi's suggestion, we use amp operation to replace the
pinctl modification for the automute, this really eliminate the noise.

BugLink: https://bugs.launchpad.net/bugs/1268468
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-14 10:42:29 +01:00
Takashi Iwai dfc6e469b6 ALSA: hda - Apply codec power_filter to FG nodes
Apply the codec->power_filter to the FG nodes in general for reducing
hackish set_power_state ops override in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-13 16:30:15 +01:00
Takashi Iwai cbd209f41e ALSA: hda - Don't set indep_hp flag for old AD codecs
Some old AD codecs don't like the independent HP handling, either it
contains a single DAC (AD1981) or it mandates the mixer routing
(AD1986A).  This patch removes the indep_hp flag for such codecs.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68081
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-13 12:40:07 +01:00
Mengdong Lin 75dcbe4dc2 ALSA: hda/hdmi - apply all Haswell fix-ups to Broadwell display codec
Broadwell and Haswell have the same behavior on display audio. So this patch
defines is_haswell_plus() to include codecs for both Haswell and its successor
Broadwell, and apply all Haswell fix-ups to Broadwell.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09 07:30:17 +01:00
Mengdong Lin 3adadd280a ALSA: hda - add codec ID for Broadwell display audio codec
This patch adds codec ID (0x80862808) and module alias for Broadwell
display codec.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09 07:30:02 +01:00
Mengdong Lin 862d761818 ALSA: hda - add device ID for Broadwell display audio controller
This patch adds the device ID for Intel Broadwell display HD-Audio controller,
and applies Haswell properties to this device.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-09 07:29:42 +01:00
Takashi Iwai b317b032d2 ALSA: hda - Split Thinkpad ACPI-related code
Both patch_realtek.c and patch_conexant.c contain the fairy same code
snippet for supporting Thinkpad ACPI LED controls.  Split them into
thinkpad_helper.c and include it from both places.  Although this
isn't the best approach from the code size POV, the probability for
coexistence of both Realtek and Conexant codecs on a single machine is
pretty low, thus it'll end up with less memory footprint than
splitting to yet another module.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 16:16:51 +01:00
Takashi Iwai 43a8e50a46 ALSA: hda - Don't create duplicated ctls for loopback paths
AD1986A mic pins (0x1d and 0x1f) share the same widget for controlling
the loopback volume/mute, but the generic parser didn't check it.
This ended up with the duplicated controls for the same effect.

This patch adds the check of the duplication for avoiding it.

After this fix, there will be only one control although it affects
both paths; this remaining issue should be fixed later in a different
patch.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:59:41 +01:00
Takashi Iwai ed0e0d0617 ALSA: hda - Correct AD1986A 3stack pin configs
The 3stack pin configs for AD1986A codec had incorrect values that
resulted in broken mic and line-in.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:59:32 +01:00
Takashi Iwai 8e3ae6f7ad ALSA: hda - Add consistent tag names for firmware patch
Some tags used in the firmware patch file are inconsistent with hwdep
sysfs file names, such as, the firmware patch takes [hint] tag while
sysfs file is */hints.  This makes even me referring back to the
document often.  Let's provide the same tag names as sysfs for
reducing confusions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:59:23 +01:00
Takashi Iwai d81e397c65 ALSA: hda - firmware patch code cleanup
Just a code refactoring: the need_codec flag in hda_patch_item struct
can be removed by checking the current mode instead.  No functional
change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:59:00 +01:00
Takashi Iwai 7546abfb8e ALSA: hda - Increment default stream numbers for AMD HDMI controllers
It turned out that some AMD HDMI controllers still don't provide
proper values in GCAP register (all zero), and the driver assigns only
one stream in that case, although the connected codec chip supports
more than one stream.

In this patch, the default max number of streams for AMD HDMI
controllers is increased to 8, which  should suffice for most use
cases.  The overhead by this increase is more azx_dev struct and BDL
allocations, so it's negligible.  Of course, if the controller
provides a proper GCAP register, the register value would be used.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:58:30 +01:00
Takashi Iwai 58c57cfa0d ALSA: hda - Minor code optimization for patch_realtek.c
No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 09:57:41 +01:00
David Henningsson b2c53e2069 ALSA: hda - Disable Front HP jack detection on Gigabyte Z87X-UD3H
This motherboard seems to have a flaky jack detection - when the
front HP is not present, the jack state quickly switches on and off.

This has been reported by three people in the bug, so I doubt it's
a user error this time.

BugLink: https://bugs.launchpad.net/bugs/1248116
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-05 11:41:07 +01:00
Takashi Iwai 4b5a5096bb Merge branch 'for-linus' into for-next 2014-01-05 11:19:34 +01:00
David Henningsson 0f4881dc1f ALSA: hda - Enable subwoofer on Dell Vostro 5460/5470
In this case, there are two DACs, and DAC 0x03 is mono. In order
to make headphones and front speaker use DAC 0x02, and subwoofer use
DAC 0x03, we artificially cut the connection from nodes 0x14 and 0x15
to node 0x03, so they can only use DAC 0x02.

In addition, the 5460 and 5470 differs in the sense that 5470 also
needs a headset mic patch, whereas 5460 has individual detection for
headphone and headset mic.

BugLink: https://bugs.launchpad.net/bugs/1211920
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 16:34:19 +01:00
Lv Zheng d171ebc5b9 ALSA: hda - Fix wrong <acpi/acpi.h> inclusion in Thinkpad ACPI users.
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of
directly including <acpi/acpi.h>.  This patch cleans up such wrong
inclusions for Thinkpad ACPI users.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 10:14:05 +01:00
Takashi Iwai d8f66c71d5 ALSA: hda - Add warning texts when codec driver Kconfig doesn't match
When a Kconfig of a codec driver doesn't match with the controller
(CONFIG_SND_HDA_INTEL), it'll result in the non-working automatic
probing.  Unfortunately kbuild can't give such a restriction, but at
least, it's possible to show a warning if such a condition is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 15:09:14 +01:00
Takashi Iwai 2698ea9805 ALSA: hda - Kill EXPORT_SYMBOL_HDA()
Replace all with the standard EXPORT_SYMBOL_GPL().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 14:36:19 +01:00
Takashi Iwai 595fe1b702 ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate
So far, CONFIG_SND_HDA_CODEC_* kconfigs have been booleans due to
historical reasons.  The major reason was that the automatic codec
driver probing wouldn't work if user sets a codec driver as a module
while the controller driver as a built-in.  And, another reason was to
avoid exporting symbols of the helper codes when all drivers are built
in.

But, this sort of "kindness" rather confuses people in the end,
especially makes the config refinement via localmodconfig unhappy.
Also, a codec module would still work if you re-bind the controller
driver via sysfs (although it's no automatic loading), so there might
be a slight use case.

That said, better to let people fallen into a pitfall than being too
smart and restrict something.  Let's make things straightforward: now
all CONFIG_SND_HDA_CODEC_* become tristate, and all symbols exported
unconditionally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 14:36:11 +01:00
David Henningsson da4a7a3926 ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense
This should help us avoid the following mutex deadlock:

[] mutex_lock+0x2a/0x50
[] hdmi_present_sense+0x53/0x3a0 [snd_hda_codec_hdmi]
[] generic_hdmi_resume+0x5a/0x70 [snd_hda_codec_hdmi]
[] hda_call_codec_resume+0xec/0x1d0 [snd_hda_codec]
[] snd_hda_power_save+0x1e4/0x280 [snd_hda_codec]
[] codec_exec_verb+0x5f/0x290 [snd_hda_codec]
[] snd_hda_codec_read+0x5b/0x90 [snd_hda_codec]
[] snd_hdmi_get_eld_size+0x1e/0x20 [snd_hda_codec_hdmi]
[] snd_hdmi_get_eld+0x2c/0xd0 [snd_hda_codec_hdmi]
[] hdmi_present_sense+0x9a/0x3a0 [snd_hda_codec_hdmi]
[] hdmi_repoll_eld+0x34/0x50 [snd_hda_codec_hdmi]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-18 12:40:45 +01:00