Commit Graph

4167 Commits

Author SHA1 Message Date
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
Hui Wang 3a6c5d8ad0 ALSA: hda - Add Dell headset detection quirk for one more laptop model
On the Dell machines with codec whose Subsystem Id is 0x10280640,
no external microphone can be detected when plugging a 3-ring headset.
Using ALC255_FIXUP_DELL1_MIC_NO_PRESENCE can fix this problem.

The codec (Vendor ID: 0x10ec0255) on the machine belongs to alc_269
family.

BugLink: https://bugs.launchpad.net/bugs/1260303
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>
2013-12-18 12:40:29 +01:00
Takashi Iwai d09476018b Merge branch 'for-linus' into for-next 2013-12-16 15:53:52 +01:00
Hui Wang c29cb5eb81 ALSA: hda - Add Dell headset detection quirk for three laptop models
On the Dell machines with codec whose Subsystem Id is 0x10280610,
0x10280629 or 0x1028063e, no external microphone can be detected when
plugging a 3-ring headset. If we add "model=dell-headset-multi" for
the snd-hda-intel.ko, the problem will disappear.

The codecs on these machines belong to alc_269 family.

BugLink: https://bugs.launchpad.net/bugs/1260303
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>
2013-12-13 09:40:31 +01:00
David Henningsson 693e0cb052 ALSA: hda - Add enable_msi=0 workaround for four HP machines
While enabling these machines, we found we would sometimes lose an
interrupt if we change hardware volume during playback, and that
disabling msi fixed this issue. (Losing the interrupt caused underruns
and crackling audio, as the one second timeout is usually bigger than
the period size.)

The machines were all machines from HP, running AMD Hudson controller,
and Realtek ALC282 codec.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1260225
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-12 17:46:39 +01:00
Takashi Iwai 3690739b01 ALSA: hda - Add static DAC/pin mapping for AD1986A codec
AD1986A codec is a pretty old codec and has really many hidden
restrictions.  One of such is that each DAC is dedicated to certain
pin although there are possible connections.  Currently, the generic
parser tries to assign individual DACs as much as possible, and this
lead to two bad situations: connections where the sound actually
doesn't work, and connections conflicting other channels.

We may fix this by trying to find the best connections more harder,
but as of now, it's easier to give some hints for paired DAC/pin
connections and honor them if available, since such a hint is needed
only for specific codecs (right now only AD1986A, and there will be
unlikely any others in future).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-11 07:16:20 +01:00
Hui Wang 7dca4bc6f3 ALSA: hda - One more Dell headset detection quirk
On the Dell machines with codec whose Subsystem Id is 0x10280624,
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/bugs/1259790
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>
2013-12-11 07:12:55 +01:00
Anssi Hannula c9a6338aec ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices
In case a single HDA card has both HDMI and S/PDIF outputs, the S/PDIF
outputs will have their IEC958 controls created starting from index 16
and the HDMI controls will be created starting from index 0.

However, HDMI simple_playback_build_controls() as used by old VIA and
NVIDIA codecs incorrectly requests the IEC958 controls to be created
with an S/PDIF type instead of HDMI.
In case the card has other codecs that have HDMI outputs, the controls
will be created with wrong index=16, causing them to e.g. be unreachable
by the ALSA "hdmi" alias.

Fix that by making simple_playback_build_controls() request controls
with HDMI indexes.

Not many cards have an affected configuration, but e.g. ASUS M3N78-VM
contains an integrated NVIDIA HDA "card" with:
- a VIA codec that has, among others, an S/PDIF pin incorrectly
  labelled as an HDMI pin, and
- an NVIDIA MCP7x HDMI codec.

Reported-by: MysterX on #openelec
Tested-by: MysterX on #openelec
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org> # 3.8+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-11 07:12:07 +01:00
Takashi Iwai ebb93c057d ALSA: hda - Mute all aamix inputs as default
Not all channels have been initialized, so far, especially when aamix
NID itself doesn't have amps but its leaves have.  This patch fixes
these holes.  Otherwise you might get unexpected loopback inputs,
e.g. from surround channels.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 21:16:50 +01:00
Hui Wang 0dfb9809e9 ALSA: hda - Another Dell headset detection quirk
On the Dell Inspiron 3045 machine (codec Subsystem Id: 0x10280628),
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/hwe-somerville/+bug/1259437
CC: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 09:02:58 +01:00
Hui Wang 6c6eb4270c ALSA: hda - A Dell headset detection quirk
On the Dell Optiplex 3030 machine (codec Subsystem Id: 0x10280623),
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/hwe-somerville/+bug/1259435
CC: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 09:02:49 +01:00
Takashi Iwai ed326363d7 ALSA: hda - Split verb definitions into sound/hda_verbs.h
Since there are more HD-audio compatible codecs, move the definitions
of HD-audio verbs into common header location, include/sound, so that
it can be included cleanly from other drivers than HD-audio driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-09 17:31:40 +01:00
Takashi Iwai f1e762ddc8 ALSA: hda - Enable stereo mix as default for AD and VIA codecs
AD and VIA codecs had stereo mixer input enabled as default before
moving to the generic parser, and people think the lack of such a
regression.  In this patch, the stereo mixer input is added back to
the input selection if no auto-mic is available, and if it's not
disabled explicitly via hint.  This should satisfy most of demands,
i.e. stereo mix on desktop machines like what it worked before, and it
still keeps the new auto-mic feature on laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-09 16:02:24 +01:00
Takashi Iwai e8648e5e33 ALSA: hda - Ignore small negative LPIB delay correction
Sometimes the hardware reports LPIB being advanced than POSBUF.
When this happens, the driver adjusts to a positive value by adding
the buffer size.  Then the driver detects it as an error (greater than
the period size), and stops the LPIB delay account from this point
on.

When I took a close look at these conditions, the values shown are all
very small numbers, and it'd be better to just ignore these values
instead of discontinuing the LPIB delay correction.

In this patch, the driver checks a negative delay value and ignores if
it's a significantly small error.  Currently the threshold is set to
64 frames, but could be smaller.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 17:28:49 +01:00
Takashi Iwai 4f7f67fb77 ALSA: hda - Add missing initialization of aamix paths
The loopback mixing paths aren't initialized correctly at init
callback.  Mostly this is harmless as codecs usually set the mute
state as default, but we still should make sure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 17:10:32 +01:00
Takashi Iwai c9e4bdb755 ALSA: hda - Allow capture-only configuration
We have blindly assumed that all valid configurations should have
either analog or digital playback, but there can be capture-only
configurations.  The parser shouldn't escape in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 09:31:40 +01:00
Mengdong Lin 5b8620bb84 ALSA: hda - skip depop delay before D3 for Haswell and Valleyview2 display codec
This patch skips the default depop delay before D3 for Haswell (10 ms) and
Valleyview2 (100 ms) display codec, to reduce codec suspend time.

The analog part of display audio is implemented in the external display. Some
displays have weak pop noise while others not when suspending, no matter there
is the default delay or not.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:53:08 +01:00
David Henningsson 31660e9084 ALSA: hda - Remove quirk for Dell Vostro 131
I've tested the old Dell Vostro 131 with the latest generic parser
and it works just fine, and as a bonus we get better jack detection
features in userspace. Therefore this quirk can be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:52:40 +01:00
Takashi Iwai f4d6a55d7b ALSA: hda - Clean up async codec PM using standard async infrastructure
This simplifies lots of codes indeed.

Tested-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:51:51 +01:00
Oleksij Rempel b1e8972e39 ALSA: hda - fix mic issues on Acer Aspire E-572
This patch add quirk for Acer Aspire E-572:
- fix external mic
- limit mic boost for internal mic with maximal noise level of -24dB

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-05 07:43:03 +01:00
Takashi Iwai 0756f09c49 ALSA: hda - Fix silent output on MacBook Air 2,1
MacBook Air 2,1 has a fairly different pin assignment from its brother
MBA 1,1, and yet another quirks are needed for pin 0x18 and 0x19,
similarly like what iMac 9,1 requires, in order to make the sound
working on it.

Reported-and-tested-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 13:59:45 +01:00
David Henningsson 20ce902978 ALSA: hda - Fix missing ELD info when using jackpoll_ms parameter
In the case of using jackpoll_ms instead of unsol events, the jack
was correctly detected, but ELD info was not refreshed on plug-in.

And without ELD info, no proper restriction of pcm, which can in turn
break sound output on some devices.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 09:02:51 +01:00
Kailang Yang eb21aad9fd ALSA: hda/realtek - remove hp_automute_hook from alc283_fixup_chromebook
I forgot to remove the hp_automute_hook from alc283_fixup_chromebook.
It doesn't need this for other chrome os machine.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 08:59:30 +01:00
Mengdong Lin 84d2dc3e57 ALSA: hda - fixup ALC262 to skip depop delay before D3 on Intel BayleyBay
This patch sets a 0ms depop delay in fixup funtion 'alc_fixup_no_depop_delay'.
And Realteck ALC262 applies this on Intel Baytrail BayleyBay platform to reduce
codec suspend time.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 11:35:43 +01:00
Kailang Yang 0202e99c69 ALSA: hda/realtek - Independent of model for HP
Create single model for HP.
The headset jack module was difference between other chrome book.
It need to manual control Mic jack detect.

Chrome OS loaded driver by models. Remove old assigned fixup table from
ALC269 fixup list entry.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 09:27:23 +01:00
David Henningsson d59915d065 ALSA: hda - Fix headset mic input after muted internal mic (Dell/Realtek)
By trial and error, I found this patch could work around an issue
where the headset mic would stop working if you switch between the
internal mic and the headset mic, and the internal mic was muted.

It still takes a second or two before the headset mic actually starts
working, but still better than nothing.

Information update from Kailang:
  The verb was ADC digital mute(bit 6 default 1).
  Switch internal mic and headset mic will run alc_headset_mode_default.
  The coef index 0x11 will set to 0x0041.
  Because headset mode was fixed type. It doesn't need to run
  alc_determine_headset_type.
  So, the value still keep 0x0041. ADC was muted.

BugLink: https://bugs.launchpad.net/bugs/1256840
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 09:26:14 +01:00
Takashi Iwai b3bd4fc382 ALSA: hda - Use always amps for auto-mute on AD1986A codec
It seems that AD1986A cannot manage the dynamic pin on/off for
auto-muting, but rather gets confused.  Since each output has own amp,
let's use it instead.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Cc: <stable@vger.kernel.org> [v3.11+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:40:14 +01:00
Takashi Iwai ce8e0fd239 ALSA: hda/analog - Handle inverted EAPD properly in vmaster hook
ad_vmaster_eapd_hook() needs to handle the inverted EAPD case
properly, too.  Otherwise the output gets broken on Lenovo N100 with
AD1986A codec.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:40:14 +01:00
Takashi Iwai e7ca237bfc ALSA: hda - Another fixup for ASUS laptop with ALC660 codec
ASUS Z35HL laptop also needs the very same fix as the previous one
that was applied to ASUS W7J.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66231
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:27:19 +01:00
Takashi Iwai aad730d070 ALSA: hda - Always do delayed probes for HD-audio devices
HD-audio devices tend to take long time for finishing the whole
probing procedure.  In this patch, the time-consuming part of the
probing procedure, the codec probe and the rest initializations, are
moved in the work, so that they can be done asynchronously in parallel
with probes of other devices.

Since we already have this mechanism in the driver code for the
firmware and i915 request_symbol() stuff, we just need to enable it
always; the resultant patch even reduces more lines, which is an
additional bonus.

Credit goes to David Henningsson, who suggested this workaround.

Reported-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:17:39 +01:00
Takashi Iwai b95ff8e61a Merge branch 'for-linus' into for-next 2013-12-02 13:32:41 +01:00
Takashi Iwai 88d071fc9a ALSA: hda - Fix complete_all() timing in deferred probes
When the probe of snd-hda-intel driver is deferred due to f/w loading
or the nested module loading, complete_all() should be also delayed
until the initialization really finished.  Otherwise, vga-switcheroo
client would start switching before the actual init is done.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 13:23:40 +01:00
Takashi Iwai 1cd9b2f78b ALSA: hda - Fix bad EAPD setup for HP machines with AD1984A
It seems that EAPD on NID 0x16 is the only control over all outputs on
HP machines with AD1984A while turning EAPD on NID 0x12 breaks the
output.  Thus we need to avoid fiddling EAPD on NID.  As a quick
workaround, just set own_eapd_ctrl flag for the wrong EAPD, then
implement finer EAPD controls.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66321
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 13:23:39 +01:00
Takashi Iwai 6ddf0fd1c4 ALSA: hda - Fix silent output on ASUS W7J laptop
The recent kernels got regressions on ASUS W7J with ALC660 codec where
no sound comes out.  After a long debugging session, we found out that
setting the pin control on the unused NID 0x10 is mandatory for the
outputs.  And, it was found out that another magic of NID 0x0f that is
required for other ASUS laptops isn't needed on this machine.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66081
Reported-and-tested-by: Andrey Lipaev <lipaev@mail.ru>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 16:20:02 +01:00
Mengdong Lin 7f13292743 ALSA: hda - allow a codec to define its own depop delay time
This patch adds 'depop_delay' to struct hda_codec, to indicate a depop delay
time in ms when power-down, in function set_power_state() to D3.

Default value is -1, for a default delay time.
Machine fixup can set a suitable value according to the codec chip and HW audio
design.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 14:47:46 +01:00
Mengdong Lin b5c6611fb4 ALSA: hda - fixup ALC262 to remove depop delay on Intel BayleyBay board
This patch defines a fixup 'alc_fixup_no_depop_delay', which sets alc_spec flag
'no_depop_delay' to indicate skipping delay in Realtek codec suspend/resume.

And Intel Baytrail BayleyBay board applies this fixup to reduce driver
suspend/resume time.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:43 +01:00
Kailang Yang 97a2657076 ALSA: hda/realtek - Remove depop delay for suspend and resume if applicable
This patch defines a flag "no_depop_delay" in alc_spec. If this flag is set,
delay in alc_eapd_shutup and alc_resume will be skipped.

Machine-specific fixup can set this flag to reduce suspend/resume time, if
the codec and hardware analog design can avoid pop noise without this delay.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:38 +01:00
Kailang Yang 4b016931a9 ALSA: hda/realtek - Add more codecs alias name for Dell
Dell assigned alias name for more codecs.
ALC3220 ALC3221 ALC3223 ALC3226 ALC3234 ALC3661.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:21 +01:00
David Henningsson eb82594b75 ALSA: hda - Add mono speaker quirk for Dell Inspiron 5439
This machine also has mono output if run through DAC node 0x03.

Cc: stable@vger.kernel.org (v3.10+)
BugLink: https://bugs.launchpad.net/bugs/1256212
Tested-by: David Chen <david.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 08:21:15 +01:00
Takashi Iwai eb9ca3ab21 ALSA: hda - Add LFE chmap to ASUS ET2700
As the previous commit 1f0bbf03cb added the pin config for the bass
speaker, this patch adds the corresponding LFE-only channel map on
ASUS ET2700.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65961
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 15:24:34 +01:00
Takashi Iwai 1f0bbf03cb ALSA: hda - Initialize missing bass speaker pin for ASUS AIO ET2700
Add a fixup entry for the missing bass speaker pin 0x16 on ASUS ET2700
AiO desktop.  The channel map will be added in the next patch, so that
this can be backported easily to stable kernels.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65961
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 15:21:21 +01:00
Takashi Iwai 696620a6cd Merge branch 'for-linus' into for-next 2013-11-28 11:43:30 +01:00
Oleksij Rempel 2cede30379 ALSA: hda - limit mic boost on Asus UX31[A,E]
This both devices need limit for internal dmic.

[cosmetic change; renamed fixup name by tiwai]

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 11:38:27 +01:00
Takashi Iwai 2ded3e5b61 ALSA: hda - Check leaf nodes to find aamix amps
The current generic parser assumes blindly that the volume and mute
amps are found in the aamix node itself.  But on some codecs,
typically Analog Devices ones, the aamix amps are separately
implemented in each leaf node of the aamix node, and the current
driver can't establish the correct amp controls.  This is a regression
compared with the previous static quirks.

This patch extends the search for the amps to the leaf nodes for
allowing the aamix controls again on such codecs.
In this implementation, I didn't code to loop through the whole paths,
since usually one depth should suffice, and we can't search too
deeply, as it may result in the conflicting control assignments.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65641
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 11:32:00 +01:00
Takashi Iwai 16c0cefe89 ALSA: hda - Fix hp-mic mode without VREF bits
When the hp mic pin has no VREF bits, the driver forgot to set PIN_IN
bit.  Spotted during debugging old MacBook Airs.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65681
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 14:55:45 +01:00
Takashi Iwai ced4cefc75 ALSA: hda - Create Headhpone Mic Jack Mode when really needed
When a headphone jack is configurable as input, the generic parser
tries to make it retaskable as Headphone Mic.  The switching can be
done smoothly if Capture Source control exists (i.e. there is another
input source).  Or when user explicitly enables the creation of jack
mode controls, "Headhpone Mic Jack Mode" will be created accordingly.

However, if the headphone mic is the only input source, we have to
create "Headphone Mic Jack Mode" control because there is no capture
source selection.  Otherwise, the generic parser assumes that the
input is constantly enabled, thus the headphone is permanently set
as input.  This situation happens on the old MacBook Airs where no
input is supported properly, for example.

This patch fixes the problem: now "Headphone Mic Jack Mode" is created
when such an input selection isn't possible.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65681
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 14:55:40 +01:00
Mengdong Lin 12edb89308 ALSA: hda - resume codecs in parallel
To reduce driver resume time, this patch resumes the codecs in parallel
if there are multiple codecs on the bus.

- The PM workqueue of bus is also used to parallel resuming multiple codecs.
- The work item 'pm_work' is renamed to 'suspend_work' to parallel suspending
  codecs.
- Add a work item 'resume_work' to parallel resuming codecs.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 12:37:07 +01:00
Mengdong Lin 0e24dbb7f4 ALSA: hda - suspend codecs in parallel
The time to suspend a single codec may be several hundreds of ms. When runtime
power saving is disabled, driver suspend time can be long especially when there
are more than one codec on the bus.

To reduce driver suspend time, this patch creates a work queue for the bus, and
suspends the codecs in parallel if there are multiple codecs on the bus.

[fixed cosmetic issues by tiwai]

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 12:16:32 +01:00
Hui Wang 2fd3f170e5 ALSA: hda - Enable mute/mic-mute LEDs for more Thinkpads with Conexant codec
Most Thinkpad Edge series laptops use conexant codec, so far although
the codecs have different minor Vendor Id and minor Subsystem Id,
they all belong to the cxt5066 family, this change can make the
mute/mic-mute LEDs support more generic among cxt_5066 family.

This design refers to the similar solution for the realtek codec
ALC269 family in the patch_realtek.c.

Cc: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 08:52:37 +01:00
Takashi Iwai 3e9bc58fef ALSA: hda - Disable runtime PM when EPSS is unavailable
According to Mengdong, we shouldn't enable runtime PM when a codec
doesn't support EPSS, based on the experiences on Windows.
We have already this check in HDMI codec drivers, but now apply it in
general in hda_codec.c.

Credit goes to Mengdong Lin <mengdong.lin@intel.com>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:43:02 +01:00
Takashi Iwai b1920c2110 ALSA: hda - Enable runtime PM on Panther Point
Now we fixed the long-standing bugs of runtime PM, let's enable
Panther Point again.  The runtime PM was disabled in the HDMI codec
driver due to the S3 issue, and this should have been fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:39 +01:00
Takashi Iwai a40e0a880b ALSA: hda - Refactor pm notification in hda_codec.c
No functional change.

- codec->pm_down_notified flag is renamed to codec->pm_up_notified
  flag (and takes the reversed meaning), which is managed solely in
  hda_call_pm_notify() now.

- The explicit call of hda_call_pm_notify() is moved into
  hda_keep_power_on().

- Removed a redundant call of hda_call_pm_notify() in
  snd_hda_power_up(), as it's called in hda_call_codec_resume()
  anyway.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai f0639272d6 ALSA: hda - Bind with HDMI codec parser automatically
If a codec contains only the digital outputs, it's very likely a
HDMI/DP codec, which isn't supported by the generic parser but via
HDMI codec parser code.  Detect such a case and bind with the proper
parser object if available.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai b21bdd0d34 ALSA: hda - Split the generic parser as an individual module
Drop the hard dependency on the generic parser code and load / unload
the generic parser code dynamically if built as a module.  This allows
us to avoid the generic parser if only HDMI/DP codecs are found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai 873ce8ad50 ALSA: hda - Drop bus->avoid_link_reset flag
Use bus->power_keep_link_on instead.  The controller shouldn't go to
D3 when the link isn't reset, so essentially avoiding the link reset
means avoiding the runtime PM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
Kailang Yang 9ad54547cf ALSA: hda/realtek - Set pcbeep amp for ALC668
Set the missing pcbeep default amp for ALC668.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
Kailang Yang ba4c4d0a90 ALSA: hda/realtek - Add support of ALC231 codec
It's compatible with ALC269.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
David Henningsson 5db4d34b54 ALSA: hda - Set current_headset_type to ALC_HEADSET_TYPE_ENUM (janitorial)
current_headset_type should be of the HEADSET_TYPE enum, not the
HEADSET_MODE enum. Since ALC_HEADSET_TYPE_UNKNOWN and ALC_HEADSET_MODE_UNKNOWN
are both 0, this patch is just janitorial.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-22 12:58:01 +01:00
Takashi Iwai d08c5ef2a0 ALSA: hda - Provide missing pin configs for VAIO with ALC260
Some models (or maybe depending on BIOS version) of Sony VAIO with
ALC260 give no proper pin configurations as default, resulting in the
non-working speaker, etc.  Just provide the whole pin configurations
via a fixup.

Reported-by: Matthew Markus <mmarkus@hearit.co>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-22 08:10:03 +01:00
David Henningsson b8362e70cb ALSA: hda - Add headset quirk for Dell Inspiron 3135
Cc: stable@vger.kernel.org (3.10+)
BugLink: https://bugs.launchpad.net/bugs/1253636
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-21 14:19:13 +01:00
Takashi Iwai 0f5a5b8515 ALSA: hda - Fix the headphone jack detection on Sony VAIO TX
BIOS sets MISC_NO_PRESENCE bit wrongly to the pin config on NID 0x0f.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-21 09:17:34 +01:00
Takashi Iwai a30c9aaa90 ALSA: hda - Fix missing bass speaker on ASUS N550
The laptop has a built-in speaker on NID 0x1a.  It's an LFE only on
the right channel, so we need to provide an explicit chmap, too.

There might be other surround speakers, but they can fixed in addition
at later point, so let's fix the easier bass speaker at first.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65091
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-21 08:02:11 +01:00
Takashi Iwai 0fc28fc030 ALSA: hda - Fix unbalanced runtime PM notification at resume
When a codec is resumed, it keeps the power on while the resuming
phase via hda_keep_power_on(), then turns down via
snd_hda_power_down().  At that point, snd_hda_power_down() notifies
the power down to the controller, and this may confuse the refcount if
the codec was already powered up before the resume.

In the end result, the controller goes to runtime suspend even before
the codec is kicked off to the power save, and the communication
stalls happens.

The fix is to add the power-up notification together with
hda_keep_power_on(), and clears the flag appropriately.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-20 16:39:14 +01:00
David Henningsson 09d2014fb0 ALSA: hda - A casual Dell Headset quirk
You're looking at a casual headset patch,
for a specific hardware it will match,
and suddenly, the headset jack will work,
so please apply this simple quirk!

BugLink: https://bugs.launchpad.net/bugs/1253038
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-20 12:59:32 +01:00
David Henningsson 521290003a ALSA: hda - Also enable mute/micmute LED control for "Lenovo dock" fixup
The docking station is a Thinkpad thing, so it makes sense to check
for mute/micmute LEDs for that quirk type too.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-19 11:28:41 +01:00
Takashi Iwai 2c312e9af7 ALSA: hda - Select FW_LOADER from CONFIG_SND_HDA_CODEC_CA0132_DSP
Use select FW_LOADER instead of depends on.  It's more intuitive and
more consistent with other entries.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-18 17:12:34 +01:00
David Henningsson 2793769f44 ALSA: hda - Enable mute/mic-mute LEDs for more Thinkpads with Realtek codec
We're using the ACPI interface to detect whether we're dealing with a Thinkpad
or not. This way we're not loading the thinkpad_acpi module when we're not on
a Thinkpad, but at the same time, we give the opportunity to check for, and
potentially enable, both present and future Thinkpad with mute/micmute LEDs.

At least those running the ALC269 family (269 to 299) of Realtek codecs.

Cc: Alex Hung <alex.hung@canonical.com>
Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-18 13:08:47 +01:00
Vitaliy Kulikov d009f3deb7 ALSA: hda - load EQ params into IDT codec on HP bNB13 systems
Adds linear EQ filtering for integrated speaker protection

Signed-off-by: Vitaliy Kulikov <vitaliy.kulikov@idt.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-15 11:57:54 +01:00
Takashi Iwai d183b4fc46 ALSA: hda - Don't clear the power state at snd_hda_codec_reset()
snd_hda_codec_reset() is called either in resetting the whole setup at
error paths or hwdep clear/reconfig sysfs triggers.  But all of these
don't assume that the power has to be off, rather they want to keep
the power state unchanged (e.g. reconfig_codec() calls the power
up/down by itself).  Thus, unconditionally clearing the power state in
snd_hda_codec_reset() leads to the inconsistency, confuses the further
operation.   This patch gets rid of the lines doing that bad thing.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13 17:02:30 +01:00
Takashi Iwai f710a9fbd3 ALSA: hda - Control EAPD for Master volume on Lenovo N100
Similarly as other laptops with AD1981 & co codecs, we can control
EAPD on AD1986A more safely depending on the Master switch, in order
to save some power.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13 09:44:33 +01:00
Takashi Iwai 7a3e6107f9 ALSA: hda - Don't turn off EAPD for headphone on Lenovo N100
The only EAPD on AD1986A is on NID 0x1b where usually the speaker.
But this doesn't control only the speaker amp but may influence on all
outputs, e.g. Lenovo N100 laptop seems to have this issue.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13 09:39:08 +01:00
Takashi Iwai 468ac41304 ALSA: hda - Check keep_eapd_on before inv_eapd
We don't change the EAPD bit in set_pin_eapd() if keep_eapd_on flag is
set by the codec driver and enable is false.  But, we also apply the
flipping of enable value according to inv_eapd flag in the same
function, and this confused the former check, handled as if it's
turned ON.  The inverted EAPD check must be applied after keep_eapd_on
check, instead.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-12 11:36:00 +01:00
David Henningsson 5959a6bc11 ALSA: hda - Fix Line Out automute on Realtek multifunction jacks
In case there is both a multifunction headset jack and a Line Out
jack, automuting was not working properly from the Line Out jack.
This patch fixes that issue.

Cc: stable@vger.kernel.org (3.10+)
BugLink: https://bugs.launchpad.net/bugs/1250377
Tested-by: Cyrus Lien <cyrus.lien@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-12 11:35:31 +01:00
Anssi Hannula 679605c768 ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD
According to the HDA specification the baseline ELD length is counted in
DW of 4 bytes instead of in bytes.

Fix the code accordingly.

Baseline length is not used by the kernel so only the ELD exported to
userspace was affected. No issues have been reported.

v2: Fixed so that eld_size is adjusted upwards accordingly as well.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11 17:08:39 +01:00
Anssi Hannula a5666824ce ALSA: hda - hdmi: Skip out-of-range latency values in AMD ELD generator
The ATI/AMD video/audio latencies are specified in apparent HDMI VSDB
format. In this format values above 251 are not valid (or stream
component is not supported - 255), but no checking is performed since
this was not mentioned in the AMD HDA verbs specification.

Check that the latencies are valid before using them, and add a comment
describing the formats.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11 17:08:04 +01:00
Anssi Hannula 13122e6ebf ALSA: hda - hdmi: Add error-checking to some codec reads
Add error checks to HBR status reads (both generic and ATI/AMD) and
ATI/AMD codec reads for ELD generation.

Unchecked errors in these just caused more errors later on (invalid
codec writes for the HBR ones and ELD parsing errors for the ATI/AMD ELD
ones), but it is better to catch them earlier.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11 17:07:49 +01:00
Anssi Hannula 94908a39ce ALSA: hda - hdmi: Use TFx channel positions instead of FxH
Channel map positions FLH, FCH, FRH duplicate positions TFL, TFC, TFR.
Both are the speakers above the front speakers (CEA uses "high" and USB
audio uses "top" nomenclature).

Since the USB audio code has used the TFx positions since v3.8
(04324ccc75, "ALSA: usb-audio: add channel map support") but the HDMI
code only just started using FxH in a5b7d510b2 ("ALSA: hda -
hdmi: Fix channel maps with less common speakers") which is not yet in
any released kernel, standardize on TFx instead.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11 17:06:40 +01:00
Takashi Iwai 0c52db8cca ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
The SPDIF output MBP11,2 requires the pin control to be set/cleared
for turning on/off the optical SPDIF.  The red light turns off only
when the corresponding pin control is cleared (or powered to D3).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-11 16:22:04 +01:00
Kailang Yang 9a22a8f558 ALSA: hda/realtek - Add new codec ALC255/ALC3234 UAJ supported
New codec ALC255/ALC3234 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>
2013-11-08 13:52:59 +01:00
Takashi Iwai 885845d785 ALSA: hda - Apply MacBook fixups for CS4208 correctly
The commit [8fe7b65ab465: ALSA: hda - Apply GPIO setup for MacBooks
with CS4208] added a fixup entry matching with the vendor id 0x106b.
This broke the fixups for previous MBA6,1 and 6,2, since the PCI SSID
vendor id matches before evaluating the codec SSIDs.

We had a similar issue on Mac with Sigmatel codecs, and solve this
problem again similarly, by introducing a skeleton entry matching with
the all MacBooks, then remap to the right one.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401
Fixes: 8fe7b65ab4 ('ALSA: hda - Apply GPIO setup for MacBooks with CS4208')
Cc: <stable@vger.kernel.org> [v3.12+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-08 13:50:56 +01:00
Kailang Yang 380702192f ALSA: hda/realtek - Make fixup regs persist after resume
Upon suspend / resume, the fixup register settings are lost because
sending HDA_FIXUP_ACT_PRE_PROBE is not part of the resume path. Instead,
write our registers in response to the HDA_FIXUP_ACT_INIT, which happens
after initial probe and upon resume.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-08 07:43:45 +01:00
Joe Perches 3b70a67da0 ALSA: hda_intel: ratelimit "spurious response" message
dmesg here has a 100+ consecutive lines of:

[ 1464.219446] hda-intel 0000:00:14.2: spurious response 0x0:0x0, last cmd=0x170500
[ 1464.219451] hda-intel 0000:00:14.2: spurious response 0x0:0x0, last cmd=0x170500
[ 1464.219454] hda-intel 0000:00:14.2: spurious response 0x0:0x0, last cmd=0x170500
...

Ratelimit the message to reduce the dmesg log noise.

Coalesce the format while at it.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 21:22:23 +01:00
Takashi Iwai aff747ebbf ALSA: hda - Get rid of AMD HDMI exception in hdmi_present_sense()
Since the recent fake ELD patches, we can remove the check for AMD
HDMI in hdmi_present_sense() and decide the return value from
eld_valid value.

Suggested by Anssi Hannula.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 16:39:37 +01:00
David Henningsson 464837a7bc ALSA: hda - block HDMI jack reports while repolling
This fixes a race condition in case several monitors are being
repolled in parallel.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 14:03:33 +01:00
David Henningsson 0f568959de ALSA: hda - Add a block_report flag to jacks
If the jack should not be reported to userspace (e g, because it is
in some transitional state), one can set this flag.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 14:03:17 +01:00
Takashi Iwai efe4710860 ALSA: hda - Delay HDMI presence reports while waiting for ELD information
There is a small gap between the jack detection unsolicited event and
the time the ELD is updated.  When user-space queries the HDMI ELD
immediately after receiving the notification, it might fail because of
this gap.

For avoiding such a problem, this patch tries to delay the HDMI jack
detect notification until ELD information is fully updated.  The
workaround is imperfect, but good enough as a starting point.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 14:02:49 +01:00
David Henningsson ad8ff99e6b ALSA: hda - Another Dell headset quirk
This machine has a multi-function headset jack.

BugLink: https://bugs.launchpad.net/bugs/1248856
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 09:53:11 +01:00
Takashi Iwai 487a588d09 ALSA: hda - Add pincfg fixup for ASUS W5A
BIOS on ASUS W5A laptop with ALC880 codec doesn't provide any pin
configurations, so we have to set up all pins manually.

Reported-and-tested-by: nb <nb@dagami.org>
Cc: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 07:35:31 +01:00
Takashi Iwai 8f42d76987 ALSA: hda - Add support for CX20952
It's a superset of the existing CX2075x codecs, so we can reuse the
existing parser code.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 07:35:26 +01:00
David Henningsson 8e35cd4ac9 ALSA: HDA - Limit mic boost and add mute LED for an HP machine
This machine has a mute LED as well as a noisy internal mic. Hence it needs
quirks for both limiting the mic boost as well as enabling the LED.

BugLink: https://bugs.launchpad.net/bugs/1248476
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-06 12:11:16 +01:00
David Henningsson d5b6b65e75 ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek)
Some HP machines with Realtek codecs have mute LEDs connected to VREF pins.
However when these go into runtime suspend, the pin powers down and its
pin control is disabled, thus disabling the LED too.

This patch fixes that issue by making sure that the pin stays in D0 with
correct pin control.

Cc: stable@kernel.org
BugLink: https://bugs.launchpad.net/bugs/1248465
Tested-by: Franz Hsieh <franz.hsieh@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-06 11:08:12 +01:00
Takashi Iwai 8fe7b65ab4 ALSA: hda - Apply GPIO setup for MacBooks with CS4208
Apply the existing GPIO0 fixup as default for MacBooks with CS4208
codec.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64401
Cc: <stable@vger.kernel.org> [v3.12+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-06 08:08:53 +01:00
Takashi Iwai fab1285a51 ALSA: hda - Name Haswell HDMI controllers better
"HDA Intel MID" is no correct name for Haswell HDMI controllers.
Give them a better name, "HDA Intel HDMI".

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 17:54:05 +01:00
Takashi Iwai 33499a15c2 ALSA: hda - Force buffer alignment for Haswell HDMI controllers
Haswell HDMI audio controllers seem to get stuck when unaligned buffer
size is used.  Let's enable the buffer alignment for the corresponding
entries.

Since AZX_DCAPS_INTEL_PCH contains AZX_DCAPS_BUFSIZE that disables the
buffer alignment forcibly, define AZX_DCAPS_INTEL_HASWELL and put the
necessary AZX_DCAPS bits there.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60769
Reported-by: Alexander E. Patrakov <patrakov@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 17:38:20 +01:00
David Henningsson b67ae3f1c9 ALSA: hda - Enable Thinkpad mute/micmute LEDs for Realtek
Same as we already have for Conexant. Right now it's only enabled
for one machine.

Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 13:42:21 +01:00
Clemens Ladisch bbaa0d6665 ALSA: hda: add device IDs for AMD Evergreen/Northern Islands HDMI
The device IDs of the AMD Cypress/Juniper/Redwood/Cedar/Cayman/Antilles/
Barts/Turks/Caicos HDMI HDA controllers weren't added explicitly
because the generic entry works, but it made the device appearing as
"Generic", and people are confused as if it's no proper HDMI
controller.  Add them so that the name shows up properly as "ATI HDMI"
instead of "Generic".

According to Takashi's tests and the lack of complaints, these devices
work fine without disabling snooping.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 10:26:56 +01:00
Takashi Iwai a1114a8c68 ALSA: hda - Introduce the bitmask for excluding output volume
Add a bitmask to hda_gen_spec indicating NIDs to exclude from the
possible volume controls.  That is, when the bit is set, the NID
corresponding to the bit won't be picked as an output volume control
any longer.

Basically this is just a band-aid for working around the issue found
with CS4208 codec, where only the headphone pin has a volume AMP with
different dB steps.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811
Cc: <stable@vger.kernel.org> [v3.12+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 07:49:41 +01:00
Takashi Iwai 485e3e0cdf ALSA: hda - Add sanity check of vmaster slave dB steps
Check whether all vmaster slaves have the same dB steps.  Otherwise
the behavior would become inconsistent.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 07:48:04 +01:00
Takashi Iwai a4e7a12168 ALSA: hda - Fix possible zero-division
Check the TLV db scale result before actually dividing in vmaster
slave init code.  Also mask TLV_DB_SCALE_MUTE bit so that the right
value is obtained even if this bit is set by the codec driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-05 07:47:52 +01:00
Takashi Iwai 24eff328f6 ALSA: hda - Enable SPDIF for Acer TravelMate 6293
BIOS on Acer TravelMate 6293 doesn't set up the SPDIF output pin
correctly as default, so enable it via a fixup entry.

Reported-and-tested-by: Hagen Heiduck <heiduck.suse@fmail.postpro.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-04 21:11:04 +01:00
James Ralston 4eeca499be ALSA: hda - Add Device IDs for Intel Wildcat Point-LP PCH
This patch adds the HD Audio Device IDs for the Intel Wildcat Point-LP PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-04 18:31:54 +01:00
Mengdong Lin 300016b960 ALSA: hda - rename function not_share_unassigned_cvt()
The function name not_share_unassigned_cvt() is opposite to what it does.
This patch renames it to intel_not_share_assigned_cvt(), and addes comments
to explain why some Intel display codecs need this workaround.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-04 14:22:08 +01:00
Anssi Hannula 611885bc96 ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs
NVIDIA HDMI codecs do not seem to follow the Audio Sample Packet (ASP)
channel mapping (as set by verb F32h per HDA specification 7.3.3.41)
when playing back 2-channel audio (CEA CA 0x00).

Basically this means that specifying swapped channels for stereo audio
(FR,FL) does not take effect, and e.g. this command plays back on the
wrong channel:
speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL -s1

Multichannel audio is not affected.

This issue has been confirmed to exist on codec 0x10de0015 by me and on
0x10de0040 by Juho Teperi.

Disable 2ch FL/FR channel swapping on all NVIDIA HDMI codecs that use
the standard HDA channel mapping system. Since this is a very minor
functionality loss, we err on the side of disabling it for newer codecs
as well until any future testing confirms that this issue has been
fixed.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Helped-by: Juho Teperi <juho.teperi@iki.fi>
Cc: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-04 10:10:28 +01:00
Mengdong Lin 023838542d ALSA: hda - not choose assigned converters for unused pins of Valleyview
For Valleyview display codec, if an unused pin chooses an assgined converter
selected by a used pin, playback on the unused pin can also give sound to the
output device of the used pin. It's because data flows from the same convertor
to the display port of the used pin. This issue is same as Haswell.

So this patch avoids using assinged convertors for unused pins.
The related function haswell_config_cvts() is renamed for code reuse.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-01 10:47:16 +01:00
Takashi Iwai 8e38395360 ALSA: hda - Add extra chmap for 2.1 outputs on ASUS laptops
ASUS N56VZ and N76VZ laptops have a bass speaker but its output comes
only from the right channel.  This patch adds the extra chmap specific
to these models.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=846531
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-30 17:41:12 +01:00
Takashi Iwai 8d684b430b Merge branch 'for-linus' into for-next 2013-10-30 17:40:54 +01:00
Takashi Iwai 6fc16e58ad ALSA: hda - Add a fixup for ASUS N76VZ
ASUS N76VZ needs the same fixup as N56VZ for supporting the boost
speaker.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=846529
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-30 12:31:35 +01:00
Takashi Iwai d2e92709e8 ALSA: hda - Disable AA-loopback on ALC283 Chromebook
ALC283-based Chromebook suffers from occasional white noise, and it
turned out that this comes from AA-loopback.  Disable this output path
by just clearing mixer_nid, then the generic parser will skip the
creation of AA-loopback path.

Reported-and-tested-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-30 07:52:44 +01:00
Takashi Iwai ca16ec02e1 ALSA: hda - Remove locally dead codes
Reported by coverity.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29 11:37:30 +01:00
Takashi Iwai 57d8ff617f ALSA: hda - Add a fallthru comment
... to improve the readability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29 11:37:23 +01:00
Takashi Iwai 728deecdd4 ALSA: hda - Fix possible NULL dereference in snd_hda_get_pin_label()
Fix a possible NULL access of indexp in fill_audio_out_name() called
from snd_hda_get_pin_label().

Spotted by coverity CID 402035.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-29 11:37:19 +01:00
Takashi Iwai afb5a77931 ALSA: hda - Sync EAPD with vmaster on AD1984A Thinkpads
As EAPD on NID 0x12 (speaker pin) is used as the master amp on
Thinkpads with AD1984A codec, we can hook this to vmaster for saving a
bit more power at master mute state.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-26 00:33:58 +02:00
Takashi Iwai d601b66616 Merge branch 'for-linus' into for-next 2013-10-26 00:33:02 +02:00
Takashi Iwai 1ac3293095 ALSA: hda - Fix silent headphone on Thinkpads with AD1984A codec
AD1984A codec has a couple of pins with EAPD controls, and the generic
codec driver tries to turn each of them on/off depending on the pin
active state.  However, Thinkpads seem to use EAPD of the speaker pin
as a master EAPD for controlling the mute of all outputs, including
the headphone.  This results in the dead headphone output via the
headphone plugging because it mutes the speaker and turns off EAPD.

The fix is to simply add spec->gen.keep_on_eapd flag.

[This is a regression fix on 3.12 where we moved the AD codec parser
 to the generic parser.  3.11 and earlier didn't show this problem
 because still static quirks have been used.]

Reported-and-tested-by: Vito Caputo <vcaputo@gnugeneration.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-26 00:30:32 +02:00
Takashi Iwai b63eae0a6c ALSA: hda - Add missing initial vmaster hook at build_controls callback
The generic parser has a support of vmaster hook, but this is
initialized only in the init callback with the check of the presence
of the corresponding kctl.  However, since kctl is NULL at the very
first init callback that is called before build_controls callback, the
vmaster hook sync is skipped there.  Eventually this leads to the
uninitialized state depending on the hook implementation.

This patch adds a simple workaround, just calling the sync function
explicitly at build_controls callback.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-25 23:43:10 +02:00
Takashi Iwai 6913a9dbf1 ASoC: Updates for v3.13
- Further work on the dmaengine helpers, including support for
    configuring the parameters for DMA by reading the capabilities of the
    DMA controller which removes some guesswork and magic numbers fromm
    drivers.
  - A refresh of the documentation.
  - Conversions of many drivers to direct regmap API usage in order to
    allow the ASoC level register I/O code to be removed, this will
    hopefully be completed by v3.14.
  - Support for using async register I/O in DAPM, reducing the time taken
    to implement power transitions on systems that support it.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSajLdAAoJELSic+t+oim9MVEQAJ3t7df5K9R/OynjhKiEFxpP
 cBWo306CegZ5oO17UqG+SReJkOWgUI8zIUkNC818suTjtgyhv4WUBx1QgXG8akO5
 arHZEQGyReLxgWbnO5ScP7BJt5ZYldfQWN+NPnNlzwvVA8R4xChvAwuHL+kUSSYW
 DrOb0ag/Gtn2jQo3o9GbZb5c3UhZqoMg/pQSoVtnvG/O8N/xR0yoeXGsdJv1su6g
 OKhCJTRWU8v3FONatR2wWXnSrCBOeJ2Ec7YUJil1FQQdENYZfV3AOsFHxmqsyG2O
 Xj2P7CioY0JY7dtFcKjrXgsnjvgZmVdVsdegTJPWS9RjunjyupvSyhMhZYkoA60j
 V7RxyIbHAx7hILQqCYYhlOczYHom4MSwAGGt7y7T3oKt0432RvIjE2fP7sTGaqD8
 wzuVYuVl4km03xX9g9abF6xjyDE6e+4wun+d8kSvOosvd/nF47gkXUXEvPZh0Ley
 013e5fHNDaNF4uaSVXE169JyVxVnHP6nXJDRWZakXsryGXGUpn0quIzobf6fb6XE
 fY5Q3QoyP5rHdSMIvGN5Gi76KsHF5CWILWqcWLEVPLnaf9gJmrp3IypmF1c8i7VE
 CrcTim5mhNePEX56skRaHhpYHmsxYApSAzxNAA/t3cJ2rtwb87jMM4jOcjHi/war
 emSVe5lXkcwv/lU/Pa0N
 =rVsK
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v3.13

 - Further work on the dmaengine helpers, including support for
   configuring the parameters for DMA by reading the capabilities of the
   DMA controller which removes some guesswork and magic numbers fromm
   drivers.
 - A refresh of the documentation.
 - Conversions of many drivers to direct regmap API usage in order to
   allow the ASoC level register I/O code to be removed, this will
   hopefully be completed by v3.14.
 - Support for using async register I/O in DAPM, reducing the time taken
   to implement power transitions on systems that support it.
2013-10-25 11:43:47 +02:00
Anssi Hannula 7342017f4a ALSA: hda - hdmi: Re-setup pin and infoframe on plug-in on all codecs
hdmi_setup_audio_infoframe() does not set up pin and infoframe if there
is no connected sink. If a sink is connected while audio playback is
already in progress, the pin and infoframe will not be properly set up,
causing no audio or wrongly mapped audio.

On Intel Haswell codecs the hdmi_setup_audio_infoframe() is already
called again from hdmi_present_sense() when an ELD appears because
transcoder:port mapping may have changed.

Make the call non-Haswell-specific so that audio will be properly set up
if the playback was started before a sink was connected.

Tested on non-Haswell Intel HDMI codec by plugging sink in during
playback.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-25 01:03:20 +02:00
Anssi Hannula 84d69e790f ALSA: hda - hdmi: Disable ramp-up/down for non-PCM on AMD codecs
Recent AMD HDMI codecs (revision ID 3 and later, 0x100300 as reported by
procfs codec#0) have a configurable ramp-up/down functionality.

The documentation ( http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf )
specifies that 180 ("180/256 =~ 0.7") is recommended for PCM and 0 for
non-PCM.

Apply the recommended values according to provided S/PDIF AES0 settings
since ramp-up/down does not make sense for non-PCM.

v2: adapted to hdmi_ops infrastructure

* More note from Anssi:
actually, re-reading mails reveals that Olivier didn't find the
expected difference with this setting, except for "maybe slightly
slower startup with AES0=6" (i.e. value 0, which is unexpected).

So maybe
a) it makes too unnoticiable a difference, or
b) only affects certain hardware (card and/or sink), or
c) ramp-up/down is only triggered with the MUTE bit of
   ATI_VERB_SET_MULTICHANNEL_xx which is also rev3+ specific,
   but is not presently used by the driver,
or something else.

So there's a significant chance setting ramp rate is useless for us ATM,
but probably does not do actual harm either.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Olivier Langlois <olivier@trillion01.com> # v1
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 22:57:32 +02:00
Anssi Hannula 461cf6b39d ALSA: hda - hdmi: Add HBR bitstreaming support for ATI/AMD HDMI codecs
ATI/AMD HDMI codecs do not include standard HDA HDMI HBR support (which
is required for bitstreaming DTS-HD and Dolby TrueHD), instead they have
custom verbs for checking and enabling it.

Add support for the ATI/AMD HDMI HBR verbs.

The specification is available at:
http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf

v2: adapted to hdmi_ops infrastructure

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Peter Frühberger <fritsch@xbmc.org> # v1
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 22:54:56 +02:00
Anssi Hannula 89250f8464 ALSA: hda - hdmi: Add ELD emulation for ATI/AMD codecs
ATI/AMD HDMI/DP codecs do not include standard HDA ELD (EDID-like data)
support.

In place of providing access to an ELD buffer, various vendor-specific
verbs are provided to provide the relevant information. Revision ID 3
and later (0x100300 as reported by procfs codec#X) have support for
providing more information than the previous revisions (but only if
supported by the display driver).

Generate ELD from the information provided by the vendor-specific verbs
on ATI/AMD codecs.

The specification is available at:
http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf

v2: moved code to hda_eld.c and cleaned it up
v3: adapted to hdmi_ops infrastructure

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Peter Frühberger <fritsch@xbmc.org> # v2
Tested-by: Olivier Langlois <olivier@trillion01.com> # v2
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 22:54:13 +02:00
Anssi Hannula 5a61358433 ALSA: hda - hdmi: Add ATI/AMD multi-channel audio support
ATI/AMD codecs do not support all the standard HDA HDMI/DP functions,
instead various vendor-specific verbs are provided.

This commit addresses these missing functions:
- standard channel mapping support
- standard infoframe configuration support

ATI/AMD provides their own verbs that allow the following:
- setting CA for infoframe
- setting down-mix information for infoframe
- channel pair remapping
- individual channel remapping (revision ID 3+, 0x100300+)

The documentation for the verbs has now been released by AMD:
http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf

Add support for the ATI/AMD specific verbs and use them instead of the
generic methods on ATI/AMD codecs. This allows multi-channel PCM audio
to work.

Channel remapping is restricted to pairwise mapping on codecs with
revision ID 2 (0x100200 as reported by procfs codec#X) or lower. This
means cards up to Radeon HD7670 as far as I know. This will not affect
standard multi-channel modes since these codecs support automatic
FC-LFE swapping for HDMI.

ATI/AMD codecs do not advertise all of their supported rates, formats
and channel counts, therefore that information is forced accordingly so
that all HDMI 1.x PCM parameters are marked as supported.

Support for multiple ports is also added to patch_atihdmi so that
0x1002aa01 codecs with multiple ports will work properly when switched
back to that patch.

v2: splitted ELD emulation to a separate patch, tlv fixes
v3: adapted to the new hdmi_ops infrastructure, fixed rev3+ vendor id

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Peter Frühberger <fritsch@xbmc.org> # v2
Tested-by: Olivier Langlois <olivier@trillion01.com> # v2+rev3fix
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 22:53:43 +02:00
Anssi Hannula 307229d2ac ALSA: hda - hdmi: Allow HDA patches to customize more operations
Upcoming AMD multichannel support requires many customized operations
(channel mapping, ELD, HBR) but can otherwise share most of its code
with the generic patch.

Add a local struct hdmi_ops containing customizable HDMI-specific
callbacks and move the current code to those callbacks. Functionality is
unaltered.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 22:52:53 +02:00
Kailang Yang 88011c0911 ALSA: hda/realtek - Raise the delay for alc283_shutup
Some machine with 85ms delay might be happen pop noise when codec
enter to D3.  Raise up to 100ms delay will be match for more machine.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 15:45:24 +02:00
Takashi Iwai 95f74c41b2 ALSA: hda - Fix mute LED on HP laptops in runtime suspend
When HP laptops with mute and mic-record LEDs go to runtime suspend,
these LEDs are turned on forcibly no matter whether GPIO pis are on or
off.  This strange behavior seems triggered by resetting the HD-audio
bus link at azx_rutime_suspend().  So, just add a new hda_bus flag to
avoid the link reset at runtime suspend and set it for these HP
machines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 11:37:33 +02:00
Kailang Yang 161ebf295e ALSA: hda - Add support of ALC285 / ALC293 codecs
Yet another variants of ALC269.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 11:36:33 +02:00
Kailang Yang 1d04c9de5c ALSA: hda - Add support of ALC255 codecs
It's just another variant of ALC269 & co.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 11:35:18 +02:00
Joe Perches b7baa9a0e3 ALSA: hda - Remove OOM message after input_allocate_device
Emitting an OOM message isn't necessary after input_allocate_device
as there's a generic OOM and a dump_stack already done.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 11:26:07 +02:00
Takashi Iwai e6bbe66667 ALSA: hda - Fix unbalanced runtime PM refcount after S3/S4
When a machine goes to S3/S4 after power-save is enabled, the runtime
PM refcount might be incorrectly decreased because the power-down
triggered soon after resume assumes that the controller was already
powered up, and issues the pm_notify down.

This patch fixes the incorrect pm_notify call simply by checking the
current value properly.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-24 09:21:45 +02:00
Takashi Iwai b55447a730 ALSA: hda - Fix typos in patch_hdmi.c
... which was introduced by the previous commit a4e9a38b, causing
build errors without CONFIG_PROC_FS.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-21 16:31:45 +02:00
Mengdong Lin cc1a95d9f6 ALSA: hda - add codec ID for Valleyview2 display codec
This patch adds codec ID (0x80862882) and module alias for
Valleyview2 display codec.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-21 12:30:38 +02:00
Takashi Iwai a4e9a38b40 ALSA: hda - Move mutex from hda_eld to per_pin in HDMI codec driver
Since the lock is used primarily in patch_hdmi.c, it's better to move
it in the local struct instead of exporting in hda_eld.  The only
functions requiring the lock in hda_eld.c are proc accessors.  So in
this patch, the proc entry and its creation/deletion/accessors are
moved into patch_hdmi.c, together with the mutex lock to pin_spec
struct.

The former proc info functions are exported so that they can be called
from patch_hdmi.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:23:45 +02:00
Takashi Iwai cbbaa603a0 ALSA: hda - Fix possible races in HDMI driver
Some per_pin fields and ELD contents might be changed dynamically in
multiple ways where the concurrent accesses are still opened in the
current code.  This patch fixes such possible races by using eld->lock
in appropriate places.

Reported-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:23:40 +02:00
Takashi Iwai 4758fed912 ALSA: hda - Treat zero connection as non-error
The zero-length connection list happens so often on Haswell HDMI, and
it results in warning messages like
    ALSA: hda_codec: invalid CONNECT_LIST verb 5[1]:0
at each time the codec resumes from the power-save, which is fairly
annoying.

Since this is no real error, make it shown only in the verbose debug
mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:21:52 +02:00
David Henningsson 08cf680cca ALSA: hda - add connection to thinkpad_acpi to control mute/micmute LEDs
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:39:03 +02:00
David Henningsson 360fec281e ALSA: hda - add HDA_FIXUP_ACT_FREE action
A fixup which should be called before codec being freed will come
to use in the next patch.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:38:54 +02:00
David Henningsson ccb041571b ALSA: hda - Fix inverted internal mic not indicated on some machines
The create_bind_cap_vol_ctl does not create any control indicating
that an inverted dmic is present. Therefore, create multiple
capture volumes in this scenario, so we always have some indication
that the internal mic is inverted.

This happens on the Lenovo Ideapad U310 as well as the Lenovo Yoga 13
(both are based on the CX20590 codec), but the fix is generic and
could be needed for other codecs/machines too.

Thanks to Szymon Acedański for the pointer and a draft patch.

BugLink: https://bugs.launchpad.net/bugs/1239392
BugLink: https://bugs.launchpad.net/bugs/1227491
Reported-by: Szymon Acedański <accek@mimuw.edu.pl>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-14 10:30:49 +02:00
David Henningsson fbc78ad624 ALSA: hda - Sony VAIO Pro 13 (haswell) now has a working headset jack
Just got the positive confirmation from a tester:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1227093/comments/28

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-11 13:49:43 +02:00
David Henningsson 7c478f0337 ALSA: hda - Add a headset mic model for ALC269 and friends
Using the headset mic model will cause the headset mic to be labeled
"headset mic" instead of just "mic".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-11 10:23:49 +02:00
David Henningsson 88cfcf86aa ALSA: hda - Fix microphone for Sony VAIO Pro 13 (Haswell model)
The external mic showed up with a precense detect of "always present",
essentially disabling the internal mic. Therefore turn off presence
detection for this pin.

Note: The external mic seems not yet working, but an internal mic is
certainly better than no mic at all.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1227093
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-11 10:23:42 +02:00
David Henningsson cd4035e814 ALSA: hda - Enable surround speakers (when line out is also present)
In the case where we have both line out and more than stereo speakers,
the speaker DACs will end up in extra_out_nid.
In fact, AFAIU, speakers are the only ones that can end up in extra_out_nid,
and if we have several of those, they should be surround outputs
rather than copy front.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-10 09:47:58 +02:00
Takashi Iwai c6cc3d58b4 ALSA: hda - Add fixup for ASUS N56VZ
ASUS N56VZ needs a fixup for the bass speaker pin, which was already
provided via model=asus-mode4.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=841645
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-08 19:57:50 +02:00
Takashi Iwai d820306cbe Merge branch 'for-linus' into for-next
For updating the HDMI chmap fix.

Conflicts:
	sound/pci/hda/patch_hdmi.c
2013-10-08 09:30:04 +02:00
Anssi Hannula 39edac70e9 ALSA: hda - hdmi: Fix channel map switch not taking effect
Currently hdmi_setup_audio_infoframe() reprograms the HDA channel
mapping only when the infoframe is not up-to-date or the non-PCM flag
has changed.

However, when just the channel map has been changed, the infoframe may
still be up-to-date and non-PCM flag may not have changed, so the new
channel map is not actually programmed into the HDA codec.

Notably, this failing case is also always triggered when the device is
already in a prepared state and a new channel map is configured while
changing only the channel positions (for example, plain
"speaker-test -c2 -m FR,FL").

Fix that by always programming the channel map in
hdmi_setup_audio_infoframe(). Tested on Intel HDMI.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-08 09:27:26 +02:00
Anssi Hannula 980b24958f ALSA: hda - hdmi: Tweak debug messages to be more useful
Allow channel map debugging for both automatic and manual channel maps,
and print CA always when updating infoframe.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:49:25 +02:00
Anssi Hannula bb731f2100 ALSA: hda - hdmi: Fix available channel maps missing from TLV
Currently the available channel maps TLV only contains channel maps that
are limited to the traditional 7.1 speakers.

Since the other HDMI channel mapping functions have been fixed to
properly handle all CEA-861-E specified speakers, allow them to be
listed.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:49:13 +02:00
Anssi Hannula a5b7d510b2 ALSA: hda - hdmi: Fix channel maps with less common speakers
For some speakers and slots the CEA slot <-> speaker assignment depends
on the used CEA Channel Allocation value.

Therefore the from_cea_slot() and to_cea_slot() helpers currently only
work correctly for the regular 7.1 speakers.

Fix them to work with all speakers, taking the re-ordered CA index as
input and adapting use sites accordingly.

This change allows manual channel mapping to actually work for all CEA
allocated speakers. Additionally, this fixes incorrect channel map
reporting in automatic channel mapping mode when an affected speaker
position is used (e.g. 6.1 map which contains an RC speaker).

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:48:15 +02:00
Anssi Hannula 11f7c52d90 ALSA: hda - hdmi: Fix unused slots being enabled in manual and non-PCM mappings
hdmi_manual_setup_channel_mapping() and hdmi_std_setup_channel_mapping
try to assign ALSA channels to HDMI channel slots and disable (i.e.
silence) other slots.

However, they try to disable a slot by using AC_VERB_SET_CHAN_SLOT with
parameter ((alsa_ch << 8) | 0xf), while the correct parameter is
((0xf << 8) | hdmi_slot), i.e. the slot should be unassigned, not the
ALSA channel.

Fix that by actually disabling the unused slots.

Note that this bug did not cause any (reported) issues because slots
incorrectly having audio are normally ignored by a receiver if the CEA
channel allocation used does not map that slot to any speaker.
Additionally, the converter channel count configuration limits the
number of actually active channels in any case.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:47:30 +02:00
Anssi Hannula 1df5a06abb ALSA: hda - hdmi: Fix programmed active channel count
Currently the converter channel count is set to the number of actual
input channels. The audio infoframe channel count field is set
similarly.

However, sometimes the used channel map does not map all input channels
to outputs. Notably, 3 channel modes (e.g. 2.1) require a dummy input
channel so there are 4 input channels. According to the HDA
specification, converter channel count should be programmed according to
the number of _active_ channels.

On Intel HDMI codecs (but not on NVIDIA), setting the converter channel
to a higher value than there are actually mapped channels to HDMI slots
will cause no audio to be output at all.

Note that the effects of this issue are currently partially masked by
other bugs that prevent the driver from actually unmapping channels in
certain cases. For example, if a 4 channel stream is first created and
prepared, it gets a FL,FR,RL,RR mapping (ALSA->HDMI slot mapping 0->0,
1->1, 2->4, 3->5). If one thereafter assigns a FR,FL,FC mapping to it,
the driver will remap 2->3 but fail to unmap 2->4 and 3->5, so there are
still 4 active channels and the issue will not trigger in this case.
These bugs will be fixed separately.

Fix the channel counts in the converter channel count field and in the
audio infoframe channel count field to match the actual number of active
channels.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:47:06 +02:00
Anssi Hannula 90f2800211 ALSA: hda - hdmi: Fix incorrect default channel mapping for unusual CAs
hdmi_std_setup_channel_mapping() selects a Channel Allocation according
to the sink reported speaker mask, preferring the ALSA standard layouts.

If the channel allocation is not one of the ALSA standard layouts, the
ALSA channels are mapped directly to HDMI channels in order. However,
the function does not take into account that there a holes in the HDMI
channel map.

Additionally, the function tries to disable a slot by using
AC_VERB_SET_CHAN_SLOT with parameter ((alsa_ch << 8) | 0xf), while the
correct parameter is ((0xf << 8) | hdmi_slot), i.e. the slot should be
unassigned, not the ALSA channel.

Fix both of the issues for non-ALSA-default layouts.

Tested on Intel HDMI with a speaker mask of FL | FR | FC | RC, which
causes CA 0x06 to be selected for 4-channel audio, which causes
incorrect output (sound destined to RC goes to FC and FC goes nowhere)
without the patch.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:46:26 +02:00
Anssi Hannula 56cac413dd ALSA: hda - hdmi: Fix reported channel map on common default layouts
hdmi_setup_fake_chmap() is supposed to set the reported channel map when
the channel map is not specified by the user.

However, the function indexes channel_allocations[] with a wrong value
and extracts the wrong nibble from hdmi_channel_mapping[], causing wrong
channel maps to be shown.

Fix those issues.

Tested on Intel HDMI to correctly generate various channel maps, for
example 3,4,14,15,7,8,5,6 (instead of incorrect 3,4,8,7,5,6,14,0) for
standard 7.1 channel audio. (Note that the side and rear channels are
reported as RL/RR and RLC/RRC, respectively, as per the CEA-861
standard, instead of the more traditional SL/SR and RL/RR.)

Note that this only fixes the layouts that only contain traditional 7.1
speakers (2.0, 2.1, 4.0, 5.1, 7.1, etc.). E.g. the rear center of 6.1
is still being shown wrongly due to an issue with from_cea_slot()
which will be fixed in a later patch.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:46:00 +02:00
David Henningsson 338cae565c ALSA: hda - Fix mono speakers and headset mic on Dell Vostro 5470
On this machine, DAC on node 0x03 seems to give mono output.

Also, it needs additional patches for headset mic support.
It supports CTIA style headsets only.

Alsa-info available at the bug link below.

Cc: stable@kernel.org (v3.10+)
BugLink: https://bugs.launchpad.net/bugs/1236228
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 10:49:37 +02:00
Takashi Iwai 4a4370442c ALSA: hda - Fix GPIO for Acer Aspire 3830TG
Acer Aspire 3830TG seems requiring GPIO bit 0 as the primary mute
control.  When a machine is booted after Windows 8, the GPIO pin is
turned off and it results in the silent output.

This patch adds the manual fixup of GPIO bit 0 for this model.

Reported-by: Christopher <DIDI2002@web.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-30 12:18:36 +02:00
Kailang Yang 1bb3e062d4 ALSA: hda - Enable internal mic on a Thinkpad machine with ALC283
More thorough testing showed that these verbs were necessary to
improve quality of the internal mic. Patch originally from Realtek.

BugLink: https://bugs.launchpad.net/bugs/1231931
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-27 14:10:52 +02:00
Kailang Yang 068fd3a081 ALSA: hda - Fix Internal Mic boost can't control with ALC283
ALC283 pin control for Line1 default control by hidden register.
Use line1 as internal Mic will not get sound when boost value up.
Set control by verb for hidden register will solve this issue.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-27 14:04:05 +02:00
Ben Whitten b5bf0a929d ALSA: hda - Add fixup for MacBook Air 6,1 and 6,2 with CS4208 codec
This patch adds the default pin configuration and some init verbs for
setting COEFs, in addition to the correction of input pin AMP caps
for MacBook Air 6,1 and 6,2.  With these changes, the headphone jack
detection starts working properly.

[trivial space fixes by tiwai]

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811
Signed-off-by: Ben Whitten <benwhitten@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-27 10:17:44 +02:00
Takashi Iwai e8bc99425e Merge branch 'for-linus' into for-next
* for-linus:
  ALSA : hda - not use assigned converters for all unused pins
  ALSA: compress: Make sure we trigger STOP before closing the stream.
2013-09-26 10:23:31 +02:00
Mengdong Lin f82d7d16ae ALSA : hda - not use assigned converters for all unused pins
BIOS can mark a pin as "no physical connection" if the port is used by an
integrated display which is not audio capable. And audio driver will overlook
such pins.

On Haswell, such a disconneted pin will keep muted and connected to the 1st
converter by default. But if the 1st convertor is assigned to a connected pin
for audio streaming. The muted disconnected pin can make the connected pin
no sound output.

So this patch avoids using assigned converters for all unused pins for Haswell,
including the disconected pins.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-26 10:22:49 +02:00
Takashi Iwai 43cdd088b1 Merge branch 'for-linus' into for-next 2013-09-19 18:46:43 +02:00
Sachin Kamat 399ae7254e ALSA: hda/ca0132: Staticize codec_send_command
'codec_send_command' is used only in this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-13 14:36:32 +02:00
Linus Torvalds decf7abcc9 sound fixes for 3.12-rc1
A few last-minute fixes for 3.12-rc1.  All patches are driver specific.
 
 - HD-audio fixes: MacBook 6,1/6,2 speaker fix, ASUS TX300 dock speaker
   fix, Toshiba Satellite irq fix, Haswell HDMI audio cleanups)
 
 - ASoC fixes: atmel irq fix, fsl DT fix, mc13783 spi fix, kirkwood
   compatible string change, etc
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJSMWJeAAoJEGwxgFQ9KSmkkLsP/RMeleT18hbZEhdSZsJaqErg
 p6Dk59fb28HrQrY/ECcZnBChGFgCagS316lBjuEkDtQmZdhYtIDHV9r/udV4MbFc
 rX4IVNv1JerpCyZu4pC0yngHiEX3NMBmu204RJBC8vzJt3fupTFIioliNQlmMuiR
 k6Kb9kGmNHLtA7LwshHwNs8JwXEJHUcnsBGdPB0BUy8BpZ8FVTIOvuBixpxv9kXm
 +n80KRhY/YBjpU+bTvGTgJhH7U3BXylU20q5cO2ukv8vW79LGNZ0XA5Rnerrlr/F
 fvDzg+liOEV8ijchfS9rhs28J+4ICHmFkY/rj7QFpVpP9xYfpqhvw93KmIACirDX
 DlJt63fOJuHbGEv5cGjAmdZXcKONoD9fG11CKDj46Fm4borNy7DdfmMLxNM3xo5q
 rxbgUWplCDHFRALXATJ3t8Occz71l2W+GjklmI7td8K5SD6JCzSI1GdR4YVVf76B
 Wd6AM3wpIGKdjCwZvT5jDBb/4O8ZMtOqEhxvBKI1eO4l+A3UbqWlBKyncfvpKBqY
 yHTBIOgF5QdtUMVSI0/hb64nzmOGHLAWxQoCZssvSFEV6P+jodrqGGayxvbM+6rU
 YR2w2omh+6UkacQvjyVWGehBHiYCECfl0kk9XmPVkIGgHmOdgvkv1/MMbPeEcoXv
 z2YGcgbOIBpNrLcgTev4
 =fKdg
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A few last-minute fixes for 3.12-rc1.  All patches are driver
  specific.

   - HD-audio fixes: MacBook 6,1/6,2 speaker fix, ASUS TX300 dock
     speaker fix, Toshiba Satellite irq fix, Haswell HDMI audio
     cleanups)

   - ASoC fixes: atmel irq fix, fsl DT fix, mc13783 spi fix, kirkwood
     compatible string change, etc"

* tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: mc13783: add spi errata fix
  ASoC: rsnd: fixup flag name of rsnd_scu_platform_info
  ALSA: hda - Add CS4208 codec support for MacBook 6,1 and 6,2
  ALSA: hda - Add Toshiba Satellite C870 to MSI blacklist
  ASoC: fsl_spdif: Select regmap-mmio
  ALSA: hda - unmute pin amplifier in infoframe setup for Haswell
  ALSA: hda - define is_haswell() to check if a display audio codec is Haswell
  ALSA: hda - Add dock speaker support for ASUS TX300
  ASoC: kirkwood: change the compatible string of the kirkwood-i2s driver
  ASoC: atmel: disable error interrupt
  ASoC: fsl: imx-audmux: Do not call imx_audmux_parse_dt_defaults() on non-dt kernel
2013-09-12 08:52:41 -07:00
Takashi Iwai 3d0049e852 ASoC: Fixes for v3.12
A few small fixes, nothing with any broad impact but all useful for the
 affected systems.  The Kirkwood compatible string change is fixing up a
 string just added in the merge window so that we don't get any changes
 in released kernels.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSMEN7AAoJELSic+t+oim9fUcP/2/JSlEzCnf9mnIVu5JUb4o0
 N9sqvZ3FuBmB2s+X7XdzHHatn/SRcj8bdPIUDyghsM+Ax6inzHCkLLxF0gMfgo1k
 YmbVamD9x+Odj7ovs/M7/pRji9vBUFRmTdh6DnxIcQUGyuZRIMEIYxgnu//tXQ6+
 vL2dJ3d3S37k4NtqHebKf1iL4ExGMAkp6f7Rig3YXc/N+jc8O/uUWAitfvBnzuBH
 ZlFTCxkHhZ9mYi/xRBUSOFbb96bQnHN2KQ3soss1xDKhJVpjuo1rOWfTZE9c7bMY
 OvqsMJDwaPNiCF0UzdCPQ1SMdE8r8U2lMMjyeQN76R9tqSVBtgxPeLvjzN0l3Xkf
 mnHd1LZXGOF5cSfrA/Diy4leFk0A0pJQSxdDt54vlRcCG3aV7IRJOkPi4C0tMHQE
 hkXOfgF6XERDsNV4RgzangAAvjKeXPqItWITZx+qtK7AxtCC6xpMc5EHV4wbFmTP
 bYz6oKBehQy5gaI/z5Ad0mU1JK1vJH6n2ENtu/zNxBzfHIiyhF5fBPSuE+IGxvJf
 /ANQf44DkkXLHZv5766lYUbldGmFYbiva2us+uDxaEfjSW5DDSSn/aYn73IsYJ16
 L5MsX0s/J2o/i10kuXPlWMWIkoat1Y2vDUrdjg1xQ1IrkZRAZDnIYJz4yS8TwNyT
 8rToadF2zYPKxwDVb37E
 =oTEO
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v3.12

A few small fixes, nothing with any broad impact but all useful for the
affected systems.  The Kirkwood compatible string change is fixing up a
string just added in the merge window so that we don't get any changes
in released kernels.
2013-09-11 12:38:45 +02:00
Mark Brown c34c0d7684 Merge remote-tracking branch 'asoc/fix/fsl' into asoc-linus 2013-09-11 11:17:15 +01:00
Takashi Iwai be8cf44526 ALSA: hda - Add CS4208 codec support for MacBook 6,1 and 6,2
MacBook 6,1 and 6,2 have a CS4208 codec instead of CS4206/CS4207 on
the former models.  Most of functions work fine as is, except for the
silent speaker output.  After debugging sessions, it turned out that
the machine needs to set GPIO 0 for the speaker amp.

This patch adds the basic support for CS4208 and the fixup for these
MacBooks.  Basically the codec works just with the generic parser.
For re-using the existing GPIO amp code and init/free callbacks, a few
places have been changed so that CS4206/4207-specific codes (errata,
etc) won't hit with CS4208.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60811
Reported-and-tested-by: Imre Kaloz <kaloz@openwrt.org>
Reported-and-tested-by: Ian Munsie <darkstarsword@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-09 16:09:57 +02:00
Takashi Iwai 83f7215135 ALSA: hda - Add Toshiba Satellite C870 to MSI blacklist
Toshiba Satellite C870 shows interrupt problems occasionally when
certain mixer controls like "Mic Switch" is toggled.  This seems
worked around by not using MSI.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=833585
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-09 10:20:48 +02:00
Mengdong Lin 58f7d28da6 ALSA: hda - unmute pin amplifier in infoframe setup for Haswell
When Gfx driver reconnects a port and transcoder, the pin amplifier will
be muted. To enable sound, the pin amp need to be unmuted.

This patch
- moves pin amp unmuting from stream preparing to hdmi_setup_audio_infoframe().
  So if port:transcoder reconnection happens during stream playback, the ELDV
  unsol event can stil trigger pin's amp unmuting when re-setting up audio
  info frame.

- remove reading pin amp status before unmuting for speed-up, since pin amp
  should always be unmuted.

- rename haswell_verify_pin_D0() to haswell_verify_D0(), since the convertor
  power state is also fixed here.

This patch is mostly based on suggestion of David Henningsson.

Cc: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-06 18:23:54 +02:00
Mengdong Lin fb87fa3a79 ALSA: hda - define is_haswell() to check if a display audio codec is Haswell
To apply Haswell specific fixings, this patch defines is_haswell() to check
whether a display audio codec is Haswell, to avoid explicitly checking Haswell
vendor ID everywhere.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-06 18:23:38 +02:00
Takashi Iwai 7bba2157c5 ALSA: hda - Add dock speaker support for ASUS TX300
ASUS TX300 has a built-in speaker in the tablet part and in the dock
part, and the tablet speaker is supposed to be unused while the
machine is docked.  The current HD-audio driver, however, doesn't
support the dock speaker, partly because BIOS doesn't set up the pin
for the corresponding output.

But, not only the missing pin config, also the missing unsol event
handling is another issue.  Otherwise the automatic switching via
dock/undock won't work.

Through debugging sessions, we found out that the dock speaker pin is
NID 0x1b, and it generates an unsol event at docking/undocking, the
docking state can be inquired via the normal pin detection verb.
Also, it's turned out that GPIO 2 is needed as an amp.  So, all
materials are ready to cook.

This patch provides the basic dock speaker support with TX300:
- The dock speaker is turned on/off via "Dock Speaker" mixer mute.
- The dock speaker is automatically muted when docked.  This is
  independently from the mixer mute switch, just like the headphone
  auto-mute function.

The implementation is a bit tricky.  Since we want to handle it as a
secondary speaker, we set it up a pin as a speaker with a jack
detection.  Then, the fixup function registers the own unsol callback
for this pin because the standard automute can't handle the thing like
a "speaker jack".  In the own automute hook, we apply the mute of the
tablet speaker in addition by checking the dock state.

Also, the speaker control names are slightly shuffled because the
generic parser doesn't give good names but blindly assumes a bass
speaker as a secondary speaker.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59791
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-06 15:54:42 +02:00
Linus Torvalds a09e9a7a4b Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm tree changes from Dave Airlie:
 "This is the main drm pull request, I have some overlap with sound and
  arm-soc, the sound patch is acked and may conflict based on -next
  reports but should be a trivial fixup, which I'll leave to you!

  Highlights:

   - new drivers:

     MSM driver from Rob Clark

   - non-drm:

     switcheroo and hdmi audio driver support for secondary GPU
     poweroff, so drivers can use runtime PM to poweroff the GPUs.  This
     can save 5 or 6W on some optimus laptops.

   - drm core:

     combined GEM and TTM VMA manager
     per-filp mmap permission tracking
     initial rendernode support (via a runtime enable for now, until we get api stable),
     remove old proc support,
     lots of cleanups of legacy code
     hdmi vendor infoframes and 4k modes
     lots of gem/prime locking and races fixes
     async pageflip scaffolding
     drm bridge objects

   - i915:

     Haswell PC8+ support and eLLC support, HDMI 4K support, initial
     per-process VMA pieces, watermark reworks, convert to generic hdmi
     infoframes, encoder reworking, fastboot support,

   - radeon:

     CIK PM support, remove 3d blit code in favour of DMA engines,
     Berlin GPU support, HDMI audio fixes

   - nouveau:

     secondary GPU power down support for optimus laptops, lots of
     fixes, use MSI, VP3 engine support

   - exynos:

     runtime pm support for g2d, DT support, remove non-DT,

   - tda998x i2c driver:

     lots of fixes for sync issues

   - gma500:

     lots of cleanups

   - rcar:

     add LVDS support, fbdev emulation,

   - tegra:

     just minor fixes"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (684 commits)
  drm/exynos: Fix build error with exynos_drm_connector.c
  drm/exynos: Remove non-DT support in exynos_drm_fimd
  drm/exynos: Remove non-DT support in exynos_hdmi
  drm/exynos: Remove non-DT support in exynos_drm_g2d
  drm/exynos: Remove non-DT support in exynos_hdmiphy
  drm/exynos: Remove non-DT support in exynos_ddc
  drm/exynos: Make Exynos DRM drivers depend on OF
  drm/exynos: Consider fallback option to allocation fail
  drm/exynos: fimd: move platform data parsing to separate function
  drm/exynos: fimd: get signal polarities from device tree
  drm/exynos: fimd: replace struct fb_videomode with videomode
  drm/exynos: check a pixel format to a particular window layer
  drm/exynos: fix fimd pixel format setting
  drm/exynos: Add NULL pointer check
  drm/exynos: Remove redundant error messages
  drm/exynos: Add missing of.h header include
  drm/exynos: Remove redundant NULL check in exynos_drm_buf
  drm/exynos: add device tree support for rotator
  drm/exynos: Add missing includes
  drm/exynos: add runtime pm interfaces to g2d driver
  ...
2013-09-05 10:17:26 -07:00
Linus Torvalds 977dbfcf8e sound updates for 3.12-rc1
- HDPM: Updates for AIO/RayDAT support, TCO/sync support
 
 - RME96: Add PCM sync support
 
 - HD-audio:
   * A few HDMI/DP audio updates (CA assignment fix, stream switching
     fix, Intel DP device list support)
   * Device specific fixes (ASUS/CXT HP mic support, Thinkpad mic
     improvements, Chromebook fixes, STAC9228 Dell fixes)
   * Replace the all static quirks for AD codecs with the generic
     parser
   * WAKEEN support for handling irqs in the power saving mode
 
 - USB-audio: Clean up implicit fb handling and related codes
 
 - DAPM is now mandatory for ASoC CODEC drivers; all existing drivers
   have had some level of DAPM support added.  In addition, a lot of
   cleanups and improvements in DAPM.
 
 - Support for ASoC cross-platform compile test
 
 - New drivers and support for Analog Devices ADAU1702 and ADAU1401(a),
   Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based
   machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung
   Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson
   Microelectronics WM8997
 
 - DT bindings for kirkwood and i.MX S/PDIF
 
 - Clean up and bug fixes: ssm2602, rt5640 and sgtl5000.
 
 - Core helpers for bitbanged AC'97 reset
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJSJ2E+AAoJEGwxgFQ9KSmkQQgP/izfCaTbvFsFOCwn8V8qgKCv
 fBnakk1IQp7vaMxx1g0wall9clZbnae7sCgst5aCeLjCglzIUHqgsX5xr23QQfPF
 WEVzW2LhrTmrRIVDnG0v1W5gUaYJk8H6qyMOkVWGtZvpn1M88TbJDv+P2ff3VqqU
 G1yqeogXGduForHkhDw2TCvnu5WNQGWtvd5O+QtT8kqWqUWqM5sWBbdl1oMpQUnm
 0/YmFDSkNRSi8tXerYnfUf1qQuh40efHJ2oql3vfh8+I8nwPqZWScl5e+IwfgBPb
 azF0oeQM++R8/iZ89vk3hwndKzSN1y6Ok47gM2v+PwcJYoaEGDuIP8mVklUNQR9v
 ZK1n6AwlyxGH8snBKBX9upqcuT2xycBleh4sYw/t61/T4ne9L7WYY6a69dIetZ5e
 ALbzI1UP12S0oWiot/mqOcVLEneRNgKAD+K6Xcq7MYEA4g3MXbwWNrQRKRk3Hy5b
 BDWh39lb7Uh/v+D81UJEfy1UgsSOunUdsGV6AAsam9THW47+2+gO10MvALNueJhH
 QGOUVapLS553i6i7dZPj1tdumM8AKiqTRE9Bgsn4nWS3jOLtaO7EajOHoBha1JuG
 S9IxAMgI8y6h2ZXBTcdGrTFBjvbN9o0S3xYTAG0Z1hWGPTbKCxkpopZdbmHs1qJi
 Xsy9nBk9Dg2DEKDnZ555
 =wbLt
 -----END PGP SIGNATURE-----

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

Pull sound updates from Takashi Iwai:
 "Changes are seen in a wide range of codes, mainly due to ASoC DAPM
  requirements; HD-audio shows a high peak in diffstat, it's just a
  removal of bunch of old static quirks.

  Some highlights:

   - HDPM: Updates for AIO/RayDAT support, TCO/sync support

   - RME96: Add PCM sync support

   - HD-audio:

     * A few HDMI/DP audio updates (CA assignment fix, stream switching
       fix, Intel DP device list support)
     * Device specific fixes (ASUS/CXT HP mic support, Thinkpad mic
       improvements, Chromebook fixes, STAC9228 Dell fixes)
     * Replace the all static quirks for AD codecs with the generic
       parser
     * WAKEEN support for handling irqs in the power saving mode

   - USB-audio: Clean up implicit fb handling and related codes

   - DAPM is now mandatory for ASoC CODEC drivers; all existing drivers
     have had some level of DAPM support added.  In addition, a lot of
     cleanups and improvements in DAPM.

   - Support for ASoC cross-platform compile test

   - New drivers and support for Analog Devices ADAU1702 and
     ADAU1401(a), Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and
     WM8904 based machines, Freescale S/PDIF and SSI AC'97, Renesas
     R-Car SoCs, Samsung Exynos5420 SoCs, Texas Instruments PCM1681 and
     PCM1792A and Wolfson Microelectronics WM8997

   - DT bindings for kirkwood and i.MX S/PDIF

   - Clean up and bug fixes: ssm2602, rt5640 and sgtl5000.

   - Core helpers for bitbanged AC'97 reset"

* tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (375 commits)
  ALSA: hda - Re-setup HDMI pin and audio infoframe on stream switches
  ALSA: hda - hdmi: Fallback to ALSA allocation when selecting CA
  ASoC: mxs-sgtl5000: Configure the dai_links as unidirectional
  ASoC: soc-pcm: Allow to specify unidirectional dai_link
  ASoC: fsl_spdif: Staticse non-exported symbols
  ASoC: ssm2602: Fix cache sync
  ASoC: Remove unused sysfs_registered field from snd_soc_codec struct
  ASoC: Remove unused debugfs_dapm field from snd_soc_{platform,codec} struct
  ASoC: Remove unused control_type field from snd_soc_codec struct
  ASoC: fsl: Add one blank space after ':=' in Makefile
  ASoC: fsl: Add wrapping for dev_dbg() in fsl_spdif.c
  ASoC: rt5640: change widget sequence for depop
  ASoC: dapm: Fix auto-disable for inverted controls
  ASoC: fsl: Drop SND_SOC_FSL_UTILS from SND_SOC_IMX_SPDIF
  ASoC: Samsung: Do not queue cyclic buffers multiple times
  ASoC: ep93xx-i2s: Remove unnecessary dev_set_drvdata()
  ASoC: designware_i2s: Remove unnecessary dev_set_drvdata()
  ASoC: fsl_spdif: remove redundant dev_err call in fsl_spdif_probe()
  ASoC: fsl: Add S/PDIF machine driver
  ASoc: kirkwood: Use the Kirkwood audio driver in Dove boards
  ...
2013-09-04 16:26:56 -07:00
Takashi Iwai b054087dba ALSA: hda - Re-setup HDMI pin and audio infoframe on stream switches
When the transcoder:port mapping on Haswell HDMI/DP audio is changed
during the stream playback, the sound gets lost.  Typically this
problem is seen when the user switches the graphics mode from eDP+DP
to DP-only configuration, where CRTC 1 is used for DP in the former
while CRTC 0 is used for the latter.

The graphics controller notifies the change via the normal ELD update
procedure, so we get the intrinsic event.  For enabling the sound
again, the HDMI audio driver needs to reset the pin and set up the
audio infoframe again.

This patch achieves it by:
- keep the current status of channels and info frame setup in per_pin
  struct,
- check the reconnection in the intrinsic event handler,
- reset the pin and the re-invoke hdmi_setup_audio_infoframe()
  accordingly.

The hdmi_setup_audio_infoframe() function has been changed, too, so
that it can be invoked without passing the substream instance.

The patch is mostly based on the work by Mengdong Lin.

Cc: Mengdong Lin <mengdong.lin@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-03 08:26:54 +02:00
Anssi Hannula 18e391862c ALSA: hda - hdmi: Fallback to ALSA allocation when selecting CA
hdmi_channel_allocation() tries to find a HDMI channel allocation that
matches the number channels in the playback stream and contains only
speakers that the HDMI sink has reported as available via EDID. If no
such allocation is found, 0 (stereo audio) is used.

Using CA 0 causes the audio causes the sink to discard everything except
the first two channels (front left and front right).

However, the sink may be capable of receiving more channels than it has
speakers (and then perform downmix or discard the extra channels), in
which case it is preferable to use a CA that contains extra channels
than to use CA 0 which discards all the non-stereo channels.

Additionally, it seems that HBR (HD) passthrough output does not work on
Intel HDMI codecs when CA is set to 0 (possibly the codec zeroes
channels not present in CA). This happens with all receivers that report
a 5.1 speaker mask since a HBR stream is carried on 8 channels to the
codec.

Add a fallback in the CA selection so that the CA channel count at least
matches the stream channel count, even if the stream contains channels
not present in the sink speaker descriptor.

Thanks to GrimGriefer at OpenELEC forums for discovering that changing
the sink speaker mask allowed HBR output.

Reported-by: GrimGriefer
Reported-by: Ashecrow
Reported-by: Frank Zafka <kafkaesque1978@gmail.com>
Reported-by: Peter Frühberger <fritsch@xbmc.org>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-02 15:04:48 +02:00
Dave Airlie 9c725e5bcd Merge branch 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux into drm-next
Alex writes:
This is the radeon drm-next request.  Big changes include:
- support for dpm on CIK parts
- support for ASPM on CIK parts
- support for berlin GPUs
- major ring handling cleanup
- remove the old 3D blit code for bo moves in favor of CP DMA or sDMA
- lots of bug fixes

[airlied: fix up a bunch of conflicts from drm_order removal]

* 'drm-next-3.12' of git://people.freedesktop.org/~agd5f/linux: (898 commits)
  drm/radeon/dpm: make sure dc performance level limits are valid (CI)
  drm/radeon/dpm: make sure dc performance level limits are valid (BTC-SI) (v2)
  drm/radeon: gcc fixes for extended dpm tables
  drm/radeon: gcc fixes for kb/kv dpm
  drm/radeon: gcc fixes for ci dpm
  drm/radeon: gcc fixes for si dpm
  drm/radeon: gcc fixes for ni dpm
  drm/radeon: gcc fixes for trinity dpm
  drm/radeon: gcc fixes for sumo dpm
  drm/radeonn: gcc fixes for rv7xx/eg/btc dpm
  drm/radeon: gcc fixes for rv6xx dpm
  drm/radeon: gcc fixes for radeon_atombios.c
  drm/radeon: enable UVD interrupts on CIK
  drm/radeon: fix init ordering for r600+
  drm/radeon/dpm: only need to reprogram uvd if uvd pg is enabled
  drm/radeon: check the return value of uvd_v1_0_start in uvd_v1_0_init
  drm/radeon: split out radeon_uvd_resume from uvd_v4_2_resume
  radeon kms: fix uninitialised hotplug work usage in r100_irq_process()
  drm/radeon/audio: set up the sads on DCE3.2 asics
  drm/radeon: fix handling of variable sized arrays for router objects
  ...

Conflicts:
	drivers/gpu/drm/i915/i915_dma.c
	drivers/gpu/drm/i915/i915_gem_dmabuf.c
	drivers/gpu/drm/i915/intel_pm.c
	drivers/gpu/drm/radeon/cik.c
	drivers/gpu/drm/radeon/ni.c
	drivers/gpu/drm/radeon/r600.c
2013-09-02 09:31:40 +10:00
Dave Airlie 246efa4a07 snd/hda: add runtime suspend/resume on optimus support (v4)
Add support for HDMI audio device on VGA cards that powerdown
to D3cold using non-standard ACPI/PCI infrastructure (optimus).

This does a couple of things to make it work:

a) add a set of power ops for the hdmi domain, and enables them
via vga_switcheroo when we are a switcheroo controlled card. This
just replaces the runtime resume operation so that when the card
is in D3cold the userspace pci config space access via sysfs,
the vga switcheroon runtime resume gets called first and it calls
the GPU resume callback before calling the sound card runtime
resume.

b) standard ACPI/PCI stacks won't put a device into D3cold without
an ACPI handle, but since the hdmi audio devices on gpus don't have
an ACPI handle, we need to manually force the device into D3cold
after suspend from the switcheroo path only.

c) don't try and do runtime s/r when the GPU is off.

d) call runtime suspend/resume during switcheroo suspend/resume
this is to make sure the runtime stack knows to try and resume
the hdmi audio device for pci config space access.

v2: fix incorrect runtime call suspend->resume.

v3: rework irq handler to avoid false irq when we are resuming
but haven't runtime resumed yet, don't bother trying D3cold,
it won't work, just set it manually ourselves, move runtime s/r
calls outside the main s/r hook. enable dnyamic pm properly by
dropping reference.

v4: put back irq handler check just wrap it with cap check

Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-08-29 13:30:29 +10:00
Takashi Iwai 1c9a341bbd ALSA: hda - Simplify CONFIG_SND_HDA_I915 condition
CONFIG_SND_HDA_I915 doesn't have to be user-selectable as this is almost
mandatory when i915 driver is available.  Let's enable it always when
CONFIG_DRM_I915 is set, so that user won't be bothered by useless
questions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27 14:49:59 +02:00
Mengdong Lin 2e59e5ab1c ALSA: hda - add device entry and inactive flag to unsolicited response
This patch adds two fields to unsolicited response, according to spec HDA040-A:
- Device Entry (bit 20:15)
- Inactive (bit 2)
and show the info in debug message.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27 12:15:28 +02:00
Mengdong Lin 5dc989bdd9 ALSA: hda - Haswell codec exposes device list/select info on pins
This patch is only to allow codec proc file to expose devices list/select info
for Haswell codec pins.

Since Haswell Gfx driver cannot support DP1.2 MST now, so all pins' device list
is empty, meaning no pin is multi-streaming capaple.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27 12:15:22 +02:00
Mengdong Lin 7a624ea562 ALSA: hda - add device list & select info of display pins to codec proc file
If a display codec supports multi-stream transport on the pins, the pin's
device list length and device entries will be exposed to codec proc file.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27 12:15:17 +02:00
Mengdong Lin f1aa068475 ALSA: hda - add flags and routines to get devices selection info for DP1.2 MST
This patch adds flags and routines to get device list & selection info on
a pin.

To support Display Port 1.2 multi-stream transport (MST) over single DP port,
a pin can support multiple devices. Please refer to HD-A spec Document Change
Notificaton HDA040-A.

A display audio codec can set flag "dp_mst" in its patch, indicating its pins
can support MST. But at runtime, a pin may not be multi-streaming capable and
report the device list is empty, depending on Gfx driver configuration.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-27 12:15:09 +02:00
Takashi Iwai 68538bf2bc ASoC: Updates for v3.12
- DAPM is now mandatory for CODEC drivers in order to avoid the repeated
   regressions in the special cases for non-DAPM CODECs and make it
   easier to integrate with other components on boards.  All existing
   drivers have had some level of DAPM support added.
 - A lot of cleanups in DAPM plus support for maintaining controls in a
   specific state while a DAPM widget all contributed by Lars-Peter Clausen.
 - Core helpers for bitbanged AC'97 reset from Markus Pargmann.
 - New drivers and support for Analog Devices ADAU1702 and ADAU1401(a),
   Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based
   machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung
   Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson
   Microelectronics WM8997.
 - Support for building drivers that can support it cross-platform for
   compile test.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSF0rqAAoJELSic+t+oim9YK0P/0CwP7lAjL87EF+dUKW51raB
 7K8xtOgObec1+Fnc1FEbN6us1hXRkjZJMJyRqa3DO5EaNM5TUoxUa/+MNsKmyGXs
 UhoW7J2TUizxgStxszXdxLEZG5oErxwCtJR3xlIkAq4kcnUI0LwRtGctmguZH74a
 UFxd34tcq8LxytvBp1HaNgaG1OQqIqYUNHYXKCwZZMJRxk8TQU9NfAzlCOtWfPWp
 jjdsBkX6bypWzSV/0P8rdSvjhHlJ1vBw3XTD9jD1/EuC5J7qqKQvwo5Oid98QHiv
 /guV0zx6EPdW5IgyGVvlyc4e5zLrtrckj05Kjyy426mZUpLmGoQCPj+ZAZA+jdqo
 qX3M9lXdisx4FI1Ke+y00G64q9fOuNEyjHKnoMPbZXC7zBTLPC8znncM6Xk5MOx/
 Y+fSChecYzkCrBJqHZGUcMdl0/xL1cRrH6BP2I5ISn5ruEjmTuj3dD0JTUVRi1HM
 KGrLP6TnuY+yBMhoqbGsH7YtNN5NDbqnJrUXQy82GGHH++LlHs/0ljDdOCuwX774
 qu1PsyTwrBvCU9erJS4yTG1KIiFFLTn+exPvUOyjaTFVbs8PoX2NOC4/Ihqj+dvU
 UDj/Lh+/zF2BzrkxN65BwuXULElxjtoFvleWLzt7V8qOCb5LOzBVW8a7f5HQzfU6
 LsEXDtB4VkjGjOGAAsII
 =qzif
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v3.12

- DAPM is now mandatory for CODEC drivers in order to avoid the repeated
  regressions in the special cases for non-DAPM CODECs and make it
  easier to integrate with other components on boards.  All existing
  drivers have had some level of DAPM support added.
- A lot of cleanups in DAPM plus support for maintaining controls in a
  specific state while a DAPM widget all contributed by Lars-Peter Clausen.
- Core helpers for bitbanged AC'97 reset from Markus Pargmann.
- New drivers and support for Analog Devices ADAU1702 and ADAU1401(a),
  Asahi Kasei Microdevices AK4554, Atmel AT91ASM9x5 and WM8904 based
  machines, Freescale S/PDIF and SSI AC'97, Renesas R-Car SoCs, Samsung
  Exynos5420 SoCs, Texas Instruments PCM1681 and PCM1792A and Wolfson
  Microelectronics WM8997.
- Support for building drivers that can support it cross-platform for
  compile test.
2013-08-23 14:12:22 +02:00
Takashi Iwai 2ca320e294 ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
Without the dynamic minor assignment, HDMI codec may have less PCM
instances than the number of pins, which eventually leads to Oops.

Reported-by: Stratos Karafotis <stratosk@semaphore.gr>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-22 23:22:39 +02:00
Kailang Yang cd217a6395 ALSA: hda - Add workarounds for pop-noise on Chromebook with ALC283
The headphone automute on this machine triggers annoying pop noises.
It seems that only the first DAC can be used, the secondary DAC always
results in this problem.  This patch disables the secondary DAC with
a few additional workarounds.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-22 11:55:33 +02:00
Kailang Yang 2af02be71a ALSA: hda - Fix ALC283 headphone pop-noise better
Fixed ALC283 D3 to D0 and D0 to D3 Headphone pop noise.
The previous fix [c5177c86: ALSA: hda - Fix the noise after suspend on
ALC283 codec] doesn't work sufficiently for some laptops.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-22 11:54:58 +02:00
Takashi Iwai d3d3835ce9 ALSA: hda - Add inverted digital mic fixup for Acer Aspire One
Yet another entry, just use the existing fixup for this machine, too.

Reported-by: "Nathanael D. Noblet" <nathanael@gnat.ca>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-19 20:07:28 +02:00
David Henningsson c841ad2a9b ALSA: hda - Try to allow haswell HDMI audio even without powerwell
If compiled without CONFIG_SND_HDA_I915, the audio driver cannot
request power well. However, if the power well is on for other
reasons, maybe audio can still work. Therefore, do not skip the
card completely if compiled without CONFIG_SND_HDA_I915.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-19 15:46:17 +02:00
David Henningsson cd5302c0d4 ALSA: hda - Limit internal mic boost for a few more Thinkpad machines
The higher mic boosts (on internal mic) are so noisy they're unusable
in practice.

BugLink: https://bugs.launchpad.net/bugs/1213820
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-19 15:45:51 +02:00
David Henningsson aaedfb4761 ALSA: hda - Fix the order of a quirk table (janitorial)
This just cleans up the table, no functional changes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-16 14:50:00 +02:00
David Henningsson a4a9e08267 ALSA: hda - Fix internal mic boost on three Thinkpad machines
The internal mic boost is so noisy on boosts 2 and 3 so they are
unusable in practice.

BugLink: https://bugs.launchpad.net/bugs/1213055
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-16 14:49:50 +02:00
Takashi Iwai 1801928e0f ALSA: hda - Add a fixup for Gateway LT27
Gateway LT27 needs a fixup for the inverted digital mic.

Reported-by: "Nathanael D. Noblet" <nathanael@gnat.ca>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-16 08:17:05 +02:00
Takashi Iwai e80c60f3cb ALSA: hda - Mute the right widget in auto_mute_via_amp mode
The current generic parser code assumes that always a pin widget
controls the mute for an output blindly although it might be a
different widget in the middle.  Instead of the fixed assumption,
check each parsed path and just pick up the right widget that has been
already defined as a mute control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-13 09:11:04 +02:00
Takashi Iwai bc2eee29fc ALSA: hda - Allow auto_mute_via_amp on bind mute controls
The auto-mute using the amp currently works only for a single amp on a
pin.  Make it working also with HDA_CTL_BIND_MUTE type, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-13 09:10:37 +02:00
Takashi Iwai f69910ddbd ALSA: hda - Fix missing mute controls for CX5051
We've added a fake mute control (setting the amp volume to zero) for
CX5051 at commit [3868137e: ALSA: hda - Add a fake mute feature], but
this feature was overlooked in the generic parser implementation.  Now
the driver lacks of mute controls on these codecs.

The fix is just to check both AC_AMPCAP_MUTE and AC_AMPCAP_MIN_MUTE
bits in each place checking the amp capabilities.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59001
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-12 11:42:39 +02:00
Takashi Iwai db8a38e506 ALSA: hda - Add pinfix for LG LW25 laptop
Correct the pins for a line-in and a headphone on LG LW25 laptop with
ALC880 codec.  Other pins seem fine.

Reported-and-tested-by: Joonas Saarinen <jonskunator@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-12 11:04:17 +02:00
Chih-Chung Chang bde7bc6014 ALSA: hda - Fix jack gating when auto_{mute,mic} is suppressed.
The snd_hda_jack_set_gating_jack() call didn't work when
auto_{mute,mic} is suppressed because (1) am_entry is
not filled with nid of the mic pin. (2) The jacks are not
created (by snd_hda_jack_detect_enable_callback) before the
snd_hda_jack_set_gating_jack call.

Now we use the first input pin nid directly, and create the jack if it
doesn't exist yet.

Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-05 11:19:59 +02:00
Takashi Iwai 697aebab78 ALSA: hda - Fix missing fixup for Mac Mini with STAC9221
A fixup for Apple Mac Mini was lost during the adaption to the generic
parser because the fallback for the generic ID 8384:7680 was dropped,
and it resulted in the silence output (and maybe other problems).

Unfortunately, just adding the missing subsystem ID wasn't enough, in
this case.  The subsystem ID of this machine is 0000:0100 (what Apple
thought...?), and since snd_hda_pick_fixup() doesn't take the vendor
id zero into account, the driver ignored this entry.  Now it's fixed
to regard the vendor id zero as a valid value.

Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-08-02 08:16:52 +02:00
Takashi Iwai da96fb5b01 ALSA: hda - Fix invalid multi-io creation on VAIO-Z laptops
VAIO-Z laptops need to use the specific DAC for the speaker output
by some unknown reason although the codec itself supports the flexible
connection.  So we implemented a workaround by a new flag,
no_primary_hp, for assigning the speaker pin first.

This worked until 3.8 kernel, but it got broken because the driver
learned for a better multi-io pin mapping, and not it can assign two
mic pins for multi-io.  Since the multi-io requires to be the primary
output, the hp and two mic pins are assigned in prior to the speaker
in the end.

Although the machine has two mic pins, one of them is used as a noise-
canceling headphone, thus it's no real retaskable mic jack.  Thus, at
best, we can disable the multi-io assignment and make the parser
behavior back to the state before the multi-io.

This patch adds again a new flag, no_multi_io, to indicate that the
device has no multi-io capability, and set it in the fixup for
VAIO-Z.  The no_multi_io flag itself can be used generically, added
via a helper line, too.

Reported-by: Tormen <my.nl.abos@gmail.com>
Reported-by: Adam Williamson <awilliam@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29 16:54:36 +02:00
Takashi Iwai eefb8be4a4 ALSA: hda - Remove analog mic pin override from STAC9228 dell-bios quirk
The current fixup for dell-bios model with STAC9228 codec contains the
override of pin 0x0c for analog mic.  But this is actually just adding
a bogus pin and confuses the parser.  Better to remove it for the
auto-mic switching.

Meanwhile, for a possible regression, keep the old configuration as
model=dell-bios-amic, so that people can test it again quickly.

Tested on Dell 1420n laptop.

Reported-and-tested-by: Eric Shattow <lucent@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29 16:30:21 +02:00
Wang Xingchao 7d4f606c50 ALSA: hda - WAKEEN feature enabling for runtime pm
With runtime power save feature enabled, Headphone hotplug
event will not be detected while controller/codec in D3. HDA has
feature WAKEEN to let codec wake up system if controller is in D3 or
system in S3.(HDA Spec 4.5.9.2/3). Codec can send out INT or wake up
controller depending on whether CIE or GIE enabled.(Figure 4, Interupt
structure).

The controller must be in RESET mode after enter runtime-suspend, otherwise
it will not be waken up even if codec send out wake-up event. And STATESTS
will be cleared after controller brought out of RESET mode.

This patch only enable WAKEEN for runtime-suspend(Controller D3) mode,
not for system S3 mode. with tool "evtest", Headphone hotplug events
could be cought and reported successfully.

[fixed an unused variable warning by tiwai]

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29 14:33:20 +02:00
Wang Xingchao 18e6062756 ALSA: hda - jack poll once if jackpoll_interval==0
With jackpoll_interval != 0, it's used to poll jack event periodically
in a delayed work. if it's 0, give the caller chance to probe jack status
but will not restart the delayed work.

In the next patch which enable WAKEEN feature, HDA controller was able to wake
up system when it's in D3, it's useful to detect Jack hotplug event and notify
userspace. By default the jackpoll_interval=0, this patch let jack poll once
without starting the delayed work.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29 14:19:10 +02:00
Wang Xingchao 7eaa9161ed ALSA: hda - Clearing jackpoll_interval avoid pending work
Clearing jackpoll_interval before calling cancel_delayed_work_sync(),
otherwise the work will be triggered again and cause impact in
hda_jackpoll_work(). The next patch will poll jack once even with
jackpoll_interval=0.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-29 14:19:03 +02:00
Wang Xingchao da7db6ad4d ALSA: hda - use azx_writew() for 16-bit length register
Register STATESTS is 16-bit length, use correct API for read/write.

Signed-off-by: Wang Xingchao <xingchao.wang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-24 15:59:32 +02:00
Kailang Yang c5177c861e ALSA: hda - Fix the noise after suspend on ALC283 codec
When the power state of ALC283 codec goes to D3, it gives a noise via
headphone output.  This is because the driver tries to clear all pins
via snd_hda_shutup_pins().  Setting the mic pin to zero triggers such
a noise.

Define a new shutup call specific to this codec and control the pins
there more precisely.  Also, add the power-save enable/disable
sequences in the resume and the new shutup calls.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-24 14:44:40 +02:00