Commit graph

253227 commits

Author SHA1 Message Date
Takashi Iwai 57307bf24a ALSA: hda - Don't create secondary substream when no independent-hp is used
For VIA codecs, we shouldn't create a substream for independent HP mode,
when no individual HP DAC is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:03 +02:00
Takashi Iwai f4a7828bc1 ALSA: hda - Re-implement smart51 detection for VIA codecs
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:02 +02:00
Takashi Iwai 4a79616d07 ALSA: hda - Unify output-control parsing in patch_via.c
Parse the output-paths more dynamically, i.e. traverse the paths
from each output pin instead of fixed assignment for each codec.
Now all codecs are using the same output parser code.

The smart51 setup doesn't work with this change, and will be fixed
in the next commits.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:01 +02:00
Takashi Iwai 620e2b28b7 ALSA: hda - Unify input-volume creations in patch_via.c
Now storing the analog-mixer widget in spec, we can simplify the rest
parts.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:01 +02:00
Takashi Iwai 64be285b66 ALSA: hda - Auto-mute all LO and speakers in patch_via.c
Muting all line-outs and/or speakers is more common in other drivers,
so we should follow it, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:24:00 +02:00
Takashi Iwai 3e0693e278 ALSA: hda - Change pin-ctl for auto-muting in patch_via.c
Mute the outputs via pin-controls instead of amps for the auto-mute
handling.  This makes our life easier as it avoids conflict of the states
between the mixer elements and the auto-mute toggles.

With this change, we can use vmaster for the master control easily now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:59 +02:00
Takashi Iwai 82673bc895 ALSA: hda - Generate PCM names dynamically in patch_via.c
This reduces lots of static strings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:58 +02:00
Takashi Iwai 291c9e33bf ALSA: hda - Refactor ctl array handling in patch_via.c
No functional change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:57 +02:00
Takashi Iwai e06e5a2974 ALSA: hda - Defer mixer element creation to the right time in patch_via.c
The jack-detect control should be created at the time of build_controls
callback instead of calling snd_hda_add_ctls() at the tree-parsing time.
For that, copy the control to the temporary array like other cases.

Also, fixed typos of vt1708_jack_detect in all places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:56 +02:00
Takashi Iwai a766d0d763 ALSA: hda - Fill ADCs dynamically for VIA codecs
Instead of giving the fixed ADC list, parse the widgets and fill in
ADCs dynamically.

Also, probe the stereo-mixer input more dynamically, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:55 +02:00
Takashi Iwai 24088a58d6 ALSA: hda - Add control to suppress the dynamic pin-power for VIA
Currently VIA driver controls the power-state of each pin per jack
detection.  But, it means that the power-state mismatch may occur when
the machine doesn't give the proper jack-detection.

For avoiding this problem, a new control element "Dynamic Power-Control"
is provided so that user can turn on/off the pin-power control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:23:55 +02:00
Takashi Iwai 5f4b36d64d ALSA: hda - Remove superfluous NID_MAPPING use for smart51 mixer
Just a minor clean up; nid-mapping can be set directly to the smart51
mixer element.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-20 16:07:02 +02:00
David Henningsson b13e552d37 ALSA: HDA: Remove redundant LPIB quirks for ATI chipset
Now that we have changed the position_fix default for ATI and AMD
to be LPIB (see commit 50e3bbf989), we can remove the quirks that
were added for ATI chipsets.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 18:48:23 +02:00
Takashi Iwai ad2409413d ALSA: hda - Fix no NID error with VIA codecs
The via driver spews warnigs like
	hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 14:23:46 +02:00
Clemens Ladisch cf6f1ff17f ALSA: isight: adjust for new queueing API
Since commit 13882a82ee (optimize iso queueing by setting
wake only after the last packet), drivers are required to call
fw_iso_context_queue_flush() after queueing a batch of packets.
The missing call would have an effect only if the controller
queue underruns, but then the DMA would stop completely.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-17 11:37:29 +02:00
Torsten Schenk 0ec5258d68 ALSA: 6fire - Fix signedness bug
Fixed remaining issues of the signedness bug discovered by Dan Carpenter.
A check was remaining that tests if unsigned rt->rate is >= 0.
Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates)
as invalid rate value and not -1.

Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-16 21:31:33 +02:00
Takashi Iwai e72888e91c ALSA: lola - Fix section mismatch
Add missing __devinit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-15 15:14:49 +02:00
Takashi Iwai ca2585afa0 ALSA: hda - Fix missing static inline to beep dummy function
The commit 2308f4add3 missed static inline
thus it resulted in multiple-definitions error at linking.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 08:14:32 +02:00
Jesper Juhl 37f7ec38ea ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()
We have a double-free bug in
sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload().
We already call release_firmware(fw) on line 258, so when we then do it
again after usb6fire_fw_ezusb_write() returns <0, we have a double-free.
Easily fixed by just removing the last call to release_firmware().

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-14 07:27:26 +02:00
Greg Thelen 9857edfd4d ALSA: hda: check make_exec_verb() return value
If given a -1 cmd parameter then make_exec_verb() returns -1 without
setting the res output value.

Prior to this change snd_hda_codec_read() assumed that make_exec_verb()
unconditionally set res regardless of the cmd value.

This change explicitly checks the make_exec_verb() return value before
consuming the potentially unset res value.

Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 17:52:06 +02:00
Takashi Iwai 5ab775c707 Merge branch 'fix/hda' into topic/hda 2011-06-13 08:37:53 +02:00
Joe Perches 2308f4add3 ALSA: hda - Fix beep_device compilation warnings
Using static inline functions can reduce compilation messages
and macro misuse.

 sound/pci/hda/patch_conexant.c: In function ‘patch_cxt5045’:
 sound/pci/hda/patch_conexant.c:1232:3: warning: statement with no effect

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 08:36:26 +02:00
Takashi Iwai 54463a66b9 ALSA: hda - Fix wrong auto-mute type for Acer Aspire-one
The auto-mute setup for Acer Aspire-one with ALC268 was set wrongly
during the clean-up of auto-mute function.  Fixed now.

Tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-13 08:32:06 +02:00
Florian Zeitz ac5d4b404e ALSA: emu10k1: Add details for E-mu 0404 PCIe version
This patch adds the necessary details to support the PCIe version of
E-MU's 0404 card.
From comparing the PCBs it seems the PCIe version just added a PCIe
chipset and left all other components pretty much in place.
For anyone intrigued to take a look at the PCB there are pictures I took
at <http://babelmonkeys.de/~florob/E-MU%200404/>.

Signed-off-by: Florian Zeitz <florob@babelmonkeys.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 21:24:17 +02:00
Adrian Knoth efef054e8c ALSA: hdspm - Add firmware revision ID for RME MADI PCI version
The PCI version of the RME HDSP MADI card uses 0xcf as revision ID. Just
add this to the list of supported cards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:50:08 +02:00
Adrian Knoth fedf1535ab ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
When using Word Clock on RME MADI cards, AutoSync mode was alternating
betweeen MADI and WC due to a typo: AutoSync is indicated in the second
status register (status2), not the first one (status).

While the proc output was always correct, the reported WC frequency to
ALSA was unstable as mentioned in

http://mailman.alsa-project.org/pipermail/alsa-devel/2008-March/006723.html

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:56 +02:00
Adrian Knoth c0da00145f ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
For the MIDI part, we need to acquire (and release) the hmidi->lock,
access to the global hdspm structure is serialized through
hmidi->hdspm->lock instead.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-12 18:49:42 +02:00
Takashi Iwai 05e205429d Merge branch 'fix/asoc' into for-linus 2011-06-10 17:49:34 +02:00
Daniel T Chen 7ab1fc0af3 ALSA: hda: Fix inaudible internal speakers on CyberpowerPC Gamer Xplorer N57001 laptop
BugLink: https://launchpad.net/bugs/761171

The original reporter needs the model=auto quirk for his internal
speakers to be audible in the latest daily snapshot, so add an entry in
the quirk table for his PCI SSID.

A trivially different version of this patch using the model=asus quirk
should be applied to the 2.6.38 and 2.6.39 stable kernels. We don't use
the asus quirk in 3.0-rc2, because 3.0-rc2's autoparser is much
improved.

Reported-and-tested-by: tomdeering7
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 16:31:24 +02:00
Takashi Iwai 890ee02ac1 ALSA: Use %pV for snd_printk()
Clean up snd_printk() helper using the %pV prefix for recursive printks.
This also automagically fixes an Oops with RO/NX-enabled modules.

Tested-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:35:20 +02:00
Takashi Iwai c0a20263db ALSA: hda - Fix initialization of hp pins with master_mute in Realtek
Some Reatlek model quirks use master_mute bool switch for controlling
the master-mute of outputs.  For these cases, the initialization of HP
pins/amps were forgotten during the transition to the common automute
helper function in 3.0 development time, and resulted in the muted HP
output as default.

This patch fixes the issue by adjusting the HP output explicitly with
master_mute switch.

Tested-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:28:15 +02:00
Takashi Iwai 20f5e0b36d ALSA: hda - Fix invalid unsol tag for some alc262 model quirks
The tag number was forgotten to be fixed after cleaning up the model
quirks for ALC262 fujitsu and lenovo-3000 models.

Tested-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:27:32 +02:00
Takashi Iwai 8b0bd2266f ALSA: hda - Fix SSYNC register value for non-Intel controllers
SSYNC register was once defined as 0x34-37 in the old Intel datasheet,
but corrected later to 0x38-3b.  For fixing the register usage, a new
bit-flag is introduced for indicating the old ICH SSYNC register, and
ICH* PCI entries are added explicitly to enable this quirk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 15:00:07 +02:00
Takashi Iwai 695cd4a34e ALSA: hda - Disable SPDIF only when no pin config set for HP with AD1981
Some HP laptops with AD1981 have SPDIF connections, but currently the
driver disables it statically.  Better to check the pin default config
to judge whether to enable or disable the SPDIF.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 14:37:04 +02:00
Sangbeom Kim 33195500ed ASoC: SAMSUNG: Fix the incorrect referencing of I2SCON register
If DMA active status should be checked, I2SCON register should be referenced.
In this patch, Fix the incorrect referencing of I2SCON register.

Reported-by : Lakkyung Jung <lakkyung.jung@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-06-10 10:54:46 +01:00
Lars-Peter Clausen 4b80b8c2ee ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context
Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a
DAPM context not matching the widgets context. This can lead to a wrong
prefix_len calculation, which will result in undefined behaviour. To avoid
this always use the DAPM context from the widget itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-06-09 15:06:54 +01:00
Timur Tabi 0cd114fff9 ASoC: fsl: fix initialization of DMA buffers
The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs
for playback and capture, so DMA buffers should be allocated only for the
initialized streams.  Instead of checking for the number of active channels,
which apparently is not reliable, check to see if the actual stream object
exists.

Also provide a better name for the DMA interrupt.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-09 11:53:11 +01:00
Mark Brown 3115ae1746 ASoC: WM8804 does not support sample rates below 32kHz
Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-06-09 11:51:07 +01:00
Mark Brown 0f82bdf572 ASoC: Fix WM8962 headphone volume update for use of advanced caches
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
2011-06-08 15:18:17 +01:00
Takashi Iwai b4a655e81d ALSA: hda - Judge playback stream from stream id in azx_via_get_position()
Instead of checking the azx_dev index with a fixed number (4), check
the stream direction of the assigned substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 12:26:56 +02:00
Takashi Iwai a810364a04 ALSA: hda - Handle -1 as invalid position, too
When reading from the position-buffer results in -1, handle as it's
invalid and falls back to LPIB mode as well as 0.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 12:23:23 +02:00
Lars-Peter Clausen 064d58ee3a ASoC: Blackfin: bf5xx-ad1836: Fix codec device name
Fix the codec_name field of the dai_link to match the actual device name
of the codec. Otherwise the card won't be instantiated.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-06-07 09:49:28 +01:00
Daniel T Chen 0a1896b27b ALSA: hda: Fix quirk for Dell Inspiron 910
BugLink: https://launchpad.net/bugs/792712

The original reporter states that sound from the internal speakers is
inaudible until using the model=auto quirk. This symptom is due to an
existing quirk mask for 0x102802b* that uses the model=dell quirk. To
limit the possible regressions, leave the existing quirk mask but add
a higher priority specific mask for the reporter's PCI SSID.

Reported-and-tested-by: rodni hipp
Cc: <stable@kernel.org> [2.6.38+]
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-07 07:26:01 +02:00
Lars-Peter Clausen 8ca695f273 ASoC: AD1836: Fix setting the PCM format
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-06-06 21:55:10 +01:00
Mark Brown fd137e2bba ASoC: Check for NULL register bank in snd_soc_get_cache_val()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-06 19:34:11 +01:00
Mark Brown 6ac340623c ASoC: Add missing break in WM8915 FLL source selection
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-06 12:46:52 +01:00
Mark Brown 1622ee1822 ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-06 12:46:33 +01:00
Stephen Warren 384a48d715 ALSA: hda: HDMI: Support codecs with fewer cvts than pins
The general concept of this change is to create a PCM device for each
pin widget instead of each converter widget. Whenever a PCM is opened,
a converter is dynamically selected to drive that pin based on those
available for muxing into the pin.

The one thing this model doesn't support is a single PCM/converter
sending audio to multiple pin widgets at once.

Note that this means that a struct hda_pcm_stream's nid variable is
set to 0 except between a stream's open and cleanup calls. The dynamic
de-assignment of converters to PCMs occurs within cleanup, not close,
in order for it to co-incide with when controller stream IDs are
cleaned up from converters.

While the PCM for a pin is not open, the pin is disabled (its widget
control's PIN_OUT bit is cleared) so that if the currently routed
converter is used to drive a different PCM/pin, that audio does not
leak out over a disabled pin.

We use the recently added SPDIF virtualization feature in order to
create SPDIF controls for each pin widget instead of each converter
widget, so that state is specific to a PCM.

In order to support this, a number of more mechanical changes are made:

* s/nid/pin_nid/ or s/nid/cvt_nid/ in many places in order to make it
  clear exactly what the code is dealing with.

* We now have per_pin and per_cvt arrays in hdmi_spec to store relevant
  data. In particular, we store a converter's capabilities in the per_cvt
  entry, rather than relying on a combination of codec_pcm_pars and
  the struct hda_pcm_stream.

* ELD-related workarounds were removed from hdmi_channel_allocation
  into hdmi_instrinsic in order to simplifiy infoframe calculations and
  remove HW dependencies.

* Various functions only apply to a single pin, since there is now
  only 1 pin per PCM. For example, hdmi_setup_infoframe,
  hdmi_setup_stream.

* hdmi_add_pin and hdmi_add_cvt are more oriented at pure codec parsing
  and data retrieval, rather than determining which pins/converters
  are to be used for creating PCMs.

This is quite a large change; it may be appropriate to simply read the
result of the patch rather than the diffs. Some small parts of the change
might be separable into different patches, but I think the bulk of the
change will probably always be one large patch. Hopefully the change
isn't too opaque!

This has been tested on:

* NVIDIA GeForce 400 series discrete graphics card. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM
  audio to a PC monitor that supports audio.

* NVIDIA GeForce 520 discrete graphics card. This model is the new
  1 codec n converters m pins m>n model. Tested stereo PCM audio to a
  PC monitor that supports audio.

* NVIDIA GeForce 400 series laptop graphics chip. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM,
  multi-channel PCM, and AC3 pass-through to an AV receiver.

* Intel Ibex Peak laptop. This model is the new 1 codec n converters m
  pins m>n model. Tested stereo PCM, multi-channel PCM, and AC3 pass-
  through to an AV receiver.

Note that I'm not familiar at all with AC3 pass-through. Hence, I may
not have covered all possible mechanisms that are applicable here. I do
know that my receiver definitely received AC3, not decoded PCM. I tested
with mplayer's "-afm hwac3" and/or "-af lavcac3enc" options, and alsa a
WAV file that I believe has AC3 content rather than PCM.

I also tested:
* Play a stream
* Mute while playing
* Stop stream
* Play some other streams to re-assign the converter to a different
  pin, PCM, set of SPDIF controls, ... hence hopefully triggering
  cleanup for the original PCM.
* Unmute original stream while not playing
* Play a stream on the original pin/PCM.

This was to test SPDIF control virtualization.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:14 +02:00
Stephen Warren 2def8172c6 ALSA: hda: hdmi_eld_update_pcm_info: update a stream in place
A future change won't store an entire hda_pcm_stream just to represent
the capabilities of a codec; a custom data-structure will be used. To
ease that transition, modify hdmi_eld_update_pcm_info to expect the
hda_pcm_stream to be pre-initialized with the codec's capabilities, and
to update those capabilities in-place based on the ELD.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:09 +02:00
Stephen Warren 3aaf898025 ALSA: hda: Separate generic and non-generic implementations
A future change will significantly rework the generic implementation
in order to support codecs with a different number of pins and
converters. Isolate the more custom codec variants from this change by
duplicating the small portions of generic code they share. This
simplifies the later rework of that previously shared code, since we
don't have to consider the more custom codecs, and also prevents
support for those codecs from regressing.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:58:05 +02:00