1 // SPDX-License-Identifier: GPL-2.0
2 /* Helper functions for Thinkpad LED control;
3 * to be included from codec driver
6 #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
8 #include <linux/acpi.h>
9 #include <linux/leds.h>
11 static bool is_thinkpad(struct hda_codec *codec)
13 return (codec->core.subsystem_id >> 16 == 0x17aa) &&
14 (acpi_dev_found("LEN0068") || acpi_dev_found("LEN0268") ||
15 acpi_dev_found("IBM0068"));
18 static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
19 const struct hda_fixup *fix, int action)
21 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
22 if (!is_thinkpad(codec))
24 snd_hda_gen_add_mute_led_cdev(codec, NULL);
25 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
29 #else /* CONFIG_THINKPAD_ACPI */
31 static void hda_fixup_thinkpad_acpi(struct hda_codec *codec,
32 const struct hda_fixup *fix, int action)
36 #endif /* CONFIG_THINKPAD_ACPI */