Commit Graph

300 Commits

Author SHA1 Message Date
Takashi Iwai ff50479ad6 ALSA: hda - Fix digital mic on Acer Aspire 3830TG
Acer Aspire 3830TG with CX20588 codec has a digital built-in mic that
has the same problem like many others, the inverted signal in stereo.
Apply the same fixup to this machine, too.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-01 14:26:49 +02:00
Takashi Iwai 61074c1a2d ALSA: hda - Set TLV_DB_SCALE_MUTE bit for cx5051 vmaster
Conexnat HD-audio driver has a workaround for cx5051 (aka CX20561)
chip to add fake mute controls to each amp (commit 3868137e).  This
implies the minimum-as-mute TLV bit in TLV for each corresponding
control.  Meanwhile we build the virtual master from these, but the
TLV bit is missing, even though the slaves have it.

This patch simply adds the missing TLV_DB_SCALE_MUTE bit for vmaster,
as already done in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-14 11:39:57 +02:00
Takashi Iwai d0ea6d270b ALSA: hda - Remove the obsoleted static quirk codes from patch_conexant.c
The static quirk code has been disabled for a while and it seems
working fine, so it's time to actually get rid of it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-06-25 14:51:23 +02:00
Takashi Iwai d604b39908 ALSA: hda - Fix registration of beep input device
The beep input device is registered via input_register_device(), but
this is called in snd_hda_attach_beep_device() where the sound devices
aren't registered yet.  This leads to the binding to non-existing
object, thus results in failure.  And, even if the binding worked
(against the PCI object), it's still racy; the input device appears
before the sound objects.

For fixing this, register the input device properly at dev_register
ops of the codec object it's bound with.  Also, call
snd_hda_detach_beep_device() at dev_disconnection so that it's
detached at the right timing.  As a bonus, since it's called in the
codec's ops, we can get rid of the further call from the other codec
drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-28 14:02:21 +01:00
Takashi Iwai 4e76a8833f ALSA: hda - Replace with standard printk
Use dev_err() and co for messages from HD-audio controller and codec
drivers.  The codec drivers are mostly bound with codec objects, so
some helper macros, codec_err(), codec_info(), etc, are provided.
They merely wrap the corresponding dev_xxx().

There are a few places still calling snd_printk() and its variants
as they are called without the codec or device context.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-25 12:27:32 +01:00
Takashi Iwai 1f85a0f0cc ALSA: hda - Remove superfluous inclusion of linux/pci.h
Some codec drivers still have it since using PCI_VENDOR_ID_*.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-15 10:12:12 +01:00
Takashi Iwai c4d1489390 Merge branch 'for-linus' into for-next 2014-02-12 10:34:27 +01:00
Takashi Iwai 8a02c0cc4a ALSA: hda - Move HDA_FIXUP_ACT_FREE call in snd_hda_gen_free()
Now Realtek and Conexant codec parsers just call snd_hda_gen_free().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-10 18:09:45 +01:00
Takashi Iwai 7fe307117d ALSA: hda - Fix inconsistent Mic mute LED
The current code for controlling mic mute LED in patch_sigmatel.c
blindly assumes that there is a single capture switch.  But, there can
be multiple multiple ones, and each of them flips the state, ended up
in an inconsistent state.

For fixing this problem, this patch adds kcontrol to be passed to the
hook function so that the callee can check which switch is being
accessed.  In stac_capture_led_hook(), the state is checked as a
bitmask, and turns on the LED when all capture switches are off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-07 12:13:25 +01:00
Takashi Iwai 3760bc7483 ALSA: hda/conexant - Disable static quirks
Now all weird setups have been converted to fixups for the generic
parser, and we can disable the static quirks.  This commit just turns
the build off.  The bulky static quirk code still remains for a while,
in case we get an overlooked regression.  It'll be removed at the next
kernel version.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai d50ce6c0b8 ALSA: hda/conexant - Enable stereo mix input for CX20549 and CX20551
Both CX20549 and CX20551 codecs have a mixer widget and it can be
connected as the ADC source.  Like AD and VIA codecs, enable the
add_stereo_mix_input flag for these codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai 70540e245c ALSA: hda/conexant - Add analog loopback mixing to CX20549
CX20549 has an aamixer widget at NID 0x17.  Let's enable it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:14 +01:00
Takashi Iwai ea30e7dfe8 ALSA: hda/conexant - Apply cap of mix amp volume on CX20551 codec
For the generic parser, use the standard fixup matching.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:13 +01:00
Takashi Iwai e5eac90d4a ALSA: hda/conexant - Use generic parser for HP 530
This laptop with CX20549 codec misses the internal mic at NID 0x12.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:13 +01:00
Takashi Iwai 6dcbadef22 ALSA: hda/conexant - Use generic parser for Toshiba P105
We need to fix bogus pincfgs on this machine, but it works well else.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai ad7725d31b ALSA: hda/conexant - Apply the amp cap override for CX20549 mixer
Apply the amp cap override for CX20549 mixer widget in case where the
generic parser is used, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai 3a00c6605b ALSA: hda/conexant - Re-implement OLPC XO workarounds via fixup
OLPC XO needs a few special handling.  Now these are implemented as a
fixup to the generic parser.

Obviously, the DC BIAS mode had to be added manually.  This is mainly
implemented in the mic_autoswitch hook, where the mic pins are
overwritten depending on the DC bias mode.  This also required the
override of the mic boost control, since the mic boost is applied only
when the DC mode is disabled.

In addition, the mic pins must be set dynamically at recording time
because these also control the LED.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:12 +01:00
Takashi Iwai a2dd933d01 ALSA: hda - Add fixup name lookup for CX5051 and 5066 codecs
Like other codecs, apply a specific fixup given by a model string.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-30 12:39:11 +01:00
Takashi Iwai b317b032d2 ALSA: hda - Split Thinkpad ACPI-related code
Both patch_realtek.c and patch_conexant.c contain the fairy same code
snippet for supporting Thinkpad ACPI LED controls.  Split them into
thinkpad_helper.c and include it from both places.  Although this
isn't the best approach from the code size POV, the probability for
coexistence of both Realtek and Conexant codecs on a single machine is
pretty low, thus it'll end up with less memory footprint than
splitting to yet another module.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-08 16:16:51 +01:00
Lv Zheng d171ebc5b9 ALSA: hda - Fix wrong <acpi/acpi.h> inclusion in Thinkpad ACPI users.
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of
directly including <acpi/acpi.h>.  This patch cleans up such wrong
inclusions for Thinkpad ACPI users.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 10:14:05 +01:00
David Henningsson 31660e9084 ALSA: hda - Remove quirk for Dell Vostro 131
I've tested the old Dell Vostro 131 with the latest generic parser
and it works just fine, and as a bonus we get better jack detection
features in userspace. Therefore this quirk can be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:52:40 +01:00
Hui Wang 2fd3f170e5 ALSA: hda - Enable mute/mic-mute LEDs for more Thinkpads with Conexant codec
Most Thinkpad Edge series laptops use conexant codec, so far although
the codecs have different minor Vendor Id and minor Subsystem Id,
they all belong to the cxt5066 family, this change can make the
mute/mic-mute LEDs support more generic among cxt_5066 family.

This design refers to the similar solution for the realtek codec
ALC269 family in the patch_realtek.c.

Cc: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 08:52:37 +01:00
Takashi Iwai 8f42d76987 ALSA: hda - Add support for CX20952
It's a superset of the existing CX2075x codecs, so we can reuse the
existing parser code.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-07 07:35:26 +01:00
David Henningsson 08cf680cca ALSA: hda - add connection to thinkpad_acpi to control mute/micmute LEDs
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:39:03 +02:00
Takashi Iwai 4a4370442c ALSA: hda - Fix GPIO for Acer Aspire 3830TG
Acer Aspire 3830TG seems requiring GPIO bit 0 as the primary mute
control.  When a machine is booted after Windows 8, the GPIO pin is
turned off and it results in the silent output.

This patch adds the manual fixup of GPIO bit 0 for this model.

Reported-by: Christopher <DIDI2002@web.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-30 12:18:36 +02:00
David Henningsson e4c3bce26d ALSA: hda - Headphone mic support for an Asus/Conexant device
This Conexant codec has a single jack that can be used as either
headphone or mic (but not headset). The existing hp_mic functionality
does not apply here, because the mic and the HP are on separate pins.

Hence make a lighter version of what has been earlier done for Realtek
codecs.

BugLink: https://bugs.launchpad.net/bugs/1198030
Tested-by: Franz Hsieh <franz.hsieh@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-07-16 11:57:37 +02:00
David Henningsson 88d5760649 ALSA: hda - Make Thinkpad X220-tablet use generic parser
Like the X220, this quirk was added to support docking station,
so enable the fixup instead.

According to Jan, the generic parser works equal or better
than the current parser. This was tested under a 3.9 kernel.

Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-20 12:53:36 +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
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
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 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
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 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 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 42c364ace5 ALSA: hda - Add Conexant CX20755/20756/20757 codec IDs
These are just compatible with other CX2075x codecs.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-21 16:53:37 +01:00
Takashi Iwai 164a7adac9 ALSA: hda/conexant - Set mixer NID 0x19 for CX20551 codec
Conexant CX20551 codec has a mixer in NID 0x19 and a few outputs have
to take the input through this widget.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-18 18:27:29 +01:00
Takashi Iwai bf92d1d503 ALSA: hda - Rearrange for dropping static quirk codes in Coexant driver
Just shuffle the codes and add ifdefs for testing to drop the static
quirk codes from patch_conexant.c.

By commenting out ENABLE_CXT_STATIC_QUIRKS define at the beginning of
the file, you can disable the whole static codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12 08:44:58 +01:00
Takashi Iwai aed523f193 ALSA: hda - Use generic parser in Conexant codec driver
... and drop most of own parser code.

It doesn't replace any present static quirks, though.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12 08:44:56 +01:00
Takashi Iwai c9ce6b260b ALSA: hda - Move fixup code into struct hda_codec
Since the fixup code is used commonly, it's worth to move it to the
common place, struct hda_codec, instead of keeping in hda_gen_spec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-12 08:30:45 +01:00
David Henningsson 7ed4165e2d Revert "ALSA: hda - Shut up pins at power-saving mode with Conexnat codecs"
This reverts commit 697c373e34.

The original patch was meant to remove clicking, but in fact caused even
more clicking instead.

Thanks to c4pp4 for doing most of the work with this bug.

BugLink: https://bugs.launchpad.net/bugs/886975
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-09 11:03:38 +01:00
Takashi Iwai 63a077e276 ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522
Acer Aspire One 522 has the infamous digital mic unit that needs the
phase inversion fixup for stereo.

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

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12 12:12:55 +01:00
Takashi Iwai dda415d418 ALSA: hda - Add a helper function for simple enum kcontrols
The same type of code is being used in multiple places in various
codec drivers, so put it as a core library.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-30 18:34:38 +01:00
Takashi Iwai ee81abb623 ALSA: hda - Apply a proper chmap for built-in 2.1 speakers
When 2.1 speakers are detected, use the corresponding channel map
instead of the standard map with front+rear surrounds.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08 17:13:59 +01:00
Takashi Iwai f37bc7a88d ALSA: hda - Give standard "Bass Speaker" mixer for 2.1 speakers
When two built-in speakers are found on the machine, we can suppose
it's rather a 2.1 speaker system with a bass output instead of
front/surround channels.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-08 17:00:37 +01:00
Huacai Chen 239fb862e8 ALSA: HDA: Make hda sound card usable for Loongson
Lemote A1004(Laptop) and A1205(All-In-One) use Conexant's hda codec,
this patch modify patch_conexant.c to add Lemote specific code.

Both A1004 and A1205 use the same pin configurations, but A1004 need
to increase the default boost of internal mic.

Signed-off-by: Jie Chen <chenj@lemote.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Hongliang Tao <taohl@lemote.com>
Signed-off-by: Hua Yan <yanh@lemote.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-15 09:58:27 +02:00
David Henningsson 74d3e69728 ALSA: hda - fix indices on boost volume on Conexant
After the recent patch "ALSA: hda - use both input paths on Conexant
auto parser" suddenly we can have more than one "Mic Boost", this
happened on Acer Aspire One 722. Therefore we must add the possibility
to put an index on this "Mic Boost" just as we do for the other
"Mic Boost" earlier in the same function.

BugLink: https://bugs.launchpad.net/bugs/1059523
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:50:47 +02:00
Felix Kaechele e4db0952e5 ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310
The Lenovo IdeaPad U310 has an internal mic where the right channel
is phase inverted.

Signed-off-by: Felix Kaechele <felix@fetzig.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-06 16:45:53 +02:00