Commit graph

5665 commits

Author SHA1 Message Date
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
Denis Efremov dacae5a19b ALSA: ali5451: remove irq enabling in pointer callback
snd_ali_pointer function is called with local
interrupts disabled. However it seems very strange to
reenable them in such way.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-11 16:52:46 +01:00
Denis Efremov f49a59c447 ALSA: rme32.c irq enabling after spin_lock_irq
According to the other code in this driver and similar
code in rme96 it seems, that spin_lock_irq in
snd_rme32_capture_close function should be paired
with spin_unlock_irq.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-11 16:12:24 +01:00
Takashi Iwai f664417e23 ALSA: hda/ca0132 - Slight optimization for build with DSP
This reduces the resultant binary size.

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

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-10 11:58:40 +01:00
Ian Minett 6d67530e2c ALSA: CA0132: Improve the DSP transfer timeout calculations
Base the DSP firmware transfer and communication timeouts on jiffy values.

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

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-10 11:38:29 +01:00
Takashi Iwai c88d4e84e6 ALSA: hda - Yet another fix for broken HSW HDMI pin connections
A Haswell test machine showed that the invalid connection list, but
this time it has only a single pin on the codec, thus the former fixup
code doesn't work as it assumes the three pins blindly.

This patch splits the former fixup code to two parts:
- Enable eDP 1.2 for Haswell codec
- Fix the connection list of pins on Haswell codec;
  the converter list is recorded dynamically in hdmi_add_cvt(), and
  applied in hdmi_add_pin()

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08 12:23:48 +01:00
Mengdong Lin 1611a9c931 ALSA: hda - Add fixup for Haswell to enable all pin and convertor widgets
Some Haswell machines support more than one display outputs (HDMI or DP),
but its BIOS may not enable the codec's 2nd and 3rd pin and output cvt widgets.

This patch implements a board-specific fixup for Intel Haswell Machines:
If the hidden pins are not enabled by BIOS, the driver will enable them
and call common code to update the codec tree.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08 12:23:13 +01:00
Mengdong Lin a15d05db41 ALSA: hda - Support rereading widgets under the function group
A codec may allow software to hide some unused pin/cvt widgets.

Sometimes BIOS does not enable the hidden widgets properly although they are
needed for the board. Thus the driver need to enable them as a board-specific
fixup and the whole tree will change.

This patch implements a common code for rereading codec widgets. So the fixup
code can call it after enabling the hidden widgets.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-08 12:22:50 +01:00
Takashi Iwai 4eea30914f ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else.  (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)

This patch tries to remove this restriction.  For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.

Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.

Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 20:01:08 +01:00
Takashi Iwai c1279f8787 ALSA: hda - Set non-snoop for Creative HD-audio controllers
... looks like we need this for stable operations.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:36:22 +01:00
Heiko Carstens 262d62eb55 ALSA: add missing HAS_IOPORT and GENERIC_HARDIRQS dependencies
Fix these two compile errors on s390 which does not have HAS_IOPORT
nor GENERIC_HARDIRQS:

sound/pci/lx6464es/lx6464es.c: In function ‘snd_lx6464es_free’:
sound/pci/lx6464es/lx6464es.c:565:2: error: implicit declaration of function ‘ioport_unmap’

sound/soc/codecs/wm8903.c: In function ‘wm8903_set_pdata_irq_trigger’:
sound/soc/codecs/wm8903.c:1954:9: error: implicit declaration of function ‘irq_get_irq_data’

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 14:46:13 +01:00
Takashi Iwai 9a0869f402 ALSA: hda - Fix misc compile warnings in patch_ca0132.c
sound/pci/hda/patch_ca0132.c: In function ‘ca0132_is_vnode_effective’:
  sound/pci/hda/patch_ca0132.c:3331:15: warning: ‘nid’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sound/pci/hda/patch_ca0132.c:4345:13: warning: ‘ca0132_download_dsp’ defined but not used [-Wunused-function]

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 12:56:12 +01:00
Takashi Iwai 45acc86b2e Merge branch 'topic/hda-ca0132-dsp' into for-next 2013-02-07 12:34:36 +01:00
Takashi Iwai 0186f4f4f2 ALSA: hda - Use generic array for loopback list management
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 10:45:11 +01:00
Takashi Iwai 46a144818a ALSA: hda - Enable loopback accounts for CONFIG_PM=n, too
The loopback list is referred by the VIA codec driver no matter
whether CONFIG_PM is set or not, thus we need to enable it always.
Otherwise it gets compile errors.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 09:59:26 +01:00
Dan Carpenter b57a895fa2 ALSA: ice1712: fix boundary check in snd_wm8766_write()
The wm->regs[] array has WM8766_REG_COUNT (16) elements not
WM8766_REG_RESET (31).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 09:52:15 +01:00
Takashi Iwai f9afed1f7f ALSA: hda - Apply mic-mute LED fixup for new HP laptops
It's mostly harmless to apply it for new models even if they have no
mic mute LED (just toggling an unused GPIO pin).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-06 12:39:06 +01:00
Takashi Iwai 2faea5274f Merge branch 'for-linus' into for-next
Merge pending fixes that haven't pulled into 3.8.
2013-02-05 14:48:03 +01:00
David Henningsson 05dc0fc9d0 ALSA: hda - detect jacks on VT1708 even when no streams are active
These days, GUIs such as Gnome sound settings want to be able to
show the correct jack status even when no streams are currently
running. I doubt this gives any measurable difference in power,
but if it does, the "Jack Detect" control can still be used to
turn polling off.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-05 12:17:31 +01:00
David Henningsson f672f65a1c ALSA: hda - Fix phantom jacks on VT1708
The VT1708 has no unsol event capability, and polling is set using
the "Jack Detect" alsamixer control. In order not to create
phantom Jack controls, temporary enable jackpoll during build_controls.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-05 12:17:24 +01:00
Takashi Iwai 24f3cede59 ALSA: hda - Add new Kconfig CONFIG_SND_HDA_CODEC_CA0132_DSP
... to be less confusing for the update path.

This new kconfig will choose CONFIG_SND_HDA_DSP_LOADER, which is
basically a device-independent feature in hda_intel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-04 18:30:49 +01:00
Anssi Hannula 20608731f4 ALSA: hda - Fix default multichannel HDMI mapping regression
Commit d45e6889ee ("ALSA: hda - Provide
the proper channel mapping for generic HDMI driver") added support for
custom channel maps in the HDA HDMI driver. Due to a mistake in an
'if' condition the custom map is always used even when no such map has
been set. This causes incorrect channel mapping for multichannel audio
by default.

Pass per_pin->chmap_set to hdmi_setup_channel_mapping() as a parameter
so that it can use it for detecting if a custom map has been set instead
of checking if map is NULL (which is never the case).

Reported-by: Staffan Lindberg <pike@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-02-04 10:26:44 +01:00
Takashi Iwai 2ad779b732 ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open()
If the driver detects and invalid ELD, it gives an open error.
But it forgot to release the assigned pin, converter and spdif ctls
before returning.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-01 14:01:27 +01:00
Wang Xingchao 4a7c516bf0 ALSA - HDA: New PCI ID for Haswell ULT
Add new PCI ID 0x0a0c for Haswell ULT platform.

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

This patch fixes the handling for SG-buffers.

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

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-29 18:18:00 +01:00
Takashi Iwai f748abcc5b ALSA: hda - Enable LPIB delay count for Poulsbo / Oaktrail
Currently we use LPIB forcibly for both playback and capture for
Poulsbo and Oaktrail devices, and this seems rather problematic.
The recent fix for LPIB delay count seems working well with these
devices, so let's enable it instead.

Reported-by: Martin Weishart <martin.weishart@telosalliance.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-29 10:15:35 +01:00
David Henningsson 664389dbd5 ALSA: hda - Fix powermap for external mics on IDT codecs
This patch fixes a regression of the external mic not working on
HP Probook 4520s.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-28 11:33:01 +01:00
David Henningsson fcd8f3b1d4 ALSA: hda - fix inverted internal mic on Acer AOA150/ZG5
This patch enables internal mic input on the machine.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1107477
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-28 09:50:50 +01:00
Takashi Iwai 86b2723725 ALSA: Make snd_printd() and snd_printdd() inline
Because currently snd_printd() and snd_printdd() macros are expanded
to empty when CONFIG_SND_DEBUG=n, a compile warning like below
appears sometimes, and we had to covert it by ugly ifdefs:
  sound/pci/hda/patch_sigmatel.c: In function ‘stac92hd71bxx_fixup_hp’:
  sound/pci/hda/patch_sigmatel.c:2434:24: warning: unused variable ‘spec’ [-Wunused-variable]

For "fixing" these issues better, this patch replaces snd_printd() and
snd_printdd() definitions with empty inline functions instead of
macros.  This should have the same effect but shut up warnings like
above.

But since we had already put ifdefs, changing to inline functions
would trigger compile errors.  So, such ifdefs is removed in this
patch.

In addition, snd_pci_quirk name field is defined only when
CONFIG_SND_DEBUG_VERBOSE is set, and the reference to it in
snd_printdd() argument triggers the build errors, too.  For avoiding
these errors, introduce a new macro snd_pci_quirk_name() that is
defined no matter how the debug option is set.

Reported-by: Stratos Karafotis <stratosk@semaphore.gr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-25 18:32:14 +01:00
Takashi Iwai f4f678d222 ALSA: hda - Enable power down of unused widgets for IDT codecs
IDT codecs can work well with this new feature, so let's enable it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 18:02:43 +01:00
Takashi Iwai 55196fffc9 ALSA: hda - Implement path-based power filter to the generic parser
This patch adds a better power filter hook for powering down unused
widgets in the generic parser.

The feature is enabled by setting hda_gen_spec.power_down_unused
flag.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 17:55:52 +01:00
Takashi Iwai 9040d102da ALSA: hda - Add snd_hda_check_power_state() helper function
... for small refactoring.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 17:47:17 +01:00
Takashi Iwai b9c590bbf1 ALSA: hda - Synchronize the power state at the end of codec init
Put the power state synchronization at the end of the parsing of
codec.  This is necessary when the power filter is changed during the
codec probe.  Since the first power-up sequence is performed without
the special filter, all widgets are supposed to be ON at this point.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 17:32:48 +01:00
Takashi Iwai 9419ab6b72 ALSA: hda - Add power state filtering
Add a hook to struct hda_codec for filtering the target power state of
each widget when powering up/down.  The current hackish EAPD check is
implemented as the default hook pointer, too.

This allows codec drivers to implement own power filter.  In the
upcoming changes, the generic parser will have the better power filter
based on the active paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 17:23:35 +01:00
Takashi Iwai 25368c47ae ALSA: hda/via - Fix wrong checks of power state bits
AC_VERB_GET_POWER_STATE returns the combined bits of the actual state
and the target state.  Thus, comparing the obtained value directly
with the target value can't work.  The value has to be shifted and
masked properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 17:14:35 +01:00
Takashi Iwai 7dddf2aed8 ALSA: hda - Fix wrong arguments for path deactivation checks
The arguments to call is_active_nid() in activate_amp() were swapped,
and this resulted in the muted amp on some SPDIF output pins.

Also, the index to be passed to is_active_nid() must be idx_to_check.
Otherwise it checks the wrong connection in the case of implicit aamix
connection paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-24 16:31:35 +01:00
Takashi Iwai 5397145f4f ALSA: hda - Add auto-mute support to PB desktop
Using the new chained_before flag, we can correct the headphone jack
detection capability easily over the existing ALC880 6stack model
(which disables the jack detection intentionally for compatibility
reason).

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=901846

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 18:25:11 +01:00
Takashi Iwai f7c0bfa060 Merge branch 'for-linus' into for-next
Merge the 3.8 devel branch for correcting the newly added PB desktop
fixup with the automute support.
2013-01-23 18:25:00 +01:00
Takashi Iwai 0712eea349 ALSA: hda - Add a fixup for Packard-Bell desktop with ALC880
A Packard-Bell desktop machine gives no proper pin configuration from
BIOS.  It's almost equivalent with the 6stack+fp standard config, just
take the existing fixup.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=901846

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 18:24:05 +01:00
Takashi Iwai 1f57825077 ALSA: hda - Add chained_before flag to the fixup entry
Sometimes we want to call a fixup after applying other existing
fixups, but currently the fixup chain mechanism allows only the call
the others after the target fixup.  This patch adds a new flag,
chained_before, to struct hda_fixup, for allowing the chained call
before the current execution.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 18:10:10 +01:00
Takashi Iwai 3e367f155f ALSA: hda - Small code refactoring about path re-initialization
Introduce a helper function to do the same thing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 17:07:23 +01:00
Takashi Iwai e4a395e781 ALSA: hda - Fix missing path between aamix and outputs in AD codecs
AD1988 family and AD1882 codecs have another mixer widget (0x21)
between the analog-loopback mixer widget (0x20) and the actual
outputs.  Due to this hole, the analog-loopbacks aren't sent properly
to the output pins.

As a band-aid fix, introduce another fields holding the aamix merge
path, and activate it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 17:00:31 +01:00
Takashi Iwai 31614bb89b ALSA: hda - Fix inconsistent pin states after resume
The commit [26a6cb6c: ALSA: hda - Implement a poll loop for jacks as a
module parameter] introduced the polling jack detection code, but it
also moved the call of snd_hda_jack_set_dirty_all() in the resume path
after resume/init ops call.  This caused a regression when the jack
state has been changed during power-down (e.g. in the power save
mode).  Since the driver doesn't probe the new jack state but keeps
using the cached value due to no dirty flag, the pin state remains
also as if the jack is still plugged.

The fix is simply moving snd_hda_jack_set_dirty_all() to the original
position.

Reported-by: Manolo Díaz <diaz.manolo@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 16:05:37 +01:00
Takashi Iwai 0db75790e2 ALSA: hda - Fix invalid snd_BUG_ON() in alc271_hp_gate_mic_jack()
The fixup function is called multiple times before parsing the pins,
so snd_BUG_ON() hits when loaded.  Move it to the proper place in the
if block.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-23 13:57:20 +01:00
Takashi Iwai 2cf215bfaa Merge branch 'topic/hda-gen-parser' into for-next
This is a merge of really big changes: the generic parser is heavily
enhanced for handling all cases, based on the former Realtek codec
driver code.  And all codec drivers except for a few ones (CA0132,
HDMI and modem) have been converted to use the new generic driver.

Conflicts:
	sound/pci/hda/patch_realtek.c
2013-01-23 08:34:12 +01:00
Takashi Iwai e152f18027 Merge branch 'for-linus' into for-next
This is a preliminary merge before the upcoming merge of generic parser
branch.
2013-01-23 08:31:34 +01:00