Path: blob/master/sound/hda/codecs/helpers/ideapad_hotkey_led.c
26489 views
// SPDX-License-Identifier: GPL-2.01/*2* Ideapad helper functions for Lenovo Ideapad LED control,3* It should be included from codec driver.4*/56#if IS_ENABLED(CONFIG_IDEAPAD_LAPTOP)78#include <linux/acpi.h>9#include <linux/leds.h>1011static bool is_ideapad(struct hda_codec *codec)12{13return (codec->core.subsystem_id >> 16 == 0x17aa) &&14(acpi_dev_found("LHK2019") || acpi_dev_found("VPC2004"));15}1617static void hda_fixup_ideapad_acpi(struct hda_codec *codec,18const struct hda_fixup *fix, int action)19{20if (action == HDA_FIXUP_ACT_PRE_PROBE) {21if (!is_ideapad(codec))22return;23snd_hda_gen_add_mute_led_cdev(codec, NULL);24snd_hda_gen_add_micmute_led_cdev(codec, NULL);25}26}2728#else /* CONFIG_IDEAPAD_LAPTOP */2930static void hda_fixup_ideapad_acpi(struct hda_codec *codec,31const struct hda_fixup *fix, int action)32{33}3435#endif /* CONFIG_IDEAPAD_LAPTOP */363738