sound/hda/codecs/helpers/ideapad_hotkey_led.c
Source file repositories/reference/linux-study-clean/sound/hda/codecs/helpers/ideapad_hotkey_led.c
File Facts
- System
- Linux kernel
- Corpus path
sound/hda/codecs/helpers/ideapad_hotkey_led.c- Extension
.c- Size
- 882 bytes
- Lines
- 37
- Domain
- Driver Families
- Bucket
- sound/hda
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/leds.h
Detected Declarations
function is_ideapadfunction hda_fixup_ideapad_acpifunction hda_fixup_ideapad_acpi
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Ideapad helper functions for Lenovo Ideapad LED control,
* It should be included from codec driver.
*/
#if IS_ENABLED(CONFIG_IDEAPAD_LAPTOP)
#include <linux/acpi.h>
#include <linux/leds.h>
static bool is_ideapad(struct hda_codec *codec)
{
return (codec->core.subsystem_id >> 16 == 0x17aa) &&
(acpi_dev_found("LHK2019") || acpi_dev_found("VPC2004"));
}
static void hda_fixup_ideapad_acpi(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
if (!is_ideapad(codec))
return;
snd_hda_gen_add_mute_led_cdev(codec, NULL);
snd_hda_gen_add_micmute_led_cdev(codec, NULL);
}
}
#else /* CONFIG_IDEAPAD_LAPTOP */
static void hda_fixup_ideapad_acpi(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
}
#endif /* CONFIG_IDEAPAD_LAPTOP */
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/leds.h`.
- Detected declarations: `function is_ideapad`, `function hda_fixup_ideapad_acpi`, `function hda_fixup_ideapad_acpi`.
- Atlas domain: Driver Families / sound/hda.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.