sound/hda/codecs/side-codecs/hda_component.h
Source file repositories/reference/linux-study-clean/sound/hda/codecs/side-codecs/hda_component.h
File Facts
- System
- Linux kernel
- Corpus path
sound/hda/codecs/side-codecs/hda_component.h- Extension
.h- Size
- 3071 bytes
- Lines
- 103
- 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/component.hlinux/mutex.hsound/hda_codec.h
Detected Declarations
struct hda_componentstruct hda_component_parentfunction hda_component_acpi_device_notifyfunction hda_component_manager_unbind_acpi_notificationsfunction hda_component_manager_unbind
Annotated Snippet
struct hda_component {
struct device *dev;
char name[HDA_MAX_NAME_SIZE];
struct acpi_device *adev;
bool acpi_notifications_supported;
void (*acpi_notify)(acpi_handle handle, u32 event, struct device *dev);
void (*pre_playback_hook)(struct device *dev, int action);
void (*playback_hook)(struct device *dev, int action);
void (*post_playback_hook)(struct device *dev, int action);
};
struct hda_component_parent {
struct mutex mutex;
struct hda_codec *codec;
struct hda_component comps[HDA_MAX_COMPONENTS];
};
#ifdef CONFIG_ACPI
void hda_component_acpi_device_notify(struct hda_component_parent *parent,
acpi_handle handle, u32 event, void *data);
int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
struct hda_component_parent *parent,
acpi_notify_handler handler, void *data);
void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
struct hda_component_parent *parent,
acpi_notify_handler handler);
#else
static inline void hda_component_acpi_device_notify(struct hda_component_parent *parent,
acpi_handle handle,
u32 event,
void *data)
{
}
static inline int hda_component_manager_bind_acpi_notifications(struct hda_codec *cdc,
struct hda_component_parent *parent,
acpi_notify_handler handler,
void *data)
{
return 0;
}
static inline void hda_component_manager_unbind_acpi_notifications(struct hda_codec *cdc,
struct hda_component_parent *parent,
acpi_notify_handler handler)
{
}
#endif /* ifdef CONFIG_ACPI */
void hda_component_manager_playback_hook(struct hda_component_parent *parent, int action);
int hda_component_manager_init(struct hda_codec *cdc,
struct hda_component_parent *parent, int count,
const char *bus, const char *hid,
const char *match_str,
const struct component_master_ops *ops);
void hda_component_manager_free(struct hda_component_parent *parent,
const struct component_master_ops *ops);
int hda_component_manager_bind(struct hda_codec *cdc, struct hda_component_parent *parent);
static inline struct hda_component *hda_component_from_index(struct hda_component_parent *parent,
int index)
{
if (!parent)
return NULL;
if (index < 0 || index >= ARRAY_SIZE(parent->comps))
return NULL;
return &parent->comps[index];
}
static inline void hda_component_manager_unbind(struct hda_codec *cdc,
struct hda_component_parent *parent)
{
guard(mutex)(&parent->mutex);
component_unbind_all(hda_codec_dev(cdc), parent);
}
#endif /* ifndef __HDA_COMPONENT_H__ */
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/component.h`, `linux/mutex.h`, `sound/hda_codec.h`.
- Detected declarations: `struct hda_component`, `struct hda_component_parent`, `function hda_component_acpi_device_notify`, `function hda_component_manager_unbind_acpi_notifications`, `function hda_component_manager_unbind`.
- 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.