Takashi Iwai [Mon, 12 Mar 2012 11:30:22 +0000 (12:30 +0100)]
ALSA: hda - Rewrite the mute-LED hook with vmaster hook in patch_sigmatel.c
The mute-LED is controlled in patch_sigmatel.c by (ab-)using the
powersave hook. This can be now rewritten with the vmaster hook
instead, which is much simpler and can work even without
CONFIG_SND_HDA_POWER_SAVE kconfig.
A drawback is that the mute-LED corresponds _only_ to the Master mixer
switch instead of checking the whole DACs. But usually this shouldn't
be a big problem as PA enables the mixer elements accordingly.
Also, this patch changes the code to create vmaster always even on
STAC9200 and STAC925x. The former "Master" on these chips are renamed
as "PCM" now.
Takashi Iwai [Mon, 12 Mar 2012 11:18:37 +0000 (12:18 +0100)]
ALSA: Add a hook capability to vmaster controls
This patch adds a hook to vmaster control to be called at each time
when the master value is changed. It'd be handy for an additional
mute LED control following the Master switch, for example.
Takashi Iwai [Fri, 9 Mar 2012 16:51:10 +0000 (17:51 +0100)]
ALSA: hda - Initialize vmaster slave volumes
When the driver is changed to use vmaster or a new slave element is
added by the improvement of the parser code, user may face often the
silent output because of the muted slave mixer although Master volume
is properly set. And they complain. And I get upset.
Although such a mixer element should be initialized via "alsactl init",
it'd be more user-friendly if the known output slaves are unmuted and
set to 0dB so that user can control the volume only with Master as
default. Since Master is still set muted as default even with this
change, no risk of the speaker blow up, too.
Takashi Iwai [Wed, 7 Mar 2012 09:58:39 +0000 (10:58 +0100)]
ALSA: hda - Set codec to D3 forcibly even if not used
We've seen a problem with a pop-noise at suspend/resume on a HP
machine with ALC269, and it turned out to be an issue that the
controller going to D3 while the codec is unused.
When the device is once suspended and resumed and kept unused, the
driver doesn't initialize the codecs. Instead, the codec chips are
set up dynamically at the first usage. Now, suppose the device going
to suspend again before the codec is set up. The controller is turned
off to D3 while the codec chips are untouched. This caused a pop
noise because the codec chip might have been turned on implicitly by
the hardware.
As a workaround, the codec chip needs to be set to D3 when going to
suspend no matter whether it was used or not. Also, for making it
happening, the controller has to be always set up in the resume path.
Takashi Iwai [Wed, 7 Mar 2012 07:37:19 +0000 (08:37 +0100)]
ALSA: hda/realtek - Reuse init_hook for ALC269VB coef setup
Move the currently unused spec->init_hook at the beginning of the init
sequence so that the recently added ALC269VB coef setup can be put
there. The alc_init() is again clean without an ugly check.
Kailang Yang [Wed, 7 Mar 2012 07:25:20 +0000 (08:25 +0100)]
ALSA: hda/realtek - Apply the coef-setup only to ALC269VB
The coef setup in alc269_fill_coef() was designed only for ALC269VB
model, and this has some bad effects for other ALC269 variants, such
as turning off the external mic input. Apply it only to ALC269VB.
Signed-off-by: Kailang Yang <kailang@realtek.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Marton Balint [Mon, 5 Mar 2012 20:33:23 +0000 (21:33 +0100)]
ALSA: hda - add quirk to detect CD input on Gigabyte EP45-DS3
My CD input got lost in commit 68ef0561efe494143516df38c03a16b837b8e79c.
Raymond helped me to add the necessary pin fixup to make it appear again. In
fact, this is basically his patch. It fixes alsa bug #5541.
Takashi Iwai [Sun, 4 Mar 2012 15:13:58 +0000 (16:13 +0100)]
Merge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
A driver specific fix that wasn't noticed as the OpenMoko guys have been
stuck on 2.6.39 for a very long time now and are just starting to catch
up again.
Takashi Iwai [Thu, 1 Mar 2012 13:17:07 +0000 (14:17 +0100)]
Merge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
A small fix for the SSI driver and a fix for system shutdown with modern
devices. Most of the modern devices will never get shut down normally
with a visible kernel log as the systems they're in tend not to shut
down often and when they do it's usually in form factors that don't have
a user visible console.
Takashi Iwai [Mon, 20 Feb 2012 11:30:59 +0000 (12:30 +0100)]
ALSA: hda/conexant - Clear unsol events on unused pins
It seems that Lenovo machines (or codec chip itself?) leave the unsol
event tags and the enablement-flag from other pins bogusly even on the
unused pins. Although this shouldn't be too critical, it's better to
clear them up sanely.
Takashi Iwai [Mon, 27 Feb 2012 14:00:58 +0000 (15:00 +0100)]
ALSA: hda - Add a fake mute feature
Some codecs don't supply the mute amp-capabilities although the lowest
volume gives the mute. It'd be handy if the parser provides the mute
mixers in such a case.
This patch adds an extension amp-cap bit (which is used only in the
driver) to represent the min volume = mute state. Also modified the
amp cache code to support the fake mute feature when this bit is set
but the real mute bit is unset.
In addition, conexant cx5051 parser uses this new feature to implement
the missing mute controls.
Takashi Iwai [Tue, 28 Feb 2012 10:58:40 +0000 (11:58 +0100)]
ALSA: hda - Add position_fix=4 (COMBO) option
This patch adds a new position_fix option value, 4, as a combo mode
to use LPIB for playbacks and POSBUF for captures. It's the way
recommended by Intel hardware guys.
Takashi Iwai [Sat, 25 Feb 2012 10:13:16 +0000 (11:13 +0100)]
ALSA: hda/realtek - Fix resume of multiple input sources
When there are multiple input sources, the driver wrongly overwrites with
the value of the last input source on other slots at resume. Thus the
primary input source may be shown wrongly.
Javier Martin [Thu, 23 Feb 2012 14:43:18 +0000 (15:43 +0100)]
ASoC: i.MX SSI: Fix DSP_A format.
According to i.MX27 Reference Manual (p 1593) TXBIT0 bit selects
whether the most significant or the less significant part of the
data word written to the FIFO is transmitted.
As DSP_A is the same as DSP_B with a data offset of 1 bit, it
doesn't make any sense to remove TXBIT0 bit here.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
Mark Brown [Wed, 22 Feb 2012 15:52:56 +0000 (15:52 +0000)]
ASoC: dapm: Check for bias level when powering down
Recent enhancements in the bias management means that we might not be
in standby when the CODEC is idle and can have active widgets without
being in full power mode but the shutdown functionality assumes these
things. Add checks for the bias level at each stage so that we don't
do transitions other than the ON->PREPARE->STANDBY->OFF ones that the
drivers are expecting.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
The driver may create duplicated mic boost controls when there are
multiple mics with the very same type / location, and this leads to
the error at actual kcontrol creation. It needs to check the validity
of the created control and add a proper index if it's duplicated.
Takashi Iwai [Tue, 21 Feb 2012 11:54:17 +0000 (12:54 +0100)]
ALSA: hda/realtek - Small code cleanups
A few clean-ups for post-static-quirk time:
- Call alc_auto_init_std() statically in alc_init() instead of setting
spec->init_hook in each caller. spec->init_hook field is left
unused for any future use.
- Move the call of set_capture_mixer() to to alc_parse_auto_config()
instead of each caller.
- Get rid of the ADC-filling and imux check in each parser function.
This is no longer needed since the auto-parser always check ADCs and
imux. It was only for the static quirks.
Takashi Iwai [Tue, 21 Feb 2012 11:37:00 +0000 (12:37 +0100)]
ALSA: hda/realtek - Fix the wrong offset for two-speaker systems
When the machine has two speakers but wants to put more multi-io
jacks, the parser shouldn't consider about the shared DAC but try to
assign the individual DACs. Otherwise the channel mapping would be
fairly confused and lead to the wrong DACs.
Takashi Iwai [Tue, 21 Feb 2012 11:35:27 +0000 (12:35 +0100)]
ALSA: hda/realtek - Fix the possible conflicts of Bass Speaker name
When the multi-io is added to the two speaker output configuration,
the parser would try to add yet another "Bass Speaker" control since
it checks only cfg->line_outs. Add a workaround for it by simply
passing the channel name in the case of multi-io outputs.
Takashi Iwai [Tue, 21 Feb 2012 11:12:57 +0000 (12:12 +0100)]
ALSA: hda/realtek - Create individual mute switches for shared DAC
Even if the outputs are using shared DACs, we can still create individual
mute siwtches since they are assigned per pin. This allows to create,
e.g. Speaker and Bass Speaker mute switches while the single volume is
used for these outputs.
Takashi Iwai [Tue, 21 Feb 2012 10:11:48 +0000 (11:11 +0100)]
ALSA: hda/realtek - Remove the last static quirks for ALC882
Resitance is futile. The remaining static model quirks for Apple
machines with ALC882-compatible codecs are converted to the auto-parser
now. We can remove all alc*_quirks.c finally.
Current ak4642 driver had wrong dapm settings for headphone L/R.
If you select headphone L, and select R after that,
headphone L setting was removed by R settings.
This patch fixes it up.
It provides just "Headphone Enable" to user side
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi Iwai [Mon, 20 Feb 2012 17:20:42 +0000 (18:20 +0100)]
ALSA: hda/realtek - Drop all ALC880 static quirks
Finally the all static quirks for ALC880 are converted to the
auto-parser. Since we are never sure whether the BIOS on so many old
machines are really correct, the quirk table entries are copied as
they are, but just providing the proper pin-config values
accordingly.
Since alc880_quirks.c is removed, alc882_quirks.c has to be adjusted
slightly to be built again. There might be some compile warnings due
to the remaining alc882 quirks, but these shall be killed sooner or
later, I don't care it much at this point.
Takashi Iwai [Mon, 20 Feb 2012 16:56:57 +0000 (17:56 +0100)]
ALSA: hda/realtek - Drop model=asus* from ALC880
It turned out that BIOS on most of ASUS mobo's set the pin-config tables
reasonably well for the auto-parser. We'd need GPIO setups, but should
work as is other than that.
Takashi Iwai [Mon, 20 Feb 2012 16:41:51 +0000 (17:41 +0100)]
ALSA: hda/realtek - Rewrite ALC880 model=z71v with auto-parser
ASUS Z71V has a totally broken BIOS setup (at least the info I got),
thus we need to override the whole pin-config table to make the
auto-parser working correctly.
Takashi Iwai [Mon, 20 Feb 2012 16:20:48 +0000 (17:20 +0100)]
ALSA: hda/realtek - Rewrite ALC880 model=uniwill with auto-parser
The model=uniwill would work almost as is, but a couple of adjustments
are needed to make the mutli-io working correctly. The headphone and
speaker pins have to be marked properly in pin configs.
Takashi Iwai [Mon, 20 Feb 2012 15:36:52 +0000 (16:36 +0100)]
ALSA: hda/realtek - Rewrite ALC880 model=F1734 with auto-parser
Similar as the previous patch for model=fujitsu, we can now move the
static quirk for F1734 to the auto-parser. The only difference is the
default pin configurations: F1734 has less pins than Amilo's.
Takashi Iwai [Mon, 20 Feb 2012 14:47:55 +0000 (15:47 +0100)]
ALSA: hda/realtek - Apply probe-fixup really after probing
Move the call of alc_apply_fixup() with ALC_FIXUP_ACT_PROBE after the
whole setups of patch_ops & co, so that the fix-up function may override
the default setup. This will be needed for installing the own unsol
event handler (e.g. for volume-knob controls).
Takashi Iwai [Fri, 17 Feb 2012 15:33:56 +0000 (16:33 +0100)]
ALSA: hda/realtek - Rewrite ALC880 model=w810 with auto-parser
The Medion W810 with ALC880 has a typical BIOS bug, copying the
pin-defaults without disabling the unused pins. At least, the pin
0x17 must be disabled. Also, it requires GPIO-2 setup.
Takashi Iwai [Fri, 17 Feb 2012 15:18:59 +0000 (16:18 +0100)]
ALSA: hda/realtek - Rewrite ALC880 model=lg with the auto-parser
ALC880 model=lg could work fine with the auto-parser due to the recent
rewrite, but it still needs the manual adjustment; namely, the BIOS leaves
unused pins as some real active jacks. This confuses the parser.
Thus we just cover these pins and override the pin-configs as a fix-up.
Takashi Iwai [Fri, 17 Feb 2012 15:17:03 +0000 (16:17 +0100)]
ALSA: hda/realtek - Adjust badness calculation for multi-ios
Try harder to fit the multi-io pins also by checking the hard-wired
connections for multi-ios. Also, the badness values are adjusted to
prioritize the multi-ios as more valuable. These changes will enable
the multi-io on some machines without losing the current capability.
The previous fix for the speaker on Acer Aspire 59135 introduced
another problem for surround outputs. It changed the connections on
the line-in/mic pins for limiting the routes, but it left the modified
connections. Thus wrong connection indices were written when set to
4ch or 6ch mode.
This patch fixes it by restoring the right connections just after
parsing the tree but before the initialization.
Takashi Iwai [Thu, 16 Feb 2012 17:39:45 +0000 (18:39 +0100)]
ALSA: hda/realtek - Try harder to fit the single-connections
So far, the Realtek driver tires to assign the single-connected routes
for all pins only once at the beginning. However, since some DACs have
been already mapped, the rest pins might have also single conections.
In this patch, the driver does the single-connection assignment in a
loop until all possbile single-connections are checked. This will
improve the DAC assignment, e.g. for ASUS G72.
Takashi Iwai [Thu, 16 Feb 2012 15:45:59 +0000 (16:45 +0100)]
ALSA: hda/realtek - Finer tuning of auto-parser with badness evaluation
This patch improves the Realtek auto-parser for assigning the DACs and
mixers in more suitable ways by evaluating the assignment with "badness"
calculations.
When assigning a DAC hinders the assignment of individual DACs for
other pins, some badness point is given. Similarly, when it blocks the
assignment of unique mixer controls, another badness point is added.
Also, if no DAC, even shared DAC, can be assigned, more badness is
pointed. Finally, comparing the accumulated badness, the best route is
chosen among several trials.
Takashi Iwai [Thu, 16 Feb 2012 16:23:46 +0000 (17:23 +0100)]
ALSA: hda/realtek - Improve the signel-connection check
When the connections from the pin selector contain only two
widgets, a route to DAC and the aa-mixer, it's certainly a
single connection. In such a case, get_dac_if_single() should
return the connected DAC, too.
This will improve the detection of the individual DAC
assignment for each pin.
Takashi Iwai [Thu, 16 Feb 2012 15:38:07 +0000 (16:38 +0100)]
ALSA: hda/realtek - Fix overflow of vol/sw check bitmap
The bitmap introduced in the commit [527e4d73: ALSA: hda/realtek - Fix
missing volume controls with ALC260] is too narrow for some codecs,
which may have more NIDs than 0x20, thus it may overflow the bitmap
array on them.
Just double the number to cover all and also add a sanity-check code
to be safer.
Takashi Iwai [Thu, 16 Feb 2012 12:03:18 +0000 (13:03 +0100)]
ALSA: hda/realtek - Disable static fixups for ASUS with ALC269
We've enabled the static fixups for ASUS machines with ALC269 codec,
just for making things compatible during the transition to the auto-
parser. However, it seems that the static configurations do more harmful
than good, as some of entries don't match with the actual hardware setups.
Takashi Iwai [Thu, 16 Feb 2012 11:59:55 +0000 (12:59 +0100)]
ALSA: hda/realtek - Remove leftover static quirks for ALC260
Now we can clean up all static quirks for ALC260.
Also many codes in alc_quirks.c can be ripped off since they have been
used only by ALC260 static quirks.
Takashi Iwai [Thu, 16 Feb 2012 11:35:16 +0000 (12:35 +0100)]
ALSA: hda/realtek - Replace ALC260 model=replacer with the auto-parser
The support for Replacer 627V in the auto-parser needs the unique unsol
event handling: although the machine has a single output pin 0x0f, it's
used for both the headphone and the speaker, and the driver needs to
toggle the output route via GPIO 1.
In addition, it needs a special COEF setup with 0x3050.
Takashi Iwai [Thu, 16 Feb 2012 10:51:19 +0000 (11:51 +0100)]
ALSA: hda/realtek - Add the fixup codes for ALC260 model=will
The model=will for ALC260 requires the pin 0x0f to be a headphone and
some special verbs for the COEF to turn on the amp. Now added these as
fixup entries and removed the static model quirk.
Xi Wang [Tue, 14 Feb 2012 10:18:48 +0000 (05:18 -0500)]
ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()
A malicious USB device could feed in a large nr_rates value. This would
cause the subsequent call to kmemdup() to allocate a smaller buffer than
expected, leading to out-of-bounds access.
This patch validates the nr_rates value and reuses the limit introduced
in commit 4fa0e81b ("ALSA: usb-audio: fix possible hang and overflow
in parse_uac2_sample_rate_range()").
Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel T Chen [Tue, 14 Feb 2012 04:44:22 +0000 (23:44 -0500)]
ALSA: intel8x0: Fix default inaudible sound on Gateway M520
BugLink: https://bugs.launchpad.net/bugs/930842
The reporter states that audio is inaudible by default without muting
'External Amplifier'. Add a quirk to handle his SSID so that changing
the control is not necessary.
Reported-and-tested-by: Benjamin Carlson <elderbubba0810@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Since 3.2 kernel, the driver starts trying to assign the multi-io DACs
before the speaker, thus it assigns DAC2/3 for multi-io and DAC4 for
the speaker for a standard laptop setup like a HP, a speaker, a mic-in
and a line-in. However, on Acer Aspire 6935, it seems that the
speaker pin 0x14 must be connected with either DAC1 or 2; otherwise it
results in silence by some reason, although the codec itself allows
the routing to DAC3/4.
As a workaround, the connection list of each pin is reduced to be
mapped to either only DAC1/2 or DAC3/4, so that the compatible
assignment as in kernel 3.1 is achieved.
Takashi Iwai [Mon, 13 Feb 2012 14:04:06 +0000 (15:04 +0100)]
ALSA: hda - Fix initialization of secondary capture source on VT1705
VT1705 codec has two ADCs where the secondary ADC has no MUX but only
a fixed connection to the mic pin. This confused the driver and it
tries always overriding the input-source selection by assumption of
the existing MUX for the secondary ADC, resulted in resetting the
input-source at each time PM (including power-saving) occurs.
The fix is simply to check the existence of MUX for secondary ADCs in
the initialization code.
Takashi Iwai [Mon, 13 Feb 2012 10:56:25 +0000 (11:56 +0100)]
ALSA: hda - Suppress auto-mute feature on some machines with ALC861
A few machines with ALC861 & co are reported not to work properly with
the auto-mute feature in software. The auto-mute feature is implemented
in the hardware level, and the jack-detection never works with them.
Also, rename the fixup index as ALC861_FIXUP_* to follow the standard.
Takashi Iwai [Mon, 13 Feb 2012 10:55:02 +0000 (11:55 +0100)]
ALSA: hda - Add codec->no_jack_detect flag
Add a new flag to indicate that the codec has no jack-detection cap.
This flag should be set for hardwares that have no jack-detect
implementation although the codec chip itself supports it.
Takashi Iwai [Thu, 9 Feb 2012 08:32:19 +0000 (09:32 +0100)]
ALSA: hda - Fix mute-LED VREF value for new HP laptops
The new HP laptops turns off the mute LED with VREF50 or VREF80, but
not in HIZ unlike the previous models. Since VREF50 (also 80) works
with the previous models, let's use VREF50 for all.
Takashi Iwai [Wed, 8 Feb 2012 20:29:38 +0000 (21:29 +0100)]
Merge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
A few small WM8994 updates to go on top of the previous lot of things
that were sent. They collide with some -next work so I'd really like to
get them into 3.3-rc3 if possible to merge back up into the -next code.
All driver specific and unexciting in the grand scheme of things.
Clemens Ladisch [Sat, 4 Feb 2012 19:56:47 +0000 (20:56 +0100)]
ALSA: oxygen, virtuoso: fix exchanged L/R volumes of aux and CD inputs
The driver accidentally exchanged the left/right fields for stereo AC'97
mixer registers. This affected only the aux and CD inputs because the
line input bypasses the AC'97 codec and the mic input is mono; cards
without AC'97 (Xonar DS/DG/HDAV Slim, HG2PCI, HiFier) were not affected.
Reported-and-tested-by: Abby Cedar <abbycedar@yahoo.com.au> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: 2.6.31+ <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 7 Feb 2012 10:00:53 +0000 (11:00 +0100)]
ALSA: hda - Fix error handling in patch_ca0132.c
In patch_ca0132.c, the error returned from chipio_write() isn't checked
always. Also, the power-up/down sequence isn't tracked properly in some
error paths.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 7 Feb 2012 10:04:48 +0000 (11:04 +0100)]
Merge tag 'asoc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
The only particularly remarkable change here is the one for handling of
the Android suspend ignore code for idle_bias_off CODECs. That one is
actually a regression fix as some of the new power savings that have
been introduced confused the suspend ignore code, making devices that
are active for non-audio reasons look like they are idle causing them to
be suspended instead of being kept active.
Takashi Iwai [Mon, 6 Feb 2012 09:24:04 +0000 (10:24 +0100)]
ALSA: hda/realtek - Fix a wrong condition
sparse complains that "spec->multiout.dac_nids" is a pointer.
sound/pci/hda/patch_realtek.c:2321:37: error: incompatible types for operation (>)
sound/pci/hda/patch_realtek.c:2321:37: left side has type unsigned short const [usertype] *dac_nids
sound/pci/hda/patch_realtek.c:2321:37: right side has type int
It was meant to be num_dacs instead of dac_nids.
Although the current code still works as expected (when num_dacs is zero,
dac_nids should be NULL, too), better to fix now, of course.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 3 Feb 2012 13:28:01 +0000 (14:28 +0100)]
ALSA: hda - Add suffix argument to snd_hda_add_vmaster()
In most cases, the slave strings for vmaster are identical between
volumes and switches except for "xxx Volume" and "xxx Switch" suffix.
Now snd_hda_add_vmaster() takes the optional suffix argument so that
each string can be composed with the given suffix, and we can share the
slave name strings in both volume and switch calls nicely.