Commit Graph

4669 Commits

Author SHA1 Message Date
Takashi Iwai 0b8c82190c ALSA: hda - Cancel probe work instead of flush at remove
The commit [991f86d7ae4e: ALSA: hda - Flush the pending probe work at
remove] introduced the sync of async probe work at remove for fixing
the race.  However, this may lead to another hangup when the module
removal is performed quickly before starting the probe work, because
it issues flush_work() and it's blocked forever.

The workaround is to use cancel_work_sync() instead of flush_work()
there.

Fixes: 991f86d7ae ('ALSA: hda - Flush the pending probe work at remove')
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-15 16:37:24 +01:00
Takashi Iwai 2ebab40eb7 ALSA: hda - Fix bad dereference of jack object
The hda_jack_tbl entries are managed by snd_array for allowing
multiple jacks.  It's good per se, but the problem is that struct
hda_jack_callback keeps the hda_jack_tbl pointer.  Since snd_array
doesn't preserve each pointer at resizing the array, we can't keep the
original pointer but have to deduce the pointer at each time via
snd_array_entry() instead.  Actually, this resulted in the deference
to the wrong pointer on codecs that have many pins such as CS4208.

This patch replaces the pointer to the NID value as the search key.
As an unexpected good side effect, this even simplifies the code, as
only NID is needed in most cases.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-09 12:16:31 +01:00
Takashi Iwai c44d9b1181 ALSA: hda - Fix speaker output from VAIO AiO machines
Some Sony VAIO AiO models (VGC-JS4EF and VGC-JS25G, both with PCI SSID
104d:9044) need the same quirk to make the speaker working properly.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=112031
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-07 09:41:35 +01:00
Takashi Iwai 6c361d10e0 Revert "ALSA: hda - Fix noise on Gigabyte Z170X mobo"
This reverts commit 0c25ad8040.

The original commit disabled the aamixer path due to the noise
problem, but it turned out that some mobo with the same PCI SSID
doesn't suffer from the issue, and the disabled function (analog
loopback) is still demanded by users.

Since the recent commit [e7fdd52779a6: ALSA: hda - Implement loopback
control switch for Realtek and other codecs], we have the dynamic
mixer switch to enable/disable the aamix path, and we don't have to
disable the path statically any longer.  So, let's revert the
disablement, so that only the user suffering from the noise problem
can turn off the aamix on the fly.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=108301
Reported-by: <mutedbytes@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-05 20:19:00 +01:00
David Henningsson 360a824568 ALSA: hda - Fix static checker warning in patch_hdmi.c
The static checker warning is:

	sound/pci/hda/patch_hdmi.c:460 hdmi_eld_ctl_get()
	error: __memcpy() 'eld->eld_buffer' too small (256 vs 512)

I have a hard time figuring out if this can ever cause an information leak
(I don't think so), but nonetheless it does not hurt to increase the
robustness of the code.

Fixes: 68e03de985 ('ALSA: hda - hdmi: Do not expose eld data when eld is invalid')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-05 12:35:11 +01:00
Takashi Iwai 2154cc0e2d ALSA: hda - Add fixup for Mac Mini 7,1 model
Mac Mini 7,1 model with CS4208 codec reports the headphone jack
detection wrongly in an inverted way.  Moreover, the advertised pins
for the audio input and SPDIF output have actually no jack detection.

This patch addresses these issues.  The inv_jack_detect flag is set
for fixing the headphone jack detection, and the pin configs for audio
input and SPDIF output are marked as non-detectable.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105161
Report-and-tested-by: moosotc@gmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03 12:32:51 +01:00
Kailang Yang 4cc9b9d627 ALSA: hda/realtek - Support headset mode for ALC225
Support headset mode for ALC225 platforms.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03 09:05:02 +01:00
Kailang Yang cfc5a845e6 ALSA: hda/realtek - Support Dell headset mode for ALC225
Dell create new platform with ALC298 codec.
This patch will enable headset mode for ALC225/ALC3253 platform.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03 09:04:54 +01:00
Kailang Yang 4231430da9 ALSA: hda/realtek - New codec support of ALC225
Add new support for ALC225, yet another variant of ALC298 codec.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org> # 4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03 09:04:42 +01:00
Libin Yang 6639484dda ALSA: hda - disable dynamic clock gating on Broxton before reset
On Broxton, to make sure the reset controller works properly,
MISCBDCGE bit (bit 6) in CGCTL (0x48) of PCI configuration space
need be cleared before reset and set back to 1 after reset.
Otherwise, it may prevent the CORB/RIRB logic from being reset.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-29 14:00:41 +01:00
Aaron Plattner 3ec622f409 ALSA: hda - Add new GPU codec ID 0x10de0083 to snd-hda
Vendor ID 0x10de0083 is used by a yet-to-be-named GPU chip.

This chip also has the 2-ch audio swapping bug, so patch_nvhdmi is
appropriate here.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-29 07:28:17 +01:00
Takashi Iwai 991f86d7ae ALSA: hda - Flush the pending probe work at remove
As HD-audio driver does deferred probe internally via workqueue, the
driver might go into the mixed state doing both probe and remove when
the module gets unloaded during the probe work.  This eventually
triggers an Oops, unsurprisingly.

For avoiding this race, we just need to flush the pending probe work
explicitly before actually starting the resource release.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=960710
Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-20 17:19:02 +01:00
Takashi Iwai bca8e98804 ALSA: hda - Fix missing module loading with model=generic option
When the generic codec driver is specified via model option or such,
the hda driver doesn't try to load the generic driver module but still
loads the codec-specific driver, and this ends up with the binding
failure.

This patch fixes it by moving the generic module request in the common
helper code.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=111021
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-20 15:56:42 +01:00
Takashi Iwai bed2e98e1f ALSA: hda - Degrade i915 binding failure message
Currently HD-audio driver on Intel Skylake or Broxteon gives an error
message when binding with i915 audio component fails.  However, this
isn't any serious error on a system without Intel graphics.  Indeed
there are such systems, where a third-party codec (e.g. Creative) is
put on the mobo while using other discrete GPU (e.g. Nvidia).
Printing a kernel "error" message is overreaction in such a case.

This patch downgrades the print level for that message.  For systems
that mandate the i915 binding (e.g. Haswell or Broadwell HDMI/DP),
another kernel error message is shown in addition to make clear what
went wrong.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=111021
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-20 15:00:26 +01:00
Takashi Iwai db8948e653 ALSA: hda - Fix bass pin fixup for ASUS N550JX
ASUS N550JX (PCI SSID 1043:13df) requires the same fixup for a bass
speaker output pin as other N550 models.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110001
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-18 09:17:30 +01:00
Takashi Iwai cf52103a21 ALSA: hda - Add fixup for Dell Latitidue E6540
Another Dell model, another fixup entry: Latitude E6540 needs the same
fixup as other Latitude E series as workaround for noise problems.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=104341
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-15 14:19:49 +01:00
Libin Yang 91815d8aa7 ALSA: hda - add codec support for Kabylake display audio codec
This patch adds codec ID (0x8086280b) for Kabylake display codec
and apply the hsw fix-ups to Kabylake.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-14 10:05:22 +01:00
Hui Wang 0a1f90a982 ALSA: hda - fix the headset mic detection problem for a Dell laptop
The machine uses codec alc255, and the pin configuration value for
pin 0x14 on this machine is 0x90171130 which is not in the pin quirk
table yet.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1533461
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-13 07:19:52 +01:00
Takashi Iwai 98070576c4 ALSA: hda - Fix white noise on Dell Latitude E5550
Dell Latitude E5550 (1028:062c) has a white noise problem like other
Latitude E models, and it gets fixed by the very same quirk as well.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110591
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-12 21:09:26 +01:00
Heiner Kallweit de65360be0 ALSA: hda_intel: add card number to irq description
Currently the info in /proc/interrupts doesn't allow to figure out which
interrupt belongs to which card (HDMI, PCH, ..).
Therefore add card details to the interrupt description.
With the patch the info in /proc/interrupts looks like this:

PCI-MSI 442368-edge      snd_hda_intel:card1
PCI-MSI 49152-edge      snd_hda_intel:card0

NOTE: this patch adds the new irq_descr field snd_card struct that is
filled automatically at a card object creation.  This can be used
generically for other drivers as well.  The changes for others will
follow later -- tiwai

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-12 21:05:16 +01:00
David Henningsson 56f2701348 ALSA: hda - Fixup inverted internal mic for Lenovo E50-80
Inform userspace that one channel of the internal mic has reversed
polarity, so it does not attempt to add both channels together and
end up with silence.

Cc: stable@vger.kernel.org
Reported-by: Andrzej Mendel <andrzej.mendel@gmail.com>
Alsa-info: http://www.alsa-project.org/db/?f=3088f82a0cf977855f92af9db8ad406c04f71efa
BugLink: https://bugs.launchpad.net/bugs/1529624
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-11 10:02:31 +01:00
Takashi Iwai ca9ea7a5ff Merge branch 'for-linus' into for-next 2016-01-06 10:20:41 +01:00
Hui Wang c7b60a8951 ALSA: hda - Add keycode map for alc input device
Then users can remap the keycode from userspace. If without the remap,
the input device will pass KEY_MICMUTE to userspace, but in X11 layer,
it uses KEY_F20 rather than KEY_MICMUTE for XF86AudioMicMute. After
adding the keycode map, users can remap the keycode to any value users
want.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-29 10:03:36 +01:00
Kailang 3694cb2947 ALSA: hda - Add mic mute hotkey quirk for Lenovo ThinkCentre AIO
The Lenovo ThinkCenter AIO uses Line2 (NID 0x1b) to implement the
micmute hotkey, here we register an input device and use Line2 unsol
event to collect the hotkey pressing or releasing.

In the meanwhile, the micmute led is controlled by GPIO2, so we
use an existing function alc_fixup_gpio_mic_mute_hook() to control
the led.

[Hui: And there are two places to register the input device, to make
the code simple and clean, move the two same code sections into a
function.]

Cc: <stable@vger.kernel.org>
Signed-off-by: Kailang <kailang@realtek.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-29 10:03:27 +01:00
Takashi Iwai 59c8231089 Merge branch 'for-linus' into for-next
Conflicts:
	drivers/gpu/drm/i915/intel_pm.c
2015-12-23 08:33:34 +01:00
Mario Kleiner 9f660a1c43 ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2)
Without this patch, internal speaker and line-out work,
but front headphone output jack stays silent on the
Mac Pro 4,1.

This code path also gets executed on the MacPro 5,1 due
to identical codec SSID, but i don't know if it has any
positive or adverse effects there or not.

(v2) Implement feedback from Takashi Iwai: Reuse
     alc889_fixup_mbp_vref and just add a new nid
     0x19 for the MacPro 4,1.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-22 10:07:45 +01:00
Takashi Iwai 1d9d449500 Merge branch 'topic/hdmi-jack' into for-next 2015-12-21 11:46:30 +01:00
Xiong Zhang 3e6db33aaf ALSA: hda - Set SKL+ hda controller power at freeze() and thaw()
It takes three minutes to enter into hibernation on some OEM SKL
machines and we see many codec spurious response after thaw() opertion.
This is because HDA is still in D0 state after freeze() call and
pci_pm_freeze/pci_pm_freeze_noirq() don't set D3 hot in pci_bus driver.
It seems bios still access HDA when system enter into freeze state,
HDA will receive codec response interrupt immediately after thaw() call.
Because of this unexpected interrupt, HDA enter into a abnormal
state and slow down the system enter into hibernation.

In this patch, we put HDA into D3 hot state in azx_freeze_noirq() and
put HDA into D0 state in azx_thaw_noirq().

V2: Only apply this fix to SKL+
    Fix compile error when CONFIG_PM_SLEEP isn't defined

[Yet another fix for CONFIG_PM_SLEEP ifdef and the additional comment
 by tiwai]

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-18 09:49:13 +01:00
Takashi Iwai bcb337d166 ALSA: hda - Drop unused AZX_DCAPS_REVERSE_ASSIGN
AZX_DCAPS_REVERSE_ASSIGN is no longer referred by any code.
Let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-17 12:47:18 +01:00
Takashi Iwai 26f0571781 ALSA: hda - Drop AZX_DCAPS_POSFIX_VIA bit
AZX_DCAPS_POSFIX_VIA is coupled always with AZX_DRIVER_VIA type, so we
don't have to keep this bit in dcaps.  Save one more!

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-17 12:47:17 +01:00
Takashi Iwai 7d9a180895 ALSA: hda - Raise AZX_DCAPS_RIRB_DELAY handling into top drivers
AZX_DCAPS_RIRB_DELAY is dedicated only for Nvidia and its purpose is
just to set a flag in bus.  So it's better to be set in the toplevel
driver, either hda_intel.c or hda_tegra.c, instead of the common
hda_controller.c.  This also allows us to strip this flag from dcaps,
so save one more bit there.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-17 12:47:10 +01:00
Takashi Iwai ef85f299c7 ALSA: hda - Merge RIRB_PRE_DELAY into CTX_WORKAROUND caps
AZX_DCAPS_RIRB_PRE_DELAY is always tied with AZX_DCAPS_CTX_WORKAROUND,
which is Creative's XFi specific.  So, we can replace it and reduce
one more bit free for DCAPS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-17 08:14:59 +01:00
Takashi Iwai b6903c0ed9 ALSA: hda - Add a fixup for Thinkpad X1 Carbon 2nd
Apply the same fixup for Thinkpad with dock to Thinkpad X1 Carbon 2nd,
too.  This reduces the annoying loud cracking noise problem, as well
as the support of missing docking port.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 15:11:59 +01:00
Takashi Iwai 70a0976b0c ALSA: hda - Set codec to D3 at reboot/shutdown on Thinkpads
Lenovo Thinkpads with Realtek codecs may still have some loud
crackling noises at reboot/shutdown even though a few previous fixes
have been applied.  It's because the previous fix (disabling the
default shutup callback) takes effect only at transition of the codec
power state.  Meanwhile, at reboot or shutdown, we don't take down the
codec power as default, thus it triggers the same problem unless the
codec is powered down casually by runtime PM.

This patch tries to address the issue.  It gives two things:
- implement the separate reboot_notify hook to struct alc_spec, and
  call it optionally if defined.
- turn off the codec to D3 for Thinkpad models via this new callback

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 15:11:58 +01:00
Takashi Iwai 157f0b7f6c ALSA: hda - Apply click noise workaround for Thinkpads generically
It seems that a workaround for Thinkpad T440s crackling noise can be
applied generically to all Thinkpad models: namely, disabling the
default alc269 shutup callback.  This patch moves it to the existing
alc_fixup_tpt440_dock() while also replacing the rest code with
another existing alc_fixup_disable_aamix().  It resulted in a good
code reduction.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 15:06:14 +01:00
David Henningsson c04017ea81 ALSA: hda - Fix headphone mic input on a few Dell ALC293 machines
These laptops support both headphone, headset and mic modes
for the 3.5mm jack.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1526330
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 14:52:02 +01:00
Takashi Iwai 2cf721db4b ALSA: hda - Increase default bdl_pos_adj for Baytrail/Braswell
Intel Atom processors seem to have a problem at recording when
bdl_pos_adj is set to an odd value.  When a value like 1 is used, it
may drop the samples unexpectedly.  Actually, for the old Atoms, we
used to set AZX_DRIVER_SCH type, and this assigns 32 as default.
Meanwhile the newer chips, Baytrail and Braswell, are set as
AZX_DRIVER_PCH, and the lower default value, 1, is assigned.

This patch changes the default values for these chipsets to a safer
default, 32, again.  Since changing the driver type (AZX_DRIVER_XXX)
leads to the rename of the driver string, it would result in a
possible regression.  So, we can't change the type.  Instead, in this
patch, manual (ugly) PCI ID checks are added on top.

A drawback by this increase is the slight increase of the latency, but
it's a sub-ms order in normal situations, so mostly negligible.

Reported-and-tested-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 14:04:05 +01:00
Takashi Iwai 4f0189be3d ALSA: hda - Clean up the code to check bdl_pos_adj option
Just a minor cleanup; instead of passing an array, pass the assigned
bdl_pos_adj option value directory in struct azx.  Also split the code
to get the default bdl_pos_adj value for the change that will follow
after this.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-15 14:01:28 +01:00
Takashi Iwai e2dc7d7d8e ALSA: hda - Move audio component accesses to hdac_i915.c
A couple of i915_audio_component ops have been added and accessed
directly from patch_hdmi.c.  Ideally all these should be factored out
into hdac_i915.c.

This patch does it, adds two new helper functions for setting N/CTS
and fetching ELD bytes.  One bonus is that the hackish widget vs port
mapping is also moved to hdac_i915.c, so that it can be fixed /
enhanced more cleanly.

Reviewed-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-10 14:41:07 +01:00
Takashi Iwai 788d441a16 ALSA: hda - Use component ops for i915 HDMI/DP audio jack handling
Since we have a new audio component ops to fetch the current ELD and
state now, we can reduce the usage of unsol event of HDMI/DP pins.
The unsol event isn't only unreliable, but it also needs the power
up/down of the codec and link at each time, which is a significant
power and time loss.

In this patch, the jack creation and unsol/jack event handling are
modified to use the audio component for the dedicated Intel chips.

The jack handling got slightly more codes than a simple usage of
hda_jack layer since we need to deal directly with snd_jack object;
the hda_jack layer is basically designed for the pin sense read and
unsol events, both of which aren't used any longer in our case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-10 14:41:04 +01:00
Takashi Iwai 9a5e5234ba ALSA: hda - Fix superfluous HDMI jack repoll
The recent commit [e90247f9fcee: ALSA: hda - Split ELD update code
from hdmi_present_sense()] rewrote the HDMI jack handling code, but a
slight behavior change sneaked in unexpectedly.  When the jack isn't
connected, it tries repoll unnecessarily.

This patch addresses the flaw, to the right behavior as before.

Fixes: e90247f9fc ('ALSA: hda - Split ELD update code from hdmi_present_sense()')
Reported-and-tested-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-10 14:35:09 +01:00
Takashi Iwai 55913110dd ALSA: hda - Allow i915 binding later in codec driver
Due to the recent change, HDA controller driver for Intel PCH tries to
bind i915 audio component always at the probe time no matter whether
HDMI/DP codec is found.  This is, however, superflulous for old
chipsets (e.g. on IVB) where they don't have always the HDMI/DP codecs
but  often have only a discrete GPU instead.

For the newer chipsets, we need already the i915 binding from the
beginning due to power well control.  Meanwhile, for older chipsets
where we don't need power well, we don't need the i915 binding at the
controller level.

This patch removes again the i915 binding in the HDA controller driver
for old Intel PCHs, but adds the binding in HDMI/DP codec driver
instead.  This allows still the use of the direct notification from
the graphics driver while we can avoid the unnecessary load of i915
driver for machines only with another GPU.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-10 13:03:29 +01:00
Takashi Iwai f4e3040bf0 ALSA: hda - Optimize audio component check in patch_hdmi.c
The audio component is enabled only when CONFIG_SND_HDA_I915 is set.
Give a dummy macro for allowing the compiler optimize out the relevant
codes when this Kconfig isn't set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-10 13:01:28 +01:00
Gabriele Martino 5328e1ea87 ALSA: hda/ca0132 - quirk for Alienware 17 2015
The Alienware 17 (2015) has the same card and pin configuration of the
Alienware 15, so the same quirks must be applied.

Signed-off-by: Gabriele Martino <g.martino@gmx.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-09 17:06:07 +01:00
Takashi Iwai 9a81123048 ALSA: hda - Fix noise problems on Thinkpad T440s
Lenovo Thinkpad T440s suffers from constant background noises, and it
seems to be a generic hardware issue on this model:
  https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T/T440s-speaker-noise/td-p/1339883

As the noise comes from the analog loopback path, disabling the path
is the easy workaround.

Also, the machine gives significant cracking noises at PM suspend.  A
workaround found by trial-and-error is to disable the shutup callback
currently used for ALC269-variant.

This patch addresses these noise issues by introducing a new fixup
chain.  Although the same workaround might be applicable to other
Thinkpad models, it's applied only to T440s (17aa:220c) in this patch,
so far, just to be safe (you chicken!).  As a compromise, a new model
option string "tp440" is provided now, though, so that owners of other
Thinkpad models can test it more easily.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=958504
Reported-and-tested-by: Tim Hardeck <thardeck@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-09 15:31:21 +01:00
Takashi Iwai fbaf9f9f61 ALSA: hda - Don't try to bind i915 unless CONFIG_SND_HDA_I915 is set
snd-hda-intel driver tries to bind with i915 audio component always
when AZX_DCAPS_I915_POWERWELL is set in the driver caps.  This was
mostly OK in the past, as the flag was applied only to a limited set
of devices, namely, Haswell and Broadwell.  On these machines, i915
graphics is almost mandatory as long as HDMI/DP is concerned.

Recently the application of i915 binding was widened to more Intel
chips.  On these chips, the chance of a kernel without i915 graphics
is much higher, and such user would hit an error like:

 snd_hda_intel 0000:00:1b.0: failed to add i915 component master (-19)

Although the error itself is harmless, it's certainly superfluous even
to try binding with i915, if we already know that there isn't any.

This patch fixes it by simply defining AZX_DCAPS_I915_POWERWELL as 0
in the case without i915.  Then all codes referring to this flag will
be optimized out by the compiler.

Fixes: 6603249dcd ('ALSA: hda - Enable audio component for old Intel PCH devices')
Reported-by: kernel test robot <ying.huang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-09 07:31:36 +01:00
Takashi Iwai 6ee8eeb4af ALSA: hda - Less grumbling about lack of i915 binding
The recent commit [6603249dcdbb: ALSA: hda - Enable audio component
for old Intel PCH devices] enabled the i915 binding for HDMI/DP on old
Intel PCHs.  But many boards are without HDMI/DP, and they actually
don't need i915 binding, and yet the driver has a check of i915
binding and complains like
	Haswell must be built with CONFIG_SND_HDA_I915
This error is false-positive, and it should be put only for HSW/BDW,
instead of all devices that may be bound with i915.

This patch fixes the condition to check, as well as rephrasing the
message specific to HSW/BDW HDMI/DP.

Fixes: 6603249dcd ('ALSA: hda - Enable audio component for old Intel PCH devices')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-09 07:29:52 +01:00
Takashi Iwai e7fdd52779 ALSA: hda - Implement loopback control switch for Realtek and other codecs
Many codecs, typically found on Realtek codecs, have the analog
loopback path merged to the secondary input of the middle of the
output paths.  Currently, we don't offer the dynamic switching in such
configuration but let each loopback path mute by itself.

This should work well in theory, but in reality, we often see that
such a dead loopback path causes some background noises even if all
the elements get muted.  Such a problem has been fixed by adding the
quirk accordingly to disable aamix, and it's the right fix, per se.
The only problem is that it's not so trivial to achieve it; user needs
to pass a hint string via patch module option or sysfs.

This patch gives a bit improvement on the situation: it adds "Loopback
Mixing" control element for such codecs like other codecs (e.g. IDT or
VIA codecs) with the individual loopback paths.  User can turn on/off
the loopback path simply via a mixer app.

For keeping the compatibility, the loopback is still enabled on these
codecs.  But user can try to turn it off if experiencing a suspicious
background or click noise on the fly, then build a static fixup later
once after the problem is addressed.

Other than the addition of the loopback enable/disablement control,
there should be no changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-08 17:00:42 +01:00
Takashi Iwai c4a58c308a ALSA: hda - Make snd_hda_parse_nid_path() local
An exported function snd_hda_parse_nid_path() is used only inside
hda_generic.c.  Let's make it a static local function for a better
code optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-08 11:48:39 +01:00
Takashi Iwai 1e73bf7815 ALSA: hda - Remove unused snd_hda_get_nid_path()
An exported helper function snd_hda_get_nid_path() is nowhere used.
Let's remove it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-12-08 11:47:31 +01:00