include/sound/control.h
Source file repositories/reference/linux-study-clean/include/sound/control.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/control.h- Extension
.h- Size
- 10816 bytes
- Lines
- 320
- Domain
- Driver Families
- Bucket
- include/sound
- 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/wait.hlinux/nospec.hsound/asound.h
Detected Declarations
struct snd_kcontrolstruct snd_kcontrol_newstruct snd_kcontrol_volatilestruct snd_kcontrolstruct snd_kctl_eventstruct pidstruct snd_ctl_filestruct snd_ctl_layer_opsfunction snd_ctl_find_idfunction snd_ctl_get_ioffnumfunction snd_ctl_get_ioffidxfunction snd_ctl_get_iofffunction snd_ctl_create_virtual_masterfunction snd_ctl_add_followerfunction snd_ctl_led_requestfunction snd_ctl_led_request
Annotated Snippet
struct snd_kcontrol_new {
snd_ctl_elem_iface_t iface; /* interface identifier */
unsigned int device; /* device/client number */
unsigned int subdevice; /* subdevice (substream) number */
const char *name; /* ASCII name of item */
unsigned int index; /* index of item */
unsigned int access; /* access rights */
unsigned int count; /* count of same elements */
snd_kcontrol_info_t *info;
snd_kcontrol_get_t *get;
snd_kcontrol_put_t *put;
union {
snd_kcontrol_tlv_rw_t *c;
const unsigned int *p;
} tlv;
unsigned long private_value;
};
struct snd_kcontrol_volatile {
struct snd_ctl_file *owner; /* locked */
unsigned int access; /* access rights */
};
struct snd_kcontrol {
struct list_head list; /* list of controls */
struct snd_ctl_elem_id id;
unsigned int count; /* count of same elements */
snd_kcontrol_info_t *info;
snd_kcontrol_get_t *get;
snd_kcontrol_put_t *put;
union {
snd_kcontrol_tlv_rw_t *c;
const unsigned int *p;
} tlv;
unsigned long private_value;
void *private_data;
void (*private_free)(struct snd_kcontrol *kcontrol);
struct snd_kcontrol_volatile vd[] __counted_by(count); /* volatile data */
};
#define snd_kcontrol(n) list_entry(n, struct snd_kcontrol, list)
struct snd_kctl_event {
struct list_head list; /* list of events */
struct snd_ctl_elem_id id;
unsigned int mask;
};
#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list)
struct pid;
enum {
SND_CTL_SUBDEV_PCM,
SND_CTL_SUBDEV_RAWMIDI,
SND_CTL_SUBDEV_ITEMS,
};
struct snd_ctl_file {
struct list_head list; /* list of all control files */
struct snd_card *card;
struct pid *pid;
int preferred_subdevice[SND_CTL_SUBDEV_ITEMS];
wait_queue_head_t change_sleep;
spinlock_t read_lock;
struct snd_fasync *fasync;
int subscribed; /* read interface is activated */
struct list_head events; /* waiting events for read */
};
struct snd_ctl_layer_ops {
struct snd_ctl_layer_ops *next;
const char *module_name;
void (*lregister)(struct snd_card *card);
void (*ldisconnect)(struct snd_card *card);
void (*lnotify)(struct snd_card *card, unsigned int mask, struct snd_kcontrol *kctl, unsigned int ioff);
};
#define snd_ctl_file(n) list_entry(n, struct snd_ctl_file, list)
typedef int (*snd_kctl_ioctl_func_t) (struct snd_card * card,
struct snd_ctl_file * control,
unsigned int cmd, unsigned long arg);
void snd_ctl_notify(struct snd_card * card, unsigned int mask, struct snd_ctl_elem_id * id);
void snd_ctl_notify_one(struct snd_card * card, unsigned int mask, struct snd_kcontrol * kctl, unsigned int ioff);
struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, void * private_data);
void snd_ctl_free_one(struct snd_kcontrol * kcontrol);
int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
Annotation
- Immediate include surface: `linux/wait.h`, `linux/nospec.h`, `sound/asound.h`.
- Detected declarations: `struct snd_kcontrol`, `struct snd_kcontrol_new`, `struct snd_kcontrol_volatile`, `struct snd_kcontrol`, `struct snd_kctl_event`, `struct pid`, `struct snd_ctl_file`, `struct snd_ctl_layer_ops`, `function snd_ctl_find_id`, `function snd_ctl_get_ioffnum`.
- Atlas domain: Driver Families / include/sound.
- 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.