diff options
| -rw-r--r-- | sound/pci/hda/patch_conexant.c | 23 |
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 | ||
| 3248 | static int (*led_set_func)(int, bool); | 3249 | static int (*led_set_func)(int, bool); |
| 3249 | 3250 | ||
| 3251 | static 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 | |||
| 3259 | static 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 | |||
| 3250 | static void update_tpacpi_mute_led(void *private_data, int enabled) | 3270 | static 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 | {} |
