aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorHui Wang <jason77.wang@gmail.com>2013-11-27 01:47:26 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-27 02:52:37 -0500
commit2fd3f170e5ba04acc60ee94b2c76ee166727c734 (patch)
tree2c93965424d752f67ed2f5fcdb212d0f5c302190 /sound/pci
parent049da9e8f8fe9b08b934df4ffe240d14a9788e19 (diff)
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>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_conexant.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index c205bb1747fd..1f2717f817a0 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3244,9 +3244,29 @@ enum {
3244#if IS_ENABLED(CONFIG_THINKPAD_ACPI) 3244#if IS_ENABLED(CONFIG_THINKPAD_ACPI)
3245 3245
3246#include <linux/thinkpad_acpi.h> 3246#include <linux/thinkpad_acpi.h>
3247#include <acpi/acpi.h>
3247 3248
3248static int (*led_set_func)(int, bool); 3249static int (*led_set_func)(int, bool);
3249 3250
3251static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context,
3252 void **rv)
3253{
3254 bool *found = context;
3255 *found = true;
3256 return AE_OK;
3257}
3258
3259static bool is_thinkpad(struct hda_codec *codec)
3260{
3261 bool found = false;
3262 if (codec->subsystem_id >> 16 != 0x17aa)
3263 return false;
3264 if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found)
3265 return true;
3266 found = false;
3267 return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found;
3268}
3269
3250static void update_tpacpi_mute_led(void *private_data, int enabled) 3270static void update_tpacpi_mute_led(void *private_data, int enabled)
3251{ 3271{
3252 struct hda_codec *codec = private_data; 3272 struct hda_codec *codec = private_data;
@@ -3279,6 +3299,8 @@ static void cxt_fixup_thinkpad_acpi(struct hda_codec *codec,
3279 bool removefunc = false; 3299 bool removefunc = false;
3280 3300
3281 if (action == HDA_FIXUP_ACT_PROBE) { 3301 if (action == HDA_FIXUP_ACT_PROBE) {
3302 if (!is_thinkpad(codec))
3303 return;
3282 if (!led_set_func) 3304 if (!led_set_func)
3283 led_set_func = symbol_request(tpacpi_led_set); 3305 led_set_func = symbol_request(tpacpi_led_set);
3284 if (!led_set_func) { 3306 if (!led_set_func) {
@@ -3494,6 +3516,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
3494 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), 3516 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
3495 SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC), 3517 SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
3496 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC), 3518 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
3519 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", CXT_FIXUP_THINKPAD_ACPI),
3497 SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004), 3520 SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
3498 SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205), 3521 SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
3499 {} 3522 {}