Commit Graph

3703 Commits

Author SHA1 Message Date
Takashi Iwai 963afde950 ALSA: hda/via - Clean up duplicated codes
The previous commit was written in the way to make the backport to
3.9.y easier, and left the duplicated open codes intentionally.
Now let's clean up the duplicated codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-03 11:34:00 +02:00
Takashi Iwai 5a6f294e87 ALSA: hda/via - Fix wrongly cleared pins after suspend on VT1802
VIA driver has a special suspend handling only for VT1802 to reduce
the pop noise.  During the transition to the generic parser, the
behavior of snd_hda_set_pin_ctl() was also changed to modify the
cached values, too.  And this caused a regression where the pin is
still cleared even after the resume (including the resume from power
save), resulting in the silent output.

The fix is simply to replace snd_hda_set_pin_ctl() with the explicit
call of snd_hda_codec_write() again.

Reported-by: Alex Riesen <raa.lkml@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-03 11:33:16 +02:00
Takashi Iwai 05909d5c67 ALSA: hda - Add keep_eapd_on flag to generic parser
VT1802 codec seems to reset EAPD of other pins in the hardware level,
and this was another reason of the silent headphone output on some
machines.  As a workaround, introduce a new flag indicating to keep
the EPAD on to the generic parser, and set it in patch_via.c.

Reported-by: Alex Riesen <raa.lkml@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-03 11:33:06 +02:00
Takashi Iwai 77afe0e948 ALSA: hda - Allow setting automute/automic hooks after parsing
Some codec drivers (VIA codecs and some Realtek fixups) set the
automute and automic hooks after calling
snd_hda_gen_parse_auto_config().  In the current code, the hook
pointers are referred only in snd_hda_gen_parse_auto_config() and
passed to snd_hda_jack_detect_enable_callback(), thus changing the
hook values won't change the actually called callbacks properly.

This patch fixes this bug by setting the static functions as the
primary callback functions for the jack detection, and let them
calling the appropriate hooks dynamically.

Cc: <stable@vger.kernel.org> [v3.9]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-03 11:33:06 +02:00
Takashi Iwai 087c2e3b4e ALSA: hda/via - Disable broken dynamic power control
Since the transition to the generic parser, the actual routes used
there don't match always with the assumed static paths in some
set_widgets_power_state callbacks.  This results in the wrong power
setup in the end.  As a temporary workaround, we need to disable the
calls together with the non-functional dynamic power control enum.

Reported-by: Alex Riesen <raa.lkml@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-03 11:32:55 +02:00
David Henningsson 3ee2102fbe ALSA: hda - Add headset quirk for two Dell machines
This quirk is required for the headset mic to work on these
two machines.

BugLink: https://bugs.launchpad.net/bugs/1186170
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-31 10:45:26 +02:00
Ebben Aries 6b4dc2bd7e ALSA: hda - add dock support for Thinkpad T431s
Add a model/fixup string "lenovo-dock", for Thinkpad T431s, to allow sound in docking station.

Tested on Lenovo T431s with ThinkPad Mini Dock Plus Series 3

Signed-off-by: Ebben Aries <earies@dscp.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-31 08:19:46 +02:00
Takashi Iwai 20a24225d8 ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove
As drvdata is cleared to NULL at probe failure or at removal by the
driver core, we don't have to call pci_set_drvdata(pci, NULL) any
longer in each driver.

The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
hda_intel.c.  Since this function itself releases the card instance,
we need to clear drvdata here as well, so that it won't be released
doubly in the remove callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-29 12:37:32 +02:00
Takashi Iwai 4059a42c51 ALSA: hda - Enable mic-mute LED on more HP laptops
The newer HP laptops have SSID 103c:20xx and 103c:21xx, and these
usually have the mic-mute LED on Fn-F8.  Let's enable it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-28 14:53:40 +02:00
Chew, Chiau Ee e44007e0f9 ALSA: hda - add PCI IDs for Intel BayTrail
Add HD Audio Device PCI ID for the Intel BayTrail platform.

Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-17 09:35:17 +02:00
David Henningsson 436c4a0cfb ALSA: hda - Add headset mic support for another Dell machine
BugLink: https://bugs.launchpad.net/bugs/1180351
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 07:19:09 +02:00
Takashi Iwai b1b9fbd050 ALSA: hda - Check the activity of the NID to be powered down
When an inactive path is powered down with spec->power_down_unused
flag, we should check the activity of each widget in the path whether
it's still referred from any active path.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 07:18:05 +02:00
Takashi Iwai 6c35ae3c32 Revert "ALSA: hda - Don't set up active streams twice"
This reverts commit affdb62b81.

The commit introduced a regression with AD codecs where the stream is
always clean up.  Since the patch is just a minor optimization and
reverting the commit fixes the issue, let's just revert it.

Reported-and-tested-by: Michael Burian <michael.burian@sbg.at>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-10 13:41:37 +02:00
Takashi Iwai 17df3f5565 ALSA: hda - Apply pin-enablement workaround to all Haswell HDMI codecs
This is a revised patch based on Mengdong Lin's fix patch, which is a
supplement to a previous patch [1611a9c9: ALSA: hda - Add fixup for
Haswell to enable all pin and convertor widgets].

Some Haswell BIOS will disable the 2nd and 3rd pin/covertor widgets
when the HD-A controller changes state from D3 to D0.  So when the
controller resumes after a system or runtime suspend, these widgets
are disabled and programming these widgets to D0 will cause H/W error
and codec will not respond.

In addition, we found out that some BIOS disables the pins at S3
although it shows up at boot.  This confuses the driver utterly, and
the hardware falls into the fatal communication error like the above.

So in this patch, we apply intel_haswell_enable_all_pins() not only as
a fixup to a certain device (with 8086:2010) but to all Haswell
machines.  The codec driver basically assumes that all pins are
exposed, so it's anyway better to see them from the beginning.  Even
if all pins and converters are shown by this call, there should be no
regression in practice: the pin default configurations are still kept,
thus the disabled pins are handled as disabled by the driver
properly.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-08 08:24:57 +02:00
Wang YanQing 2195b063f6 ALSA: HDA: Fix Oops caused by dereference NULL pointer
The interrupt handler azx_interrupt will call azx_update_rirb,
which may call snd_hda_queue_unsol_event, snd_hda_queue_unsol_event
will dereference chip->bus pointer.

The problem is we alloc chip->bus in azx_codec_create
which will be called after we enable IRQ and enable unsolicited
event in azx_probe.

This will cause Oops due dereference NULL pointer. I meet it, good luck:)

[Rearranged the NULL check before the tracepoint and added another
 NULL check of bus->workq -- tiwai]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-07 07:31:59 +02:00
Takashi Iwai ff359b1491 ALSA: hda - Fix 3.9 regression of EAPD init on Conexant codecs
The older Conexant codecs have up to two EAPDs and these are supposed
to be rather statically turned on.  The new generic parser code
assumes the dynamic on/off per path usage, thus it resulted in the
silent output on some machines.

This patch fixes the problem by simply assuming the static EAPD on for
such old Conexant codecs as we did until 3.8 kernel.

Reported-and-tested-by: Christopher K. <c.krooss@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-04 10:57:16 +02:00
Mike Travis 49d9e77e72 ALSA: hda - Fix system panic when DMA > 40 bits for Nvidia audio controllers
The audio driver mistakenly allows 64 bit addresses to be created for
the audio driver on Nvidia GPUs.  Unfortunately, the hardware normally
only supports up to 40 bits of DMA.  This can cause system panics as
well as misdirected data when the address is > 40 bits as the upper
part the address is truncated.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-03 11:56:18 +02:00
David Henningsson a555bb8c6b ALSA: hda - Move Thinkpad X220 to use auto parser
This enables better volume controls than the current model parser.
Also, because the original quirk for X220 was added to fix
docking station support, add the TP410 fixup instead.

Reported-by: Willian Jon McCann <william.jon.mccann@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-29 10:58:53 +02:00
Kailang Yang 7fc7d04721 ALSA: hda - Add the support for ALC286 codec
It's yet another ALC269-variant.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-25 11:06:54 +02:00
David Henningsson 3e0d611b20 ALSA: hda - Limit internal mic boost for a few Asus machines
These are being reported as being so noisy at high mic boost levels,
so they are unusable in practice.
Therefore artificially limit the boosts.

BugLink: https://bugs.launchpad.net/bugs/1089795
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-22 14:50:41 +02:00
Takashi Iwai d5657ec9f4 ALSA: hda - Disable the sanity check in snd_hda_add_pincfg()
When pin default configs are overridden via patch option, these are
evaluated before fixups are applied.  Since some fixups change the
whole codec trees and/or add pins dynamically, this sanity check might
not pass when pins aren't present at the time the function is called.

We may reorder the execution, but an easier fix is simply to disable
this sanity check.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 09:59:28 +02:00
Wei Yongjun 6134b1a25b ALSA: hda - fix error return code in patch_alc662()
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-18 09:55:26 +02:00
Takashi Iwai 594813ffa7 ALSA: hda - Don't call vmaster hook when bus->shutdown is set
The flag bus->shutdown implies that the control elements might have
been already destroyed.  When a codec is resumed at this state and
tries to call vmaster hook (e.g. in snd_hda_gen_init()), it would
refer to a non-existing object, resulting in Oops in the end.

This patch just adds a check of the flag in the caller side for
avoiding such a crash.

Though, the best would be to clear hook->sw_kctl by the destructor of
the corresponding ctl element, but vmaster uses its own private_free,
it can't be done easily.  So let it be for a while.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-17 18:20:42 +02:00
David Henningsson 83f26ad2c9 ALSA: hda - fixup D3 pin and right channel mute on Haswell HDMI audio
When graphics initializes the HDMI chip, sometimes this leads to
pins going into D3 and right channel being muted. If the audio driver
finishes initialization before the graphic driver does, this situation
becomes permanent.

This is a workaround that checks for this situation and corrects it on
playback prepare. It has been verified working on at least one machine.

BugLink: https://bugs.launchpad.net/bugs/1167270
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-17 08:13:44 +02:00
Takashi Iwai 5ead56f2da ALSA: hda - Use the primary DAC for all aamix outputs
When setting up the aamix output paths, use the primary DAC instead of
the individual DAC for each output as default.  Otherwise multiple
DACs will be turned on for a single aamix widget, which results in
doubly or more volumes, because the duplicated signals will be sent
through all these DACs for a single stream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-16 14:16:54 +02:00
Takashi Iwai 65033cc8d5 ALSA: hda - Fix aamix activation with loopback control on VIA codecs
When we have a loopback mixer control, this should manage the state
whether the output paths include the aamix or not.  But the current
code blindly initializes the output paths with aamix = true, thus the
aamix is enabled unless the loopback mixer control is changed.

Also, update_aamix_paths() called by the loopback mixer control put
callback invokes snd_hda_activate_path() with aamix = true even for
disabling the mixing.  This leaves the aamix path even though the
loopback control is turned off.

This patch fixes these issues:
- Introduced aamix_default() helper to indicate whether with_aamix is
  true or false as default
- Fix the argument in update_aamix_paths() for disabling loopback

Reported-by: Lydia Wang <LydiaWang@viatech.com.cn>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-16 12:38:38 +02:00
Dylan Reid ae03bbb8f9 ALSA: hda - Add codec delay to the capture time stamp.
For capture, the delay through the codec contributes to the time stamp
of the sample recorded at the A to D.  Rename the codec time stamp
function appropriately.

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

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

ASoC: Updates for v3.10

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

 - Add a new component object type which will form the basis of moving
   to a more generic handling of SoC and off-SoC components, contributed
   by Kuninori Morimoto.
 - A fairly large set of cleanups for the dmaengine integration from
   Lars-Peter Clausen, starting to move towards being able to have a
   generic driver based on the library.
 - Performance optimisations to DAPM from Ryo Tsutsui.
 - Support for mixer control sharing in DAPM from Stephen Warren.
 - Multiplatform ARM cleanups from Arnd Bergmann.
 - New CODEC drivers for AK5385 and TAS5086 from Daniel Mack.
2013-04-15 19:45:16 +02:00
David Henningsson d240d1dcd5 ALSA: hda - Fix headset mic support for Asus X101CH
With this patch, a TRRS headset mic cannot be successfully detected
on the Asus X101CH, and we can also distinguish between headphone
and headset automatically.

Buglink: https://bugs.launchpad.net/bugs/1169138
Co-authored-by: Kailang <kailang@realtek.com>
Tested-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-15 16:03:53 +02:00
David Henningsson 73bdd59782 ALSA: hda - Implement headset jack functionality for some Dell hw
On some machines, there is a headset jack that can support both
headphone, headsets (of both CTIA and OMTP type) and mic-in.

On other machines, the headset jack supports headphone, headsets
(both CTIA and OMTP), but not mic-in.

This patch implements that functionality as different capture sources.

Buglink: https://bugs.launchpad.net/bugs/1169143
Tested-by: David Chen <david.chen@canonical.com>
Co-authored-by: Kailang <kailang@realtek.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-15 15:52:55 +02:00
David Henningsson b26b511668 ALSA: hda - Handle Headphone Mic jack more generic
Now that we have a flag for headphone mics, we can use that flag
in the jack creation instead of creating the jack manually.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-11 11:59:41 +02:00
David Henningsson 3cdbe11ae8 ALSA: hda - add some small convenience functions to auto parser
I never liked that we move our speaker and hp pins to line out
if there are not any line outs; but now that we do,
add some convenience functions to find hp and speaker pins even
if they have been moved.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-11 11:59:27 +02:00
David Henningsson cb420b1186 ALSA: hda - allow "Headphone Mic" parser flag
This allows a specific mic to get the "Headphone Mic" name, in addition
to the existing "Headset Mic" name.

Also, it allows for a special mark: if the sequence number is set
to 0xc, that's an indication to prefer it for headset mic, and if it's
set to 0xd, that's an indication to prefer it for headphone mic.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-11 11:59:20 +02:00
Dylan Reid 78daea29f2 ALSA: hda - Apply codec delay to wallclock.
For playback add the codec-side delay to the timestamp, for capture
subtract it.  This brings the timestamps in line with the time that
was recently added to the delay reporting.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-09 08:03:22 +02:00
Dylan Reid 423970042e ALSA: hda/realtek - Add a quirk for AC700 Chromebook.
Correct pin configs for the Acer AC700.  Most importantly indicate
that SPDIF is connected, it routes to HDMI out.
Similar to Aspire models, chain in the DMIC fixup and allow it to be
applied to this codec (ALC269VB) as well.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-07 09:42:40 +02:00
Dylan Reid 4af161072c ALSA: hda/cirrus - Add a quirk for Stumpy ChromeBox.
The Stumpy ChromeBox needs its pin configs fixed up.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05 07:35:37 +02:00
Dylan Reid e8412ca4d6 ALSA: hda/ca0132 - Update latency based on DSP state.
The DSP in the CA0132 codec adds a variable latency to audio depending
on what processing is being done.  Add a new patch op to return that
latency for capture and playback streams.  The latency is determined
by which blocks are enabled and knowing how much latency is added by
each block.

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

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05 07:33:32 +02:00
Jiri Slaby 868211db6d ALSA: hda/generic - fix uninitialized variable
changed is not initialized in path_power_down_sync, but it is expected
to be false in case no change happened in the loop. So set it to
false.

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

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

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

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

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=56171
Reported-and-tested-by: Nikita Tsukanov <keks9n@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04 15:35:39 +02:00
David Henningsson aeb3a97222 ALSA: hda - fix typo in proc output
Rename "Digitial In" to "Digital In". This function is only used for
proc output, so should not cause any problems to change.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04 11:49:16 +02:00
Rainer Koenig 1d87caa69c ALSA: hda - Enabling Realtek ALC 671 codec
* Added the device ID to the modalias list and assinged ALC662 patches
for it
* Added 4 port support for the device ID 0671 in alc662_parse_auto_config

Signed-off-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04 08:53:51 +02:00
Takashi Iwai efc33ce197 Merge branch 'for-linus' into for-next
Back-merge for cleaning up usb-audio code the recent commit modified,
and further UAC2 autoclock patches.
2013-04-03 17:07:29 +02:00
Mengdong Lin 10250911c6 ALSA: hda - bug fix on HDMI ELD debug message
This patch let ELD debug message show 'pin_eld->monitor_present' which reflects
the real pin response to verb GET_PIN_SENSE.

'eld->monitor_present' should not be used here because 'eld' is a temp
structure now and so its "monitor_present" is not set.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02 11:55:55 +02:00
Mengdong Lin 2ef5692efa ALSA: hda - bug fix on return value when getting HDMI ELD info
In function snd_hdmi_get_eld(), the variable 'ret' should be initialized to 0.
Otherwise it will be returned uninitialized as non-zero after ELD info is got
successfully. Thus hdmi_present_sense() will always assume ELD info is invalid
by mistake, and /proc file system cannot show the proper ELD info.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Cc: stable@vger.kernel.org
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02 11:55:23 +02:00
Chih-Chung Chang 993884f6a2 ALSA: hda/ca0132 - Delay HP amp turnon.
Turing on the headphone amp interferes with the impedance measurement
used to detect a TRRS style headset microphone.  Delay the HP turn on
until 500ms after the jack is detected, allowing the mic detection
state machine to run to completion.

Signed-off-by: Chih-Chung Chang <chihchung@chromium.org>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02 11:28:39 +02:00
Takashi Iwai 4abdbd1c2c ALSA: hda - VIA prefers side surrounds over HP
The recent fix for the independent HP reduced the availability of the
side surround output, because there are only 4 DACs for 7.1 and a HP
outputs.  Adjust the badness tables for VIA so that 7.1 outputs are
activated for the cost of missing independent HP.

Once when we implement the dynamic DAC switching to multiple outputs,
this conflicts will be eased in future...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22 15:11:07 +01:00
Takashi Iwai bec8e6807e ALSA: hda - Lower the badness for independent HP penalty
The lack of independent HP mode shouldn't be too bad, but currently
its badness is set a bit too high.  Let's lower it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22 15:10:08 +01:00
Takashi Iwai 98bd11152b ALSA: hda - Allow codec drivers to give own badness tables
The standard badness values don't seem to fit to all preferences.
Some configuration prefer the side output over the headphone, some
want the speaker over the surround, etc.

This patch moves the badness table pointers into hda_gen_spec, so that
the codec driver can override them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22 14:53:50 +01:00
Takashi Iwai 10d7410790 Merge branch 'for-linus' into for-next
Merge back for-linus branch for the badness table adjustment for VIA codecs

* for-linus:
  ALSA: hda - Fix DAC assignment for independent HP
  ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loader
  ALSA: hda - Fix typo in checking IEC958 emphasis bit
  ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()
  ALSA: snd-usb: mixer: propagate errors up the call chain
  ALSA: usb: Parse UAC2 extension unit like for UAC1
  ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driver
2013-03-22 14:53:25 +01:00
Takashi Iwai 55a63d4da3 ALSA: hda - Fix DAC assignment for independent HP
The generic parser should evaluate the availability of the independent
HP when specified.  Otherwise a DAC without the direct connection to
the corresponding pin may be assigned for the HP, but the driver
doesn't check it at all.  The problem was actually seen on some
machines with VT1708s or equivalent codec, where DAC0 is assigned to
HP although it can be connected only via aamix.

This patch adds the badness evaluation for the independent HP to make
it working properly.

Reported-by: Lydia Wang <LydiaWang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21 17:20:12 +01:00
David Henningsson f390dad4d8 ALSA: hda - Enable "Headset Mic" name for some Dell Latitude devices
Now that we have a "Headset Mic" name, let's use it for some devices
we know for sure has a headset mic jack.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21 17:17:30 +01:00
David Henningsson a385d97b82 ALSA: hda - Introduce "Headset Mic" name
Headset mic jacks, i e TRRS style jacks with Headphone Left,
Headphone Right, Mic and GND signals, are becoming increasingly
common and are now being shipped by several manufacturers.

Unfortunately, the HDA specification does not give us any hint
of whether a Mic pin belongs to such a jack or not, but it would
still be helpful for the user to know (especially if there is one
TRS Mic jack and one TRRS headset jack).

This new fixup causes the first (non-dock, non-internal) mic to
be a headset mic jack. The algorithm can be later refined if needed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21 17:17:21 +01:00
Takashi Iwai eb49faa6a4 ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loader
The current DSP loader code abuses snd_hda_lock_devices() for ensuring
the DSP loader not conflicting with the other normal operations.  But
this trick obviously doesn't work for the PM resume since the streams
are kept opened there where snd_hda_lock_devices() returns -EBUSY.
That means we need another lock mechanism instead of abuse.

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

Reported-and-tested-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20 18:36:06 +01:00
Takashi Iwai a686fd141e ALSA: hda - Fix typo in checking IEC958 emphasis bit
There is a typo in convert_to_spdif_status() about checking the
emphasis IEC958 status bit.  It should check the given value instead
of the resultant value.

Reported-by: Martin Weishart <martin.weishart@telosalliance.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20 15:42:00 +01:00
Takashi Iwai 039eb75350 ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driver
I forgot to update spec->gpio_data in the automute hook, so it will be
overridden at the init sequence, thus the machine is still silent when
no headphone jack is plugged at boot time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 16:55:49 +01:00
Takashi Iwai 9f5c6faf72 ALSA: hda - Add GPIO-based LED support on HP desktop machines
The new HP desktop machines have Realtek codecs and their LEDs are
controlled via GPIO as for many laptop models.  Add similar hooks as
well as in patch_sigmatel.c for controlling LEDs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 14:15:58 +01:00
Takashi Iwai 8bc0a8469c ALSA: hda - Make the resume of digital beep setup proper
The verb to set up the digital beep via AC_VERB_SET_DIGI_CONVERT_2
should be executed at resume as well.  Use the cached write for it
being performed automatically at resume.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 12:58:48 +01:00
Takashi Iwai e914b25e37 ALSA: hda - Fix power-saving during playing beep sound
While playing the digital beep tone, the codec shouldn't be turned
off.  This patch adds proper snd_hda_power_up()/down() calls at each
time when the beep is played or off.

Also, this fixes automatically an unnecessary codec power-up at
detaching the beep device when the beep isn't being played.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 12:58:47 +01:00
Takashi Iwai 7504b6cd22 ALSA: hda - Move beep attach/detach calls in hda_generic.c
Instead of calling snd_hda_attach_beep_device() and
snd_hda_detach_beep_device() in each codec driver, move them to the
generic parser.  The codec driver just needs to set spec->beep_nid for
activating the digital beep.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 12:58:42 +01:00
Takashi Iwai cf30f46acd Merge branch 'for-linus' into for-next
Back-merged for refactoring beep stuff.
2013-03-18 11:04:42 +01:00
Takashi Iwai a86b1a2cd2 ALSA: hda/cirrus - Fix the digital beep registration
The argument passed to snd_hda_attach_beep_device() is a widget NID
while spec->beep_amp holds the composed value for amp controls.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 11:00:44 +01:00
Takashi Iwai 31b6945a89 ALSA: hda - Fix missing beep detach in patch_conexant.c
This leaks the beep input device after module unload, which leads to
Oops.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55321
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18 10:06:41 +01:00
Takashi Iwai 6d3073e124 ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecs
During the transition to the generic parser, the hook to the codec
specific automute function was forgotten.  This resulted in the silent
output on some MacBooks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15 14:24:45 +01:00
Dylan Reid b714a7106b ALSA: hda/ca0132 - Remove extra setting of dsp_state.
spec->dsp_state is initialized to DSP_DOWNLOAD_INIT, no need to reset
and check it in ca0132_download_dsp().

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15 07:41:12 +01:00
Dylan Reid e8f1bd5d77 ALSA: hda/ca0132 - Check download state of DSP.
Instead of using the dspload_is_loaded() function, check the dsp_state
that is kept in the spec.  The dspload_is_loaded() function returns
true if the DSP transfer was never started.  This false-positive leads
to multiple second delays when ca0132_setup_efaults() times out on
each write.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15 07:40:39 +01:00
Dylan Reid d1d28500cc ALSA: hda/ca0132 - Check if dspload_image succeeded.
If dspload_image() fails, it was ignored and dspload_wait_loaded() was
still called.  dsp_loaded should never be set to true in this case,
skip it.  The check in dspload_wait_loaded() return true if the DSP is
loaded or if it never started.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15 07:40:11 +01:00
David Henningsson 303985f810 ALSA: hda - Disable IDT eapd_switch if there are no internal speakers
If there are no internal speakers, we should not turn the eapd switch
off, because it might be necessary to keep high for Headphone.

BugLink: https://bugs.launchpad.net/bugs/1155016
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-14 15:31:45 +01:00
Takashi Iwai ba615b86d6 ALSA: hda - Don't apply EAPD power filter as default
So far, the driver doesn't power down the widget at going down to D3
when the widget node has an EAPD capability and EAPD is actually set
on all codecs unless codec->power_filter is set explicitly.
This caused a problem on some Conexant codecs, leading to click
noises, and we set it as NULL there.  But it is very unlikely that the
problem hits only these codecs.

Looking back at the development history, this workaround for EAPD was
introduced just for some laptops with STAC9200 codec, then we applied
it blindly for all.  Now, since it's revealed to have an ill effect,
we should disable this workaround per default and apply only for the
known requiring systems.

The EAPD workaround is implemented now as snd_hda_codec_eapd_power_filter(),
and this has to be set explicitly by the codec driver when needed.
As of now, only patch_stac9200() sets this one.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13 18:07:05 +01:00
Takashi Iwai bce0d2a80e ALSA: hda - Allow unlimited pins and converters in patch_hdmi.c
Use the dynamic array allocations for pins, converters and PCM arrays
instead of the fixed size arrays.  The modern HDMI codecs get more and
more pins, and we don't know the sensitive limit.

Most of the patch are spent for the straight conversions from the
fixed array access to snd_array helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13 18:07:04 +01:00
Takashi Iwai 5265fd9a9f ALSA: hda - Drop explicit memset() by reallocation with __GFP_ZERO
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13 18:06:59 +01:00
Takashi Iwai b5f82b1044 ALSA: hda - Fix snd_hda_get_num_raw_conns() to return a correct value
In the connection list expansion in hda_codec.c and hda_proc.c, the
value returned from snd_hda_get_num_raw_conns() is used as the array
size to store the connection list.  However, the function returns
simply a raw value of the AC_PAR_CONNLIST_LEN parameter, and the
widget list with ranges isn't considered there.  Thus it may return a
smaller size than the actual list, which results in -ENOSPC in
snd_hda_get_raw_conections().

This patch fixes the bug by parsing the connection list correctly also
for snd_hda_get_num_raw_conns().

Reported-and-tested-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12 16:47:30 +01:00
Takashi Iwai 93c9d8ae0b ALSA: hda - Don't re-initialize shared hp/mic pinctl
When a headphone pin is set up as a shared hp/mic pin, we rather want
to keep it as a headphone primarily as default, but the driver
overrides it always as a mic pin, just because the input controls are
created after outputs.  Add a check of pin NID and skip the
re-initialization of pinctl for such a shared hp/mic pin.

Reported-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11 09:57:21 +01:00
Takashi Iwai 8ba955cef3 ALSA: hda - Avoid automatic pin-ctl update for hp/mic when jack ctl exists
When the headphone mic jack enum control is created (via explicitly
specification by user), it doesn't make much sense to change the I/O
direction dynamically per capture source change, since the I/O
direction is rather controlled over the enum ctl.

This also reduces the implicit dependency between the capture source
and the hp mic jack enum ctls, which might confuse a program accessing
the whole control elements at once like alsactl.

In addition, this patch introduces update_hp_automute_hook() function
to call the proper hook function.  It's just to remove the open codes
in multiple places in hda_generic.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:43:27 +01:00
Takashi Iwai f811c3cf8f ALSA: hda - Consolidate add_in_jack_modes and add_out_jack_modes hints
There is no big merit to distinguish these two hints.  Instead, just
have a single flag, add_jack_modes, for creating the jack mode enum
ctls for both I/O directions.

The hint string parser code is left and translated as add_jack_modes
just for keeping compatibility.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:32:59 +01:00
Takashi Iwai 3f550e3232 ALSA: hda - Allow to change I/O direction in hp/mic jack mode ctl
The previous commits added the capability to change the pin control of
hp/mic shared jack, but it actually didn't work as expected when the
value is changed from the output to the input, since I forgot to reset
the pin I/O bit in that case.  This patch fixes the problem.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:30:27 +01:00
Takashi Iwai 5ebd3bbdcc ALSA: hda - Add some model name strings for ALC260
In order to let user test the known workaround more easily, give a few
known fixups for ALC260 to the model strings so that it can be passed
via the module option.

Also, move the unusual setups found in FSC S7020 fixup into a special
model, fujitsu-jwse, Jonathan Woithe Special Edition.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:30:07 +01:00
Takashi Iwai 5f171baaa5 ALSA: hda - Handle shared hp/mic jack mode
When a headphone jack is configured as a shared hp/mic jack, the jack
mode enum needs to handle both input and output directions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:30:01 +01:00
Takashi Iwai 967303dabc ALSA: hda - Add the generic Headphone Mic feature
This patch improves the generic parser code to allow to set up the
headphone jack as a mic input.  User can enable this feature by giving
hp_mic hint string.

The former shared hp/mic feature for the single built-in mic is still
retained.  This detection can be disabled now via hp_mic_detect hint
string, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 18:29:52 +01:00
Kailang Yang 84dfd0ac23 ALSA: hda - Add support of new codec ALC233
It's compatible with ALC282.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 09:21:01 +01:00
Xi Wang 3bc085a12d ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg()
Move the zero check `hda_frame_size_words == 0' before the modulus
`buffer_size_words % hda_frame_size_words'.

Also remove the redundant null check `buffer_addx == NULL'.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 09:18:00 +01:00
Mengdong Lin 4c7a548a70 ALSA: hda - check NULL pointer when creating SPDIF PCM switch
If the new control cannot be created, this function will return to avoid
snd_hda_ctl_add dereferencing a NULL control pointer.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 09:14:03 +01:00
Mengdong Lin 25336e8ae2 ALSA: hda - check NULL pointer when creating SPDIF controls
If the SPDIF control array cannot be reallocated, the function
will return to avoid dereferencing a NULL pointer.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07 09:12:14 +01:00
Takashi Iwai 8554ee4057 ALSA: hda - Enable beep for ASUS EeeBox EBP1501P
Reported-by: Harald Becker <ralda@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-25 09:54:43 +01:00
David Henningsson 30efd8debd ALSA: hda - hdmi: Make jacks phantom, if they're not detectable
Just as for analog codecs, a jack that isn't suitable for detection
(in this case, NO_PRESENCE was set) should be a phantom Jack
instead of a normal one.

Thanks to Raymond Yau for spotting.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/961286
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=903869
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-22 10:23:32 +01:00
David Henningsson 92c69e796b ALSA: hda - hdmi: Notify userspace when ELD control changes
ELD validity can change during the lifetime of a presence detect,
so we need to be able to listen for changes on the ELD control.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19 18:28:38 +01:00
David Henningsson 4bd038f9d8 ALSA: hda - hdmi: Protect ELD buffer
Because the eld buffer can be simultaneously accessed from both
workqueue context (updating) and process context (kcontrol read),
we need to protect it with a mutex to guarantee consistency.

To avoid holding the mutex while reading the ELD info from the
codec, we introduce a temporary eld buffer.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19 18:28:30 +01:00
David Henningsson 1613d6b46b ALSA: hda - hdmi: Refactor hdmi_eld into parsed_hdmi_eld
For better readability, the information that is parsed out of the
ELD data is now put into a separate parsed_hdmi_eld struct.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19 18:28:22 +01:00
David Henningsson 68e03de985 ALSA: hda - hdmi: Do not expose eld data when eld is invalid
Previously, it was possible to read the eld data of the previous
monitor connected. This should not be allowed.

Also refactor the function slightly.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19 18:28:13 +01:00
David Henningsson bbfd8a19b6 ALSA: hda - hdmi: ELD shouldn't be valid after unplug
Currently, eld_valid is never set to false, except at kernel module
load time. This patch makes sure that eld is no longer valid when
the cable is (hot-)unplugged.

Cc: stable@kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19 18:28:04 +01:00
Takashi Iwai e6e0ee507f ALSA: hda - Fix the silent speaker output on Fujitsu S7020 laptop
In the recent update, Fujitsu S7020 laptop with ALC260 codec lost the
speaker output, no matter how the amps and the pins are set.  After a
long debugging session, we found out that the default codec init code
is harmful for this machine, and we have to reset it to
ALC_INIT_NONE.

Reported-and-tested-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-18 17:04:20 +01:00
David Henningsson d06ac14399 ALSA: hda - add quirks for mute LED on two HP machines
These two machines have no mute LED string in BIOS.

BugLink: https://bugs.launchpad.net/bugs/1128934
Tested-by: Tammy Yang <tammy.yang@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-18 11:46:46 +01:00
David Henningsson 8be69efacd ALSA: hda - Remove speaker clicks on CX20549
This chip needs the speaker pin to go to D3 to avoid clicks,
so default_power_filter does not work here.

This was found on Thinkpad R61i/T61i but I guess it applies to
the entire chip. If not, quirks should be set for at least
PCI SSID 17aa:20ac.

Thanks to c4pp4 for testing.

BugLink: https://bugs.launchpad.net/bugs/886975
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-14 11:54:43 +01:00
Takashi Iwai 2c1350fdea ALSA: hda - Disable runtime PM for Intel 5 Series/3400
We've got a regression report wrt the IRQ issue related with the
power-save on a Dell machine, and disabling runtime PM works around.

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

Cc: <stable@vger.kernel.org> [v3.7+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-14 09:44:55 +01:00
Takashi Iwai 1d739066a0 ALSA: hda - Increase badness for missing multi-io
The current badness value used for the missing multi-io seems too
weak, and the multi-io tends to be skipped for desktop configurations
when no enough DACs are available.  It's because the total badness of
the multi-io becomes often larger than the badness with assigning an
individual DAC to a headphone jack.  This is good for one side, but it
seems that the surround outputs are more demanded by that.

This patch increases the badness value for the missing multi-io
slightly so that the multi-io would be preferred than the individual
headphone DAC if they conflict.  Through the tests with hda-emu,
mostly only desktop configurations with ALC662/663 and CMI codecs are
affected by this change, and all look reasonable.

Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-13 14:17:32 +01:00
Takashi Iwai ea9b43addc ALSA: hda - Fix broken workaround for HDMI/SPDIF conflicts
The commit [dcda58061: ALSA: hda - Add workaround for conflicting
IEC958 controls] introduced a workaround for cards that have both
SPDIF and HDMI devices for giving device=1 to SPDIF control elements.
It turned out, however, that this workaround doesn't work well -

- The workaround checks only conflicts in a single codec, but SPDIF
  and HDMI are provided by multiple codecs in many cases, and

- ALSA mixer abstraction doesn't care about the device number in ctl
  elements, thus you'll get errors from amixer such as
  % amixer scontrols -c 0
  ALSA lib simple_none.c:1551:(simple_add1) helem (MIXER,'IEC958
  Playback Switch',0,1,0) appears twice or more
  amixer: Mixer hw:0 load error: Invalid argument

This patch fixes the previous broken workaround.  Instead of changing
the device number of SPDIF ctl elements, shift the element indices of
such controls up to 16.  Also, the conflict check is performed over
all codecs found on the bus.

HDMI devices will be put to dev=0,index=0 as before.  Only the
conflicting SPDIF device is moved to a different place.  The new place
of SPDIF device is supposed by the updated alsa-lib HDA-Intel.conf,
respectively.

Reported-by: Stephan Raue <stephan@openelec.tv>
Reported-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org> [v3.8]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 17:09:19 +01:00
Takashi Iwai 9958922a32 ALSA: hda/ca0132 - Add missing \n to debug prints
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 12:11:03 +01:00
Takashi Iwai 4a8b89f995 ALSA: hda/ca0132 - Fix type of INVALID_CHIP_ADDRESS
The chip address is 32bit long but INVALID_CHIP_ADDRESS is defined as
an unsigned long.  This makes dsp_chip_to_dsp_addx() misbehaving on
64bit architectures.  Fix the INVALID_CHIP_ADDRESS definition to be
32bit.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 10:15:15 +01:00
Fernando Luis Vázquez Cao d911149625 ALSA: hda - update documentation for no-primary-hp fixup
The problem addressed by this fixup is not specific to Vaio Z, affecting
some Vaio all-in-one desktop PCs too. Update the code comments accordingly.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 10:12:39 +01:00
Fernando Luis Vázquez Cao 12e31a78c7 ALSA: hda - Workaround for silent output on Sony Vaio VGC-LN51JGB with ALC889
Some Vaio all-in-one desktop PCs (for example VGC-LN51JGB) are affected by
the same issue that caused Vaio Z laptops to become silent: the speaker pin
must be connected to the first DAC even though the codec itself advertises
flexible routing through any of the DACs.

Use the no-primary-hp fixup for choosing the speaker pin as the primary so
that the right DAC is assigned on this device.

Cc: stable@vger.kernel.org
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-12 10:11:01 +01:00