Takashi Iwai [Tue, 28 Jun 2011 10:45:47 +0000 (12:45 +0200)]
ALSA: hda - Create snd_hda_get_conn_index() helper function
Create snd_hda_get_conn_index() helper function for obtaining the
connection index of the widget. Replaced the similar codes used in
several codec-drivers with this common helper.
Takashi Iwai [Tue, 28 Jun 2011 06:59:30 +0000 (08:59 +0200)]
ALSA: hda - Fix warnings with CONFIG_SND_POWER_SAVE=n
Use static inline for dummy function to fix the warnings like below
sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_init’:
sound/pci/hda/patch_sigmatel.c:4387:3: warning: statement with no effect
sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_resume’:
sound/pci/hda/patch_sigmatel.c:4927:3: warning: statement with no effect
Takashi Iwai [Mon, 27 Jun 2011 14:17:07 +0000 (16:17 +0200)]
ALSA: hda - More volume-init fixes for ALC267 codec
More similar fixes like previous commits: handle the exceptional case
like ALC267 where no volume amp is found in ADC widget but in the
capsrc widget instead.
Also minor checks for avoiding possible erros: no connection-select
when the pin has a single selection, and add beep verbs only when the
0x1d is used for beep.
Takashi Iwai [Mon, 27 Jun 2011 13:53:38 +0000 (15:53 +0200)]
ALSA: hda - Fix volume-init for ALC259 with invalid widget caps
ALC259 seems to provide an invalid widget capability for the input-src
selector widget. The widget shows the input-amp while it's a selector,
and this confuses the current ALC882 initialization code that is used
for ALC259, too. For fixing this, check the amp capability and handle
the connection selection individually.
Also, ALC259 has no mute bit in DAC volume, so we need to initialize
it as ZERO instead of MUTE.
Takashi Iwai [Mon, 27 Jun 2011 13:48:17 +0000 (15:48 +0200)]
ALSA: hda - Fix volume-init of ALC299 & co
ALC269 and compatible codecs have the output volume in DACs, thus we
can't use the ALC880's code as is. Fixed by checking the amp caps and
picking up the right widget for initialization.
The input amps of mixer widgets should be unmuted as default (as
usually they have no assigned mixer switches).
More fixes in this commit are, however, for ALC260: ALC260 codec can
have multiple output mixers connnected to a single DAC althouh the
driver didn't pick up them properly.
Takashi Iwai [Mon, 27 Jun 2011 10:34:01 +0000 (12:34 +0200)]
ALSA: hda - Check hard-wired DACs at first for ALC662 & co
Some Realtek codecs have the output pins hardwired with certain DACs.
These DACs have to be assigned at first and assign the rest for
multi-DAC pins so that all DACs can be assigned properly.
Without such an optimization, speaker outputs may be assigned to the
same DAC as the headphone or others.
Takashi Iwai [Mon, 27 Jun 2011 09:32:07 +0000 (11:32 +0200)]
ALSA: hda - Call proper DAC-filler function for Realtek auto-parser
In alc_auto_add_multi_channel_mode(), when the primary HP workaround
is enabled, it re-initializes the DAC list but calls alc662's function
in a fixed way. This isn't pretty suitable for other codecs, of course.
Now we call it with fill_dac function pointer so that the proper
function can be called at that point.
Takashi Iwai [Fri, 24 Jun 2011 12:10:28 +0000 (14:10 +0200)]
ALSA: hda - Add snd_hda_get_conn_list() helper function
Add a new helper function snd_hda_get_conn_list().
Unlike snd_hda_get_connections(), this function doesn't copy the
connection-list but gives the raw pointer for the cached list.
Takashi Iwai [Fri, 24 Jun 2011 09:03:58 +0000 (11:03 +0200)]
ALSA: hda - Clean up multi-channel mixer name assignment in patch_realtek.c
Change alc_get_line_out_pfx() in patch_realtek.c to provide the channel
specific name and assign the index so that each caller doesn't have to
set the channel name by itself.
Also, check the multi-io case with the primary hp-out; for the multi-io
channels, assign the channel name instead of "Headphone" with indices.
This makes the mixer names more intuitive and reduces confusion.
Takashi Iwai [Fri, 24 Jun 2011 08:43:03 +0000 (10:43 +0200)]
ALSA: hda - Add a workaround for invalid line-out setups
Some BIOS set up the pin config wrongly as line-out although it's
supposed to be a speaker out. In most cases, though, we can judge
the validity by checking the connection type -- when it's FIXED,
mostly it's an invalid line-out but a speaker.
Takashi Iwai [Wed, 22 Jun 2011 13:23:25 +0000 (15:23 +0200)]
ALSA: hda - Implement dynamic-ADC switching for VIA codecs
Some VIA codecs like VT1702 provide the input-route only to specific
ADCs such as digital-mic inputs. These routes aren't covered by the
normal primary ADC, and for now, user had to open the capture stream
assigned to that special ADC manually for using such inputs.
This patch implements a way to switch the current ADC dynamically per
the input-source selection in such a case. When this workaround is
activated, the driver provides only one capture stream and one input-
source control but with the full possible inputs. The driver switches
the ADC to be used (or being used) according to the input-source on the
fly.
Takashi Iwai [Tue, 21 Jun 2011 12:22:14 +0000 (14:22 +0200)]
ALSA: hda - Fix surround-volume parsing for VT1708B codecs
The surround/CLFE/side DACs on VT1708B and co have no amp but the
connected selector widgets have the amp instead. Fix the parser to
check these selector widgets for the possible mixer controls as well.
Takashi Iwai [Tue, 21 Jun 2011 10:57:22 +0000 (12:57 +0200)]
ALSA: hda - Fix the check of loopback-mixer element index in patch_via.c
Fix the check of the multiple loopback-mixer, which gave sometimes
a wrong index assigned to an element even for different names, e.g.
Mic and Front Mic. Now check the label properly for avoid duplication.
Reported-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 21 Jun 2011 10:51:33 +0000 (12:51 +0200)]
ALSA: hda - Assign smart51 only in the same stack for VIA codecs
The input jacks assigned as the smart51 outputs must be in the same
stack, either rear, front or other. Also, prefer line-in as the surround
to mic-in.
Tony Vroon [Mon, 20 Jun 2011 21:11:11 +0000 (22:11 +0100)]
ALSA: hda - Remove ALC268 model override for CPR2000
The "diverse" Quanta ID 0x0763 is overridden to ALC268_ACER.
This keeps headphone automute and microphone input from operating
on at least one laptop from Opti Systems.
Without the override, the BIOS parser does a fine job setting the
card up and everything works.
Tested-By: Peter Schneider <e.at.chi.kaen@googlemail.com> Signed-off-by: Tony Vroon <tony@linx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 20 Jun 2011 10:39:26 +0000 (12:39 +0200)]
ALSA: hda - Initialize unsol events dynamically in patch_via.c
Issue the init verbs of unsolicited events dynamically from the parsed
results for VIA codecs. Also, consolidate the unsol handlers for HP
and line-out mutes.
Takashi Iwai [Sun, 19 Jun 2011 14:24:21 +0000 (16:24 +0200)]
ALSA: hda - Fix independent-HP handling in patch_via.c
Fix races in handling of HP DAC and independent streams for VIA codecs.
Also, allow the HP output path without front-DAC, and removed
unnecessary activation of HP mixer elements.
This also removes the handling of shared side/HP stream; it's anyway
implemented in a broken way, so we need to re-implement the feature
later...
Takashi Iwai [Sat, 18 Jun 2011 14:40:14 +0000 (16:40 +0200)]
ALSA: hda - Assign HP-independent PCM to individual stream
Instead of using the secondary substream, create an individual PCM
stream for HP-independent PCM. Otherwise it's difficult to handle
different channel numbers with multi-channel stream in the sam PCM
stream structure.
Takashi Iwai [Fri, 17 Jun 2011 15:53:38 +0000 (17:53 +0200)]
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.
Takashi Iwai [Fri, 17 Jun 2011 14:37:45 +0000 (16:37 +0200)]
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.
Takashi Iwai [Fri, 17 Jun 2011 13:46:13 +0000 (15:46 +0200)]
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.
Takashi Iwai [Fri, 17 Jun 2011 14:59:21 +0000 (16:59 +0200)]
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.
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>
Takashi Iwai [Fri, 17 Jun 2011 12:23:46 +0000 (14:23 +0200)]
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.
Clemens Ladisch [Fri, 17 Jun 2011 06:18:35 +0000 (08:18 +0200)]
ALSA: isight: adjust for new queueing API
Since commit 13882a82ee16 (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>
Torsten Schenk [Thu, 16 Jun 2011 19:06:27 +0000 (21:06 +0200)]
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.
Jesper Juhl [Mon, 13 Jun 2011 21:52:02 +0000 (23:52 +0200)]
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().
Florian Zeitz [Sat, 11 Jun 2011 23:15:42 +0000 (01:15 +0200)]
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/>.
Adrian Knoth [Sun, 12 Jun 2011 15:26:18 +0000 (17:26 +0200)]
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
Adrian Knoth [Sun, 12 Jun 2011 15:26:17 +0000 (17:26 +0200)]
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>
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>
Takashi Iwai [Fri, 10 Jun 2011 13:28:15 +0000 (15:28 +0200)]
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>
Takashi Iwai [Fri, 10 Jun 2011 12:56:26 +0000 (14:56 +0200)]
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.
Takashi Iwai [Fri, 10 Jun 2011 12:37:04 +0000 (14:37 +0200)]
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.
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
Timur Tabi [Wed, 8 Jun 2011 20:02:56 +0000 (15:02 -0500)]
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>
Daniel T Chen [Mon, 6 Jun 2011 22:55:34 +0000 (18:55 -0400)]
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>