| 0/0 |
2026/07/18 00:00 |
flow |
assessment-security |
57m
Results: map[DenialOfService:false Explanation:Based on the analysis of the kernel bug report and the source code, here is the
assessment of the bug's security impact:
**Bug Mechanism:**
The crash is a NULL pointer dereference (`address: 0000000000000000`) occurring
in `snd_ctl_led_get()` at `sound/core/control_led.c`.
This happens because the function attempts to call the `get` callback of a sound
control (`kctl->get(kctl, &value)`), but the `get` function pointer is `NULL`.
The call trace shows this is triggered by a write to a sysfs file:
`sysfs_kf_write` -> `dev_attr_store` -> `set_led_id` -> `snd_ctl_led_set_id` ->
`snd_ctl_led_notify` -> `snd_ctl_led_set_state` -> `snd_ctl_led_get`.
Specifically, this occurs when a control ID is written to the `attach` sysfs
attribute of a sound LED (e.g., `/sys/class/sound/ctl-led/speaker/attach`).
**How `kctl->get` becomes NULL:**
A sound control can have a `NULL` `get` callback if it is a user-defined control
created via the `SNDRV_CTL_IOCTL_ELEM_ADD` ioctl on `/dev/snd/controlC*`. If the
user creates the control without specifying the `SNDRV_CTL_ELEM_ACCESS_READ`
flag (e.g., a write-only control), the kernel's `snd_ctl_elem_add()` function
leaves `kctl->get` uninitialized (`NULL`).
**Exploitability & Accessibility:**
While an unprivileged user (who is in the `audio` group or has ACL access to the
sound device) can create a user-defined control with a `NULL` `get` callback,
they **cannot** trigger the crash.
To trigger the crash, the malformed control must be attached to the LED
subsystem by writing its ID to the `attach` sysfs file. However, the `attach`
attribute is defined using `DEVICE_ATTR_WO(attach)`, which hardcodes the file
permissions to `0200` (write-only by the file owner). In sysfs, these files are
owned by `root:root`.
Therefore, an unprivileged user cannot write to the `attach` file. The bug can
only be triggered by the `root` user intentionally creating a write-only user
control and then explicitly attaching it to the LED subsystem via sysfs.
Since triggering the bug strictly requires `root` privileges (and root can
already crash or modify the system at will), this is **not a security
vulnerability**. It is a local Denial-of-Service that crosses no privilege
boundaries.
**Conclusion:**
- **Exploitable:** No (NULL pointer dereference requiring root).
- **Accessible From Unprivileged Processes:** No (blocked by sysfs `0200`
root-only permissions).
- **Accessible From User Namespaces:** No (sysfs device attributes are owned by
the global root and cannot be written to from within an unprivileged user
namespace).
- **Remote / Network / Peripheral Trigger:** No. Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 1/1 |
2026/07/18 00:00 |
action |
syz-repro-to-c-repro |
0m
Results:
|
| 2/1 |
2026/07/18 00:00 |
action |
kernel-checkouter |
1m
Results: map[KernelSrc:/app/workdir/cache/src/616ad0bb7fd0e57794f58b6a8b531efba9cc084f]
|
| 3/1 |
2026/07/18 00:01 |
action |
kernel-builder |
24m
Results: map[KernelObj:/app/workdir/cache/build/dc492e0980eeb9ea5f2527a6ba87be519c25266c]
|
| 4/1 |
2026/07/18 00:25 |
action |
codesearch-prepare |
17m
Results: map[Index:codesearch-index]
|
| 5/1 |
2026/07/18 00:43 |
agent |
expert |
14m
Model:
Results: map[DenialOfService:false Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Instruction: You are an experienced Linux kernel security engineer. Your task is to analyze given kernel bug report
and determine its security impact based on the following dimensions.
Use the provided tools to examine the source code, check for capability checks (e.g., capable(), ns_capable()),
and understand the nature of the bug. Analyze the given kernel build and configuration.
You can check the kernel config by grepping ".config" file; you can check kernel cmdline by grepping
".config" file for "CONFIG_CMDLINE=". Assume sysctl parameters have default values.
But analyze for the corresponding production build w/o debugging tools enabled (like KASAN, KMSAN, UBSAN).
Try different strategies when analyzing the bug:
- think of ways in which the vulnerable code is unreachable
- or the other way around: try to come up with different ideas of how an unprivileged user can reach the bug
If still unsure err on the side of the bug being non-exploitable/not-accessible.
In the final reply, provide a reasoning for your assessment.
Analysis dimensions:
* Exploitable:
Determine if the bug can result in memory corruption, elevated privileges, or an information leak.
Memory safety issues are almost always exploitable (KASAN or UBSAN reports for use-after-free, out-of-bounds;
refcounting issues, corrupted lists, etc). When kernel is crashing on a completely wild pointer access
(e.g. user-space address, or non-canonical address, but not on NULL or address corresponding to KASAN shadow
for NULL address), including both data accesses and control transfers, that also usually implies possibility
of exploitation. Such reports usually say "unable to handle kernel paging request".
Uses of uninitialized values detected by KMSAN may be exploitable b/c attacker frequently can affect uninit
values with spraying techniques. However, for these exploitability depends on how exactly the uninit value
is used in the code, and what it affects.
Information leaks are exploitable on their own and should be classified as such. A bug that copies kernel
memory contents to userspace (e.g. an out-of-bounds read whose result is returned to the caller, or
uninitialized stack/heap bytes written to a user buffer) is exploitable: it can reveal kernel pointer
values and defeat KASLR, expose sensitive data such as cryptographic keys or other processes' memory, and
serves as a necessary building block in most modern kernel privilege-escalation exploit chains. Do not classify
an information leak as non-exploitable solely because it does not directly cause a memory write or control-flow
hijack; the leak itself is the exploit primitive.
Think of what happens after the bug is triggered. Some bugs cause kernel panic and halt execution,
they are harder to exploit. For example, BUG reports halts the kernel. However, WARNING reports don't halt
execution in production builds. Debug bug detection tools (like KASAN, KMSAN, KCSAN, UBSAN) are also not enabled
in production builds, so attacker can freely exploit these bugs w/o being detected by these tools.
If you see an integer overflow, think how the overflowed value used later (if it's used as allocation size,
or an array index). If you see an out-of-bounds read, think if it's followed by an out-of-bounds write as well.
Some KCSAN data-races may be exploitable by skilled attackers as well. Think what data structures got corrupted
as the result of data races and how. However, note that kernel has lots of "benign" data races that don't lead
to any runtime misbehavior at all.
* Denial Of Service:
Determine if the bug can result in denial-of-service. Most bugs can, since they cause system crash,
hangs, deadlocks, or resource leaks. This is mostly applicable to WARNING bugs that won't cause system crash
in production. For these think what will be consequences of the violation of the kernel assumptions flagged
by the WARNING. In some cases the unexpected condition is also properly handled by the normal control flow
(e.g. with "if (WARN_ON(...))"), these won't cause denial-of-service. If the condition is not handled,
then it may or may not cause denial-of-service.
* Accessible From Unprivileged Processes:
Determine if the bug can be reached from a typical (non-root) user process that does NOT have any special capabilities
(like CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON) or access to device nodes restricted to root.
Assume that unprivileged_bpf_disabled=1, that is eBPF loading is not accessible. However, cBPF (classical BPF)
is still accessible to non-root processes.
Assume that user namespaces are not accessible, that is, the process cannot get the mentioned capabilities even
within a new user namespace (checked by ns_capable() function in the kernel sources).
* Accessible From User Namespaces:
Determine if the bug can be reached within a user-namespace where the process has all capabilities
(including CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_PERFMON). Such capabilities are checked with ns_capable()
function in the kernel sources.
* VM Guest Trigger:
Determine if the bug can be triggered from the context of a typical KVM guest (e.g., set up by a QEMU VMM).
Consider accesses to standard Linux host paravirtualized features (virtio-blk, virtio-net, etc.),
and handling of VM exits in the KVM code.
* VM Host Trigger in The Confidential Computing Context:
Determine if the bug can be triggered in a confidential computing guest kernel from the context of a KVM host.
Consider access to standard Linux guest paravirtualized features (virtio-blk, virtio-net, etc.).
* Ethernet Network Trigger:
Determine if the bug can be triggered by processing ingress network Ethernet traffic, either directly (network stack)
or via drivers exposed to network data.
* Other Remote Trigger:
Determine if the bug can be triggered by processing remote traffic other than Ethernet (Wifi, Bluetooth, NFC, etc).
* Peripheral Trigger:
Determine if the bug can be triggered via an untrusted peripheral device that can be physically plugged
into a system, such as a USB device or a niche hardware driver handling external hardware inputs.
This is particularly important for mobile and desktop environments where users can plug in unknown devices.
* Malicious Filesystem Trigger:
Determine if the bug can be triggered by the kernel mounting and parsing a malicious filesystem image.
This is highly critical for Desktop and Mobile environments where external media or downloaded images
might be auto-mounted.
Don't make assumptions about the kernel source code (it may be different from what you assume it is).
Extensively use the provided code access tools (codesearch-*, git-*, grepper, etc)
to examine the actual source code, and confirm any assumptions.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt:
The kernel bug report is:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 8000000022bb9067 P4D 8000000022bb9067 PUD 0
Oops: Oops: 0010 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 12845 Comm: syz.0.1344 Tainted: G U L syzkaller #0 PREEMPT(full)
Tainted: [U]=USER, [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/25/2026
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc90006877940 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88807b7e0000 RCX: 0000000000000000
RDX: 1ffff1100f6fc00c RSI: ffffffff9bb68200 RDI: ffff88807b7e0000
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff9bb68200 R11: 0000000000000000 R12: 0000000000000007
R13: ffff88802a307e00 R14: ffff88807b7e0000 R15: ffffffff90960768
FS: 00007f6de0ffc6c0(0000) GS:ffff888123df1000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000007ae10000 CR4: 00000000003526f0
Call Trace:
<TASK>
snd_ctl_led_get+0x231/0x430 sound/core/control_led.c:122
snd_ctl_led_set_state+0x5c1/0x7f0 sound/core/control_led.c:168
snd_ctl_led_notify+0x15b/0x1e0 sound/core/control_led.c:239
snd_ctl_led_set_id sound/core/control_led.c:268 [inline]
set_led_id+0xb0f/0xe80 sound/core/control_led.c:557
dev_attr_store+0x58/0x80 drivers/base/core.c:2505
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6ac/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x840 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6de019de59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6de0ffc028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f6de0425fa0 RCX: 00007f6de019de59
RDX: 0000000000000002 RSI: 0000200000000000 RDI: 0000000000000004
RBP: 00007f6de0233e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f6de0426038 R14: 00007f6de0425fa0 R15: 00007ffd07078428
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc90006877940 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88807b7e0000 RCX: 0000000000000000
RDX: 1ffff1100f6fc00c RSI: ffffffff9bb68200 RDI: ffff88807b7e0000
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: ffffffff9bb68200 R11: 0000000000000000 R12: 0000000000000007
R13: ffff88802a307e00 R14: ffff88807b7e0000 R15: ffffffff90960768
FS: 00007f6de0ffc6c0(0000) GS:ffff888123df1000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000007ae10000 CR4: 00000000003526f0
Reply: Based on the analysis of the kernel bug report and the source code, here is the assessment of the bug's security impact:
**Bug Mechanism:**
The crash is a NULL pointer dereference (`address: 0000000000000000`) occurring in `snd_ctl_led_get()` at `sound/core/control_led.c`.
This happens because the function attempts to call the `get` callback of a sound control (`kctl->get(kctl, &value)`), but the `get` function pointer is `NULL`.
The call trace shows this is triggered by a write to a sysfs file:
`sysfs_kf_write` -> `dev_attr_store` -> `set_led_id` -> `snd_ctl_led_set_id` -> `snd_ctl_led_notify` -> `snd_ctl_led_set_state` -> `snd_ctl_led_get`.
Specifically, this occurs when a control ID is written to the `attach` sysfs attribute of a sound LED (e.g., `/sys/class/sound/ctl-led/speaker/attach`).
**How `kctl->get` becomes NULL:**
A sound control can have a `NULL` `get` callback if it is a user-defined control created via the `SNDRV_CTL_IOCTL_ELEM_ADD` ioctl on `/dev/snd/controlC*`. If the user creates the control without specifying the `SNDRV_CTL_ELEM_ACCESS_READ` flag (e.g., a write-only control), the kernel's `snd_ctl_elem_add()` function leaves `kctl->get` uninitialized (`NULL`).
**Exploitability & Accessibility:**
While an unprivileged user (who is in the `audio` group or has ACL access to the sound device) can create a user-defined control with a `NULL` `get` callback, they **cannot** trigger the crash.
To trigger the crash, the malformed control must be attached to the LED subsystem by writing its ID to the `attach` sysfs file. However, the `attach` attribute is defined using `DEVICE_ATTR_WO(attach)`, which hardcodes the file permissions to `0200` (write-only by the file owner). In sysfs, these files are owned by `root:root`.
Therefore, an unprivileged user cannot write to the `attach` file. The bug can only be triggered by the `root` user intentionally creating a write-only user control and then explicitly attaching it to the LED subsystem via sysfs.
Since triggering the bug strictly requires `root` privileges (and root can already crash or modify the system at will), this is **not a security vulnerability**. It is a local Denial-of-Service that crosses no privilege boundaries.
**Conclusion:**
- **Exploitable:** No (NULL pointer dereference requiring root).
- **Accessible From Unprivileged Processes:** No (blocked by sysfs `0200` root-only permissions).
- **Accessible From User Namespaces:** No (sysfs device attributes are owned by the global root and cannot be written to from within an unprivileged user namespace).
- **Remote / Network / Peripheral Trigger:** No.
|
| 6/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 7943
output: 40
thoughts: 134
Thoughts: Okay, here's my take on that bug report, walking through my thought process:
**Diving into a NULL Pointer Dereference**
Alright, a NULL pointer dereference in `snd_ctl_led_get` at `sound/core/control_led.c:122`... that's always fun. The call trace provided is the key here. Let's see... we have `sysfs_kf_write` leading down to `dev_attr_store`, which then heads into `set_led_id`, then calls `snd_ctl_led_set_id`, `snd_ctl_led_notify`, `snd_ctl_led_set_state` and finally `snd_ctl_led_get`. So, it looks like something's going wrong during what appears to be an LED state change triggered through a sysfs write. That gives me a roadmap. Now, my immediate focus is on line 122 of `sound/core/control_led.c`. Time to see what's happening at that critical point in the function `snd_ctl_led_get`!
|
| 7/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:snd_ctl_led_get]
Results: map[SourceCode: 101: /*
102: * A note for callers:
103: * The two static variables info and value are protected using snd_ctl_led_mutex.
104: */
105: static int snd_ctl_led_get(struct snd_ctl_led_ctl *lctl)
106: {
107: static struct snd_ctl_elem_info info;
108: static struct snd_ctl_elem_value value;
109: struct snd_kcontrol *kctl = lctl->kctl;
110: unsigned int i;
111: int result;
112:
113: memset(&info, 0, sizeof(info));
114: info.id = kctl->id;
115: info.id.index += lctl->index_offset;
116: info.id.numid += lctl->index_offset;
117: result = kctl->info(kctl, &info);
118: if (result < 0)
119: return -1;
120: memset(&value, 0, sizeof(value));
121: value.id = info.id;
122: result = kctl->get(kctl, &value);
123: if (result < 0)
124: return -1;
125: if (info.type == SNDRV_CTL_ELEM_TYPE_BOOLEAN ||
126: info.type == SNDRV_CTL_ELEM_TYPE_INTEGER) {
127: for (i = 0; i < info.count; i++)
128: if (value.value.integer.value[i] != info.value.integer.min)
129: return 1;
130: } else if (info.type == SNDRV_CTL_ELEM_TYPE_INTEGER64) {
131: for (i = 0; i < info.count; i++)
132: if (value.value.integer64.value[i] != info.value.integer64.min)
133: return 1;
134: }
135: return 0;
136: }
SourceFile:sound/core/control_led.c]
|
| 8/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 9000
output: 42
thoughts: 77
Thoughts: Okay, let's break this down.
**Debugging a Kernel Control Crash**
Alright, I'm staring at this crash, and it's hitting me right at line 122: `result = kctl->get(kctl, &value);`. The dreaded NULL pointer dereference, and, as expected, RIP is 0x0. This means `kctl->get` is being called on a NULL pointer. Classic.
So, the game plan now is to trace back *why* `kctl->get` is NULL. I need to figure out how `kctl` is being initialized and where it could be getting clobbered. Where is this pointer coming from? This is kernel land, and debugging in the kernel is always a little tricky. I need to examine the initialization of that `kctl` structure.
I'm thinking I should immediately investigate calls to `snd_ctl_led_set_state` and `snd_ctl_led_notify`. They both are likely candidates. Given the context, it's possible these functions are creating or modifying this control and potentially nulling out the function pointer `get` when they shouldn't. The led context is a good starting point.
|
| 9/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:snd_ctl_led_set_state]
Results: map[SourceCode: 138: static void snd_ctl_led_set_state(struct snd_card *card, unsigned int access,
139: struct snd_kcontrol *kctl, unsigned int ioff)
140: {
141: struct snd_ctl_led *led;
142: struct snd_ctl_led_ctl *lctl;
143: int route;
144: bool found;
145:
146: led = snd_ctl_led_get_by_access(access);
147: if (!led)
148: return;
149: route = -1;
150: found = false;
151: scoped_guard(mutex, &snd_ctl_led_mutex) {
152: /* the card may not be registered (active) at this point */
153: if (card && !snd_ctl_led_card_valid[card->number])
154: return;
155: list_for_each_entry(lctl, &led->controls, list) {
156: if (lctl->kctl == kctl && lctl->index_offset == ioff)
157: found = true;
158: UPDATE_ROUTE(route, snd_ctl_led_get(lctl));
159: }
160: if (!found && kctl && card) {
161: lctl = kzalloc(sizeof(*lctl), GFP_KERNEL);
162: if (lctl) {
163: lctl->card = card;
164: lctl->access = access;
165: lctl->kctl = kctl;
166: lctl->index_offset = ioff;
167: list_add(&lctl->list, &led->controls);
168: UPDATE_ROUTE(route, snd_ctl_led_get(lctl));
169: }
170: }
171: }
172: switch (led->mode) {
173: case MODE_OFF: route = 1; break;
174: case MODE_ON: route = 0; break;
175: case MODE_FOLLOW_ROUTE: if (route >= 0) route ^= 1; break;
176: case MODE_FOLLOW_MUTE: /* noop */ break;
177: }
178: if (route >= 0) {
179: struct led_trigger *trig = snd_ctl_ledtrig_audio[led->trigger_type];
180:
181: led_trigger_event(trig, route ? LED_OFF : LED_ON);
182: }
183: }
SourceFile:sound/core/control_led.c]
|
| 10/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 10163
output: 40
thoughts: 57
Thoughts: Here's my understanding of the process, tailored for a fellow expert:
**LED Control State Assignment Deep Dive**
Okay, so I'm looking at how we're setting the LED state, and the core of it seems to be in `snd_ctl_led_set_state`. From what I can see, this function is making a call to `snd_ctl_led_get` on `lctl`. That's where it's grabbing the current LED control information. Essentially, we need the existing state to modify it.
Now, `lctl->kctl` is clearly being set to `kctl`. That's the pivotal link, isn't it? It seems `kctl` is coming directly from `snd_ctl_led_notify`. Which is expected, it looks like an LED control notification. From the notification we're grabbing the control state, and associating the control with the device that received the notification.
Essentially `snd_ctl_led_notify` is likely the key for initializing the system, then the other functions allow state changes.
So, in essence, `snd_ctl_led_set_state` is leveraging the current state (retrieved through `snd_ctl_led_get`) of the LED control, then modifying it as needed. The state itself is provided by an notification.
|
| 11/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:snd_ctl_led_notify]
Results: map[SourceCode: 216: static void snd_ctl_led_notify(struct snd_card *card, unsigned int mask,
217: struct snd_kcontrol *kctl, unsigned int ioff)
218: {
219: struct snd_kcontrol_volatile *vd;
220: unsigned int access, access2;
221:
222: if (mask == SNDRV_CTL_EVENT_MASK_REMOVE) {
223: access = snd_ctl_led_remove(kctl, ioff, 0);
224: if (access)
225: snd_ctl_led_set_state(card, access, NULL, 0);
226: } else if (mask & SNDRV_CTL_EVENT_MASK_INFO) {
227: vd = &kctl->vd[ioff];
228: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
229: access2 = snd_ctl_led_remove(kctl, ioff, access);
230: if (access2)
231: snd_ctl_led_set_state(card, access2, NULL, 0);
232: if (access)
233: snd_ctl_led_set_state(card, access, kctl, ioff);
234: } else if ((mask & (SNDRV_CTL_EVENT_MASK_ADD |
235: SNDRV_CTL_EVENT_MASK_VALUE)) != 0) {
236: vd = &kctl->vd[ioff];
237: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
238: if (access)
239: snd_ctl_led_set_state(card, access, kctl, ioff);
240: }
241: }
SourceFile:sound/core/control_led.c]
|
| 12/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 11082
output: 42
thoughts: 23
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**Diving into the Audio Control Flow**
Alright, so I'm focusing on how the system handles LED notifications in audio control. I'm noting that `snd_ctl_led_notify` is triggered directly from `snd_ctl_led_set_id`. This immediately tells me something about the control flow. It means that the act of setting an LED identifier, presumably for some audio-related device or component, directly leads to a notification mechanism. This connection is quite tight, suggesting a real-time or immediate feedback loop. I'll need to look at both functions in detail to see the specifics. Is the notification synchronous or asynchronous? What data is being passed in `snd_ctl_led_set_id` that `snd_ctl_led_notify` uses? Understanding this relationship between setting the ID and triggering the notification is key. It's likely that the ID acts as a handle of sorts, indicating what audio controller/device needs the LED updated. This also tells me that `snd_ctl_led_notify` probably serves as a callback/observer pattern, getting updated in response to changes made by `snd_ctl_led_set_id`. Makes perfect sense. I'll need to trace the data flow to fully get this!
|
| 13/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:snd_ctl_led_set_id]
Results: map[SourceCode: 243: static int snd_ctl_led_set_id(int card_number, struct snd_ctl_elem_id *id,
244: unsigned int group, bool set)
245: {
246: struct snd_kcontrol *kctl;
247: struct snd_kcontrol_volatile *vd;
248: unsigned int ioff, access, new_access;
249: struct snd_card *card __free(snd_card_unref) =
250: snd_card_ref(card_number);
251:
252: if (!card)
253: return -ENXIO;
254: guard(rwsem_write)(&card->controls_rwsem);
255: kctl = snd_ctl_find_id(card, id);
256: if (!kctl)
257: return -ENOENT;
258: ioff = snd_ctl_get_ioff(kctl, id);
259: vd = &kctl->vd[ioff];
260: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
261: if (access != 0 && access != group_to_access(group))
262: return -EXDEV;
263: new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
264: if (set)
265: new_access |= group_to_access(group);
266: if (new_access != vd->access) {
267: vd->access = new_access;
268: snd_ctl_led_notify(card, SNDRV_CTL_EVENT_MASK_INFO, kctl, ioff);
269: }
270: return 0;
271: }
SourceFile:sound/core/control_led.c]
|
| 14/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 11970
output: 38
thoughts: 21
Thoughts: Okay, here's my interpretation of that.
**Analyzing the LED Control Flow**
Alright, let's break this down. From what I can gather, there's a function named `set_led_id`. My thought is that this is likely a high-level function responsible for controlling the identification, or perhaps the configuration, of an LED or a collection of LEDs.
And then, I see that the function `snd_ctl_led_set_id` is called directly from within `set_led_id`. This instantly tells me a few things about the relationship between these two functions:
* **`snd_ctl_led_set_id` is a lower-level function.** It's the one actually doing the *work* of setting or changing the ID. Think of it as the "worker" or the "engine" behind the process. `set_led_id` likely does some higher level setup, validation or error checking.
* **Encapsulation and Abstraction:** `set_led_id` probably hides the specifics of how the LED ID is set. It acts as an abstraction layer. I'm imagining it might provide a cleaner, more user-friendly interface for setting the ID, while `snd_ctl_led_set_id` deals with the nitty-gritty details.
* **Possible Sound Driver Context:** The presence of "snd\_ctl" in the name of the worker function definitely suggests we're dealing with something related to a sound driver, or at least audio control. It's likely involved in setting some kind of ID related to audio input, output, or a sound-related LED.
* **Implication for Debugging:** If I'm troubleshooting an LED issue, knowing this hierarchy is crucial. If the LED doesn't behave as expected, I'd first look at `set_led_id` to ensure the correct values are being passed. Then, I'd investigate `snd_ctl_led_set_id` to see if it's handling the ID setting correctly, or if there is an error in the low level function.
Essentially, `set_led_id` seems to be the entry point or public API call, and `snd_ctl_led_set_id` does the actual heavy lifting. This is a common and logical design pattern. I'll need to look at the function definitions and possibly any associated data structures to gain a clearer picture, but this is a solid starting point for my understanding.
|
| 15/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:set_led_id]
Results: map[SourceCode: 502: /*
503: * These types of input strings are accepted:
504: *
505: * unsigned integer - numid (equivaled to numid=UINT)
506: * string - basic mixer name (equivalent to iface=MIXER,name=STR)
507: * numid=UINT
508: * [iface=MIXER,][device=UINT,][subdevice=UINT,]name=STR[,index=UINT]
509: */
510: static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, size_t count,
511: bool attach)
512: {
513: char buf2[256], *s, *os;
514: struct snd_ctl_elem_id id;
515: int err;
516:
517: if (strscpy(buf2, buf, sizeof(buf2)) < 0)
518: return -E2BIG;
519: memset(&id, 0, sizeof(id));
520: id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
521: s = buf2;
522: while (*s) {
523: os = s;
524: if (!strncasecmp(s, "numid=", 6)) {
525: s = parse_uint(s + 6, &id.numid);
526: } else if (!strncasecmp(s, "iface=", 6)) {
527: s = parse_iface(s + 6, &id.iface);
528: } else if (!strncasecmp(s, "device=", 7)) {
529: s = parse_uint(s + 7, &id.device);
530: } else if (!strncasecmp(s, "subdevice=", 10)) {
531: s = parse_uint(s + 10, &id.subdevice);
532: } else if (!strncasecmp(s, "name=", 5)) {
533: s = parse_string(s + 5, id.name, sizeof(id.name));
534: } else if (!strncasecmp(s, "index=", 6)) {
535: s = parse_uint(s + 6, &id.index);
536: } else if (s == buf2) {
537: while (*s) {
538: if (*s < '0' || *s > '9')
539: break;
540: s++;
541: }
542: if (*s == '\0')
543: parse_uint(buf2, &id.numid);
544: else {
545: for (; *s >= ' '; s++);
546: *s = '\0';
547: strscpy(id.name, buf2, sizeof(id.name));
548: }
549: break;
550: }
551: if (*s == ',')
552: s++;
553: if (s == os)
554: break;
555: }
556:
557: err = snd_ctl_led_set_id(led_card->number, &id, led_card->led->group, attach);
558: if (err < 0)
559: return err;
560:
561: return count;
562: }
SourceFile:sound/core/control_led.c]
|
| 16/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 13605
output: 51
thoughts: 46
Thoughts: Okay, here's my understanding, tailored for an expert audience:
**Analyzing the `set_led_id` Call Chain**
Alright, so `set_led_id` gets triggered via the `dev_attr_store` function, which is linked to a sysfs entry. Essentially, something is writing to a sysfs file, and that write operation directly leads to a call to `set_led_id`. My immediate goal is to understand the context and implications of this call. I need to trace the usage of `set_led_id`. Where else is this function invoked? Understanding the call stack provides valuable insight to the system, and how the interaction of the call influences the rest of the application. The goal here is to determine all the scenarios, the intended behaviors, and all the possibilities for errors to occur. Knowing everything the function touches will allow for a better understanding of the code.
|
| 17/2 |
2026/07/18 00:43 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control_led.c IncludeSnippetLines:0 Name:set_led_id SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:attach_store SourceFile:sound/core/control_led.c SourceLine:569] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:detach_store SourceFile:sound/core/control_led.c SourceLine:577]] TruncatedOutput:false]
|
| 18/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 14008
output: 36
thoughts: 17
Thoughts: Okay, here's my take on those functions, thinking as a seasoned pro in this field:
**Sysfs Store Functions: My Perspective**
Right, so we're talking about `attach_store` and `detach_store`. Those are clearly the sysfs store functions, the crucial entry points for interacting with the kernel from user space, specifically designed for handling the attachment and detachment of devices or modules, likely within a sysfs hierarchy. I immediately recognize their importance; this is where you control how a device's data gets manipulated and exposed to the user. I can almost picture the sysfs entries and how they interact with the relevant device driver code. It's the plumbing that enables the userspace to signal that I'm supposed to initiate this action - attaching or detaching.
|
| 19/2 |
2026/07/18 00:43 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:attach_store]
Results: map[SourceCode: 564: static ssize_t attach_store(struct device *dev,
565: struct device_attribute *attr,
566: const char *buf, size_t count)
567: {
568: struct snd_ctl_led_card *led_card = container_of(dev, struct snd_ctl_led_card, dev);
569: return set_led_id(led_card, buf, count, true);
570: }
SourceFile:sound/core/control_led.c]
|
| 20/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 14387
output: 50
thoughts: 92
Thoughts: **Debugging a Sound Driver Crash**
Okay, so I'm seeing a crash when I interact with the `/sys/class/sound/ctl-led/.../attach` or `detach` sysfs nodes. Right, so I'm thinking the trigger is that specific file interaction. The error logs point to `kctl->get` being NULL, which is... problematic. Wait a minute, `kctl->get` is a function pointer within the `struct snd_kcontrol`, right? A function pointer being NULL shouldn't be possible, and certainly not in a function that's part of a struct like that. Hmm, that's not right. This is where I go digging through the kernel code.
I need to understand if `kctl->get` can *actually* be NULL. The next logical step is to trace back the creation of the `snd_kcontrol` struct and see how the `get` field is initialized, or not initialized, in each instance. I need to understand if this field is explicitly required in all cases, or if it can be left undefined. Let's see if I can figure out why this pointer is NULL, and when it is or isn't supposed to be.
|
| 21/2 |
2026/07/18 00:43 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control.c IncludeSnippetLines:0 Name:snd_ctl_new1 SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__build_feature_ctl SourceFile:sound/usb/mixer.c SourceLine:1916] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__build_feature_ctl SourceFile:sound/usb/mixer.c SourceLine:1918] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_ca0132_alt_eq_presets SourceFile:sound/hda/codecs/ca0132.c SourceLine:6702] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_controls SourceFile:sound/usb/caiaq/control.c SourceLine:601] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_fx_switch SourceFile:sound/hda/codecs/ca0132.c SourceLine:6678] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_new_ctl SourceFile:sound/usb/mixer_scarlett.c SourceLine:840] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_new_ctl SourceFile:sound/usb/mixer_us16x08.c SourceLine:1101] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_single_ctl_with_resume SourceFile:sound/usb/mixer_quirks.c SourceLine:162] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_tuning_control SourceFile:sound/hda/codecs/ca0132.c SourceLine:4397] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:add_voicefx SourceFile:sound/hda/codecs/ca0132.c SourceLine:6689] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ae5_add_headphone_gain_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6862] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ae5_add_sound_filter_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6879] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:build_audio_procunit SourceFile:sound/usb/mixer.c SourceLine:2789] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:build_connector_control SourceFile:sound/usb/mixer.c SourceLine:2111] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:build_mixer_unit_ctl SourceFile:sound/usb/mixer.c SourceLine:2391] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_bass_redirection_crossover SourceFile:sound/hda/codecs/ca0132.c SourceLine:6800] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_bass_redirection_switch SourceFile:sound/hda/codecs/ca0132.c SourceLine:6811] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_effect_slider SourceFile:sound/hda/codecs/ca0132.c SourceLine:6654] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_front_full_range_switch SourceFile:sound/hda/codecs/ca0132.c SourceLine:6768] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_input_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6828] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_mic_boost_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6844] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_output_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6736] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_rear_full_range_switch SourceFile:sound/hda/codecs/ca0132.c SourceLine:6778] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_speaker_channel_cfg_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6753] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:ca0132_alt_add_svm_enum SourceFile:sound/hda/codecs/ca0132.c SourceLine:6719] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:create_beep_ctls SourceFile:sound/hda/codecs/analog.c SourceLine:72] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:em28xx_cvol_new SourceFile:drivers/media/usb/em28xx/em28xx-audio.c SourceLine:585] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:em28xx_cvol_new SourceFile:drivers/media/usb/em28xx/em28xx-audio.c SourceLine:603] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:f_midi2_create_card SourceFile:drivers/usb/gadget/function/f_midi2.c SourceLine:1612] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:fcp_add_new_ctl SourceFile:sound/usb/fcp.c SourceLine:346] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:g_audio_setup SourceFile:drivers/usb/gadget/function/u_audio.c SourceLine:1286] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:g_audio_setup SourceFile:drivers/usb/gadget/function/u_audio.c SourceLine:1302] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:g_audio_setup SourceFile:drivers/usb/gadget/function/u_audio.c SourceLine:1344] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:g_audio_setup SourceFile:drivers/usb/gadget/function/u_audio.c SourceLine:1367] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:g_audio_setup SourceFile:drivers/usb/gadget/function/u_audio.c SourceLine:1397] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:line6_init_pcm SourceFile:sound/usb/line6/pcm.c SourceLine:574] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:loopback_mixer_new SourceFile:sound/drivers/aloop.c SourceLine:1658] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:parse_audio_selector_unit SourceFile:sound/usb/mixer.c SourceLine:3020] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:parse_clock_source_unit SourceFile:sound/usb/mixer.c SourceLine:2160] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:pod_init SourceFile:sound/usb/line6/pod.c SourceLine:387] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:podhd_init SourceFile:sound/usb/line6/podhd.c SourceLine:415] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:realtek_add_jack SourceFile:sound/usb/mixer_quirks.c SourceLine:2347] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:scarlett2_add_new_ctl SourceFile:sound/usb/mixer_scarlett2.c SourceLine:3445] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_card_dummy_new_mixer SourceFile:sound/drivers/dummy.c SourceLine:875] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_create_std_mono_ctl_offset SourceFile:sound/usb/mixer_quirks.c SourceLine:91] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_make_virtual_master SourceFile:sound/core/vmaster.c SourceLine:437] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_dualsense_jack_create SourceFile:sound/usb/mixer_quirks.c SourceLine:724] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_hda_add_new_ctls SourceFile:sound/hda/common/codec.c SourceLine:3376] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_hda_create_dig_out_ctls SourceFile:sound/hda/common/codec.c SourceLine:2437] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_hda_create_spdif_in_ctls SourceFile:sound/hda/common/codec.c SourceLine:2686] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_hda_create_spdif_share_sw SourceFile:sound/hda/common/codec.c SourceLine:2578] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_kctl_jack_new SourceFile:sound/core/ctljack.c SourceLine:71] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_pcm_add_chmap_ctls SourceFile:sound/core/pcm_lib.c SourceLine:2621] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_s1810c_switch_init SourceFile:sound/usb/mixer_s1810c.c SourceLine:547] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_soc_cnew SourceFile:sound/soc/soc-core.c SourceLine:2333] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_usbmidi_switch_roland_altsetting SourceFile:sound/usb/midi.c SourceLine:2137] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:toneport_init SourceFile:sound/usb/line6/toneport.c SourceLine:426] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:toneport_init SourceFile:sound/usb/line6/toneport.c SourceLine:435] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:usb6fire_control_add_virtual SourceFile:sound/usb/6fire/control.c SourceLine:538] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:usb6fire_control_init SourceFile:sound/usb/6fire/control.c SourceLine:596] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:virtsnd_kctl_build_devs SourceFile:sound/virtio/virtio_kctl.c SourceLine:488] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:zxr_add_headphone_gain_switch SourceFile:sound/hda/codecs/ca0132.c SourceLine:6889] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__UNIQUE_ID_addressable_snd_ctl_new1_843 SourceFile:sound/core/control.c SourceLine:320] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_new1 SourceFile:sound/core/control.c SourceLine:320] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_new1 SourceFile:sound/core/control.c SourceLine:320]] TruncatedOutput:false]
|
| 22/2 |
2026/07/18 00:43 |
llm |
expert |
0m
Model:
Tokens:
input: 18611
output: 32
thoughts: 52
Thoughts: **Analyzing the `snd_ctl_led_get` Function**
Okay, so I'm looking at this `snd_ctl_led_get` function, and it seems to hinge on checking the `kctl->info` and `kctl->get` members of a control structure. Interesting. It's a bit of a pattern, but this has me wondering: are there any instances out there, in this whole audio system, where we have a `kcontrol` that *doesn't* define a `get` function? That's the real question. I need to be sure that this check is exhaustive and that we are handling all edge cases.
To answer that, I'm going to quickly search the code base for definitions of `snd_kcontrol_new`. I need to get a clear picture of how these control structures are actually *created* and initialized. Understanding the creation process will help clarify the likelihood of a missing `get` function. A quick search should reveal the common patterns.
|
| 23/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Args: map[Expression:struct snd_kcontrol_new .* = \{ PathPrefix:sound/]
Results: map[Output:
Full output is too long, showing 500 out of 12877 lines.
Use more precise expression if possible.
sound/aoa/codecs/onyx.c=136=static int onyx_snd_vol_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-166-
sound/aoa/codecs/onyx.c:167:static const struct snd_kcontrol_new volume_control = {
sound/aoa/codecs/onyx.c-168- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/onyx.c=207=static int onyx_snd_inputgain_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-226-
sound/aoa/codecs/onyx.c:227:static const struct snd_kcontrol_new inputgain_control = {
sound/aoa/codecs/onyx.c-228- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/onyx.c=270=static int onyx_snd_capture_source_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-279-
sound/aoa/codecs/onyx.c:280:static const struct snd_kcontrol_new capture_source_control = {
sound/aoa/codecs/onyx.c-281- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/onyx.c=317=static int onyx_snd_mute_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-339-
sound/aoa/codecs/onyx.c:340:static const struct snd_kcontrol_new mute_control = {
sound/aoa/codecs/onyx.c-341- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/onyx.c=373=static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-400-#define SINGLE_BIT(n, type, description, address, mask, flags) \
sound/aoa/codecs/onyx.c:401:static const struct snd_kcontrol_new n##_control = { \
sound/aoa/codecs/onyx.c-402- .iface = SNDRV_CTL_ELEM_IFACE_##type, \
--
sound/aoa/codecs/onyx.c=450=static int onyx_spdif_mask_get(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/onyx.c-462-
sound/aoa/codecs/onyx.c:463:static const struct snd_kcontrol_new onyx_spdif_mask = {
sound/aoa/codecs/onyx.c-464- .access = SNDRV_CTL_ELEM_ACCESS_READ,
--
sound/aoa/codecs/onyx.c=518=static int onyx_set_spdif_pcm_rate(struct onyx *onyx, unsigned int rate)
--
sound/aoa/codecs/onyx.c-544-
sound/aoa/codecs/onyx.c:545:static const struct snd_kcontrol_new onyx_spdif_ctrl = {
sound/aoa/codecs/onyx.c-546- .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
--
sound/aoa/codecs/tas.c=244=static int tas_snd_vol_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-267-
sound/aoa/codecs/tas.c:268:static const struct snd_kcontrol_new volume_control = {
sound/aoa/codecs/tas.c-269- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=290=static int tas_snd_mute_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-306-
sound/aoa/codecs/tas.c:307:static const struct snd_kcontrol_new mute_control = {
sound/aoa/codecs/tas.c-308- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=339=static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-358-#define MIXER_CONTROL(n,descr,idx) \
sound/aoa/codecs/tas.c:359:static const struct snd_kcontrol_new n##_control = { \
sound/aoa/codecs/tas.c-360- .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
--
sound/aoa/codecs/tas.c=392=static int tas_snd_drc_range_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-410-
sound/aoa/codecs/tas.c:411:static const struct snd_kcontrol_new drc_range_control = {
sound/aoa/codecs/tas.c-412- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=432=static int tas_snd_drc_switch_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-446-
sound/aoa/codecs/tas.c:447:static const struct snd_kcontrol_new drc_switch_control = {
sound/aoa/codecs/tas.c-448- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=474=static int tas_snd_capture_source_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-500-
sound/aoa/codecs/tas.c:501:static const struct snd_kcontrol_new capture_source_control = {
sound/aoa/codecs/tas.c-502- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=541=static int tas_snd_treble_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-558-
sound/aoa/codecs/tas.c:559:static const struct snd_kcontrol_new treble_control = {
sound/aoa/codecs/tas.c-560- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/codecs/tas.c=588=static int tas_snd_bass_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/codecs/tas.c-605-
sound/aoa/codecs/tas.c:606:static const struct snd_kcontrol_new bass_control = {
sound/aoa/codecs/tas.c-607- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/fabrics/layout.c=650=static int n##_control_put(struct snd_kcontrol *kcontrol, \
--
sound/aoa/fabrics/layout.c-658-} \
sound/aoa/fabrics/layout.c:659:static const struct snd_kcontrol_new n##_ctl = { \
sound/aoa/fabrics/layout.c-660- .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
--
sound/aoa/fabrics/layout.c=691=static int detect_choice_put(struct snd_kcontrol *kcontrol,
--
sound/aoa/fabrics/layout.c-708-
sound/aoa/fabrics/layout.c:709:static const struct snd_kcontrol_new headphone_detect_choice = {
sound/aoa/fabrics/layout.c-710- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/fabrics/layout.c-718-
sound/aoa/fabrics/layout.c:719:static const struct snd_kcontrol_new lineout_detect_choice = {
sound/aoa/fabrics/layout.c-720- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/fabrics/layout.c=729=static int detected_get(struct snd_kcontrol *kcontrol,
--
sound/aoa/fabrics/layout.c-750-
sound/aoa/fabrics/layout.c:751:static const struct snd_kcontrol_new headphone_detected = {
sound/aoa/fabrics/layout.c-752- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/aoa/fabrics/layout.c-759-
sound/aoa/fabrics/layout.c:760:static const struct snd_kcontrol_new lineout_detected = {
sound/aoa/fabrics/layout.c-761- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/core/ctljack.c=16=static int jack_detect_kctl_get(struct snd_kcontrol *kcontrol,
--
sound/core/ctljack.c-22-
sound/core/ctljack.c:23:static const struct snd_kcontrol_new jack_detect_kctl = {
sound/core/ctljack.c-24- /* name is filled later */
--
sound/core/pcm_lib.c=2586=int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
--
sound/core/pcm_lib.c-2592- struct snd_pcm_chmap *info;
sound/core/pcm_lib.c:2593: struct snd_kcontrol_new knew = {
sound/core/pcm_lib.c-2594- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/drivers/aloop.c=1564=static int loopback_access_get(struct snd_kcontrol *kcontrol,
--
sound/drivers/aloop.c-1577-
sound/drivers/aloop.c:1578:static const struct snd_kcontrol_new loopback_controls[] = {
sound/drivers/aloop.c-1579-{
--
sound/drivers/dummy.c=809=static int snd_dummy_iobox_put(struct snd_kcontrol *kcontrol,
--
sound/drivers/dummy.c-842-
sound/drivers/dummy.c:843:static const struct snd_kcontrol_new snd_dummy_controls[] = {
sound/drivers/dummy.c-844-DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
--
sound/drivers/mts64.c=443=static int snd_mts64_ctl_smpte_switch_put(struct snd_kcontrol* kctl,
--
sound/drivers/mts64.c-464-
sound/drivers/mts64.c:465:static const struct snd_kcontrol_new mts64_ctl_smpte_switch = {
sound/drivers/mts64.c-466- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c=519=static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl,
--
sound/drivers/mts64.c-534-
sound/drivers/mts64.c:535:static const struct snd_kcontrol_new mts64_ctl_smpte_time_hours = {
sound/drivers/mts64.c-536- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c-545-
sound/drivers/mts64.c:546:static const struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = {
sound/drivers/mts64.c-547- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c-556-
sound/drivers/mts64.c:557:static const struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = {
sound/drivers/mts64.c-558- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c-567-
sound/drivers/mts64.c:568:static const struct snd_kcontrol_new mts64_ctl_smpte_time_frames = {
sound/drivers/mts64.c-569- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c=601=static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl,
--
sound/drivers/mts64.c-616-
sound/drivers/mts64.c:617:static const struct snd_kcontrol_new mts64_ctl_smpte_fps = {
sound/drivers/mts64.c-618- .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI,
--
sound/drivers/mts64.c=629=static int snd_mts64_ctl_create(struct snd_card *card,
--
sound/drivers/mts64.c-632- int err, i;
sound/drivers/mts64.c:633: static const struct snd_kcontrol_new *control[] = {
sound/drivers/mts64.c-634- &mts64_ctl_smpte_switch,
--
sound/drivers/opl4/opl4_mixer.c=32=static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/opl4/opl4_mixer.c-45-
sound/drivers/opl4/opl4_mixer.c:46:static const struct snd_kcontrol_new snd_opl4_controls[] = {
sound/drivers/opl4/opl4_mixer.c-47- {
--
sound/drivers/pcsp/pcsp_mixer.c=101=static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol,
--
sound/drivers/pcsp/pcsp_mixer.c-122-
sound/drivers/pcsp/pcsp_mixer.c:123:static const struct snd_kcontrol_new snd_pcsp_controls_pcm[] = {
sound/drivers/pcsp/pcsp_mixer.c-124- PCSP_MIXER_CONTROL(enable, "Master Playback Switch"),
--
sound/drivers/pcsp/pcsp_mixer.c-127-
sound/drivers/pcsp/pcsp_mixer.c:128:static const struct snd_kcontrol_new snd_pcsp_controls_spkr[] = {
sound/drivers/pcsp/pcsp_mixer.c-129- PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"),
--
sound/drivers/vx/vx_mixer.c=419=static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/vx/vx_mixer.c-440-
sound/drivers/vx/vx_mixer.c:441:static const struct snd_kcontrol_new vx_control_output_level = {
sound/drivers/vx/vx_mixer.c-442- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c=478=static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/vx/vx_mixer.c-497-
sound/drivers/vx/vx_mixer.c:498:static const struct snd_kcontrol_new vx_control_audio_src = {
sound/drivers/vx/vx_mixer.c-499- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c=525=static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/vx/vx_mixer.c-539-
sound/drivers/vx/vx_mixer.c:540:static const struct snd_kcontrol_new vx_control_clock_mode = {
sound/drivers/vx/vx_mixer.c-541- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c=685=static const DECLARE_TLV_DB_SCALE(db_scale_audio_gain, -10975, 25, 0);
sound/drivers/vx/vx_mixer.c-686-
sound/drivers/vx/vx_mixer.c:687:static const struct snd_kcontrol_new vx_control_audio_gain = {
sound/drivers/vx/vx_mixer.c-688- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c-696-};
sound/drivers/vx/vx_mixer.c:697:static const struct snd_kcontrol_new vx_control_output_switch = {
sound/drivers/vx/vx_mixer.c-698- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c-703-};
sound/drivers/vx/vx_mixer.c:704:static const struct snd_kcontrol_new vx_control_monitor_gain = {
sound/drivers/vx/vx_mixer.c-705- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c-713-};
sound/drivers/vx/vx_mixer.c:714:static const struct snd_kcontrol_new vx_control_monitor_switch = {
sound/drivers/vx/vx_mixer.c-715- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c=754=static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/vx/vx_mixer.c-771-
sound/drivers/vx/vx_mixer.c:772:static const struct snd_kcontrol_new vx_control_iec958_mask = {
sound/drivers/vx/vx_mixer.c-773- .access = SNDRV_CTL_ELEM_ACCESS_READ,
--
sound/drivers/vx/vx_mixer.c-779-
sound/drivers/vx/vx_mixer.c:780:static const struct snd_kcontrol_new vx_control_iec958 = {
sound/drivers/vx/vx_mixer.c-781- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/drivers/vx/vx_mixer.c=833=static int vx_saturation_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/drivers/vx/vx_mixer.c-844-
sound/drivers/vx/vx_mixer.c:845:static const struct snd_kcontrol_new vx_control_vu_meter = {
sound/drivers/vx/vx_mixer.c-846- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c-852-
sound/drivers/vx/vx_mixer.c:853:static const struct snd_kcontrol_new vx_control_peak_meter = {
sound/drivers/vx/vx_mixer.c-854- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/drivers/vx/vx_mixer.c-860-
sound/drivers/vx/vx_mixer.c:861:static const struct snd_kcontrol_new vx_control_saturation = {
sound/drivers/vx/vx_mixer.c-862- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/firewire/bebob/bebob_maudio.c=373=static int special_clk_ctl_put(struct snd_kcontrol *kctl,
--
sound/firewire/bebob/bebob_maudio.c-394-}
sound/firewire/bebob/bebob_maudio.c:395:static const struct snd_kcontrol_new special_clk_ctl = {
sound/firewire/bebob/bebob_maudio.c-396- .name = "Clock Source",
--
sound/firewire/bebob/bebob_maudio.c=415=static int special_sync_ctl_get(struct snd_kcontrol *kctl,
--
sound/firewire/bebob/bebob_maudio.c-427-}
sound/firewire/bebob/bebob_maudio.c:428:static const struct snd_kcontrol_new special_sync_ctl = {
sound/firewire/bebob/bebob_maudio.c-429- .name = "Sync Status",
--
sound/firewire/bebob/bebob_maudio.c=475=static int special_dig_in_iface_ctl_set(struct snd_kcontrol *kctl,
--
sound/firewire/bebob/bebob_maudio.c-512-}
sound/firewire/bebob/bebob_maudio.c:513:static const struct snd_kcontrol_new special_dig_in_iface_ctl = {
sound/firewire/bebob/bebob_maudio.c-514- .name = "Digital Input Interface",
--
sound/firewire/bebob/bebob_maudio.c=543=static int special_dig_out_iface_ctl_set(struct snd_kcontrol *kctl,
--
sound/firewire/bebob/bebob_maudio.c-567-}
sound/firewire/bebob/bebob_maudio.c:568:static const struct snd_kcontrol_new special_dig_out_iface_ctl = {
sound/firewire/bebob/bebob_maudio.c-569- .name = "Digital Output Interface",
--
sound/firewire/isight.c=528=static int isight_create_mixer(struct isight *isight)
sound/firewire/isight.c-529-{
sound/firewire/isight.c:530: static const struct snd_kcontrol_new gain_control = {
sound/firewire/isight.c-531- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/firewire/isight.c-538- };
sound/firewire/isight.c:539: static const struct snd_kcontrol_new mute_control = {
sound/firewire/isight.c-540- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/firewire/oxfw/oxfw-spkr.c=251=int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie)
sound/firewire/oxfw/oxfw-spkr.c-252-{
sound/firewire/oxfw/oxfw-spkr.c:253: static const struct snd_kcontrol_new controls[] = {
sound/firewire/oxfw/oxfw-spkr.c-254- {
--
sound/hda/codecs/analog.c=30=struct ad198x_spec {
--
sound/hda/codecs/analog.c-47-/* additional beep mixers; the actual parameters are overwritten at build */
sound/hda/codecs/analog.c:48:static const struct snd_kcontrol_new ad_beep_mixer[] = {
sound/hda/codecs/analog.c-49- HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_OUTPUT),
--
sound/hda/codecs/analog.c=458=static int ad1983_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/analog.c-476-
sound/hda/codecs/analog.c:477:static const struct snd_kcontrol_new ad1983_auto_smux_mixer = {
sound/hda/codecs/analog.c-478- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/analog.c=718=static int ad1988_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/analog.c-743-
sound/hda/codecs/analog.c:744:static const struct snd_kcontrol_new ad1988_auto_smux_mixer = {
sound/hda/codecs/analog.c-745- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/ca0132.c=6919=static void ca0132_alt_add_chmap_ctls(struct hda_codec *codec)
--
sound/hda/codecs/ca0132.c-6944- */
sound/hda/codecs/ca0132.c:6945:static const struct snd_kcontrol_new ca0132_mixer[] = {
sound/hda/codecs/ca0132.c-6946- CA0132_CODEC_VOL("Master Playback Volume", VNID_SPK, HDA_OUTPUT),
--
sound/hda/codecs/ca0132.c-6971- */
sound/hda/codecs/ca0132.c:6972:static const struct snd_kcontrol_new desktop_mixer[] = {
sound/hda/codecs/ca0132.c-6973- CA0132_ALT_CODEC_VOL("Front Playback Volume", 0x02, HDA_OUTPUT),
--
sound/hda/codecs/ca0132.c-6993- */
sound/hda/codecs/ca0132.c:6994:static const struct snd_kcontrol_new r3di_mixer[] = {
sound/hda/codecs/ca0132.c-6995- CA0132_ALT_CODEC_VOL("Front Playback Volume", 0x02, HDA_OUTPUT),
--
sound/hda/codecs/cirrus/cs421x.c=328=static int cs421x_boost_vol_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/cirrus/cs421x.c-347-
sound/hda/codecs/cirrus/cs421x.c:348:static const struct snd_kcontrol_new cs421x_speaker_boost_ctl = {
sound/hda/codecs/cirrus/cs421x.c-349-
--
sound/hda/codecs/cirrus/cs8409-tables.c=20=static const DECLARE_TLV_DB_SCALE(cs42l42_adc_db_scale, CS42L42_AMIC_VOL_REAL_MIN * 100, 100, 1);
sound/hda/codecs/cirrus/cs8409-tables.c-21-
sound/hda/codecs/cirrus/cs8409-tables.c:22:const struct snd_kcontrol_new cs42l42_dac_volume_mixer = {
sound/hda/codecs/cirrus/cs8409-tables.c-23- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/cirrus/cs8409-tables.c-34-
sound/hda/codecs/cirrus/cs8409-tables.c:35:const struct snd_kcontrol_new cs42l42_adc_volume_mixer = {
sound/hda/codecs/cirrus/cs8409-tables.c-36- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/cirrus/cs8409.c=430=static int cs8409_spk_sw_gpio_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/cirrus/cs8409.c-445-
sound/hda/codecs/cirrus/cs8409.c:446:static const struct snd_kcontrol_new cs8409_spk_sw_ctrl = {
sound/hda/codecs/cirrus/cs8409.c-447- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/cirrus/cs8409.c=1267=static int cs8409_spk_sw_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/cirrus/cs8409.c-1281-
sound/hda/codecs/cirrus/cs8409.c:1282:static const struct snd_kcontrol_new cs8409_spk_sw_component_ctrl = {
sound/hda/codecs/cirrus/cs8409.c-1283- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/conexant.c=24=struct conexant_spec {
--
sound/hda/codecs/conexant.c-50-/* additional beep mixers; private_value will be overwritten */
sound/hda/codecs/conexant.c:51:static const struct snd_kcontrol_new cxt_beep_mixer[] = {
sound/hda/codecs/conexant.c-52- HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0, 1, 0, HDA_OUTPUT),
--
sound/hda/codecs/conexant.c=571=static int olpc_xo_dc_bias_enum_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/conexant.c-590-
sound/hda/codecs/conexant.c:591:static const struct snd_kcontrol_new olpc_xo_mixers[] = {
sound/hda/codecs/conexant.c-592- {
--
sound/hda/codecs/generic.c=952=enum {
--
sound/hda/codecs/generic.c-956-};
sound/hda/codecs/generic.c:957:static const struct snd_kcontrol_new control_templates[] = {
sound/hda/codecs/generic.c-958- HDA_CODEC_VOLUME(NULL, 0, 0, 0),
--
sound/hda/codecs/generic.c=2239=static int indep_hp_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-2283-
sound/hda/codecs/generic.c:2284:static const struct snd_kcontrol_new indep_hp_ctl = {
sound/hda/codecs/generic.c-2285- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=2395=static int ch_mode_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-2416-
sound/hda/codecs/generic.c:2417:static const struct snd_kcontrol_new channel_mode_enum = {
sound/hda/codecs/generic.c-2418- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=2497=static int loopback_mixing_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-2528-
sound/hda/codecs/generic.c:2529:static const struct snd_kcontrol_new loopback_mixing_enum = {
sound/hda/codecs/generic.c-2530- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=2677=static int out_jack_mode_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-2690-
sound/hda/codecs/generic.c:2691:static const struct snd_kcontrol_new out_jack_mode_enum = {
sound/hda/codecs/generic.c-2692- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=2840=static int in_jack_mode_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-2858-
sound/hda/codecs/generic.c:2859:static const struct snd_kcontrol_new in_jack_mode_enum = {
sound/hda/codecs/generic.c-2860- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=2970=static int hp_mic_jack_mode_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-3004-
sound/hda/codecs/generic.c:3005:static const struct snd_kcontrol_new hp_mic_jack_mode_enum = {
sound/hda/codecs/generic.c-3006- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=3432=static int mux_enum_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-3440-
sound/hda/codecs/generic.c:3441:static const struct snd_kcontrol_new cap_src_temp = {
sound/hda/codecs/generic.c-3442- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=3492=static int cap_vol_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-3499-
sound/hda/codecs/generic.c:3500:static const struct snd_kcontrol_new cap_vol_temp = {
sound/hda/codecs/generic.c-3501- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=3516=static int cap_sw_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-3523-
sound/hda/codecs/generic.c:3524:static const struct snd_kcontrol_new cap_sw_temp = {
sound/hda/codecs/generic.c-3525- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/generic.c=4651=static int automute_mode_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/generic.c-4691-
sound/hda/codecs/generic.c:4692:static const struct snd_kcontrol_new automute_mode_enum = {
sound/hda/codecs/generic.c-4693- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/hdmi/hdmi.c=160=static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/hdmi/hdmi.c-193-
sound/hda/codecs/hdmi/hdmi.c:194:static const struct snd_kcontrol_new eld_bytes_ctl = {
sound/hda/codecs/hdmi/hdmi.c-195- .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE |
--
sound/hda/codecs/realtek/alc268.c=8=static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/realtek/alc268.c-26-
sound/hda/codecs/realtek/alc268.c:27:static const struct snd_kcontrol_new alc268_beep_mixer[] = {
sound/hda/codecs/realtek/alc268.c-28- HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
--
sound/hda/codecs/realtek/realtek.c=901=static int alc_codec_rename_from_preset(struct hda_codec *codec)
--
sound/hda/codecs/realtek/realtek.c-933-/* additional beep mixers; private_value will be overwritten */
sound/hda/codecs/realtek/realtek.c:934:static const struct snd_kcontrol_new alc_beep_mixer[] = {
sound/hda/codecs/realtek/realtek.c-935- HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
--
sound/hda/codecs/senarytech.c=61=static const struct hda_quirk sn6186_fixups[] = {
--
sound/hda/codecs/senarytech.c-66-/* additional beep mixers; private_value will be overwritten */
sound/hda/codecs/senarytech.c:67:static const struct snd_kcontrol_new senary_beep_mixer[] = {
sound/hda/codecs/senarytech.c-68- HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0, 1, 0, HDA_OUTPUT),
--
sound/hda/codecs/si3054.c=95=static int si3054_switch_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/si3054.c-118-
sound/hda/codecs/si3054.c:119:static const struct snd_kcontrol_new si3054_modem_mixer[] = {
sound/hda/codecs/si3054.c-120- SI3054_KCONTROL("Off-hook Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_OH),
--
sound/hda/codecs/side-codecs/cs35l41_hda.c=1365=static int cs35l41_create_controls(struct cs35l41_hda *cs35l41)
--
sound/hda/codecs/side-codecs/cs35l41_hda.c-1369- char mute_override_ctl_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
sound/hda/codecs/side-codecs/cs35l41_hda.c:1370: struct snd_kcontrol_new fw_type_ctl = {
sound/hda/codecs/side-codecs/cs35l41_hda.c-1371- .name = fw_type_ctl_name,
--
sound/hda/codecs/side-codecs/cs35l41_hda.c-1376- };
sound/hda/codecs/side-codecs/cs35l41_hda.c:1377: struct snd_kcontrol_new fw_load_ctl = {
sound/hda/codecs/side-codecs/cs35l41_hda.c-1378- .name = fw_load_ctl_name,
--
sound/hda/codecs/side-codecs/cs35l41_hda.c-1383- };
sound/hda/codecs/side-codecs/cs35l41_hda.c:1384: struct snd_kcontrol_new mute_override_ctl = {
sound/hda/codecs/side-codecs/cs35l41_hda.c-1385- .name = mute_override_ctl_name,
--
sound/hda/codecs/side-codecs/cs35l56_hda.c=356=static void cs35l56_hda_create_controls(struct cs35l56_hda *cs35l56)
sound/hda/codecs/side-codecs/cs35l56_hda.c-357-{
sound/hda/codecs/side-codecs/cs35l56_hda.c:358: struct snd_kcontrol_new ctl_template = {
sound/hda/codecs/side-codecs/cs35l56_hda.c-359- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c=241=static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-262-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:263:static const struct snd_kcontrol_new tas2770_snd_controls[] = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-264- ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2770_AMP_LEVEL,
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-271-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:272:static const struct snd_kcontrol_new tas2781_snd_controls[] = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-273- ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2781_AMP_LEVEL,
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-279-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:280:static const struct snd_kcontrol_new tas5825_snd_controls[] = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-281- ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS5825_AMP_LEVEL,
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-290-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:291:static const struct snd_kcontrol_new tasdevice_prof_ctrl = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-292- .name = "Speaker Profile Id",
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-298-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:299:static const struct snd_kcontrol_new tasdevice_dsp_prog_ctrl = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-300- .name = "Speaker Program Id",
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-306-
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:307:static const struct snd_kcontrol_new tasdevice_dsp_conf_ctrl = {
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-308- .name = "Speaker Config Id",
]
|
| 24/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 30969
output: 34
thoughts: 22
Thoughts: Okay, let's dive into this code. Here's what I'm thinking as I analyze this section:
**Hunting for Missing Audio Control Handlers**
Alright, I need to see if there are any instances of `snd_kcontrol_new` being used where the `.get` field is *not* defined. This is a common pattern, and it can be a problem. My goal is to identify potentially incomplete or problematic audio control configurations. A missing `.get` method usually means you can't *read* the control's current value, which is a big hole. It could mean the author intended a write-only control, but that's a rare and often questionable design choice. I need to make sure this is intentional (and justified), or to track down a bug in the configuration of audio controls. Let's start the search!
|
| 25/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Args: map[Expression:struct snd_kcontrol_new .* = \{ PathPrefix:sound/usb/]
Results: map[Output:
Full output is too long, showing 500 out of 651 lines.
Use more precise expression if possible.
sound/usb/6fire/control.c=394=static int usb6fire_control_digital_thru_get(struct snd_kcontrol *kcontrol,
--
sound/usb/6fire/control.c-401-
sound/usb/6fire/control.c:402:static const struct snd_kcontrol_new vol_elements[] = {
sound/usb/6fire/control.c-403- {
--
sound/usb/6fire/control.c-441-
sound/usb/6fire/control.c:442:static const struct snd_kcontrol_new mute_elements[] = {
sound/usb/6fire/control.c-443- {
--
sound/usb/6fire/control.c-475-
sound/usb/6fire/control.c:476:static const struct snd_kcontrol_new elements[] = {
sound/usb/6fire/control.c-477- {
--
sound/usb/caiaq/control.c=83=static int control_put(struct snd_kcontrol *kcontrol,
--
sound/usb/caiaq/control.c-171-
sound/usb/caiaq/control.c:172:static struct snd_kcontrol_new kcontrol_template = {
sound/usb/caiaq/control.c-173- .iface = SNDRV_CTL_ELEM_IFACE_HWDEP,
--
sound/usb/fcp.c=424=static int fcp_meter_tlv_callback(struct snd_kcontrol *kctl,
--
sound/usb/fcp.c-449-
sound/usb/fcp.c:450:static const struct snd_kcontrol_new fcp_meter_ctl = {
sound/usb/fcp.c-451- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/usb/line6/pcm.c=404=static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/pcm.c-421-/* control definition */
sound/usb/line6/pcm.c:422:static const struct snd_kcontrol_new line6_controls[] = {
sound/usb/line6/pcm.c-423- {
--
sound/usb/line6/pod.c=337=static int snd_pod_control_monitor_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/pod.c-352-/* control definition */
sound/usb/line6/pod.c:353:static const struct snd_kcontrol_new pod_control_monitor = {
sound/usb/line6/pod.c-354- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/podhd.c=340=static int snd_podhd_control_monitor_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/podhd.c-353-/* control definition */
sound/usb/line6/podhd.c:354:static const struct snd_kcontrol_new podhd_control_monitor = {
sound/usb/line6/podhd.c-355- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/toneport.c=239=static void toneport_startup(struct usb_line6 *line6)
--
sound/usb/line6/toneport.c-244-/* control definition */
sound/usb/line6/toneport.c:245:static const struct snd_kcontrol_new toneport_control_monitor = {
sound/usb/line6/toneport.c-246- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/toneport.c-255-/* source selector definition */
sound/usb/line6/toneport.c:256:static const struct snd_kcontrol_new toneport_control_source = {
sound/usb/line6/toneport.c-257- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/midi.c=2082=static int roland_load_put(struct snd_kcontrol *kcontrol,
--
sound/usb/midi.c-2096-
sound/usb/midi.c:2097:static const struct snd_kcontrol_new roland_load_ctl = {
sound/usb/midi.c-2098- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c=1686=static int mixer_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-1700-
sound/usb/mixer.c:1701:static const struct snd_kcontrol_new usb_feature_unit_ctl = {
sound/usb/mixer.c-1702- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c-1709-/* the read-only variant */
sound/usb/mixer.c:1710:static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
sound/usb/mixer.c-1711- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c-1721- */
sound/usb/mixer.c:1722:static const struct snd_kcontrol_new usb_bool_master_control_ctl_ro = {
sound/usb/mixer.c-1723- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer.c-1730-
sound/usb/mixer.c:1731:static const struct snd_kcontrol_new usb_connector_ctl_ro = {
sound/usb/mixer.c-1732- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer.c=2523=static int mixer_ctl_procunit_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-2545-/* alsa control interface for processing/extension unit */
sound/usb/mixer.c:2546:static const struct snd_kcontrol_new mixer_procunit_ctl = {
sound/usb/mixer.c-2547- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c=2891=static int mixer_ctl_selector_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-2913-/* alsa control interface for selector unit */
sound/usb/mixer.c:2914:static const struct snd_kcontrol_new mixer_selectunit_ctl = {
sound/usb/mixer.c-2915- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=352=static int snd_audigy2nx_led_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-360-/* name and private_value are set dynamically */
sound/usb/mixer_quirks.c:361:static const struct snd_kcontrol_new snd_audigy2nx_control = {
sound/usb/mixer_quirks.c-362- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=513=static int snd_emu0204_ch_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-518-
sound/usb/mixer_quirks.c:519:static const struct snd_kcontrol_new snd_emu0204_control = {
sound/usb/mixer_quirks.c-520- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=668=static int snd_dualsense_jack_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_quirks.c-677-
sound/usb/mixer_quirks.c:678:static const struct snd_kcontrol_new snd_dualsense_jack_control = {
sound/usb/mixer_quirks.c-679- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=825=static int snd_xonar_u1_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-830-
sound/usb/mixer_quirks.c:831:static const struct snd_kcontrol_new snd_xonar_u1_output_switch = {
sound/usb/mixer_quirks.c-832- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1067=static int snd_mbox1_src_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-1071-
sound/usb/mixer_quirks.c:1072:static const struct snd_kcontrol_new snd_mbox1_clk_switch = {
sound/usb/mixer_quirks.c-1073- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-1082-
sound/usb/mixer_quirks.c:1083:static const struct snd_kcontrol_new snd_mbox1_src_switch = {
sound/usb/mixer_quirks.c-1084- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1156=static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-1177-
sound/usb/mixer_quirks.c:1178:static const struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = {
sound/usb/mixer_quirks.c-1179- {
--
sound/usb/mixer_quirks.c-1196-
sound/usb/mixer_quirks.c:1197:static const struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = {
sound/usb/mixer_quirks.c-1198- {
--
sound/usb/mixer_quirks.c=1232=static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1236- int i, err = 0;
sound/usb/mixer_quirks.c:1237: struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1238- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1349=static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1351-{
sound/usb/mixer_quirks.c:1352: static struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1353- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1754=static int snd_c400_create_knob_switch(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1756-{
sound/usb/mixer_quirks.c:1757: static struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1758- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=2072=static int snd_microii_spdif_switch_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2087-
sound/usb/mixer_quirks.c:2088:static const struct snd_kcontrol_new snd_microii_mixer_spdif[] = {
sound/usb/mixer_quirks.c-2089- {
--
sound/usb/mixer_quirks.c=2187=static int snd_soundblaster_e1_switch_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2196-
sound/usb/mixer_quirks.c:2197:static const struct snd_kcontrol_new snd_soundblaster_e1_input_switch = {
sound/usb/mixer_quirks.c-2198- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=2274=static int realtek_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2315-
sound/usb/mixer_quirks.c:2316:static const struct snd_kcontrol_new realtek_connector_ctl_ro = {
sound/usb/mixer_quirks.c-2317- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=2438=static int hp_dock_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2488-
sound/usb/mixer_quirks.c:2489:static const struct snd_kcontrol_new hp_dock_connector_ctl_ro = {
sound/usb/mixer_quirks.c-2490- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=2789=static int snd_rme_sync_source_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2799-
sound/usb/mixer_quirks.c:2800:static const struct snd_kcontrol_new snd_rme_controls[] = {
sound/usb/mixer_quirks.c-2801- {
--
sound/usb/mixer_quirks.c=3257=static int snd_bbfpro_vol_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-3266-// Predfine elements
sound/usb/mixer_quirks.c:3267:static const struct snd_kcontrol_new snd_bbfpro_ctl_control = {
sound/usb/mixer_quirks.c-3268- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-3275-
sound/usb/mixer_quirks.c:3276:static const struct snd_kcontrol_new snd_bbfpro_gain_control = {
sound/usb/mixer_quirks.c-3277- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-3284-
sound/usb/mixer_quirks.c:3285:static const struct snd_kcontrol_new snd_bbfpro_vol_control = {
sound/usb/mixer_quirks.c-3286- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=3653=static int snd_rme_digiface_rate_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-3663-
sound/usb/mixer_quirks.c:3664:static const struct snd_kcontrol_new snd_rme_digiface_controls[] = {
sound/usb/mixer_quirks.c-3665- {
--
sound/usb/mixer_quirks.c=4361=static int snd_djm_controls_create(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-4368-
sound/usb/mixer_quirks.c:4369: struct snd_kcontrol_new knew = {
sound/usb/mixer_quirks.c-4370- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c=558=snd_s1810c_line_sw_info(struct snd_kcontrol *kctl,
--
sound/usb/mixer_s1810c.c-568-
sound/usb/mixer_s1810c.c:569:static const struct snd_kcontrol_new snd_s1810c_line_sw = {
sound/usb/mixer_s1810c.c-570- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-577-
sound/usb/mixer_s1810c.c:578:static const struct snd_kcontrol_new snd_s1810c_mute_sw = {
sound/usb/mixer_s1810c.c-579- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-586-
sound/usb/mixer_s1810c.c:587:static const struct snd_kcontrol_new snd_s1824c_mono_sw = {
sound/usb/mixer_s1810c.c-588- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-595-
sound/usb/mixer_s1810c.c:596:static const struct snd_kcontrol_new snd_s1810c_48v_sw = {
sound/usb/mixer_s1810c.c-597- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c=606=snd_s1810c_ab_sw_info(struct snd_kcontrol *kctl,
--
sound/usb/mixer_s1810c.c-616-
sound/usb/mixer_s1810c.c:617:static const struct snd_kcontrol_new snd_s1810c_ab_sw = {
sound/usb/mixer_s1810c.c-618- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=700=static int scarlett_ctl_meter_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett.c-721-
sound/usb/mixer_scarlett.c:722:static const struct snd_kcontrol_new usb_scarlett_ctl_switch = {
sound/usb/mixer_scarlett.c-723- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=730=static const DECLARE_TLV_DB_SCALE(db_scale_scarlett_gain, -12800, 100, 0);
sound/usb/mixer_scarlett.c-731-
sound/usb/mixer_scarlett.c:732:static const struct snd_kcontrol_new usb_scarlett_ctl = {
sound/usb/mixer_scarlett.c-733- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-743-
sound/usb/mixer_scarlett.c:744:static const struct snd_kcontrol_new usb_scarlett_ctl_master = {
sound/usb/mixer_scarlett.c-745- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-755-
sound/usb/mixer_scarlett.c:756:static const struct snd_kcontrol_new usb_scarlett_ctl_enum = {
sound/usb/mixer_scarlett.c-757- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-763-
sound/usb/mixer_scarlett.c:764:static const struct snd_kcontrol_new usb_scarlett_ctl_dynamic_enum = {
sound/usb/mixer_scarlett.c-765- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-771-
sound/usb/mixer_scarlett.c:772:static const struct snd_kcontrol_new usb_scarlett_ctl_sync = {
sound/usb/mixer_scarlett.c-773- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-780-/* Forte-specific control structures - use bRequest=0x03 instead of 0x01 */
sound/usb/mixer_scarlett.c:781:static const struct snd_kcontrol_new usb_forte_ctl_enum = {
sound/usb/mixer_scarlett.c-782- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-788-
sound/usb/mixer_scarlett.c:789:static const struct snd_kcontrol_new usb_forte_ctl_switch = {
sound/usb/mixer_scarlett.c-790- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=798=static const DECLARE_TLV_DB_SCALE(db_scale_forte_input_gain, 0, 179, 0);
sound/usb/mixer_scarlett.c-799-
sound/usb/mixer_scarlett.c:800:static const struct snd_kcontrol_new usb_forte_ctl_input_gain = {
sound/usb/mixer_scarlett.c-801- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=3478=static int scarlett2_firmware_version_ctl_info(
--
sound/usb/mixer_scarlett2.c-3487-
sound/usb/mixer_scarlett2.c:3488:static const struct snd_kcontrol_new scarlett2_firmware_version_ctl = {
sound/usb/mixer_scarlett2.c-3489- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=3518=static int scarlett2_min_firmware_version_ctl_info(
--
sound/usb/mixer_scarlett2.c-3527-
sound/usb/mixer_scarlett2.c:3528:static const struct snd_kcontrol_new scarlett2_min_firmware_version_ctl = {
sound/usb/mixer_scarlett2.c-3529- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=3565=static int scarlett2_sync_ctl_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-3586-
sound/usb/mixer_scarlett2.c:3587:static const struct snd_kcontrol_new scarlett2_sync_ctl = {
sound/usb/mixer_scarlett2.c-3588- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=3925=static int scarlett2_autogain_status_ctl_info(
--
sound/usb/mixer_scarlett2.c-3936-
sound/usb/mixer_scarlett2.c:3937:static const struct snd_kcontrol_new scarlett2_autogain_switch_ctl = {
sound/usb/mixer_scarlett2.c-3938- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-3944-
sound/usb/mixer_scarlett2.c:3945:static const struct snd_kcontrol_new scarlett2_autogain_status_ctl = {
sound/usb/mixer_scarlett2.c-3946- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4038=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-4041-
sound/usb/mixer_scarlett2.c:4042:static const struct snd_kcontrol_new scarlett2_ag_target_ctl = {
sound/usb/mixer_scarlett2.c-4043- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=4145=static int scarlett2_input_select_ctl_info(
--
sound/usb/mixer_scarlett2.c-4186-
sound/usb/mixer_scarlett2.c:4187:static const struct snd_kcontrol_new scarlett2_input_select_ctl = {
sound/usb/mixer_scarlett2.c-4188- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4243=static int scarlett2_input_link_ctl_put(
--
sound/usb/mixer_scarlett2.c-4274-
sound/usb/mixer_scarlett2.c:4275:static const struct snd_kcontrol_new scarlett2_input_link_ctl = {
sound/usb/mixer_scarlett2.c-4276- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4349=static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4381-
sound/usb/mixer_scarlett2.c:4382:static const struct snd_kcontrol_new scarlett2_input_gain_ctl = {
sound/usb/mixer_scarlett2.c-4383- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4433=static int scarlett2_safe_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4465-
sound/usb/mixer_scarlett2.c:4466:static const struct snd_kcontrol_new scarlett2_safe_ctl = {
sound/usb/mixer_scarlett2.c-4467- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4540=static int scarlett2_pcm_input_switch_ctl_info(
--
sound/usb/mixer_scarlett2.c-4550-
sound/usb/mixer_scarlett2.c:4551:static const struct snd_kcontrol_new scarlett2_pcm_input_switch_ctl = {
sound/usb/mixer_scarlett2.c-4552- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4726=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-4729-
sound/usb/mixer_scarlett2.c:4730:static const struct snd_kcontrol_new scarlett2_master_volume_ctl = {
sound/usb/mixer_scarlett2.c-4731- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-4740-
sound/usb/mixer_scarlett2.c:4741:static const struct snd_kcontrol_new scarlett2_headphone_volume_ctl = {
sound/usb/mixer_scarlett2.c-4742- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-4751-
sound/usb/mixer_scarlett2.c:4752:static const struct snd_kcontrol_new scarlett2_line_out_volume_ctl = {
sound/usb/mixer_scarlett2.c-4753- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4818=static int scarlett2_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4846-
sound/usb/mixer_scarlett2.c:4847:static const struct snd_kcontrol_new scarlett2_mute_ctl = {
sound/usb/mixer_scarlett2.c-4848- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4955=static int scarlett2_sw_hw_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4980-
sound/usb/mixer_scarlett2.c:4981:static const struct snd_kcontrol_new scarlett2_sw_hw_enum_ctl = {
sound/usb/mixer_scarlett2.c-4982- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5055=static int scarlett2_level_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5092-
sound/usb/mixer_scarlett2.c:5093:static const struct snd_kcontrol_new scarlett2_level_enum_ctl = {
sound/usb/mixer_scarlett2.c-5094- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5141=static int scarlett2_pad_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5169-
sound/usb/mixer_scarlett2.c:5170:static const struct snd_kcontrol_new scarlett2_pad_ctl = {
sound/usb/mixer_scarlett2.c-5171- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5250=static int scarlett2_air_with_drive_ctl_info(
--
sound/usb/mixer_scarlett2.c-5272-
sound/usb/mixer_scarlett2.c:5273:static const struct snd_kcontrol_new scarlett2_air_ctl[2] = {
sound/usb/mixer_scarlett2.c-5274- {
--
sound/usb/mixer_scarlett2.c=5329=static int scarlett2_dsp_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5361-
sound/usb/mixer_scarlett2.c:5362:static const struct snd_kcontrol_new scarlett2_dsp_ctl = {
sound/usb/mixer_scarlett2.c-5363- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5464=static int scarlett2_compressor_ctl_info(
--
sound/usb/mixer_scarlett2.c-5477-
sound/usb/mixer_scarlett2.c:5478:static const struct snd_kcontrol_new scarlett2_compressor_ctl = {
sound/usb/mixer_scarlett2.c-5479- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5540=static int scarlett2_peq_flt_switch_ctl_put(
--
sound/usb/mixer_scarlett2.c-5568-
sound/usb/mixer_scarlett2.c:5569:static const struct snd_kcontrol_new scarlett2_precomp_flt_switch_ctl = {
sound/usb/mixer_scarlett2.c-5570- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c-5576-
sound/usb/mixer_scarlett2.c:5577:static const struct snd_kcontrol_new scarlett2_peq_flt_switch_ctl = {
sound/usb/mixer_scarlett2.c-5578- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5783=static int scarlett2_flt_ctl_info(
--
sound/usb/mixer_scarlett2.c-5793-
sound/usb/mixer_scarlett2.c:5794:static const struct snd_kcontrol_new scarlett2_precomp_flt_ctl = {
sound/usb/mixer_scarlett2.c-5795- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c-5801-
sound/usb/mixer_scarlett2.c:5802:static const struct snd_kcontrol_new scarlett2_peq_flt_ctl = {
sound/usb/mixer_scarlett2.c-5803- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5850=static int scarlett2_input_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5883-
sound/usb/mixer_scarlett2.c:5884:static const struct snd_kcontrol_new scarlett2_input_mute_ctl = {
sound/usb/mixer_scarlett2.c-5885- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6006=static int scarlett2_phantom_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6045-
sound/usb/mixer_scarlett2.c:6046:static const struct snd_kcontrol_new scarlett2_phantom_ctl = {
sound/usb/mixer_scarlett2.c-6047- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6066=static int scarlett2_phantom_persistence_ctl_put(
--
sound/usb/mixer_scarlett2.c-6094-
sound/usb/mixer_scarlett2.c:6095:static const struct snd_kcontrol_new scarlett2_phantom_persistence_ctl = {
sound/usb/mixer_scarlett2.c-6096- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6256=static int scarlett2_speaker_switch_enum_ctl_put(
--
sound/usb/mixer_scarlett2.c-6299-
sound/usb/mixer_scarlett2.c:6300:static const struct snd_kcontrol_new scarlett2_speaker_switch_enum_ctl = {
sound/usb/mixer_scarlett2.c-6301- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6356=static int scarlett2_talkback_enum_ctl_put(
--
sound/usb/mixer_scarlett2.c-6391-
sound/usb/mixer_scarlett2.c:6392:static const struct snd_kcontrol_new scarlett2_talkback_enum_ctl = {
sound/usb/mixer_scarlett2.c-6393- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6413=static int scarlett2_talkback_map_ctl_put(
--
sound/usb/mixer_scarlett2.c-6445-
sound/usb/mixer_scarlett2.c:6446:static const struct snd_kcontrol_new scarlett2_talkback_map_ctl = {
sound/usb/mixer_scarlett2.c-6447- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6507=static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6546-
sound/usb/mixer_scarlett2.c:6547:static const struct snd_kcontrol_new scarlett2_dim_mute_ctl = {
sound/usb/mixer_scarlett2.c-6548- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6569=static int scarlett2_sp_hp_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6601-
sound/usb/mixer_scarlett2.c:6602:static const struct snd_kcontrol_new scarlett2_sp_hp_mute_ctl = {
sound/usb/mixer_scarlett2.c-6603- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7068=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-7073-
sound/usb/mixer_scarlett2.c:7074:static const struct snd_kcontrol_new scarlett2_mixer_ctl = {
sound/usb/mixer_scarlett2.c-7075- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7197=static int scarlett2_direct_monitor_stereo_enum_ctl_info(
--
sound/usb/mixer_scarlett2.c-7209- */
sound/usb/mixer_scarlett2.c:7210:static const struct snd_kcontrol_new scarlett2_direct_monitor_ctl[2] = {
sound/usb/mixer_scarlett2.c-7211- {
--
sound/usb/mixer_scarlett2.c=7238=static int scarlett2_monitor_mix_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7266-
sound/usb/mixer_scarlett2.c:7267:static const struct snd_kcontrol_new scarlett2_monitor_mix_ctl = {
sound/usb/mixer_scarlett2.c-7268- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7406=static int scarlett2_mux_src_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7432-
sound/usb/mixer_scarlett2.c:7433:static const struct snd_kcontrol_new scarlett2_mux_src_enum_ctl = {
sound/usb/mixer_scarlett2.c-7434- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7497=static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7532-
sound/usb/mixer_scarlett2.c:7533:static const struct snd_kcontrol_new scarlett2_meter_ctl = {
sound/usb/mixer_scarlett2.c-7534- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/usb/mixer_scarlett2.c=7566=static int scarlett2_msd_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7593-
sound/usb/mixer_scarlett2.c:7594:static const struct snd_kcontrol_new scarlett2_msd_ctl = {
sound/usb/mixer_scarlett2.c-7595- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7630=static int scarlett2_standalone_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7658-
sound/usb/mixer_scarlett2.c:7659:static const struct snd_kcontrol_new scarlett2_standalone_ctl = {
]
|
| 26/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 42228
output: 40
thoughts: 31
Thoughts: Here's a summary of my immediate thought process, focusing on the provided snippet, framed as if I'm thinking it:
**Diving into the Code: `sound/usb/mixer.c`**
Okay, so we're looking at `sound/usb/mixer.c`. That file usually deals with USB audio device handling, specifically the mixer controls. Let's see... the specific line mentioned is 1710. That's usually deep within the control structure, so it likely relates to a very specific aspect of audio device configuration. Ah, yes, it seems we are at the function `usb_feature_unit_ctl_ro`. "RO" likely denotes a "read-only" control. This likely deals with a feature unit. So this implies we are checking a feature unit's read only control. Given my expertise, I'm already starting to think about what the most common scenarios this function would handle are. I'll need to remember to check how this integrates with the overall audio subsystem architecture.
|
| 27/2 |
2026/07/18 00:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer.c Name:usb_feature_unit_ctl_ro]
Results: map[SourceCode:1709: /* the read-only variant */
1710: static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
1711: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1712: .name = "", /* will be filled later manually */
1713: .info = mixer_ctl_feature_info,
1714: .get = mixer_ctl_feature_get,
1715: .put = NULL,
1716: };
SourceFile:sound/usb/mixer.c]
|
| 28/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 42686
output: 26
thoughts: 27
Thoughts: Okay, let's see. Here's my thought process on this:
**Analyzing `put` and `get` Operations**
Hmm, this is curious. I'm seeing that the `put` operation is returning NULL, but the corresponding `get` operation *is* present. That's not the typical behavior I'd expect. Now I'm wondering, are there other instances within the dataset where we have the reverse scenario -- where the `get` operation is missing but the `put` operation is present? That pattern could tell us a lot.
|
| 29/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Error:
Args: map[Expression:\.get = NULL PathPrefix:sound/]
Results:
|
| 30/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 42872
output: 34
thoughts: 34
Thoughts: Okay, here's my interpretation of those thoughts, framed as my own:
**Investigating a Potential Initialization Issue**
Hmm, it seems like the problem might stem from `.get` not being properly initialized in this context. It's a classic debugging scenario. The behavior just doesn't seem right, and initialization issues are always the first place to look when you're dealing with function pointers within a struct, especially in the kernel.
So, I'll start by searching the codebase for definitions of `struct snd_kcontrol_new`. I need to identify any instances where the structure is declared but *doesn't* have the `.get` function pointer explicitly assigned. If I find examples like that, it'll confirm my suspicion. That's usually the root cause of these kind of errors; it's a very common gotcha. If I can find some, I can then trace them back to where the struct is instantiated to see if my hypothesis holds true. From there, I can determine why it's not being initialized properly.
|
| 31/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Args: map[Expression:struct snd_kcontrol_new .* = \{ PathPrefix:sound/usb/]
Results: map[Output:
Full output is too long, showing 500 out of 651 lines.
Use more precise expression if possible.
sound/usb/6fire/control.c=394=static int usb6fire_control_digital_thru_get(struct snd_kcontrol *kcontrol,
--
sound/usb/6fire/control.c-401-
sound/usb/6fire/control.c:402:static const struct snd_kcontrol_new vol_elements[] = {
sound/usb/6fire/control.c-403- {
--
sound/usb/6fire/control.c-441-
sound/usb/6fire/control.c:442:static const struct snd_kcontrol_new mute_elements[] = {
sound/usb/6fire/control.c-443- {
--
sound/usb/6fire/control.c-475-
sound/usb/6fire/control.c:476:static const struct snd_kcontrol_new elements[] = {
sound/usb/6fire/control.c-477- {
--
sound/usb/caiaq/control.c=83=static int control_put(struct snd_kcontrol *kcontrol,
--
sound/usb/caiaq/control.c-171-
sound/usb/caiaq/control.c:172:static struct snd_kcontrol_new kcontrol_template = {
sound/usb/caiaq/control.c-173- .iface = SNDRV_CTL_ELEM_IFACE_HWDEP,
--
sound/usb/fcp.c=424=static int fcp_meter_tlv_callback(struct snd_kcontrol *kctl,
--
sound/usb/fcp.c-449-
sound/usb/fcp.c:450:static const struct snd_kcontrol_new fcp_meter_ctl = {
sound/usb/fcp.c-451- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/usb/line6/pcm.c=404=static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/pcm.c-421-/* control definition */
sound/usb/line6/pcm.c:422:static const struct snd_kcontrol_new line6_controls[] = {
sound/usb/line6/pcm.c-423- {
--
sound/usb/line6/pod.c=337=static int snd_pod_control_monitor_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/pod.c-352-/* control definition */
sound/usb/line6/pod.c:353:static const struct snd_kcontrol_new pod_control_monitor = {
sound/usb/line6/pod.c-354- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/podhd.c=340=static int snd_podhd_control_monitor_put(struct snd_kcontrol *kcontrol,
--
sound/usb/line6/podhd.c-353-/* control definition */
sound/usb/line6/podhd.c:354:static const struct snd_kcontrol_new podhd_control_monitor = {
sound/usb/line6/podhd.c-355- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/toneport.c=239=static void toneport_startup(struct usb_line6 *line6)
--
sound/usb/line6/toneport.c-244-/* control definition */
sound/usb/line6/toneport.c:245:static const struct snd_kcontrol_new toneport_control_monitor = {
sound/usb/line6/toneport.c-246- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/line6/toneport.c-255-/* source selector definition */
sound/usb/line6/toneport.c:256:static const struct snd_kcontrol_new toneport_control_source = {
sound/usb/line6/toneport.c-257- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/midi.c=2082=static int roland_load_put(struct snd_kcontrol *kcontrol,
--
sound/usb/midi.c-2096-
sound/usb/midi.c:2097:static const struct snd_kcontrol_new roland_load_ctl = {
sound/usb/midi.c-2098- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c=1686=static int mixer_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-1700-
sound/usb/mixer.c:1701:static const struct snd_kcontrol_new usb_feature_unit_ctl = {
sound/usb/mixer.c-1702- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c-1709-/* the read-only variant */
sound/usb/mixer.c:1710:static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
sound/usb/mixer.c-1711- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c-1721- */
sound/usb/mixer.c:1722:static const struct snd_kcontrol_new usb_bool_master_control_ctl_ro = {
sound/usb/mixer.c-1723- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer.c-1730-
sound/usb/mixer.c:1731:static const struct snd_kcontrol_new usb_connector_ctl_ro = {
sound/usb/mixer.c-1732- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer.c=2523=static int mixer_ctl_procunit_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-2545-/* alsa control interface for processing/extension unit */
sound/usb/mixer.c:2546:static const struct snd_kcontrol_new mixer_procunit_ctl = {
sound/usb/mixer.c-2547- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer.c=2891=static int mixer_ctl_selector_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer.c-2913-/* alsa control interface for selector unit */
sound/usb/mixer.c:2914:static const struct snd_kcontrol_new mixer_selectunit_ctl = {
sound/usb/mixer.c-2915- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=352=static int snd_audigy2nx_led_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-360-/* name and private_value are set dynamically */
sound/usb/mixer_quirks.c:361:static const struct snd_kcontrol_new snd_audigy2nx_control = {
sound/usb/mixer_quirks.c-362- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=513=static int snd_emu0204_ch_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-518-
sound/usb/mixer_quirks.c:519:static const struct snd_kcontrol_new snd_emu0204_control = {
sound/usb/mixer_quirks.c-520- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=668=static int snd_dualsense_jack_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_quirks.c-677-
sound/usb/mixer_quirks.c:678:static const struct snd_kcontrol_new snd_dualsense_jack_control = {
sound/usb/mixer_quirks.c-679- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=825=static int snd_xonar_u1_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-830-
sound/usb/mixer_quirks.c:831:static const struct snd_kcontrol_new snd_xonar_u1_output_switch = {
sound/usb/mixer_quirks.c-832- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1067=static int snd_mbox1_src_switch_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-1071-
sound/usb/mixer_quirks.c:1072:static const struct snd_kcontrol_new snd_mbox1_clk_switch = {
sound/usb/mixer_quirks.c-1073- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-1082-
sound/usb/mixer_quirks.c:1083:static const struct snd_kcontrol_new snd_mbox1_src_switch = {
sound/usb/mixer_quirks.c-1084- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1156=static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-1177-
sound/usb/mixer_quirks.c:1178:static const struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = {
sound/usb/mixer_quirks.c-1179- {
--
sound/usb/mixer_quirks.c-1196-
sound/usb/mixer_quirks.c:1197:static const struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = {
sound/usb/mixer_quirks.c-1198- {
--
sound/usb/mixer_quirks.c=1232=static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1236- int i, err = 0;
sound/usb/mixer_quirks.c:1237: struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1238- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1349=static int snd_ftu_create_effect_switch(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1351-{
sound/usb/mixer_quirks.c:1352: static struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1353- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=1754=static int snd_c400_create_knob_switch(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-1756-{
sound/usb/mixer_quirks.c:1757: static struct snd_kcontrol_new template = {
sound/usb/mixer_quirks.c-1758- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=2072=static int snd_microii_spdif_switch_put(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2087-
sound/usb/mixer_quirks.c:2088:static const struct snd_kcontrol_new snd_microii_mixer_spdif[] = {
sound/usb/mixer_quirks.c-2089- {
--
sound/usb/mixer_quirks.c=2187=static int snd_soundblaster_e1_switch_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2196-
sound/usb/mixer_quirks.c:2197:static const struct snd_kcontrol_new snd_soundblaster_e1_input_switch = {
sound/usb/mixer_quirks.c-2198- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=2274=static int realtek_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2315-
sound/usb/mixer_quirks.c:2316:static const struct snd_kcontrol_new realtek_connector_ctl_ro = {
sound/usb/mixer_quirks.c-2317- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=2438=static int hp_dock_ctl_connector_get(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2488-
sound/usb/mixer_quirks.c:2489:static const struct snd_kcontrol_new hp_dock_connector_ctl_ro = {
sound/usb/mixer_quirks.c-2490- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_quirks.c=2789=static int snd_rme_sync_source_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-2799-
sound/usb/mixer_quirks.c:2800:static const struct snd_kcontrol_new snd_rme_controls[] = {
sound/usb/mixer_quirks.c-2801- {
--
sound/usb/mixer_quirks.c=3257=static int snd_bbfpro_vol_resume(struct usb_mixer_elem_list *list)
--
sound/usb/mixer_quirks.c-3266-// Predfine elements
sound/usb/mixer_quirks.c:3267:static const struct snd_kcontrol_new snd_bbfpro_ctl_control = {
sound/usb/mixer_quirks.c-3268- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-3275-
sound/usb/mixer_quirks.c:3276:static const struct snd_kcontrol_new snd_bbfpro_gain_control = {
sound/usb/mixer_quirks.c-3277- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c-3284-
sound/usb/mixer_quirks.c:3285:static const struct snd_kcontrol_new snd_bbfpro_vol_control = {
sound/usb/mixer_quirks.c-3286- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_quirks.c=3653=static int snd_rme_digiface_rate_info(struct snd_kcontrol *kcontrol,
--
sound/usb/mixer_quirks.c-3663-
sound/usb/mixer_quirks.c:3664:static const struct snd_kcontrol_new snd_rme_digiface_controls[] = {
sound/usb/mixer_quirks.c-3665- {
--
sound/usb/mixer_quirks.c=4361=static int snd_djm_controls_create(struct usb_mixer_interface *mixer,
--
sound/usb/mixer_quirks.c-4368-
sound/usb/mixer_quirks.c:4369: struct snd_kcontrol_new knew = {
sound/usb/mixer_quirks.c-4370- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c=558=snd_s1810c_line_sw_info(struct snd_kcontrol *kctl,
--
sound/usb/mixer_s1810c.c-568-
sound/usb/mixer_s1810c.c:569:static const struct snd_kcontrol_new snd_s1810c_line_sw = {
sound/usb/mixer_s1810c.c-570- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-577-
sound/usb/mixer_s1810c.c:578:static const struct snd_kcontrol_new snd_s1810c_mute_sw = {
sound/usb/mixer_s1810c.c-579- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-586-
sound/usb/mixer_s1810c.c:587:static const struct snd_kcontrol_new snd_s1824c_mono_sw = {
sound/usb/mixer_s1810c.c-588- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c-595-
sound/usb/mixer_s1810c.c:596:static const struct snd_kcontrol_new snd_s1810c_48v_sw = {
sound/usb/mixer_s1810c.c-597- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_s1810c.c=606=snd_s1810c_ab_sw_info(struct snd_kcontrol *kctl,
--
sound/usb/mixer_s1810c.c-616-
sound/usb/mixer_s1810c.c:617:static const struct snd_kcontrol_new snd_s1810c_ab_sw = {
sound/usb/mixer_s1810c.c-618- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=700=static int scarlett_ctl_meter_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett.c-721-
sound/usb/mixer_scarlett.c:722:static const struct snd_kcontrol_new usb_scarlett_ctl_switch = {
sound/usb/mixer_scarlett.c-723- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=730=static const DECLARE_TLV_DB_SCALE(db_scale_scarlett_gain, -12800, 100, 0);
sound/usb/mixer_scarlett.c-731-
sound/usb/mixer_scarlett.c:732:static const struct snd_kcontrol_new usb_scarlett_ctl = {
sound/usb/mixer_scarlett.c-733- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-743-
sound/usb/mixer_scarlett.c:744:static const struct snd_kcontrol_new usb_scarlett_ctl_master = {
sound/usb/mixer_scarlett.c-745- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-755-
sound/usb/mixer_scarlett.c:756:static const struct snd_kcontrol_new usb_scarlett_ctl_enum = {
sound/usb/mixer_scarlett.c-757- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-763-
sound/usb/mixer_scarlett.c:764:static const struct snd_kcontrol_new usb_scarlett_ctl_dynamic_enum = {
sound/usb/mixer_scarlett.c-765- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-771-
sound/usb/mixer_scarlett.c:772:static const struct snd_kcontrol_new usb_scarlett_ctl_sync = {
sound/usb/mixer_scarlett.c-773- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-780-/* Forte-specific control structures - use bRequest=0x03 instead of 0x01 */
sound/usb/mixer_scarlett.c:781:static const struct snd_kcontrol_new usb_forte_ctl_enum = {
sound/usb/mixer_scarlett.c-782- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c-788-
sound/usb/mixer_scarlett.c:789:static const struct snd_kcontrol_new usb_forte_ctl_switch = {
sound/usb/mixer_scarlett.c-790- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett.c=798=static const DECLARE_TLV_DB_SCALE(db_scale_forte_input_gain, 0, 179, 0);
sound/usb/mixer_scarlett.c-799-
sound/usb/mixer_scarlett.c:800:static const struct snd_kcontrol_new usb_forte_ctl_input_gain = {
sound/usb/mixer_scarlett.c-801- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=3478=static int scarlett2_firmware_version_ctl_info(
--
sound/usb/mixer_scarlett2.c-3487-
sound/usb/mixer_scarlett2.c:3488:static const struct snd_kcontrol_new scarlett2_firmware_version_ctl = {
sound/usb/mixer_scarlett2.c-3489- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=3518=static int scarlett2_min_firmware_version_ctl_info(
--
sound/usb/mixer_scarlett2.c-3527-
sound/usb/mixer_scarlett2.c:3528:static const struct snd_kcontrol_new scarlett2_min_firmware_version_ctl = {
sound/usb/mixer_scarlett2.c-3529- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=3565=static int scarlett2_sync_ctl_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-3586-
sound/usb/mixer_scarlett2.c:3587:static const struct snd_kcontrol_new scarlett2_sync_ctl = {
sound/usb/mixer_scarlett2.c-3588- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=3925=static int scarlett2_autogain_status_ctl_info(
--
sound/usb/mixer_scarlett2.c-3936-
sound/usb/mixer_scarlett2.c:3937:static const struct snd_kcontrol_new scarlett2_autogain_switch_ctl = {
sound/usb/mixer_scarlett2.c-3938- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-3944-
sound/usb/mixer_scarlett2.c:3945:static const struct snd_kcontrol_new scarlett2_autogain_status_ctl = {
sound/usb/mixer_scarlett2.c-3946- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4038=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-4041-
sound/usb/mixer_scarlett2.c:4042:static const struct snd_kcontrol_new scarlett2_ag_target_ctl = {
sound/usb/mixer_scarlett2.c-4043- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=4145=static int scarlett2_input_select_ctl_info(
--
sound/usb/mixer_scarlett2.c-4186-
sound/usb/mixer_scarlett2.c:4187:static const struct snd_kcontrol_new scarlett2_input_select_ctl = {
sound/usb/mixer_scarlett2.c-4188- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4243=static int scarlett2_input_link_ctl_put(
--
sound/usb/mixer_scarlett2.c-4274-
sound/usb/mixer_scarlett2.c:4275:static const struct snd_kcontrol_new scarlett2_input_link_ctl = {
sound/usb/mixer_scarlett2.c-4276- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4349=static int scarlett2_input_gain_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4381-
sound/usb/mixer_scarlett2.c:4382:static const struct snd_kcontrol_new scarlett2_input_gain_ctl = {
sound/usb/mixer_scarlett2.c-4383- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4433=static int scarlett2_safe_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4465-
sound/usb/mixer_scarlett2.c:4466:static const struct snd_kcontrol_new scarlett2_safe_ctl = {
sound/usb/mixer_scarlett2.c-4467- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4540=static int scarlett2_pcm_input_switch_ctl_info(
--
sound/usb/mixer_scarlett2.c-4550-
sound/usb/mixer_scarlett2.c:4551:static const struct snd_kcontrol_new scarlett2_pcm_input_switch_ctl = {
sound/usb/mixer_scarlett2.c-4552- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4726=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-4729-
sound/usb/mixer_scarlett2.c:4730:static const struct snd_kcontrol_new scarlett2_master_volume_ctl = {
sound/usb/mixer_scarlett2.c-4731- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-4740-
sound/usb/mixer_scarlett2.c:4741:static const struct snd_kcontrol_new scarlett2_headphone_volume_ctl = {
sound/usb/mixer_scarlett2.c-4742- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c-4751-
sound/usb/mixer_scarlett2.c:4752:static const struct snd_kcontrol_new scarlett2_line_out_volume_ctl = {
sound/usb/mixer_scarlett2.c-4753- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4818=static int scarlett2_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4846-
sound/usb/mixer_scarlett2.c:4847:static const struct snd_kcontrol_new scarlett2_mute_ctl = {
sound/usb/mixer_scarlett2.c-4848- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=4955=static int scarlett2_sw_hw_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-4980-
sound/usb/mixer_scarlett2.c:4981:static const struct snd_kcontrol_new scarlett2_sw_hw_enum_ctl = {
sound/usb/mixer_scarlett2.c-4982- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5055=static int scarlett2_level_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5092-
sound/usb/mixer_scarlett2.c:5093:static const struct snd_kcontrol_new scarlett2_level_enum_ctl = {
sound/usb/mixer_scarlett2.c-5094- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5141=static int scarlett2_pad_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5169-
sound/usb/mixer_scarlett2.c:5170:static const struct snd_kcontrol_new scarlett2_pad_ctl = {
sound/usb/mixer_scarlett2.c-5171- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5250=static int scarlett2_air_with_drive_ctl_info(
--
sound/usb/mixer_scarlett2.c-5272-
sound/usb/mixer_scarlett2.c:5273:static const struct snd_kcontrol_new scarlett2_air_ctl[2] = {
sound/usb/mixer_scarlett2.c-5274- {
--
sound/usb/mixer_scarlett2.c=5329=static int scarlett2_dsp_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5361-
sound/usb/mixer_scarlett2.c:5362:static const struct snd_kcontrol_new scarlett2_dsp_ctl = {
sound/usb/mixer_scarlett2.c-5363- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=5464=static int scarlett2_compressor_ctl_info(
--
sound/usb/mixer_scarlett2.c-5477-
sound/usb/mixer_scarlett2.c:5478:static const struct snd_kcontrol_new scarlett2_compressor_ctl = {
sound/usb/mixer_scarlett2.c-5479- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5540=static int scarlett2_peq_flt_switch_ctl_put(
--
sound/usb/mixer_scarlett2.c-5568-
sound/usb/mixer_scarlett2.c:5569:static const struct snd_kcontrol_new scarlett2_precomp_flt_switch_ctl = {
sound/usb/mixer_scarlett2.c-5570- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c-5576-
sound/usb/mixer_scarlett2.c:5577:static const struct snd_kcontrol_new scarlett2_peq_flt_switch_ctl = {
sound/usb/mixer_scarlett2.c-5578- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5783=static int scarlett2_flt_ctl_info(
--
sound/usb/mixer_scarlett2.c-5793-
sound/usb/mixer_scarlett2.c:5794:static const struct snd_kcontrol_new scarlett2_precomp_flt_ctl = {
sound/usb/mixer_scarlett2.c-5795- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c-5801-
sound/usb/mixer_scarlett2.c:5802:static const struct snd_kcontrol_new scarlett2_peq_flt_ctl = {
sound/usb/mixer_scarlett2.c-5803- .iface = SNDRV_CTL_ELEM_IFACE_CARD,
--
sound/usb/mixer_scarlett2.c=5850=static int scarlett2_input_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-5883-
sound/usb/mixer_scarlett2.c:5884:static const struct snd_kcontrol_new scarlett2_input_mute_ctl = {
sound/usb/mixer_scarlett2.c-5885- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6006=static int scarlett2_phantom_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6045-
sound/usb/mixer_scarlett2.c:6046:static const struct snd_kcontrol_new scarlett2_phantom_ctl = {
sound/usb/mixer_scarlett2.c-6047- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6066=static int scarlett2_phantom_persistence_ctl_put(
--
sound/usb/mixer_scarlett2.c-6094-
sound/usb/mixer_scarlett2.c:6095:static const struct snd_kcontrol_new scarlett2_phantom_persistence_ctl = {
sound/usb/mixer_scarlett2.c-6096- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6256=static int scarlett2_speaker_switch_enum_ctl_put(
--
sound/usb/mixer_scarlett2.c-6299-
sound/usb/mixer_scarlett2.c:6300:static const struct snd_kcontrol_new scarlett2_speaker_switch_enum_ctl = {
sound/usb/mixer_scarlett2.c-6301- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6356=static int scarlett2_talkback_enum_ctl_put(
--
sound/usb/mixer_scarlett2.c-6391-
sound/usb/mixer_scarlett2.c:6392:static const struct snd_kcontrol_new scarlett2_talkback_enum_ctl = {
sound/usb/mixer_scarlett2.c-6393- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6413=static int scarlett2_talkback_map_ctl_put(
--
sound/usb/mixer_scarlett2.c-6445-
sound/usb/mixer_scarlett2.c:6446:static const struct snd_kcontrol_new scarlett2_talkback_map_ctl = {
sound/usb/mixer_scarlett2.c-6447- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6507=static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6546-
sound/usb/mixer_scarlett2.c:6547:static const struct snd_kcontrol_new scarlett2_dim_mute_ctl = {
sound/usb/mixer_scarlett2.c-6548- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=6569=static int scarlett2_sp_hp_mute_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-6601-
sound/usb/mixer_scarlett2.c:6602:static const struct snd_kcontrol_new scarlett2_sp_hp_mute_ctl = {
sound/usb/mixer_scarlett2.c-6603- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7068=static const DECLARE_TLV_DB_MINMAX(
--
sound/usb/mixer_scarlett2.c-7073-
sound/usb/mixer_scarlett2.c:7074:static const struct snd_kcontrol_new scarlett2_mixer_ctl = {
sound/usb/mixer_scarlett2.c-7075- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7197=static int scarlett2_direct_monitor_stereo_enum_ctl_info(
--
sound/usb/mixer_scarlett2.c-7209- */
sound/usb/mixer_scarlett2.c:7210:static const struct snd_kcontrol_new scarlett2_direct_monitor_ctl[2] = {
sound/usb/mixer_scarlett2.c-7211- {
--
sound/usb/mixer_scarlett2.c=7238=static int scarlett2_monitor_mix_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7266-
sound/usb/mixer_scarlett2.c:7267:static const struct snd_kcontrol_new scarlett2_monitor_mix_ctl = {
sound/usb/mixer_scarlett2.c-7268- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7406=static int scarlett2_mux_src_enum_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7432-
sound/usb/mixer_scarlett2.c:7433:static const struct snd_kcontrol_new scarlett2_mux_src_enum_ctl = {
sound/usb/mixer_scarlett2.c-7434- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7497=static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7532-
sound/usb/mixer_scarlett2.c:7533:static const struct snd_kcontrol_new scarlett2_meter_ctl = {
sound/usb/mixer_scarlett2.c-7534- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/usb/mixer_scarlett2.c=7566=static int scarlett2_msd_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7593-
sound/usb/mixer_scarlett2.c:7594:static const struct snd_kcontrol_new scarlett2_msd_ctl = {
sound/usb/mixer_scarlett2.c-7595- .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
--
sound/usb/mixer_scarlett2.c=7630=static int scarlett2_standalone_ctl_put(struct snd_kcontrol *kctl,
--
sound/usb/mixer_scarlett2.c-7658-
sound/usb/mixer_scarlett2.c:7659:static const struct snd_kcontrol_new scarlett2_standalone_ctl = {
]
|
| 32/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 54182
output: 45
thoughts: 29
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Examining the Scarlett 2i2 Mixer Firmware Version**
Right, let's dive straight into the code. I need to refresh my memory on the handling of the Scarlett 2i2 mixer. The first place I'm going to start is `sound/usb/mixer_scarlett2.c`. I recall that file containing the core driver logic for the Scarlett 2i2 interface, particularly the mixer functionality. Specifically, I want to zero in on the `scarlett2_firmware_version_ctl` component. This control likely handles retrieving and potentially setting (although, with firmwares, setting is less common) the firmware version information for the device. Understanding how that's handled is crucial for debugging firmware-related issues, ensuring compatibility, and maybe even enabling future features. I'll check its structure, how the data is fetched, and any error handling surrounding the retrieval process. I'm especially interested in whether there are any potential race conditions or synchronization issues in accessing this critical piece of device information.
|
| 33/2 |
2026/07/18 00:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_firmware_version_ctl]
Results: map[SourceCode:3488: static const struct snd_kcontrol_new scarlett2_firmware_version_ctl = {
3489: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
3490: .access = SNDRV_CTL_ELEM_ACCESS_READ,
3491: .name = "",
3492: .info = scarlett2_firmware_version_ctl_info,
3493: .get = scarlett2_firmware_version_ctl_get
3494: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 34/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 54660
output: 34
thoughts: 17
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Investigating a Sound Control Creation Scenario**
Right, let's drill down on this. My immediate thought is, what happens if we call `snd_kcontrol_new` but *omit* the `.get` function pointer? This is the core of the matter, the crux of the design decision. I'm assuming that the lack of the `.get` function pointer means the control won't provide the current value, and will therefore be write-only. This raises immediate questions: What does the driver expect to happen? What are the implications in terms of the ALSA API behavior? Are there corner cases that are exposed? How does the ALSA core react to the driver omitting `.get`? Specifically, does the absence of the `.get` result in expected behaviors? Are there other function pointers that will need to be configured? I'll probably need to consult the ALSA documentation and source code to see how `snd_kcontrol_new` and the related ALSA core functionalities handle the cases where specific function pointers are omitted. The ramifications could be subtle, and I need to consider thoroughly.
|
| 35/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Args: map[Expression:struct snd_kcontrol_new .* = \{ PathPrefix:sound/core/]
Results: map[Output:sound/core/ctljack.c=16=static int jack_detect_kctl_get(struct snd_kcontrol *kcontrol,
--
sound/core/ctljack.c-22-
sound/core/ctljack.c:23:static const struct snd_kcontrol_new jack_detect_kctl = {
sound/core/ctljack.c-24- /* name is filled later */
--
sound/core/pcm_lib.c=2586=int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
--
sound/core/pcm_lib.c-2592- struct snd_pcm_chmap *info;
sound/core/pcm_lib.c:2593: struct snd_kcontrol_new knew = {
sound/core/pcm_lib.c-2594- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
]
|
| 36/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 55203
output: 39
thoughts: 12
Thoughts: Okay, here's my summarized thought process, assuming I'm an expert in the field:
**Assessing the `jack_detect_kctl` Module**
Alright, time to focus. First, I need to take a look at `jack_detect_kctl`. That particular module is on my radar, so it's a good place to start. Let's see what's being done there. I'm sure it's doing something relevant to the project I'm working on and it's important to keep an eye on, so this is where I'll begin.
|
| 37/2 |
2026/07/18 00:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/ctljack.c Name:jack_detect_kctl]
Results: map[SourceCode: 23: static const struct snd_kcontrol_new jack_detect_kctl = {
24: /* name is filled later */
25: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
26: .access = SNDRV_CTL_ELEM_ACCESS_READ,
27: .info = jack_detect_kctl_info,
28: .get = jack_detect_kctl_get,
29: };
SourceFile:sound/core/ctljack.c]
|
| 38/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 55535
output: 44
thoughts: 17
Thoughts: Okay, let's dive into this. Here's my thought process on this:
**Analyzing `snd_pcm_add_chmap_ctls`**
Alright, time to get to it. First things first, let's take a look at `snd_pcm_add_chmap_ctls`. I'm going to start by confirming its purpose and what it's trying to achieve. I expect this to be a core function within the ALSA sound system, likely dealing with how channel maps are handled. I'm guessing it relates to the setup or modification of control elements that influence the channel mapping. My focus is going to be on understanding how it integrates into the overall architecture, what data structures it manipulates, and its potential impact on performance and flexibility. From what I know about this code base, this function is probably central to dealing with multichannel audio and complex routing, so I'll need a full understanding. Let's see how well my understanding holds up!
|
| 39/2 |
2026/07/18 00:44 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/pcm_lib.c Name:snd_pcm_add_chmap_ctls]
Results: map[SourceCode:2574: /**
2575: * snd_pcm_add_chmap_ctls - create channel-mapping control elements
2576: * @pcm: the assigned PCM instance
2577: * @stream: stream direction
2578: * @chmap: channel map elements (for query)
2579: * @max_channels: the max number of channels for the stream
2580: * @private_value: the value passed to each kcontrol's private_value field
2581: * @info_ret: store struct snd_pcm_chmap instance if non-NULL
2582: *
2583: * Create channel-mapping control elements assigned to the given PCM stream(s).
2584: * Return: Zero if successful, or a negative error value.
2585: */
2586: int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
2587: const struct snd_pcm_chmap_elem *chmap,
2588: int max_channels,
2589: unsigned long private_value,
2590: struct snd_pcm_chmap **info_ret)
2591: {
2592: struct snd_pcm_chmap *info;
2593: struct snd_kcontrol_new knew = {
2594: .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2595: .access = SNDRV_CTL_ELEM_ACCESS_READ |
2596: SNDRV_CTL_ELEM_ACCESS_VOLATILE |
2597: SNDRV_CTL_ELEM_ACCESS_TLV_READ |
2598: SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
2599: .info = pcm_chmap_ctl_info,
2600: .get = pcm_chmap_ctl_get,
2601: .tlv.c = pcm_chmap_ctl_tlv,
2602: };
2603: int err;
2604:
2605: if (WARN_ON(pcm->streams[stream].chmap_kctl))
2606: return -EBUSY;
2607: info = kzalloc_obj(*info);
2608: if (!info)
2609: return -ENOMEM;
2610: info->pcm = pcm;
2611: info->stream = stream;
2612: info->chmap = chmap;
2613: info->max_channels = max_channels;
2614: if (stream == SNDRV_PCM_STREAM_PLAYBACK)
2615: knew.name = "Playback Channel Map";
2616: else
2617: knew.name = "Capture Channel Map";
2618: knew.device = pcm->device;
2619: knew.count = pcm->streams[stream].substream_count;
2620: knew.private_value = private_value;
2621: info->kctl = snd_ctl_new1(&knew, info);
2622: if (!info->kctl) {
2623: kfree(info);
2624: return -ENOMEM;
2625: }
2626: info->kctl->private_free = pcm_chmap_ctl_private_free;
2627: err = snd_ctl_add(pcm->card, info->kctl);
2628: if (err < 0)
2629: return err;
2630: pcm->streams[stream].chmap_kctl = info->kctl;
2631: if (info_ret)
2632: *info_ret = info;
2633: return 0;
2634: }
SourceFile:sound/core/pcm_lib.c]
|
| 40/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 56867
output: 34
thoughts: 28
Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person:
**Investigating Potential Missing Getters in snd_kcontrol_new Usage**
Right, let's dive into this. I'm thinking, "Okay, we need to hunt down every instance of `snd_kcontrol_new` within the `sound/` directory. The goal is to see which of them are being created without an associated `.get` function." That's the core of the investigation. We're looking for control elements created that lack a defined method for retrieving their current state. That, of course, usually indicates a potential oversight or problem β perhaps a missing implementation, an incomplete control design, or maybe a control that is purely "set" without a corresponding "get" operation (though even that needs careful consideration). I suspect there's a reason for us wanting to investigate this: performance concerns, debugging or some other refactoring objective.
|
| 41/2 |
2026/07/18 00:44 |
tool |
grepper |
0m
Args: map[Expression:struct snd_kcontrol_new .* = \{ PathPrefix:sound/soc/]
Results: map[Output:
Full output is too long, showing 500 out of 9919 lines.
Use more precise expression if possible.
sound/soc/amd/acp-da7219-max98357a.c=663=static const struct snd_soc_dapm_route cz_rt5682_audio_route[] = {
--
sound/soc/amd/acp-da7219-max98357a.c-670-
sound/soc/amd/acp-da7219-max98357a.c:671:static const struct snd_kcontrol_new cz_mc_controls[] = {
sound/soc/amd/acp-da7219-max98357a.c-672- SOC_DAPM_PIN_SWITCH("Headphones"),
--
sound/soc/amd/acp-es8336.c=169=static const struct snd_soc_dapm_route st_audio_route[] = {
--
sound/soc/amd/acp-es8336.c-178-
sound/soc/amd/acp-es8336.c:179:static const struct snd_kcontrol_new st_mc_controls[] = {
sound/soc/amd/acp-es8336.c-180- SOC_DAPM_PIN_SWITCH("Speaker"),
--
sound/soc/amd/acp-rt5645.c=128=static const struct snd_soc_dapm_route cz_audio_route[] = {
--
sound/soc/amd/acp-rt5645.c-138-
sound/soc/amd/acp-rt5645.c:139:static const struct snd_kcontrol_new cz_mc_controls[] = {
sound/soc/amd/acp-rt5645.c-140- SOC_DAPM_PIN_SWITCH("Headphones"),
--
sound/soc/amd/acp/acp-mach-common.c=95=static struct snd_soc_jack_pin rt5682_jack_pins[] = {
--
sound/soc/amd/acp/acp-mach-common.c-105-
sound/soc/amd/acp/acp-mach-common.c:106:static const struct snd_kcontrol_new rt5682_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-107- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp/acp-mach-common.c=343=static struct snd_soc_jack_pin rt5682s_jack_pins[] = {
--
sound/soc/amd/acp/acp-mach-common.c-353-
sound/soc/amd/acp/acp-mach-common.c:354:static const struct snd_kcontrol_new rt5682s_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-355- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp/acp-mach-common.c=570=SND_SOC_DAILINK_DEF(rt1019,
--
sound/soc/amd/acp/acp-mach-common.c-573-
sound/soc/amd/acp/acp-mach-common.c:574:static const struct snd_kcontrol_new rt1019_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-575- SOC_DAPM_PIN_SWITCH("Left Spk"),
--
sound/soc/amd/acp/acp-mach-common.c=751=SND_SOC_DAILINK_DEF(max98360a,
--
sound/soc/amd/acp/acp-mach-common.c-753-
sound/soc/amd/acp/acp-mach-common.c:754:static const struct snd_kcontrol_new max98360a_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-755- SOC_DAPM_PIN_SWITCH("Spk"),
--
sound/soc/amd/acp/acp-mach-common.c=851=SND_SOC_DAILINK_DEF(max98388,
--
sound/soc/amd/acp/acp-mach-common.c-854-
sound/soc/amd/acp/acp-mach-common.c:855:static const struct snd_kcontrol_new max98388_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-856- SOC_DAPM_PIN_SWITCH("Left Spk"),
--
sound/soc/amd/acp/acp-mach-common.c=962=static struct snd_soc_jack_pin nau8825_jack_pins[] = {
--
sound/soc/amd/acp/acp-mach-common.c-972-
sound/soc/amd/acp/acp-mach-common.c:973:static const struct snd_kcontrol_new nau8825_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-974- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp/acp-mach-common.c=1159=static struct snd_soc_jack_pin nau8821_jack_pins[] = {
--
sound/soc/amd/acp/acp-mach-common.c-1169-
sound/soc/amd/acp/acp-mach-common.c:1170:static const struct snd_kcontrol_new nau8821_controls[] = {
sound/soc/amd/acp/acp-mach-common.c-1171- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c=124=static const struct snd_soc_dapm_route acp3x_es83xx_audio_map[] = {
--
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c-138-
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c:139:static const struct snd_kcontrol_new acp3x_es83xx_controls[] = {
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c-140- SOC_DAPM_PIN_SWITCH("Speaker"),
--
sound/soc/amd/acp3x-rt5682-max9836.c=370=static const struct snd_soc_dapm_route acp3x_5682_audio_route[] = {
--
sound/soc/amd/acp3x-rt5682-max9836.c-378-
sound/soc/amd/acp3x-rt5682-max9836.c:379:static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = {
sound/soc/amd/acp3x-rt5682-max9836.c-380- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp3x-rt5682-max9836.c=407=static const struct snd_soc_dapm_route acp3x_1015_route[] = {
--
sound/soc/amd/acp3x-rt5682-max9836.c-416-
sound/soc/amd/acp3x-rt5682-max9836.c:417:static const struct snd_kcontrol_new acp3x_mc_1015_controls[] = {
sound/soc/amd/acp3x-rt5682-max9836.c-418- SOC_DAPM_PIN_SWITCH("Headphone Jack"),
--
sound/soc/amd/acp3x-rt5682-max9836.c=447=static const struct snd_soc_dapm_route acp3x_1015p_route[] = {
--
sound/soc/amd/acp3x-rt5682-max9836.c-456-
sound/soc/amd/acp3x-rt5682-max9836.c:457:static const struct snd_kcontrol_new acp3x_mc_1015p_controls[] = {
sound/soc/amd/acp3x-rt5682-max9836.c-458- SOC_DAPM_PIN_SWITCH("Speakers"),
--
sound/soc/amd/vangogh/acp5x-mach.c=44=static struct snd_soc_jack_pin acp5x_nau8821_jack_pins[] = {
--
sound/soc/amd/vangogh/acp5x-mach.c-54-
sound/soc/amd/vangogh/acp5x-mach.c:55:static const struct snd_kcontrol_new acp5x_8821_controls[] = {
sound/soc/amd/vangogh/acp5x-mach.c-56- SOC_DAPM_PIN_SWITCH("Headphone"),
--
sound/soc/atmel/atmel-classd.c=209=static const DECLARE_TLV_DB_SCALE(classd_digital_tlv, -7800, 100, 1);
sound/soc/atmel/atmel-classd.c-210-
sound/soc/atmel/atmel-classd.c:211:static const struct snd_kcontrol_new atmel_classd_snd_controls[] = {
sound/soc/atmel/atmel-classd.c-212-SOC_DOUBLE_TLV("Playback Volume", CLASSD_INTPMR,
--
sound/soc/atmel/atmel-pdmic.c=302=static int pdmic_put_mic_volsw(struct snd_kcontrol *kcontrol,
--
sound/soc/atmel/atmel-pdmic.c-329-
sound/soc/atmel/atmel-pdmic.c:330:static const struct snd_kcontrol_new atmel_pdmic_snd_controls[] = {
sound/soc/atmel/atmel-pdmic.c-331-SOC_SINGLE_EXT_TLV("Mic Capture Volume", PDMIC_DSPR1, PDMIC_DSPR1_DGAIN_SHIFT,
--
sound/soc/atmel/mchp-pdmc.c=339=static int mchp_pdmc_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
--
sound/soc/atmel/mchp-pdmc.c-380-
sound/soc/atmel/mchp-pdmc.c:381:static const struct snd_kcontrol_new mchp_pdmc_snd_controls[] = {
sound/soc/atmel/mchp-pdmc.c-382- SOC_SINGLE_BOOL_EXT("Audio Filter", 0, &mchp_pdmc_af_get, &mchp_pdmc_af_put),
--
sound/soc/atmel/mchp-pdmc.c=692=static int mchp_pdmc_add_chmap_ctls(struct snd_pcm *pcm, struct mchp_pdmc *dd)
--
sound/soc/atmel/mchp-pdmc.c-694- struct mchp_pdmc_chmap *info;
sound/soc/atmel/mchp-pdmc.c:695: struct snd_kcontrol_new knew = {
sound/soc/atmel/mchp-pdmc.c-696- .iface = SNDRV_CTL_ELEM_IFACE_PCM,
--
sound/soc/atmel/mchp-spdifrx.c=842=static int mchp_spdifrx_rate_get(struct snd_kcontrol *kcontrol,
--
sound/soc/atmel/mchp-spdifrx.c-885-
sound/soc/atmel/mchp-spdifrx.c:886:static struct snd_kcontrol_new mchp_spdifrx_ctrls[] = {
sound/soc/atmel/mchp-spdifrx.c-887- /* Channel status controller */
--
sound/soc/atmel/mchp-spdiftx.c=621=static int mchp_spdiftx_subcode_put(struct snd_kcontrol *kcontrol,
--
sound/soc/atmel/mchp-spdiftx.c-654-
sound/soc/atmel/mchp-spdiftx.c:655:static struct snd_kcontrol_new mchp_spdiftx_ctrls[] = {
sound/soc/atmel/mchp-spdiftx.c-656- /* Channel status controller */
--
sound/soc/atmel/tse850-pcm5142.c=227=static const struct snd_kcontrol_new mux2 =
--
sound/soc/atmel/tse850-pcm5142.c-229-
sound/soc/atmel/tse850-pcm5142.c:230:static const struct snd_kcontrol_new mix[] = {
sound/soc/atmel/tse850-pcm5142.c-231- SOC_SINGLE_EXT("IN Switch", SND_SOC_NOPM, 0, 1, 0,
--
sound/soc/codecs/88pm860x-codec.c=474=static SOC_ENUM_SINGLE_DECL(pm860x_spk_ear_opamp_enum,
--
sound/soc/codecs/88pm860x-codec.c-476-
sound/soc/codecs/88pm860x-codec.c:477:static const struct snd_kcontrol_new pm860x_snd_controls[] = {
sound/soc/codecs/88pm860x-codec.c-478- SOC_DOUBLE_R_TLV("ADC Capture Volume", PM860X_ADC_ANA_2,
--
sound/soc/codecs/ab8500-codec.c=161=static SOC_ENUM_DOUBLE_DECL(dapm_enum_lineout_source, AB8500_ANACONF5,
--
sound/soc/codecs/ab8500-codec.c-163- AB8500_ANACONF5_HSRDACTOLOR, enum_lineout_source);
sound/soc/codecs/ab8500-codec.c:164:static const struct snd_kcontrol_new dapm_lineout_source[] = {
sound/soc/codecs/ab8500-codec.c-165- SOC_DAPM_ENUM("LineOut Source", dapm_enum_lineout_source),
--
sound/soc/codecs/ab8500-codec.c=172=static SOC_ENUM_SINGLE_DECL(dapm_enum_HFl_sel, AB8500_DIGMULTCONF2,
sound/soc/codecs/ab8500-codec.c-173- AB8500_DIGMULTCONF2_HFLSEL, enum_HFx_sel);
sound/soc/codecs/ab8500-codec.c:174:static const struct snd_kcontrol_new dapm_HFl_select[] = {
sound/soc/codecs/ab8500-codec.c-175- SOC_DAPM_ENUM("Speaker Left Source", dapm_enum_HFl_sel),
--
sound/soc/codecs/ab8500-codec.c=179=static SOC_ENUM_SINGLE_DECL(dapm_enum_HFr_sel, AB8500_DIGMULTCONF2,
sound/soc/codecs/ab8500-codec.c-180- AB8500_DIGMULTCONF2_HFRSEL, enum_HFx_sel);
sound/soc/codecs/ab8500-codec.c:181:static const struct snd_kcontrol_new dapm_HFr_select[] = {
sound/soc/codecs/ab8500-codec.c-182- SOC_DAPM_ENUM("Speaker Right Source", dapm_enum_HFr_sel),
--
sound/soc/codecs/ab8500-codec.c=189=static SOC_ENUM_SINGLE_DECL(dapm_enum_mic1ab_sel, AB8500_ANACONF3,
sound/soc/codecs/ab8500-codec.c-190- AB8500_ANACONF3_MIC1SEL, enum_mic1ab_sel);
sound/soc/codecs/ab8500-codec.c:191:static const struct snd_kcontrol_new dapm_mic1ab_mux[] = {
sound/soc/codecs/ab8500-codec.c-192- SOC_DAPM_ENUM("Mic 1a or 1b Select", dapm_enum_mic1ab_sel),
--
sound/soc/codecs/ab8500-codec.c=197=static SOC_ENUM_SINGLE_DECL(dapm_enum_ad3_sel, AB8500_DIGMULTCONF1,
sound/soc/codecs/ab8500-codec.c-198- AB8500_DIGMULTCONF1_AD3SEL, enum_ad3_sel);
sound/soc/codecs/ab8500-codec.c:199:static const struct snd_kcontrol_new dapm_ad3_select[] = {
sound/soc/codecs/ab8500-codec.c-200- SOC_DAPM_ENUM("AD3 Source Select", dapm_enum_ad3_sel),
--
sound/soc/codecs/ab8500-codec.c=205=static SOC_ENUM_SINGLE_DECL(dapm_enum_ad6_sel, AB8500_DIGMULTCONF1,
sound/soc/codecs/ab8500-codec.c-206- AB8500_DIGMULTCONF1_AD6SEL, enum_ad6_sel);
sound/soc/codecs/ab8500-codec.c:207:static const struct snd_kcontrol_new dapm_ad6_select[] = {
sound/soc/codecs/ab8500-codec.c-208- SOC_DAPM_ENUM("AD6 Source Select", dapm_enum_ad6_sel),
--
sound/soc/codecs/ab8500-codec.c=215=static SOC_ENUM_SINGLE_DECL(dapm_enum_ad5_sel, AB8500_DIGMULTCONF1,
sound/soc/codecs/ab8500-codec.c-216- AB8500_DIGMULTCONF1_AD5SEL, enum_ad5_sel);
sound/soc/codecs/ab8500-codec.c:217:static const struct snd_kcontrol_new dapm_ad5_select[] = {
sound/soc/codecs/ab8500-codec.c-218- SOC_DAPM_ENUM("AD5 Source Select", dapm_enum_ad5_sel),
--
sound/soc/codecs/ab8500-codec.c=225=static SOC_ENUM_SINGLE_DECL(dapm_enum_ad1_sel, AB8500_DIGMULTCONF1,
sound/soc/codecs/ab8500-codec.c-226- AB8500_DIGMULTCONF1_AD1SEL, enum_ad1_sel);
sound/soc/codecs/ab8500-codec.c:227:static const struct snd_kcontrol_new dapm_ad1_select[] = {
sound/soc/codecs/ab8500-codec.c-228- SOC_DAPM_ENUM("AD1 Source Select", dapm_enum_ad1_sel),
--
sound/soc/codecs/ab8500-codec.c=233=static SOC_ENUM_SINGLE_DECL(dapm_enum_mic2lr_sel, AB8500_ANACONF3,
sound/soc/codecs/ab8500-codec.c-234- AB8500_ANACONF3_LINRSEL, enum_mic2lr_sel);
sound/soc/codecs/ab8500-codec.c:235:static const struct snd_kcontrol_new dapm_mic2lr_select[] = {
sound/soc/codecs/ab8500-codec.c-236- SOC_DAPM_ENUM("Mic 2 or LINR Select", dapm_enum_mic2lr_sel),
--
sound/soc/codecs/ab8500-codec.c=241=static SOC_ENUM_SINGLE_DECL(dapm_enum_ad2_sel, AB8500_DIGMULTCONF1,
sound/soc/codecs/ab8500-codec.c-242- AB8500_DIGMULTCONF1_AD2SEL, enum_ad2_sel);
sound/soc/codecs/ab8500-codec.c:243:static const struct snd_kcontrol_new dapm_ad2_select[] = {
sound/soc/codecs/ab8500-codec.c-244- SOC_DAPM_ENUM("AD2 Source Select", dapm_enum_ad2_sel),
--
sound/soc/codecs/ab8500-codec.c=252=static SOC_ENUM_SINGLE_DECL(dapm_enum_anc_in_sel, AB8500_DMICFILTCONF,
sound/soc/codecs/ab8500-codec.c-253- AB8500_DMICFILTCONF_ANCINSEL, enum_anc_in_sel);
sound/soc/codecs/ab8500-codec.c:254:static const struct snd_kcontrol_new dapm_anc_in_select[] = {
sound/soc/codecs/ab8500-codec.c-255- SOC_DAPM_ENUM("ANC Source", dapm_enum_anc_in_sel),
--
sound/soc/codecs/ab8500-codec.c-258-/* ANC - Enable/Disable */
sound/soc/codecs/ab8500-codec.c:259:static const struct snd_kcontrol_new dapm_anc_enable[] = {
sound/soc/codecs/ab8500-codec.c-260- SOC_DAPM_SINGLE("Switch", AB8500_ANCCONF1,
--
sound/soc/codecs/ab8500-codec.c-264-/* ANC to Earpiece - Mute */
sound/soc/codecs/ab8500-codec.c:265:static const struct snd_kcontrol_new dapm_anc_ear_mute[] = {
sound/soc/codecs/ab8500-codec.c-266- SOC_DAPM_SINGLE("Switch", AB8500_DIGMULTCONF1,
--
sound/soc/codecs/ab8500-codec.c=278=static SOC_ENUM_SINGLE_DECL(dapm_enum_stfir1_in_sel, AB8500_DIGMULTCONF2,
sound/soc/codecs/ab8500-codec.c-279- AB8500_DIGMULTCONF2_FIRSID1SEL, enum_stfir1_in_sel);
sound/soc/codecs/ab8500-codec.c:280:static const struct snd_kcontrol_new dapm_stfir1_in_select[] = {
sound/soc/codecs/ab8500-codec.c-281- SOC_DAPM_ENUM("Sidetone Left Source", dapm_enum_stfir1_in_sel),
--
sound/soc/codecs/ab8500-codec.c=290=static SOC_ENUM_SINGLE_DECL(dapm_enum_stfir2_in_sel, AB8500_DIGMULTCONF2,
sound/soc/codecs/ab8500-codec.c-291- AB8500_DIGMULTCONF2_FIRSID2SEL, enum_stfir2_in_sel);
sound/soc/codecs/ab8500-codec.c:292:static const struct snd_kcontrol_new dapm_stfir2_in_select[] = {
sound/soc/codecs/ab8500-codec.c-293- SOC_DAPM_ENUM("Sidetone Right Source", dapm_enum_stfir2_in_sel),
--
sound/soc/codecs/ab8500-codec.c=300=static SOC_ENUM_SINGLE_DECL(dapm_enum_pwm2vib1, AB8500_PWMGENCONF1,
--
sound/soc/codecs/ab8500-codec.c-302-
sound/soc/codecs/ab8500-codec.c:303:static const struct snd_kcontrol_new dapm_pwm2vib1[] = {
sound/soc/codecs/ab8500-codec.c-304- SOC_DAPM_ENUM("Vibra 1 Controller", dapm_enum_pwm2vib1),
--
sound/soc/codecs/ab8500-codec.c=307=static SOC_ENUM_SINGLE_DECL(dapm_enum_pwm2vib2, AB8500_PWMGENCONF1,
--
sound/soc/codecs/ab8500-codec.c-309-
sound/soc/codecs/ab8500-codec.c:310:static const struct snd_kcontrol_new dapm_pwm2vib2[] = {
sound/soc/codecs/ab8500-codec.c-311- SOC_DAPM_ENUM("Vibra 2 Controller", dapm_enum_pwm2vib2),
--
sound/soc/codecs/ab8500-codec.c=1338=static SOC_ENUM_SINGLE_EXT_DECL(soc_enum_sidstate, enum_sid_state);
--
sound/soc/codecs/ab8500-codec.c-1341-
sound/soc/codecs/ab8500-codec.c:1342:static struct snd_kcontrol_new ab8500_ctrls[] = {
sound/soc/codecs/ab8500-codec.c-1343- /* Charge pump */
--
sound/soc/codecs/ad1836.c=42=static SOC_ENUM_SINGLE_DECL(ad1836_deemp_enum,
--
sound/soc/codecs/ad1836.c-56-
sound/soc/codecs/ad1836.c:57:static const struct snd_kcontrol_new ad183x_dac_controls[] = {
sound/soc/codecs/ad1836.c-58- AD1836_DAC_VOLUME(1),
--
sound/soc/codecs/ad1836.c=75=static const struct snd_soc_dapm_route ad183x_dac_routes[] = {
--
sound/soc/codecs/ad1836.c-81-
sound/soc/codecs/ad1836.c:82:static const struct snd_kcontrol_new ad183x_adc_controls[] = {
sound/soc/codecs/ad1836.c-83- AD1836_ADC_SWITCH(1),
--
sound/soc/codecs/ad1836.c=93=static const struct snd_soc_dapm_route ad183x_adc_routes[] = {
--
sound/soc/codecs/ad1836.c-97-
sound/soc/codecs/ad1836.c:98:static const struct snd_kcontrol_new ad183x_controls[] = {
sound/soc/codecs/ad1836.c-99- /* ADC high-pass filter */
--
sound/soc/codecs/ad1836.c=120=static const DECLARE_TLV_DB_SCALE(ad1836_in_tlv, 0, 300, 0);
sound/soc/codecs/ad1836.c-121-
sound/soc/codecs/ad1836.c:122:static const struct snd_kcontrol_new ad1836_controls[] = {
sound/soc/codecs/ad1836.c-123- SOC_DOUBLE_TLV("ADC2 Capture Volume", AD1836_ADC_CTRL1, 3, 0, 4, 0,
--
sound/soc/codecs/ad193x.c=41=static struct snd_pcm_hw_constraint_list constr = {
--
sound/soc/codecs/ad193x.c-45-
sound/soc/codecs/ad193x.c:46:static const struct snd_kcontrol_new ad193x_snd_controls[] = {
sound/soc/codecs/ad193x.c-47- /* DAC volume control */
--
sound/soc/codecs/ad193x.c-70-
sound/soc/codecs/ad193x.c:71:static const struct snd_kcontrol_new ad193x_adc_snd_controls[] = {
sound/soc/codecs/ad193x.c-72- /* ADC switch control */
--
sound/soc/codecs/ad1980.c=108=static SOC_ENUM_DOUBLE_DECL(ad1980_cap_src,
--
sound/soc/codecs/ad1980.c-110-
sound/soc/codecs/ad1980.c:111:static const struct snd_kcontrol_new ad1980_snd_ac97_controls[] = {
sound/soc/codecs/ad1980.c-112-SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1),
--
sound/soc/codecs/adau1372.c=173=static SOC_ENUM_SINGLE_DECL(adau1372_hpf2_3_enum, ADAU1372_REG_ADC_CTRL3, 5,
sound/soc/codecs/adau1372.c-174- adau1372_hpf_text);
sound/soc/codecs/adau1372.c:175:static const struct snd_kcontrol_new adau1372_controls[] = {
sound/soc/codecs/adau1372.c-176- SOC_SINGLE_TLV("ADC 0 Capture Volume", ADAU1372_REG_ADC_VOL(0),
--
sound/soc/codecs/adau1373.c=450=static SOC_ENUM_SINGLE_DECL(adau1373_speaker_lr_mux_enum,
--
sound/soc/codecs/adau1373.c-452-
sound/soc/codecs/adau1373.c:453:static const struct snd_kcontrol_new adau1373_controls[] = {
sound/soc/codecs/adau1373.c-454- SOC_DOUBLE_R_TLV("AIF1 Capture Volume", ADAU1373_DAI_RECL_VOL(0),
--
sound/soc/codecs/adau1373.c-554-
sound/soc/codecs/adau1373.c:555:static const struct snd_kcontrol_new adau1373_lineout2_controls[] = {
sound/soc/codecs/adau1373.c-556- SOC_DOUBLE_R_TLV("Lineout2 Playback Volume", ADAU1373_LLINE_OUT(1),
--
sound/soc/codecs/adau1373.c-560-
sound/soc/codecs/adau1373.c:561:static const struct snd_kcontrol_new adau1373_drc_controls[] = {
sound/soc/codecs/adau1373.c-562- SOC_ENUM("DRC1 Channel", adau1373_drc1_channel_enum),
--
sound/soc/codecs/adau1373.c=597=static const struct snd_kcontrol_new adau1373_decimator_mux =
--
sound/soc/codecs/adau1373.c-599-
sound/soc/codecs/adau1373.c:600:static const struct snd_kcontrol_new adau1373_left_adc_mixer_controls[] = {
sound/soc/codecs/adau1373.c-601- SOC_DAPM_SINGLE("DAC1 Switch", ADAU1373_LADC_MIXER, 4, 1, 0),
--
sound/soc/codecs/adau1373.c-607-
sound/soc/codecs/adau1373.c:608:static const struct snd_kcontrol_new adau1373_right_adc_mixer_controls[] = {
sound/soc/codecs/adau1373.c-609- SOC_DAPM_SINGLE("DAC1 Switch", ADAU1373_RADC_MIXER, 4, 1, 0),
--
sound/soc/codecs/adau1373.c-616-#define DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(_name, _reg) \
sound/soc/codecs/adau1373.c:617:const struct snd_kcontrol_new _name[] = { \
sound/soc/codecs/adau1373.c-618- SOC_DAPM_SINGLE("Left DAC2 Switch", _reg, 7, 1, 0), \
--
sound/soc/codecs/adau1373.c=640=static DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(adau1373_ep_mixer_controls,
--
sound/soc/codecs/adau1373.c-642-
sound/soc/codecs/adau1373.c:643:static const struct snd_kcontrol_new adau1373_left_hp_mixer_controls[] = {
sound/soc/codecs/adau1373.c-644- SOC_DAPM_SINGLE("Left DAC1 Switch", ADAU1373_LHP_MIX, 5, 1, 0),
--
sound/soc/codecs/adau1373.c-651-
sound/soc/codecs/adau1373.c:652:static const struct snd_kcontrol_new adau1373_right_hp_mixer_controls[] = {
sound/soc/codecs/adau1373.c-653- SOC_DAPM_SINGLE("Right DAC1 Switch", ADAU1373_RHP_MIX, 5, 1, 0),
--
sound/soc/codecs/adau1373.c-661-#define DECLARE_ADAU1373_DSP_CHANNEL_MIXER_CTRLS(_name, _reg) \
sound/soc/codecs/adau1373.c:662:const struct snd_kcontrol_new _name[] = { \
sound/soc/codecs/adau1373.c-663- SOC_DAPM_SINGLE("DMIC2 Swapped Switch", _reg, 6, 1, 0), \
--
sound/soc/codecs/adau1373.c=680=static DECLARE_ADAU1373_DSP_CHANNEL_MIXER_CTRLS(adau1373_dsp_channel5_mixer_controls,
--
sound/soc/codecs/adau1373.c-683-#define DECLARE_ADAU1373_DSP_OUTPUT_MIXER_CTRLS(_name, _reg) \
sound/soc/codecs/adau1373.c:684:const struct snd_kcontrol_new _name[] = { \
sound/soc/codecs/adau1373.c-685- SOC_DAPM_SINGLE("DSP Channel5 Switch", _reg, 4, 1, 0), \
--
sound/soc/codecs/adau1701.c=107=struct adau1701 {
--
sound/soc/codecs/adau1701.c-120-
sound/soc/codecs/adau1701.c:121:static const struct snd_kcontrol_new adau1701_controls[] = {
sound/soc/codecs/adau1701.c-122- SOC_SINGLE("Master Capture Switch", ADAU1701_DSPCTRL, 4, 1, 0),
--
sound/soc/codecs/adau1761.c=256=static SOC_ENUM_SINGLE_DECL(adau1761_alc_ng_type_enum,
--
sound/soc/codecs/adau1761.c-258-
sound/soc/codecs/adau1761.c:259:static const struct snd_kcontrol_new adau1761_jack_detect_controls[] = {
sound/soc/codecs/adau1761.c-260- SOC_SINGLE("Speaker Auto-mute Switch", ADAU1761_DIGMIC_JACKDETECT,
--
sound/soc/codecs/adau1761.c-263-
sound/soc/codecs/adau1761.c:264:static const struct snd_kcontrol_new adau1761_differential_mode_controls[] = {
sound/soc/codecs/adau1761.c-265- SOC_DOUBLE_R_TLV("Capture Volume", ADAU1761_LEFT_DIFF_INPUT_VOL,
--
sound/soc/codecs/adau1761.c-290-
sound/soc/codecs/adau1761.c:291:static const struct snd_kcontrol_new adau1761_single_mode_controls[] = {
sound/soc/codecs/adau1761.c-292- SOC_SINGLE_TLV("Input 1 Capture Volume", ADAU1761_REC_MIXER_LEFT0,
--
sound/soc/codecs/adau1761.c-301-
sound/soc/codecs/adau1761.c:302:static const struct snd_kcontrol_new adau1761_controls[] = {
sound/soc/codecs/adau1761.c-303- SOC_DOUBLE_R_TLV("Aux Capture Volume", ADAU1761_REC_MIXER_LEFT1,
--
sound/soc/codecs/adau1761.c-321-
sound/soc/codecs/adau1761.c:322:static const struct snd_kcontrol_new adau1761_mono_controls[] = {
sound/soc/codecs/adau1761.c-323- SOC_SINGLE_TLV("Mono Playback Volume", ADAU1761_PLAY_MONO_OUTPUT_VOL,
--
sound/soc/codecs/adau1761.c-328-
sound/soc/codecs/adau1761.c:329:static const struct snd_kcontrol_new adau1761_left_mixer_controls[] = {
sound/soc/codecs/adau1761.c-330- SOC_DAPM_SINGLE_AUTODISABLE("Left DAC Switch",
--
sound/soc/codecs/adau1761.c-341-
sound/soc/codecs/adau1761.c:342:static const struct snd_kcontrol_new adau1761_right_mixer_controls[] = {
sound/soc/codecs/adau1761.c-343- SOC_DAPM_SINGLE_AUTODISABLE("Left DAC Switch",
--
sound/soc/codecs/adau1761.c-354-
sound/soc/codecs/adau1761.c:355:static const struct snd_kcontrol_new adau1761_left_lr_mixer_controls[] = {
sound/soc/codecs/adau1761.c-356- SOC_DAPM_SINGLE_TLV("Left Volume",
--
sound/soc/codecs/adau1761.c-361-
sound/soc/codecs/adau1761.c:362:static const struct snd_kcontrol_new adau1761_right_lr_mixer_controls[] = {
sound/soc/codecs/adau1761.c-363- SOC_DAPM_SINGLE_TLV("Left Volume",
--
sound/soc/codecs/adau1781.c=118=static SOC_ENUM_SINGLE_DECL(adau1781_capture_bias_enum,
--
sound/soc/codecs/adau1781.c-120-
sound/soc/codecs/adau1781.c:121:static const struct snd_kcontrol_new adau1781_controls[] = {
sound/soc/codecs/adau1781.c-122- SOC_SINGLE_TLV("Beep Capture Volume", ADAU1781_DMIC_BEEP_CTRL, 0, 7, 0,
--
sound/soc/codecs/adau1781.c-144-
sound/soc/codecs/adau1781.c:145:static const struct snd_kcontrol_new adau1781_beep_mixer_controls[] = {
sound/soc/codecs/adau1781.c-146- SOC_DAPM_SINGLE("Beep Capture Switch", ADAU1781_DMIC_BEEP_CTRL,
--
sound/soc/codecs/adau1781.c-149-
sound/soc/codecs/adau1781.c:150:static const struct snd_kcontrol_new adau1781_left_mixer_controls[] = {
sound/soc/codecs/adau1781.c-151- SOC_DAPM_SINGLE_AUTODISABLE("Switch",
--
sound/soc/codecs/adau1781.c-156-
sound/soc/codecs/adau1781.c:157:static const struct snd_kcontrol_new adau1781_right_mixer_controls[] = {
sound/soc/codecs/adau1781.c-158- SOC_DAPM_SINGLE_AUTODISABLE("Switch",
--
sound/soc/codecs/adau1781.c-163-
sound/soc/codecs/adau1781.c:164:static const struct snd_kcontrol_new adau1781_mono_mixer_controls[] = {
sound/soc/codecs/adau1781.c-165- SOC_DAPM_SINGLE_AUTODISABLE("Left Switch",
--
sound/soc/codecs/adau17x1.c=48=static const DECLARE_TLV_DB_MINMAX(adau17x1_digital_tlv, -9563, 0);
sound/soc/codecs/adau17x1.c-49-
sound/soc/codecs/adau17x1.c:50:static const struct snd_kcontrol_new adau17x1_controls[] = {
sound/soc/codecs/adau17x1.c-51- SOC_DOUBLE_R_TLV("Digital Capture Volume",
--
sound/soc/codecs/adau1977.c=181=static const struct snd_soc_dapm_route adau1977_dapm_routes[] = {
--
sound/soc/codecs/adau1977.c-207-
sound/soc/codecs/adau1977.c:208:static const struct snd_kcontrol_new adau1977_snd_controls[] = {
sound/soc/codecs/adau1977.c-209- ADAU1977_VOLUME(1),
--
sound/soc/codecs/adau7118.c=35=struct adau7118_data {
--
sound/soc/codecs/adau7118.c-46-/* Input Enable */
sound/soc/codecs/adau7118.c:47:static const struct snd_kcontrol_new adau7118_dapm_pdm_control[4] = {
sound/soc/codecs/adau7118.c-48- SOC_DAPM_SINGLE("Capture Switch", ADAU7118_REG_ENABLES, 0, 1, 0),
--
sound/soc/codecs/adav80x.c=340=static const DECLARE_TLV_DB_MINMAX(adav80x_digital_tlv, -9563, 0);
sound/soc/codecs/adav80x.c-341-
sound/soc/codecs/adav80x.c:342:static const struct snd_kcontrol_new adav80x_controls[] = {
sound/soc/codecs/adav80x.c-343- SOC_DOUBLE_R_TLV("Master Playback Volume", ADAV80X_DAC_L_VOL,
--
sound/soc/codecs/ak4118.c=116=static SOC_VALUE_ENUM_SINGLE_DECL(ak4118_iec958_fs_enum, AK4118_REG_RCV_STATUS1,
--
sound/soc/codecs/ak4118.c-119-
sound/soc/codecs/ak4118.c:120:static struct snd_kcontrol_new ak4118_iec958_controls[] = {
sound/soc/codecs/ak4118.c-121- SOC_SINGLE("IEC958 Parity Errors", AK4118_REG_RCV_STATUS0, 0, 1, 0),
--
sound/soc/codecs/ak4375.c=162=static const struct soc_enum ak4375_digfil_enum =
--
sound/soc/codecs/ak4375.c-165-
sound/soc/codecs/ak4375.c:166:static const struct snd_kcontrol_new ak4375_snd_controls[] = {
sound/soc/codecs/ak4375.c-167- SOC_DOUBLE_R_TLV("Digital Output Volume", AK4375_0B_LCH_OUTPUT_VOLUME,
--
sound/soc/codecs/ak4375.c-180-
sound/soc/codecs/ak4375.c:181:static const struct snd_kcontrol_new ak4375_hpl_mixer_controls[] = {
sound/soc/codecs/ak4375.c-182- SOC_DAPM_SINGLE("LDACL Switch", AK4375_07_DAC_MONO_MIXING, 0, 1, 0),
--
sound/soc/codecs/ak4375.c-185-
sound/soc/codecs/ak4375.c:186:static const struct snd_kcontrol_new ak4375_hpr_mixer_controls[] = {
sound/soc/codecs/ak4375.c-187- SOC_DAPM_SINGLE("LDACR Switch", AK4375_07_DAC_MONO_MIXING, 4, 1, 0),
--
sound/soc/codecs/ak4458.c=198=static int set_digfil(struct snd_kcontrol *kcontrol,
--
sound/soc/codecs/ak4458.c-228-
sound/soc/codecs/ak4458.c:229:static const struct snd_kcontrol_new ak4458_snd_controls[] = {
sound/soc/codecs/ak4458.c-230- SOC_DOUBLE_R_TLV("DAC1 Playback Volume", AK4458_03_LCHATT,
--
sound/soc/codecs/ak4458.c=268=static const struct snd_soc_dapm_route ak4458_intercon[] = {
--
sound/soc/codecs/ak4458.c-282-/* ak4497 controls */
sound/soc/codecs/ak4458.c:283:static const struct snd_kcontrol_new ak4497_snd_controls[] = {
sound/soc/codecs/ak4458.c-284- SOC_DOUBLE_R_TLV("DAC Playback Volume", AK4458_03_LCHATT,
--
sound/soc/codecs/ak4535.c=71=static const struct soc_enum ak4535_enum[] = {
--
sound/soc/codecs/ak4535.c-78-
sound/soc/codecs/ak4535.c:79:static const struct snd_kcontrol_new ak4535_snd_controls[] = {
sound/soc/codecs/ak4535.c-80- SOC_SINGLE("ALC2 Switch", AK4535_SIG1, 1, 1, 0),
--
sound/soc/codecs/ak4535.c-101-/* Mono 1 Mixer */
sound/soc/codecs/ak4535.c:102:static const struct snd_kcontrol_new ak4535_mono1_mixer_controls[] = {
sound/soc/codecs/ak4535.c-103- SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG1, 4, 1, 0),
--
sound/soc/codecs/ak4535.c-107-/* Stereo Mixer */
sound/soc/codecs/ak4535.c:108:static const struct snd_kcontrol_new ak4535_stereo_mixer_controls[] = {
sound/soc/codecs/ak4535.c-109- SOC_DAPM_SINGLE("Mic Sidetone Switch", AK4535_SIG2, 4, 1, 0),
--
sound/soc/codecs/ak4535.c-114-/* Input Mixer */
sound/soc/codecs/ak4535.c:115:static const struct snd_kcontrol_new ak4535_input_mixer_controls[] = {
sound/soc/codecs/ak4535.c-116- SOC_DAPM_SINGLE("Mic Capture Switch", AK4535_MIC, 2, 1, 0),
--
sound/soc/codecs/ak4613.c=245=static const DECLARE_TLV_DB_SCALE(out_tlv, -12750, 50, 1);
sound/soc/codecs/ak4613.c-246-
sound/soc/codecs/ak4613.c:247:static const struct snd_kcontrol_new ak4613_snd_controls[] = {
sound/soc/codecs/ak4613.c-248- SOC_DOUBLE_R_TLV("Digital Playback Volume1", LOUT1, ROUT1,
--
sound/soc/codecs/ak4619.c=282=static int ak4619_get_deemph(struct snd_kcontrol *kcontrol,
--
sound/soc/codecs/ak4619.c-295- */
sound/soc/codecs/ak4619.c:296:static const struct snd_kcontrol_new ak4619_snd_controls[] = {
sound/soc/codecs/ak4619.c-297-
--
sound/soc/codecs/ak4642.c=156=static const DECLARE_TLV_DB_SCALE(out_tlv, -11550, 50, 1);
sound/soc/codecs/ak4642.c-157-
sound/soc/codecs/ak4642.c:158:static const struct snd_kcontrol_new ak4642_snd_controls[] = {
sound/soc/codecs/ak4642.c-159-
--
sound/soc/codecs/ak4642.c=166=static const struct snd_kcontrol_new ak4642_headphone_control =
--
sound/soc/codecs/ak4642.c-168-
sound/soc/codecs/ak4642.c:169:static const struct snd_kcontrol_new ak4642_lout_mixer_controls[] = {
sound/soc/codecs/ak4642.c-170- SOC_DAPM_SINGLE("DACL", SG_SL1, 4, 1, 0),
--
sound/soc/codecs/ak4671.c=141=static DECLARE_TLV_DB_SCALE(mic_amp_tlv, -1500, 300, 0);
sound/soc/codecs/ak4671.c-142-
sound/soc/codecs/ak4671.c:143:static const struct snd_kcontrol_new ak4671_snd_controls[] = {
sound/soc/codecs/ak4671.c-144- /* Common playback gain controls */
--
sound/soc/codecs/ak4671.c=158=static int ak4671_out2_event(struct snd_soc_dapm_widget *w,
--
sound/soc/codecs/ak4671.c-177-/* Output Mixers */
sound/soc/codecs/ak4671.c:178:static const struct snd_kcontrol_new ak4671_lout1_mixer_controls[] = {
sound/soc/codecs/ak4671.c-179- SOC_DAPM_SINGLE("DACL", AK4671_LOUT1_SIGNAL_SELECT, 0, 1, 0),
--
sound/soc/codecs/ak4671.c-186-
sound/soc/codecs/ak4671.c:187:static const struct snd_kcontrol_new ak4671_rout1_mixer_controls[] = {
sound/soc/codecs/ak4671.c-188- SOC_DAPM_SINGLE("DACR", AK4671_ROUT1_SIGNAL_SELECT, 0, 1, 0),
--
sound/soc/codecs/ak4671.c-195-
sound/soc/codecs/ak4671.c:196:static const struct snd_kcontrol_new ak4671_lout2_mixer_controls[] = {
sound/soc/codecs/ak4671.c-197- SOC_DAPM_SINGLE("DACHL", AK4671_LOUT2_SIGNAL_SELECT, 0, 1, 0),
--
]
|
| 42/2 |
2026/07/18 00:44 |
llm |
expert |
0m
Model:
Tokens:
input: 71509
output: 49
thoughts: 33
Thoughts: Here's my take on the thought process:
**Diving into the ADau1373 Endpoint Mixer**
Okay, so I need to get into the nitty-gritty of the ADau1373's endpoint mixer controls. I'm going to start by pulling up the `sound/soc/codecs/adau1373.c` file. Specifically, I'm interested in the `adau1373_ep_mixer_controls` section. This is where the magic happens, where I can see exactly what the mixer controls look like for the endpoint. I'm expecting to find the standard stuff here β volume controls, mute settings, input source selection, perhaps some gain adjustments. My goal is to understand how these controls are structured and if I can use them, directly, in my work. I might need this knowledge for a driver change. Let's see what we've got. I'm hoping it's well-documented... but, knowing this codec, I'm prepared for a deep dive!
|
| 43/2 |
2026/07/18 00:44 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:sound/soc/codecs/adau1373.c Name:adau1373_ep_mixer_controls]
Results: map[SourceCode: SourceFile:]
|
| 44/2 |
2026/07/18 00:44 |
llm |
expert |
1m
Model:
Tokens:
input: 71835
output: 42
thoughts: 39
Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience:
**Analyzing the ADau1373 Codec Declaration**
Alright, so the codec's declared via a macro, which is a pretty standard approach in the kernel's sound subsystem. I know I've seen that pattern countless times. I need to get a clear picture of how this specific one is implemented. My focus is going to be on the `sound/soc/codecs/adau1373.c` file β that's the obvious place to start. I'm zeroing in on the vicinity of line 616. That's usually where the meat of the codec driver's registration or initialization logic is located. Hopefully, I'll find the macro expansion or the key structure definition that I need to quickly grasp its details.
|
| 45/2 |
2026/07/18 00:45 |
tool |
read-file |
0m
Args: map[File:sound/soc/codecs/adau1373.c FirstLine:616 LineCount:20]
Results: map[Contents: 616: #define DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(_name, _reg) \
617: const struct snd_kcontrol_new _name[] = { \
618: SOC_DAPM_SINGLE("Left DAC2 Switch", _reg, 7, 1, 0), \
619: SOC_DAPM_SINGLE("Right DAC2 Switch", _reg, 6, 1, 0), \
620: SOC_DAPM_SINGLE("Left DAC1 Switch", _reg, 5, 1, 0), \
621: SOC_DAPM_SINGLE("Right DAC1 Switch", _reg, 4, 1, 0), \
622: SOC_DAPM_SINGLE("Input 4 Bypass Switch", _reg, 3, 1, 0), \
623: SOC_DAPM_SINGLE("Input 3 Bypass Switch", _reg, 2, 1, 0), \
624: SOC_DAPM_SINGLE("Input 2 Bypass Switch", _reg, 1, 1, 0), \
625: SOC_DAPM_SINGLE("Input 1 Bypass Switch", _reg, 0, 1, 0), \
626: }
627:
628: static DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(adau1373_left_line1_mixer_controls,
629: ADAU1373_LLINE1_MIX);
630: static DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(adau1373_right_line1_mixer_controls,
631: ADAU1373_RLINE1_MIX);
632: static DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(adau1373_left_line2_mixer_controls,
633: ADAU1373_LLINE2_MIX);
634: static DECLARE_ADAU1373_OUTPUT_MIXER_CTRLS(adau1373_right_line2_mixer_controls,
635: ADAU1373_RLINE2_MIX);
]
|
| 46/2 |
2026/07/18 00:45 |
llm |
expert |
0m
Model:
Tokens:
input: 72689
output: 33
thoughts: 42
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**Diving into the DAPM Single Initialization**
Alright, hang on a second. I need to take a closer look at this audio driver code. I see `SOC_DAPM_SINGLE` being used and my immediate thought is that this likely expands to a `snd_kcontrol_new` initialization. Thatβs the classic structure for creating controls, so it makes sense. I need to confirm though, I need to understand exactly what `SOC_DAPM_SINGLE` is doing in this particular context. I need to dissect the macro definition to see what parameters it is setting for the kcontrol, and how it is all connected within the DAPM (Dynamic Audio Power Management) framework. I'm going to quickly check what that macro actually expands to. That's the critical first step to understanding how this control is being created and integrated into the audio graph. From there I can determine if any part of the control could have a problem.
|
| 47/2 |
2026/07/18 00:45 |
tool |
grepper |
0m
Args: map[Expression:#define SOC_DAPM_SINGLE PathPrefix:include/sound/]
Results: map[Output:include/sound/soc-dapm.h=23=struct snd_soc_dapm_context;
--
include/sound/soc-dapm.h-335- snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw)
include/sound/soc-dapm.h:336:#define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \
include/sound/soc-dapm.h-337- SOC_SINGLE_EXT(xname, reg, shift, max, invert, \
include/sound/soc-dapm.h-338- snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw)
include/sound/soc-dapm.h:339:#define SOC_DAPM_SINGLE_VIRT(xname, max) \
include/sound/soc-dapm.h-340- SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0)
--
include/sound/soc-dapm.h-344- tlv_array)
include/sound/soc-dapm.h:345:#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
include/sound/soc-dapm.h-346- SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \
--
include/sound/soc-dapm.h-348- tlv_array)
include/sound/soc-dapm.h:349:#define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \
include/sound/soc-dapm.h-350- SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array)
--
include/sound/soc-dapm.h-356-
include/sound/soc-dapm.h:357:#define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \
include/sound/soc-dapm.h-358-{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
--
include/sound/soc-dapm.h-361- .private_value = SOC_SINGLE_VALUE(reg, shift, 0, max, invert, 1) }
include/sound/soc-dapm.h:362:#define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \
include/sound/soc-dapm.h-363-{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
]
|
| 48/2 |
2026/07/18 00:45 |
llm |
expert |
0m
Model:
Tokens:
input: 73711
output: 31
thoughts: 11
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm an expert in the relevant field:
**Decoding the `SOC_SINGLE_EXT` Conundrum**
Alright, *SOC_SINGLE_EXT*... that's a key identifier, and it immediately sets a specific context. My mind jumps to... what are we talking about? A single extension? This could be a reference to a particular system-on-a-chip (SoC) configuration, a software flag, or maybe a hardware register setting. It depends heavily on the surrounding code, the architecture in play, and the specific domain I'm working in.
My initial thought process immediately starts to drill down into potential meanings:
* **Hardware Interpretation**: Is this a register setting? Is it related to a specific memory address or configuration bit in an SoC? Are we talking about the enabling/disabling of a single peripheral, like a specific communication port, an interrupt controller or security feature? I start to think about the typical register layouts I've seen in similar SOCs. What are the common names or bits used in this context?
* **Software Context**: Is this a defined constant in a header file? A preprocessor macro? I'm quickly scanning my mental library for relevant header files and driver code. What is the scope? Is it device-specific, or more generic across a platform? Are there any related `SOC_*` constants? What functionality is related to the rest of the file?
* **System-Level Impact**: This identifier has consequences. If it's a hardware setting, what is the effect on the device's behavior? If it's a software flag, what code path does it trigger? Is it enabling some security or debug functionality or changing how peripherals are configured? I start building a potential logical chain: *`SOC_SINGLE_EXT` -> [Some other hardware or software component] -> [Impact]*
Basically, my mind is now a whirlwind of potential interpretations, based on my past experience with similar systems and that identifier itself. I need more context to truly understand the purpose of that identifier. Without that, it could be anything, but based on it's name I think that the purpose of that identifier is for something to be enabled or disabled, possibly from a hardware or software perspective.
|
| 49/2 |
2026/07/18 00:45 |
tool |
grepper |
0m
Args: map[Expression:#define SOC_SINGLE_EXT PathPrefix:include/sound/]
Results: map[Output:include/sound/soc.h=33=struct platform_device;
--
include/sound/soc.h-233- .private_value = (unsigned long)&xenum }
include/sound/soc.h:234:#define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
include/sound/soc.h-235- xhandler_get, xhandler_put) \
--
include/sound/soc.h-253- 0, xmax, xinvert) }
include/sound/soc.h:254:#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
include/sound/soc.h-255- xhandler_get, xhandler_put, tlv_array) \
]
|
| 50/2 |
2026/07/18 00:45 |
llm |
expert |
0m
Model:
Tokens:
input: 74445
output: 35
thoughts: 22
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Diving into the SoC Audio Framework**
Okay, so I need to understand `SOC_SINGLE_EXT`. My immediate instinct is to check the source, specifically `include/sound/soc.h`. This is where the core definitions for the Sound Open Firmware (SOF) subsystem's System-on-Chip (SoC) audio framework are kept. I'm assuming `SOC_SINGLE_EXT` is likely related to a specific type of audio control, possibly handling external inputs or outputs as a single channel, given the "SINGLE" and "EXT" terminology. Let me quickly scan through the header and get a better picture of what's going on. I'm anticipating this is a macro definition, likely for use within the DAI (Digital Audio Interface) or codec driver context, but I need to see the actual implementation to be sure. It could be a flag, an enumeration value, or part of a more complex structure, but the header file will undoubtedly provide the answer.
|
| 51/2 |
2026/07/18 00:45 |
tool |
read-file |
0m
Args: map[File:include/sound/soc.h FirstLine:234 LineCount:10]
Results: map[Contents: 234: #define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\
235: xhandler_get, xhandler_put) \
236: { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
237: .info = snd_soc_info_volsw, \
238: .get = xhandler_get, .put = xhandler_put, \
239: .private_value = SOC_SINGLE_VALUE(xreg, xshift, 0, xmax, xinvert, 0) }
240: #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\
241: xhandler_get, xhandler_put) \
242: { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
243: .info = snd_soc_info_volsw, \
]
|
| 52/2 |
2026/07/18 00:45 |
llm |
expert |
0m
Model:
Tokens:
input: 75005
output: 29
thoughts: 51
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm an expert in this area:
**Deconstructing a Data Retrieval Mechanism**
Alright, so the `.get` function pointer is currently assigned to `xhandler_get`. My mind immediately jumps to a critical question: what happens if `xhandler_get` itself is NULL? That would be a serious problem, and it's essential to understand the implications of a null handler. The system likely assumes a handler is present, and a NULL pointer there would lead to a seg fault.
Therefore, it's time to investigate how the system is behaving when `SOC_SINGLE_EXT` is utilized alongside a NULL `xhandler_get`. This test case might be illuminating. Digging deeper into this combination is the key. Perhaps it is defined for a certain type of configuration, or in certain states of operation. I need to understand what this combination would *mean* to the system.
|
| 53/2 |
2026/07/18 00:46 |
tool |
grepper |
0m
Error:
Args: map[Expression:SOC_SINGLE_EXT.*NULL PathPrefix:sound/]
Results:
|
| 54/2 |
2026/07/18 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 75298
output: 31
thoughts: 19
Thoughts: Here's my thought process, as if I were considering this search:
**Diving into ALSA Kernel Control Logic**
Alright, let's get down to brass tacks. I need to track down instances of `snd_kcontrol_new` within the ALSA kernel code where the `.get` callback is left as `NULL`. This is often a red flag; usually, you expect a `get` function to be implemented, otherwise what good is the control? I need to understand why someone might deliberately leave it null and what the implications are. This could point to a design choice, a potential bug, a simplified control, or maybe something very clever that I need to unpack. I'm going to leverage my understanding of the ALSA framework to quickly identify relevant sections, paying close attention to the data structures involved, the intended use cases of those controls, and any context or comments around their initialization. Let's see what we can find.
|
| 55/2 |
2026/07/18 00:46 |
tool |
grepper |
0m
Error:
Args: map[Expression:\.get\s*=\s*NULL PathPrefix:sound/]
Results:
|
| 56/2 |
2026/07/18 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 75560
output: 44
thoughts: 102
Thoughts: **Investigating Default Behavior in snd_kcontrol_new Initialization**
Okay, so I'm thinking about how the `snd_kcontrol_new` struct behaves. My initial understanding is that if the `.get` member isn't explicitly defined during initialization, it defaults to `NULL`. I want to verify this and understand the implications.
To confirm this, I need to hunt down some instances of `snd_kcontrol_new` struct definitions where `.get` isn't explicitly set. I'll use `codesearch-definition-source` to explore the source code of projects using ALSA. Finding these examples will let me see how the kernel uses these control structs and implicitly relies on that NULL value.
For a concrete example, I'll examine a previously discovered instance, specifically the `scarlett2_ag_target_ctl` in `sound/usb/mixer_scarlett2.c`. Analyzing this, and others I find using the search, will give me a clear picture of this implicit behavior in action.
|
| 57/2 |
2026/07/18 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_ag_target_ctl]
Results: map[SourceCode:4042: static const struct snd_kcontrol_new scarlett2_ag_target_ctl = {
4043: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
4044: .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
4045: SNDRV_CTL_ELEM_ACCESS_TLV_READ,
4046: .name = "",
4047: .info = scarlett2_ag_target_ctl_info,
4048: .get = scarlett2_ag_target_ctl_get,
4049: .put = scarlett2_ag_target_ctl_put,
4050: .tlv = { .p = db_scale_ag_target }
4051: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 58/2 |
2026/07/18 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 76163
output: 43
thoughts: 26
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deep in audio driver development:
**Thinking Through the Scarlett 2 Compressor Control**
Alright, I'm digging into this Scarlett 2 driver, specifically `sound/usb/mixer_scarlett2.c`. I'm starting to think about how the compression controls are handled β the `scarlett2_compressor_ctl` function, to be exact. I need to refresh my mental map of that section. What are the key aspects I need to consider for that specific control? Are there any potential timing issues? I need to go back and check the code, make sure it's interacting properly with the hardware register.
|
| 59/2 |
2026/07/18 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_compressor_ctl]
Results: map[SourceCode:5478: static const struct snd_kcontrol_new scarlett2_compressor_ctl = {
5479: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
5480: .name = "",
5481: .info = scarlett2_compressor_ctl_info,
5482: .get = scarlett2_compressor_ctl_get,
5483: .put = scarlett2_compressor_ctl_put,
5484: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 60/2 |
2026/07/18 00:46 |
llm |
expert |
0m
Model:
Tokens:
input: 76547
output: 48
thoughts: 31
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deep in audio driver development, like me!
**Investigating a PEQ Filter Switch in the Scarlett 2 Driver**
Alright, let me think. I'm focusing on the `sound/usb/mixer_scarlett2.c` file and specifically that `scarlett2_peq_flt_switch_ctl` control function. The implication here is that this function likely handles the on/off state of a parametric equalizer filter within the Scarlett 2 USB audio interface driver.
This is critical because parametric EQs are often used for precision audio processing. If I'm working on a bug fix, feature, or optimization, this control function is going to be central. I'll need to remember exactly what parameters this function expects, how the switch affects the audio data flow through the device, and whether the switching behavior is hardware or software controlled. I'm also interested in its role in conjunction with other functions and variables in the driver. Are there any dependencies? Potential race conditions? Any specific hardware register writes involved that I'll need to understand thoroughly? It is imperative that I am aware of this to avoid introducing unintended side effects or even causing the device to misbehave!
|
| 61/2 |
2026/07/18 00:46 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_peq_flt_switch_ctl]
Results: map[SourceCode:5577: static const struct snd_kcontrol_new scarlett2_peq_flt_switch_ctl = {
5578: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
5579: .name = "",
5580: .info = snd_ctl_boolean_mono_info,
5581: .get = scarlett2_peq_flt_switch_ctl_get,
5582: .put = scarlett2_peq_flt_switch_ctl_put,
5583: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 62/2 |
2026/07/18 00:46 |
llm |
expert |
1m
Model:
Tokens:
input: 77071
output: 42
thoughts: 25
Thoughts: Here's the summary, assuming I'm an audio engineering expert:
**Investigating Scarlett Mixer Control**
Okay, let's see... I'm pondering this `sound/usb/mixer_scarlett.c` file and specifically that `usb_scarlett_ctl_switch` function. I'm immediately thinking, "What exactly is this controlling on a Scarlett interface?" I'm drilling down into that specific function because, based on the file path, this is where the core logic for managing the physical controls (switches, knobs, routing matrices, etc.) of the interface through USB is going to be implemented. I need to understand if it's handling basic mute/solo toggles, input gain adjustments, output level control, headphone monitoring selections, or something more complex. Knowing what this does is key to figuring out how the rest of the driver interacts with it. This function is the gateway to understanding the level of configurability this interface provides. I need to get into the details here, and fast.
|
| 63/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett.c Name:usb_scarlett_ctl_switch]
Results: map[SourceCode: 722: static const struct snd_kcontrol_new usb_scarlett_ctl_switch = {
723: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
724: .name = "",
725: .info = scarlett_ctl_switch_info,
726: .get = scarlett_ctl_switch_get,
727: .put = scarlett_ctl_switch_put,
728: };
SourceFile:sound/usb/mixer_scarlett.c]
|
| 64/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 77512
output: 42
thoughts: 25
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and presented as if it were my own internal monologue:
**Investigating Audigy2NX Control in the Sound System**
Right, so we're looking at audio device quirks, and my mind immediately jumps to `sound/usb/mixer_quirks.c`. Specifically, Iβm thinking about the `snd_audigy2nx_control` function. That seems like a prime area to check. It's almost a knee-jerk reaction at this point β any time I'm diving into USB audio issues, the Audigy2NX handling is a potential sticking point. I need to refresh my memory on what specific quirks were addressed there and whether anything in that code base could be relevant to the issue at hand. Were there any unusual control setups, initialization sequences, or specific workarounds implemented for that particular device? Any peculiar clocking issues or USB bus interactions that might provide a clue? Is it similar to the current issue, or could it inspire an idea for solving this? Time to go back and cross reference the relevant code!
|
| 65/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_audigy2nx_control]
Results: map[SourceCode: 360: /* name and private_value are set dynamically */
361: static const struct snd_kcontrol_new snd_audigy2nx_control = {
362: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
363: .info = snd_audigy2nx_led_info,
364: .get = snd_audigy2nx_led_get,
365: .put = snd_audigy2nx_led_put,
366: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 66/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 77985
output: 43
thoughts: 26
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:
**Kernel Audio Quirks: Specifically, DualSense Jack Control**
Alright, my mind's on audio quirk handling in the kernel, specifically digging through the `sound/usb/mixer_quirks.c` file again. I keep circling back to `snd_dualsense_jack_control`. Something about it is gnawing at me. I'm trying to recall the intricacies of how we're dealing with the DualSense controller and its audio jack. Is there a potential edge case I'm overlooking in how we detect and manage the headphone connection? Are we handling all the permutations of plug/unplug events correctly, especially given the controller's more complex audio routing? I need to re-examine the logic there. The quirks handling seems important to get right to ensure a smooth user experience. I need to make sure we're not inadvertently causing any regressions or conflicts with other USB audio devices. It's time for a deeper dive into that specific function.
|
| 67/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_dualsense_jack_control]
Results: map[SourceCode: 678: static const struct snd_kcontrol_new snd_dualsense_jack_control = {
679: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
680: .access = SNDRV_CTL_ELEM_ACCESS_READ,
681: .info = snd_ctl_boolean_mono_info,
682: .get = snd_dualsense_jack_get,
683: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 68/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 78435
output: 45
thoughts: 28
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience and written in the first person:
**Investigating a Potential Audio Quirks Source**
Okay, so I'm looking at this audio issue, and the first place my brain jumps to is the quirky hardware-specific driver territory. Specifically, I'm thinking about the Xonar U1 and its known output switching issues. Does the problem relate to something in the `sound/usb/mixer_quirks.c` file? My mind immediately flags the `snd_xonar_u1_output_switch` function. Could the root cause of this sound issue be related to a specific quirk or handling problem within that switch? It seems like a logical first line of inquiry, especially given the history of these types of issues on various USB sound devices. I should definitely check that function for any obvious problems or potential interactions with the currently reported behavior. I need to dive in and refresh my memory of that code.
|
| 69/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_xonar_u1_output_switch]
Results: map[SourceCode: 831: static const struct snd_kcontrol_new snd_xonar_u1_output_switch = {
832: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
833: .name = "Digital Playback Switch",
834: .info = snd_ctl_boolean_mono_info,
835: .get = snd_xonar_u1_switch_get,
836: .put = snd_xonar_u1_switch_put,
837: .private_value = 0x05,
838: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 70/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 78905
output: 42
thoughts: 25
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Investigating a Potential Audio Quirks Source**
Okay, let me quickly run through this audio issue. We're troubleshooting... let's get down to brass tacks. Something's not right, and I need to start narrowing down the possibilities systematically. Hmm, let me think. Where would I begin? Okay, what about delving into the driver's quirky behaviour? Let me check `sound/usb/mixer_quirks.c`. This seems like a reasonable place to start, as it is the place where several fixes may be contained for particular mixer devices. Specifically, I should look at `snd_mbox1_clk_switch` since clock switching behavior has been troublesome in the past. This function seems like a likely candidate for a bug or a misconfiguration that could be contributing to the issue I'm seeing. I'll need to examine that function's logic closely, along with its interactions with the relevant hardware registers and any related USB descriptors. Time to dig in...
|
| 71/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_mbox1_clk_switch]
Results: map[SourceCode:1072: static const struct snd_kcontrol_new snd_mbox1_clk_switch = {
1073: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1074: .name = "Clock Source",
1075: .index = 0,
1076: .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
1077: .info = snd_mbox1_clk_switch_info,
1078: .get = snd_mbox1_clk_switch_get,
1079: .put = snd_mbox1_clk_switch_put,
1080: .private_value = 0
1081: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 72/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 79414
output: 44
thoughts: 27
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm an expert in audio driver development, summarized in the first person:
**Investigating a Potential Audio Device Quirks**
Hmm, thinking about potential audio device quirks, particularly for a mixer... where should I start looking? My mind immediately jumps to `sound/usb/mixer_quirks.c`. It's a prime location for handling those special cases and workarounds that often pop up with USB audio devices. Given the context of a mixer and the mention of "nativeinstruments", I'm thinking specifically about that `snd_nativeinstruments_ta6_mixers` entry within that file. Is that the right place? I need to check if there are any documented quirks or specific handling in place there for a device similar to the one I'm working with. This function could be key. It's the most likely spot to start my investigation.
|
| 73/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_nativeinstruments_ta6_mixers]
Results: map[SourceCode:1178: static const struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = {
1179: {
1180: .name = "Direct Thru Channel A",
1181: .private_value = _MAKE_NI_CONTROL(0x01, 0x03),
1182: },
1183: {
1184: .name = "Direct Thru Channel B",
1185: .private_value = _MAKE_NI_CONTROL(0x01, 0x05),
1186: },
1187: {
1188: .name = "Phono Input Channel A",
1189: .private_value = _MAKE_NI_CONTROL(0x02, 0x03),
1190: },
1191: {
1192: .name = "Phono Input Channel B",
1193: .private_value = _MAKE_NI_CONTROL(0x02, 0x05),
1194: },
1195: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 74/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 80000
output: 57
thoughts: 32
Thoughts: Okay, here's my interpretation of those thoughts, framed as a first-person expert summary:
**Digging into `snd_nativeinstruments_ta6_mixers`**
Alright, a quick scan tells me that `snd_nativeinstruments_ta6_mixers` doesn't implement a `.get` method, which is a bit unusual, given the general pattern I see in mixer implementations. Hmm, okay, let's trace this back and see where this module is actually being utilized. I need to understand how data is expected to be retrieved or accessed in this specific context, even if it's not a standard `.get` operation. I'll need to follow the calling code to see what's happening.
|
| 75/2 |
2026/07/18 00:47 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c IncludeSnippetLines:0 Name:snd_nativeinstruments_ta6_mixers SourceTreePrefix:]
Results: map[References:<nil> TruncatedOutput:false]
|
| 76/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 80259
output: 42
thoughts: 23
Thoughts: Here's my thought process, as if I were considering this code:
**Analyzing the Mixer Creation**
Okay, first thought: it's definitely dealing with an array. That immediately triggers a mental checklist: what's the purpose of the array? Is it a collection of audio components, channels, presets, or something else entirely? The context will be key.
Now, let's dive into the core of it all: `snd_nativeinstruments_create_mixer`. This is where the magic (or the potential headache!) likely happens. This function name strongly implies it's responsible for the creation of the mixer object, in the context of `nativeinstruments`, whatever that library/framework defines. Iβm thinking about what the likely parameters are: number of channels, the sample rate, the bit depth, and maybe even initial configuration details. I'll need to go beyond this simple snippet to really grasp the architecture, but `create_mixer` is the essential entry point I need to understand. Is this a custom implementation, or something that interacts with underlying OS audio frameworks? This is where I start formulating the design possibilities.
|
| 77/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_nativeinstruments_create_mixer]
Results: map[SourceCode:1232: static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer,
1233: const struct snd_kcontrol_new *kc,
1234: unsigned int count)
1235: {
1236: int i, err = 0;
1237: struct snd_kcontrol_new template = {
1238: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1239: .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
1240: .get = snd_nativeinstruments_control_get,
1241: .put = snd_nativeinstruments_control_put,
1242: .info = snd_ctl_boolean_mono_info,
1243: };
1244:
1245: for (i = 0; i < count; i++) {
1246: struct usb_mixer_elem_list *list;
1247:
1248: template.name = kc[i].name;
1249: template.private_value = kc[i].private_value;
1250:
1251: err = add_single_ctl_with_resume(mixer, 0,
1252: snd_ni_update_cur_val,
1253: &template, &list);
1254: if (err < 0)
1255: break;
1256: snd_ni_control_init_val(mixer, list->kctl);
1257: }
1258:
1259: return err;
1260: }
SourceFile:sound/usb/mixer_quirks.c]
|
| 78/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 81036
output: 43
thoughts: 39
Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience:
**Analyzing the Code Structure and Identifying Key Elements**
Right, so we're looking at code that's likely dealing with audio device configuration, specifically using a template structure with a `.get` function. My initial thought is to quickly dissect the flow and pinpoint the critical point of interaction with these templates. Given that we have a `.get` function, my mind immediately jumps to how the system retrieves or accesses information related to the device using the template; this could be anything from volume levels, SPDIF states, mute options, etc.
I'm heading directly to `sound/usb/mixer_quirks.c` because, based on the context, that's where I would expect to find any custom configurations or workarounds for specific USB audio hardware, in particular, the `snd_microii_mixer_spdif` entry. My brain now is focused on the definition, usage, and implications of that function within this context. I'm keen to examine precisely how the code interacts with and utilizes the `.get` function within the `snd_microii_mixer_spdif` structure. This is a common pattern in the Linux audio subsystem, and I want to refresh my memory or perhaps learn a new quirk or configuration.
|
| 79/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:snd_microii_mixer_spdif]
Results: map[SourceCode:2088: static const struct snd_kcontrol_new snd_microii_mixer_spdif[] = {
2089: {
2090: .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2091: .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
2092: .info = snd_microii_spdif_info,
2093: .get = snd_microii_spdif_default_get,
2094: .put = snd_microii_spdif_default_put,
2095: .private_value = 0x00000100UL,/* reset value */
2096: },
2097: {
2098: .access = SNDRV_CTL_ELEM_ACCESS_READ,
2099: .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2100: .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, MASK),
2101: .info = snd_microii_spdif_info,
2102: .get = snd_microii_spdif_mask_get,
2103: },
2104: {
2105: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2106: .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH),
2107: .info = snd_ctl_boolean_mono_info,
2108: .get = snd_microii_spdif_switch_get,
2109: .put = snd_microii_spdif_switch_put,
2110: .private_value = 0x00000028UL,/* reset value */
2111: }
2112: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 80/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 81933
output: 42
thoughts: 33
Thoughts: Okay, here's my take on those thoughts, framed as my own:
**Analyzing Mixer Quirks**
Alright, so I'm looking at these audio control schemes and the common denominator keeps popping up: `.get`. That's the key to retrieving the current state, and itβs likely how we interact with the hardware's current settings. Now, letβs dig into the specifics. I need to see how they're handling things. I'm going to jump into `sound/usb/mixer_quirks.c`, specifically the `realtek_connector_ctl_ro` section. I need to understand how Realtek chips are being managed, which is likely where the relevant low-level operations are defined. This is my next step to get a clearer picture of the issue.
|
| 81/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_quirks.c Name:realtek_connector_ctl_ro]
Results: map[SourceCode:2316: static const struct snd_kcontrol_new realtek_connector_ctl_ro = {
2317: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
2318: .name = "", /* will be filled later manually */
2319: .access = SNDRV_CTL_ELEM_ACCESS_READ,
2320: .info = snd_ctl_boolean_mono_info,
2321: .get = realtek_ctl_connector_get,
2322: };
SourceFile:sound/usb/mixer_quirks.c]
|
| 82/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 82346
output: 50
thoughts: 34
Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person:
**Investigating a Sound Driver**
Alright, time to dive into this sound driver, specifically `sound/usb/mixer_s1810c.c`. I need to get my head around how this S1810C mixer is implemented, and the specific function I'm focusing on now is `snd_s1810c_line_sw`. That likely handles the line switch controls, which are always a critical area when it comes to USB audio. I'm assuming that it manages routing, gain, or mute settings for line inputs/outputs. Gotta dig in and understand the control flow, any potential quirks or dependencies on other parts of the driver, and how it's dealing with the actual USB audio interface. It is essential to be able to assess potential issues and to find how to resolve these issues for my client. Time to get to work.
|
| 83/2 |
2026/07/18 00:47 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_s1810c.c Name:snd_s1810c_line_sw]
Results: map[SourceCode: 569: static const struct snd_kcontrol_new snd_s1810c_line_sw = {
570: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
571: .name = "Line 1/2 Source Type",
572: .info = snd_s1810c_line_sw_info,
573: .get = snd_s1810c_switch_get,
574: .put = snd_s1810c_switch_set,
575: .private_value = (SC1810C_STATE_LINE_SW | SC1810C_CTL_LINE_SW << 8)
576: };
SourceFile:sound/usb/mixer_s1810c.c]
|
| 84/2 |
2026/07/18 00:47 |
llm |
expert |
0m
Model:
Tokens:
input: 82869
output: 45
thoughts: 29
Thoughts: Here's my take on the thought process, as if it were my own:
**Analyzing Scarlett 2i2 Firmware Version Control**
Okay, time to dive in. My immediate thought is, "Let's zero in on `sound/usb/mixer_scarlett2.c` and specifically, the `scarlett2_firmware_version_ctl` function." This is where the firmware version handling logic for the Scarlett 2i2 is going to live. I need to understand how the system is querying, reading, interpreting, or potentially even setting the firmware version for that device. I'll need to see the structure of the control itself, what data it's accessing, and how it interacts with the USB interface and the device itself. Is it a simple read-only control, or is there more involved? This is the starting point for understanding how the system identifies and works with the Scarlett's firmware. I anticipate there's going to be a need to handle different versions or to check for updates. Knowing the details of this control is key to understanding the device integration.
|
| 85/2 |
2026/07/18 00:48 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_firmware_version_ctl]
Results: map[SourceCode:3488: static const struct snd_kcontrol_new scarlett2_firmware_version_ctl = {
3489: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
3490: .access = SNDRV_CTL_ELEM_ACCESS_READ,
3491: .name = "",
3492: .info = scarlett2_firmware_version_ctl_info,
3493: .get = scarlett2_firmware_version_ctl_get
3494: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 86/2 |
2026/07/18 00:48 |
llm |
expert |
0m
Model:
Tokens:
input: 83344
output: 47
thoughts: 31
Thoughts: Here's my take on those thoughts, tailored for an expert audience:
**Investigating the Scarlett 2i2 Mixer Firmware Check**
Okay, time to dive into that Scarlett 2i2 mixer code. Specifically, I need to revisit `sound/usb/mixer_scarlett2.c`. I recall working with that driver before, and I'm pretty sure there's a crucial firmware check in there β the `scarlett2_min_firmware_version_ctl` control. I need to refresh my memory on the specifics of how that minimum firmware version is handled. What are the implications of a version mismatch? Is it just a warning, or does it prevent functionality? I should quickly verify if any recent commits have touched that area and if any regressions have cropped up recently regarding firmware compatibility. I want to check the control logic: How does it impact the audio path setup, and, more importantly, are there any potential security vulnerabilities with the firmware version checks implemented in `scarlett2_min_firmware_version_ctl`?
|
| 87/2 |
2026/07/18 00:48 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_min_firmware_version_ctl]
Results: map[SourceCode:3528: static const struct snd_kcontrol_new scarlett2_min_firmware_version_ctl = {
3529: .iface = SNDRV_CTL_ELEM_IFACE_CARD,
3530: .access = SNDRV_CTL_ELEM_ACCESS_READ,
3531: .name = "",
3532: .info = scarlett2_min_firmware_version_ctl_info,
3533: .get = scarlett2_min_firmware_version_ctl_get
3534: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 88/2 |
2026/07/18 00:48 |
llm |
expert |
1m
Model:
Tokens:
input: 83820
output: 42
thoughts: 26
Thoughts: Here's my take on those thoughts, tailored for an expert audience:
**Diving into Scarlett 2 Synchronization**
Okay, so I'm thinking, time to dig into the `sound/usb/mixer_scarlett2.c` file, specifically the `scarlett2_sync_ctl` function. This is where the magic happens β or where it all goes horribly wrong, depending on how robust the implementation is. I need to refresh my memory on how they're handling the synchronization logic for the Scarlett 2's mixer. I'm hoping it's clean and efficient, perhaps using some clever DMA or interrupt-driven techniques to minimize latency and ensure proper data alignment. I'm particularly interested in how they address potential clock drift between the USB interface and the internal audio processing. Are they using any sophisticated resampling methods, or is it more of a basic sample-rate lock? And what's the error handling like? Gotta make sure it gracefully recovers from any dropped packets or synchronization issues. Let's see if this code is as well-architected as I'd expect from Focusrite.
|
| 89/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_sync_ctl]
Results: map[SourceCode:3587: static const struct snd_kcontrol_new scarlett2_sync_ctl = {
3588: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3589: .access = SNDRV_CTL_ELEM_ACCESS_READ,
3590: .name = "",
3591: .info = scarlett2_sync_ctl_info,
3592: .get = scarlett2_sync_ctl_get
3593: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 90/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 84285
output: 45
thoughts: 29
Thoughts: Here's a summary of my immediate thought process:
**Diving into the Scarlett 2i2 Auto-Gain Implementation**
Okay, so I need to get a handle on how this auto-gain feature is working within the Scarlett 2i2 mixer. The first place to look, logically, is the control structure for the auto-gain status. That would be in the `sound/usb/mixer_scarlett2.c` file, specifically the `scarlett2_autogain_status_ctl` module or function. Let me see what that reveals about the low-level workings. Is it using hardware feedback? Software algorithms? What parameters are being adjusted based on the auto-gain logic, and how are those parameters being controlled? Knowing the control logic is key to understanding the full picture.
|
| 91/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_autogain_status_ctl]
Results: map[SourceCode:3945: static const struct snd_kcontrol_new scarlett2_autogain_status_ctl = {
3946: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
3947: .access = SNDRV_CTL_ELEM_ACCESS_READ,
3948: .name = "",
3949: .info = scarlett2_autogain_status_ctl_info,
3950: .get = scarlett2_autogain_status_ctl_get,
3951: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 92/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 84702
output: 42
thoughts: 26
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**Diving into Scarlett 2i2 Metering Implementation**
Alright, time to dig into the guts of the Scarlett 2i2 mixer control. I need to refresh my memory on the metering implementation, so I'm heading directly to the code that handles it: `sound/usb/mixer_scarlett2.c`, specifically the `scarlett2_meter_ctl` function. This likely contains the logic for how we're reading levels and potentially driving the meter display, either on the device or feeding that information back to the host. I'm expecting to find the register interactions, data parsing, and any necessary scaling or averaging that's needed to represent the audio signal as a meter. I'll be looking for potential performance bottlenecks or subtle bugs related to how the meters are polled or updated. I hope the code is well-commented, but even if it's not, the function name gives me a good starting point to deduce its purpose, and my experience should get me through it. I need to quickly grasp the mechanism used to translate the raw audio data from the device to human-readable meter values.
|
| 93/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_meter_ctl]
Results: map[SourceCode:7533: static const struct snd_kcontrol_new scarlett2_meter_ctl = {
7534: .iface = SNDRV_CTL_ELEM_IFACE_PCM,
7535: .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
7536: .name = "",
7537: .info = scarlett2_meter_ctl_info,
7538: .get = scarlett2_meter_ctl_get
7539: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 94/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 85202
output: 44
thoughts: 47
Thoughts: **Focusing on the Core of the Matter**
Alright, let's cut through the noise. I'm specifically after the `snd_kcontrol_new` function calls, but I'm *not* interested in instances where a `.get` function is associated. Seems straightforward, doesn't it? My instincts tell me the place to start is within the `sound/usb/mixer_scarlett2.c` file. Specifically, I'm going to take a look at the `scarlett2_direct_monitor_ctl` control. That feels like a promising lead given my understanding of the relevant hardware. Let's see what we can find.
|
| 95/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_direct_monitor_ctl]
Results: map[SourceCode:7207: /* Direct Monitor for Solo is mono-only and only needs a boolean control
7208: * Direct Monitor for 2i2 is selectable between Off/Mono/Stereo
7209: */
7210: static const struct snd_kcontrol_new scarlett2_direct_monitor_ctl[2] = {
7211: {
7212: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7213: .name = "",
7214: .info = snd_ctl_boolean_mono_info,
7215: .get = scarlett2_direct_monitor_ctl_get,
7216: .put = scarlett2_direct_monitor_ctl_put,
7217: },
7218: {
7219: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
7220: .name = "",
7221: .info = scarlett2_direct_monitor_stereo_enum_ctl_info,
7222: .get = scarlett2_direct_monitor_ctl_get,
7223: .put = scarlett2_direct_monitor_ctl_put,
7224: }
7225: };
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 96/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 84184
output: 44
thoughts: 0
|
| 97/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer_scarlett2.c Name:scarlett2_meter_ctl_get]
Results: map[SourceCode:7497: static int scarlett2_meter_ctl_get(struct snd_kcontrol *kctl,
7498: struct snd_ctl_elem_value *ucontrol)
7499: {
7500: struct usb_mixer_elem_info *elem = kctl->private_data;
7501: struct usb_mixer_interface *mixer = elem->head.mixer;
7502: struct scarlett2_data *private = mixer->private_data;
7503: u8 *meter_level_map = private->meter_level_map;
7504: u16 meter_levels[SCARLETT2_MAX_METERS];
7505: int i, err;
7506:
7507: guard(mutex)(&private->data_mutex);
7508:
7509: if (private->hwdep_in_use)
7510: return -EBUSY;
7511:
7512: err = scarlett2_usb_get_meter_levels(mixer, elem->channels,
7513: meter_levels);
7514: if (err < 0)
7515: return err;
7516:
7517: /* copy & translate from meter_levels[] using meter_level_map[] */
7518: for (i = 0; i < elem->channels; i++) {
7519: int idx = meter_level_map[i];
7520: int value;
7521:
7522: if (idx == 255)
7523: value = 0;
7524: else
7525: value = meter_levels[idx];
7526:
7527: ucontrol->value.integer.value[i] = value;
7528: }
7529:
7530: return 0;
7531: }
SourceFile:sound/usb/mixer_scarlett2.c]
|
| 98/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 86399
output: 40
thoughts: 24
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Diving into USB Audio Control**
Alright, time to dig in. The issue *feels* like it's going to be somewhere around the USB audio control flow. I'm thinking specifically about that read-only control functionality, specifically the `sound/usb/mixer.c` code and its `usb_feature_unit_ctl_ro` function. My gut says there might be an interaction, possibly related to feature unit attributes. Maybe it is failing to handle something when reading, or some timing issue, particularly regarding how the driver handles status changes. Or perhaps some subtle race condition with the read only controls. Time to verify. I need to get into the details of how the USB audio class descriptors are being interpreted and whether or not the controls are properly exposed.
|
| 99/2 |
2026/07/18 00:49 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer.c Name:usb_feature_unit_ctl_ro]
Results: map[SourceCode:1709: /* the read-only variant */
1710: static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
1711: .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1712: .name = "", /* will be filled later manually */
1713: .info = mixer_ctl_feature_info,
1714: .get = mixer_ctl_feature_get,
1715: .put = NULL,
1716: };
SourceFile:sound/usb/mixer.c]
|
| 100/2 |
2026/07/18 00:49 |
llm |
expert |
0m
Model:
Tokens:
input: 86811
output: 41
thoughts: 135
Thoughts: **Investigating a Potential Kernel Crash**
Okay, so `snd_ctl_led_get` checks `kctl->get`. The code clearly indicates a crash will occur if `kctl->get` is NULL. My immediate concern is whether or not we have kcontrols in the kernel where the `get` function pointer is, in fact, NULL. That's the likely source of the problem.
My next thought is to try to understand how this can occur. Let's see if there are any instances where `snd_kcontrol_new` is called with `.get` left undefined. I'll need to use my tools β likely `grepper`, I think β to search the code.
Instead of a broad search for `snd_kcontrol_new` and manually sifting through the results, I can be more specific, searching for calls to `snd_kcontrol_new` that *only* define `.info` and `.put`. That should narrow things down significantly and show me the culprits, if they exist. I can use `grepper` or write a quick script. That's the best way to identify the potentially problematic definitions quickly.
|
| 101/2 |
2026/07/18 00:49 |
tool |
grepper |
0m
Args: map[Expression:\.put\s*=\s*[a-zA-Z0-9_]+, PathPrefix:sound/]
Results: map[Output:
Full output is too long, showing 500 out of 4027 lines.
Use more precise expression if possible.
sound/aoa/codecs/onyx.c=167=static const struct snd_kcontrol_new volume_control = {
--
sound/aoa/codecs/onyx.c-172- .get = onyx_snd_vol_get,
sound/aoa/codecs/onyx.c:173: .put = onyx_snd_vol_put,
sound/aoa/codecs/onyx.c-174-};
--
sound/aoa/codecs/onyx.c=227=static const struct snd_kcontrol_new inputgain_control = {
--
sound/aoa/codecs/onyx.c-232- .get = onyx_snd_inputgain_get,
sound/aoa/codecs/onyx.c:233: .put = onyx_snd_inputgain_put,
sound/aoa/codecs/onyx.c-234-};
--
sound/aoa/codecs/onyx.c=280=static const struct snd_kcontrol_new capture_source_control = {
--
sound/aoa/codecs/onyx.c-296- .get = onyx_snd_capture_source_get,
sound/aoa/codecs/onyx.c:297: .put = onyx_snd_capture_source_put,
sound/aoa/codecs/onyx.c-298-};
--
sound/aoa/codecs/onyx.c=340=static const struct snd_kcontrol_new mute_control = {
--
sound/aoa/codecs/onyx.c-345- .get = onyx_snd_mute_get,
sound/aoa/codecs/onyx.c:346: .put = onyx_snd_mute_put,
sound/aoa/codecs/onyx.c-347-};
--
sound/aoa/codecs/onyx.c=401=static const struct snd_kcontrol_new n##_control = { \
--
sound/aoa/codecs/onyx.c-406- .get = onyx_snd_single_bit_get, \
sound/aoa/codecs/onyx.c:407: .put = onyx_snd_single_bit_put, \
sound/aoa/codecs/onyx.c-408- .private_value = (flags << 16) | (address << 8) | mask \
--
sound/aoa/codecs/onyx.c=545=static const struct snd_kcontrol_new onyx_spdif_ctrl = {
--
sound/aoa/codecs/onyx.c-551- .get = onyx_spdif_get,
sound/aoa/codecs/onyx.c:552: .put = onyx_spdif_put,
sound/aoa/codecs/onyx.c-553-};
--
sound/aoa/codecs/tas.c=268=static const struct snd_kcontrol_new volume_control = {
--
sound/aoa/codecs/tas.c-273- .get = tas_snd_vol_get,
sound/aoa/codecs/tas.c:274: .put = tas_snd_vol_put,
sound/aoa/codecs/tas.c-275-};
--
sound/aoa/codecs/tas.c=307=static const struct snd_kcontrol_new mute_control = {
--
sound/aoa/codecs/tas.c-312- .get = tas_snd_mute_get,
sound/aoa/codecs/tas.c:313: .put = tas_snd_mute_put,
sound/aoa/codecs/tas.c-314-};
--
sound/aoa/codecs/tas.c=359=static const struct snd_kcontrol_new n##_control = { \
--
sound/aoa/codecs/tas.c-364- .get = tas_snd_mixer_get, \
sound/aoa/codecs/tas.c:365: .put = tas_snd_mixer_put, \
sound/aoa/codecs/tas.c-366- .private_value = idx, \
--
sound/aoa/codecs/tas.c=411=static const struct snd_kcontrol_new drc_range_control = {
--
sound/aoa/codecs/tas.c-416- .get = tas_snd_drc_range_get,
sound/aoa/codecs/tas.c:417: .put = tas_snd_drc_range_put,
sound/aoa/codecs/tas.c-418-};
--
sound/aoa/codecs/tas.c=447=static const struct snd_kcontrol_new drc_switch_control = {
--
sound/aoa/codecs/tas.c-452- .get = tas_snd_drc_switch_get,
sound/aoa/codecs/tas.c:453: .put = tas_snd_drc_switch_put,
sound/aoa/codecs/tas.c-454-};
--
sound/aoa/codecs/tas.c=501=static const struct snd_kcontrol_new capture_source_control = {
--
sound/aoa/codecs/tas.c-517- .get = tas_snd_capture_source_get,
sound/aoa/codecs/tas.c:518: .put = tas_snd_capture_source_put,
sound/aoa/codecs/tas.c-519-};
--
sound/aoa/codecs/tas.c=559=static const struct snd_kcontrol_new treble_control = {
--
sound/aoa/codecs/tas.c-564- .get = tas_snd_treble_get,
sound/aoa/codecs/tas.c:565: .put = tas_snd_treble_put,
sound/aoa/codecs/tas.c-566-};
--
sound/aoa/codecs/tas.c=606=static const struct snd_kcontrol_new bass_control = {
--
sound/aoa/codecs/tas.c-611- .get = tas_snd_bass_get,
sound/aoa/codecs/tas.c:612: .put = tas_snd_bass_put,
sound/aoa/codecs/tas.c-613-};
--
sound/aoa/fabrics/layout.c=709=static const struct snd_kcontrol_new headphone_detect_choice = {
--
sound/aoa/fabrics/layout.c-714- .get = detect_choice_get,
sound/aoa/fabrics/layout.c:715: .put = detect_choice_put,
sound/aoa/fabrics/layout.c-716- .private_value = 0,
--
sound/aoa/fabrics/layout.c=719=static const struct snd_kcontrol_new lineout_detect_choice = {
--
sound/aoa/fabrics/layout.c-724- .get = detect_choice_get,
sound/aoa/fabrics/layout.c:725: .put = detect_choice_put,
sound/aoa/fabrics/layout.c-726- .private_value = 1,
--
sound/drivers/aloop.c=1578=static const struct snd_kcontrol_new loopback_controls[] = {
--
sound/drivers/aloop.c-1583- .get = loopback_rate_shift_get,
sound/drivers/aloop.c:1584: .put = loopback_rate_shift_put,
sound/drivers/aloop.c-1585-},
--
sound/drivers/aloop.c-1590- .get = loopback_notify_get,
sound/drivers/aloop.c:1591: .put = loopback_notify_put,
sound/drivers/aloop.c-1592-},
--
sound/drivers/dummy.c=664=static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
--
sound/drivers/dummy.c-702- .info = snd_dummy_volume_info, \
sound/drivers/dummy.c:703: .get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
sound/drivers/dummy.c-704- .private_value = addr, \
--
sound/drivers/dummy.c=754=static const DECLARE_TLV_DB_SCALE(db_scale_dummy, -4500, 30, 0);
--
sound/drivers/dummy.c-758- .info = snd_dummy_capsrc_info, \
sound/drivers/dummy.c:759: .get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
sound/drivers/dummy.c-760- .private_value = addr }
--
sound/drivers/dummy.c=853=DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_CD),
--
sound/drivers/dummy.c-858- .get = snd_dummy_iobox_get,
sound/drivers/dummy.c:859: .put = snd_dummy_iobox_put,
sound/drivers/dummy.c-860-},
--
sound/drivers/opl4/opl4_mixer.c=46=static const struct snd_kcontrol_new snd_opl4_controls[] = {
--
sound/drivers/opl4/opl4_mixer.c-51- .get = snd_opl4_ctl_get,
sound/drivers/opl4/opl4_mixer.c:52: .put = snd_opl4_ctl_put,
sound/drivers/opl4/opl4_mixer.c-53- .private_value = OPL4_REG_MIX_CONTROL_FM
--
sound/drivers/opl4/opl4_mixer.c-59- .get = snd_opl4_ctl_get,
sound/drivers/opl4/opl4_mixer.c:60: .put = snd_opl4_ctl_put,
sound/drivers/opl4/opl4_mixer.c-61- .private_value = OPL4_REG_MIX_CONTROL_PCM
--
sound/drivers/vx/vx_mixer.c=441=static const struct snd_kcontrol_new vx_control_output_level = {
--
sound/drivers/vx/vx_mixer.c-447- .get = vx_output_level_get,
sound/drivers/vx/vx_mixer.c:448: .put = vx_output_level_put,
sound/drivers/vx/vx_mixer.c-449- /* tlv will be filled later */
--
sound/drivers/vx/vx_mixer.c=498=static const struct snd_kcontrol_new vx_control_audio_src = {
--
sound/drivers/vx/vx_mixer.c-502- .get = vx_audio_src_get,
sound/drivers/vx/vx_mixer.c:503: .put = vx_audio_src_put,
sound/drivers/vx/vx_mixer.c-504-};
--
sound/drivers/vx/vx_mixer.c=540=static const struct snd_kcontrol_new vx_control_clock_mode = {
--
sound/drivers/vx/vx_mixer.c-544- .get = vx_clock_mode_get,
sound/drivers/vx/vx_mixer.c:545: .put = vx_clock_mode_put,
sound/drivers/vx/vx_mixer.c-546-};
--
sound/drivers/vx/vx_mixer.c=687=static const struct snd_kcontrol_new vx_control_audio_gain = {
--
sound/drivers/vx/vx_mixer.c-693- .get = vx_audio_gain_get,
sound/drivers/vx/vx_mixer.c:694: .put = vx_audio_gain_put,
sound/drivers/vx/vx_mixer.c-695- .tlv = { .p = db_scale_audio_gain },
--
sound/drivers/vx/vx_mixer.c=704=static const struct snd_kcontrol_new vx_control_monitor_gain = {
--
sound/drivers/vx/vx_mixer.c-710- .get = vx_audio_monitor_get,
sound/drivers/vx/vx_mixer.c:711: .put = vx_audio_monitor_put,
sound/drivers/vx/vx_mixer.c-712- .tlv = { .p = db_scale_audio_gain },
--
sound/firewire/isight.c=528=static int isight_create_mixer(struct isight *isight)
--
sound/firewire/isight.c-536- .get = isight_gain_get,
sound/firewire/isight.c:537: .put = isight_gain_put,
sound/firewire/isight.c-538- };
--
sound/firewire/isight.c-543- .get = isight_mute_get,
sound/firewire/isight.c:544: .put = isight_mute_put,
sound/firewire/isight.c-545- };
--
sound/firewire/oxfw/oxfw-spkr.c=251=int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie)
--
sound/firewire/oxfw/oxfw-spkr.c-258- .get = spkr_mute_get,
sound/firewire/oxfw/oxfw-spkr.c:259: .put = spkr_mute_put,
sound/firewire/oxfw/oxfw-spkr.c-260- },
--
sound/firewire/oxfw/oxfw-spkr.c-265- .get = spkr_volume_get,
sound/firewire/oxfw/oxfw-spkr.c:266: .put = spkr_volume_put,
sound/firewire/oxfw/oxfw-spkr.c-267- },
--
sound/hda/codecs/analog.c=477=static const struct snd_kcontrol_new ad1983_auto_smux_mixer = {
--
sound/hda/codecs/analog.c-481- .get = ad1983_auto_smux_enum_get,
sound/hda/codecs/analog.c:482: .put = ad1983_auto_smux_enum_put,
sound/hda/codecs/analog.c-483-};
--
sound/hda/codecs/analog.c=744=static const struct snd_kcontrol_new ad1988_auto_smux_mixer = {
--
sound/hda/codecs/analog.c-748- .get = ad1988_auto_smux_enum_get,
sound/hda/codecs/analog.c:749: .put = ad1988_auto_smux_enum_put,
sound/hda/codecs/analog.c-750-};
--
sound/hda/codecs/ca0132.c=4007=static unsigned int ca0132_capture_pcm_delay(struct hda_pcm_stream *info,
--
sound/hda/codecs/ca0132.c-4039- .get = ca0132_volume_get, \
sound/hda/codecs/ca0132.c:4040: .put = ca0132_volume_put, \
sound/hda/codecs/ca0132.c-4041- .tlv = { .c = ca0132_volume_tlv }, \
--
sound/hda/codecs/ca0132.c-4057- .get = snd_hda_mixer_amp_volume_get, \
sound/hda/codecs/ca0132.c:4058: .put = ca0132_alt_volume_put, \
sound/hda/codecs/ca0132.c-4059- .tlv = { .c = snd_hda_mixer_amp_tlv }, \
--
sound/hda/codecs/ca0132.c-4067- .get = ca0132_switch_get, \
sound/hda/codecs/ca0132.c:4068: .put = ca0132_switch_put, \
sound/hda/codecs/ca0132.c-4069- .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, 0, dir) }
--
sound/hda/codecs/cirrus/cs421x.c=348=static const struct snd_kcontrol_new cs421x_speaker_boost_ctl = {
--
sound/hda/codecs/cirrus/cs421x.c-355- .get = cs421x_boost_vol_get,
sound/hda/codecs/cirrus/cs421x.c:356: .put = cs421x_boost_vol_put,
sound/hda/codecs/cirrus/cs421x.c-357- .tlv = { .p = cs421x_speaker_boost_db_scale },
--
sound/hda/codecs/cirrus/cs8409-tables.c=22=const struct snd_kcontrol_new cs42l42_dac_volume_mixer = {
--
sound/hda/codecs/cirrus/cs8409-tables.c-28- .get = cs42l42_volume_get,
sound/hda/codecs/cirrus/cs8409-tables.c:29: .put = cs42l42_volume_put,
sound/hda/codecs/cirrus/cs8409-tables.c-30- .tlv = { .p = cs42l42_dac_db_scale },
--
sound/hda/codecs/cirrus/cs8409-tables.c=35=const struct snd_kcontrol_new cs42l42_adc_volume_mixer = {
--
sound/hda/codecs/cirrus/cs8409-tables.c-41- .get = cs42l42_volume_get,
sound/hda/codecs/cirrus/cs8409-tables.c:42: .put = cs42l42_volume_put,
sound/hda/codecs/cirrus/cs8409-tables.c-43- .tlv = { .p = cs42l42_adc_db_scale },
--
sound/hda/codecs/cirrus/cs8409.c=446=static const struct snd_kcontrol_new cs8409_spk_sw_ctrl = {
--
sound/hda/codecs/cirrus/cs8409.c-449- .get = cs8409_spk_sw_gpio_get,
sound/hda/codecs/cirrus/cs8409.c:450: .put = cs8409_spk_sw_gpio_put,
sound/hda/codecs/cirrus/cs8409.c-451-};
--
sound/hda/codecs/cirrus/cs8409.c=1282=static const struct snd_kcontrol_new cs8409_spk_sw_component_ctrl = {
--
sound/hda/codecs/cirrus/cs8409.c-1285- .get = cs8409_spk_sw_get,
sound/hda/codecs/cirrus/cs8409.c:1286: .put = cs8409_spk_sw_put,
sound/hda/codecs/cirrus/cs8409.c-1287-};
--
sound/hda/codecs/conexant.c=591=static const struct snd_kcontrol_new olpc_xo_mixers[] = {
--
sound/hda/codecs/conexant.c-596- .get = olpc_xo_dc_mode_get,
sound/hda/codecs/conexant.c:597: .put = olpc_xo_dc_mode_put,
sound/hda/codecs/conexant.c-598- },
--
sound/hda/codecs/conexant.c-603- .get = olpc_xo_dc_bias_enum_get,
sound/hda/codecs/conexant.c:604: .put = olpc_xo_dc_bias_enum_put,
sound/hda/codecs/conexant.c-605- },
--
sound/hda/codecs/generic.c=957=static const struct snd_kcontrol_new control_templates[] = {
--
sound/hda/codecs/generic.c-964- .get = snd_hda_mixer_amp_switch_get,
sound/hda/codecs/generic.c:965: .put = hda_gen_mixer_mute_put, /* replaced */
sound/hda/codecs/generic.c-966- .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0),
--
sound/hda/codecs/generic.c-971- .get = hda_gen_bind_mute_get,
sound/hda/codecs/generic.c:972: .put = hda_gen_bind_mute_put, /* replaced */
sound/hda/codecs/generic.c-973- .private_value = HDA_COMPOSE_AMP_VAL(0, 3, 0, 0),
--
sound/hda/codecs/generic.c=2284=static const struct snd_kcontrol_new indep_hp_ctl = {
--
sound/hda/codecs/generic.c-2288- .get = indep_hp_get,
sound/hda/codecs/generic.c:2289: .put = indep_hp_put,
sound/hda/codecs/generic.c-2290-};
--
sound/hda/codecs/generic.c=2417=static const struct snd_kcontrol_new channel_mode_enum = {
--
sound/hda/codecs/generic.c-2421- .get = ch_mode_get,
sound/hda/codecs/generic.c:2422: .put = ch_mode_put,
sound/hda/codecs/generic.c-2423-};
--
sound/hda/codecs/generic.c=2529=static const struct snd_kcontrol_new loopback_mixing_enum = {
--
sound/hda/codecs/generic.c-2533- .get = loopback_mixing_get,
sound/hda/codecs/generic.c:2534: .put = loopback_mixing_put,
sound/hda/codecs/generic.c-2535-};
--
sound/hda/codecs/generic.c=2691=static const struct snd_kcontrol_new out_jack_mode_enum = {
--
sound/hda/codecs/generic.c-2694- .get = out_jack_mode_get,
sound/hda/codecs/generic.c:2695: .put = out_jack_mode_put,
sound/hda/codecs/generic.c-2696-};
--
sound/hda/codecs/generic.c=2859=static const struct snd_kcontrol_new in_jack_mode_enum = {
--
sound/hda/codecs/generic.c-2862- .get = in_jack_mode_get,
sound/hda/codecs/generic.c:2863: .put = in_jack_mode_put,
sound/hda/codecs/generic.c-2864-};
--
sound/hda/codecs/generic.c=3005=static const struct snd_kcontrol_new hp_mic_jack_mode_enum = {
--
sound/hda/codecs/generic.c-3008- .get = hp_mic_jack_mode_get,
sound/hda/codecs/generic.c:3009: .put = hp_mic_jack_mode_put,
sound/hda/codecs/generic.c-3010-};
--
sound/hda/codecs/generic.c=3441=static const struct snd_kcontrol_new cap_src_temp = {
--
sound/hda/codecs/generic.c-3445- .get = mux_enum_get,
sound/hda/codecs/generic.c:3446: .put = mux_enum_put,
sound/hda/codecs/generic.c-3447-};
--
sound/hda/codecs/generic.c=3500=static const struct snd_kcontrol_new cap_vol_temp = {
--
sound/hda/codecs/generic.c-3507- .get = cap_vol_get,
sound/hda/codecs/generic.c:3508: .put = cap_vol_put,
sound/hda/codecs/generic.c-3509- .tlv = { .c = cap_vol_tlv },
--
sound/hda/codecs/generic.c=3524=static const struct snd_kcontrol_new cap_sw_temp = {
--
sound/hda/codecs/generic.c-3529- .get = cap_sw_get,
sound/hda/codecs/generic.c:3530: .put = cap_sw_put,
sound/hda/codecs/generic.c-3531-};
--
sound/hda/codecs/generic.c=4692=static const struct snd_kcontrol_new automute_mode_enum = {
--
sound/hda/codecs/generic.c-4696- .get = automute_mode_get,
sound/hda/codecs/generic.c:4697: .put = automute_mode_put,
sound/hda/codecs/generic.c-4698-};
--
sound/hda/codecs/realtek/alc268.c=27=static const struct snd_kcontrol_new alc268_beep_mixer[] = {
--
sound/hda/codecs/realtek/alc268.c-34- .get = snd_hda_mixer_amp_switch_get,
sound/hda/codecs/realtek/alc268.c:35: .put = alc268_beep_switch_put,
sound/hda/codecs/realtek/alc268.c-36- .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
--
sound/hda/codecs/si3054.c=95=static int si3054_switch_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/si3054.c-113- .get = si3054_switch_get, \
sound/hda/codecs/si3054.c:114: .put = si3054_switch_put, \
sound/hda/codecs/si3054.c-115- .private_value = PRIVATE_VALUE(reg,mask), \
--
sound/hda/codecs/side-codecs/cs35l41_hda.c=1365=static int cs35l41_create_controls(struct cs35l41_hda *cs35l41)
--
sound/hda/codecs/side-codecs/cs35l41_hda.c-1374- .get = cs35l41_fw_type_ctl_get,
sound/hda/codecs/side-codecs/cs35l41_hda.c:1375: .put = cs35l41_fw_type_ctl_put,
sound/hda/codecs/side-codecs/cs35l41_hda.c-1376- };
--
sound/hda/codecs/side-codecs/cs35l41_hda.c-1381- .get = cs35l41_fw_load_ctl_get,
sound/hda/codecs/side-codecs/cs35l41_hda.c:1382: .put = cs35l41_fw_load_ctl_put,
sound/hda/codecs/side-codecs/cs35l41_hda.c-1383- };
--
sound/hda/codecs/side-codecs/cs35l56_hda.c=356=static void cs35l56_hda_create_controls(struct cs35l56_hda *cs35l56)
--
sound/hda/codecs/side-codecs/cs35l56_hda.c-362- .get = cs35l56_hda_posture_get,
sound/hda/codecs/side-codecs/cs35l56_hda.c:363: .put = cs35l56_hda_posture_put,
sound/hda/codecs/side-codecs/cs35l56_hda.c-364- };
--
sound/hda/codecs/side-codecs/tas2781_hda.h-30- .info = snd_soc_info_volsw, \
sound/hda/codecs/side-codecs/tas2781_hda.h:31: .get = xhandler_get, .put = xhandler_put, \
sound/hda/codecs/side-codecs/tas2781_hda.h-32- .private_value = (unsigned long)&(struct soc_mixer_control) { \
--
sound/hda/codecs/side-codecs/tas2781_hda.h-44- .get = xhandler_get, \
sound/hda/codecs/side-codecs/tas2781_hda.h:45: .put = xhandler_put, \
sound/hda/codecs/side-codecs/tas2781_hda.h-46- .private_value = xdata, \
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c=291=static const struct snd_kcontrol_new tasdevice_prof_ctrl = {
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-295- .get = tasdevice_get_profile_id,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:296: .put = tasdevice_set_profile_id,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-297-};
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c=299=static const struct snd_kcontrol_new tasdevice_dsp_prog_ctrl = {
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-303- .get = tasdevice_program_get,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:304: .put = tasdevice_program_put,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-305-};
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c=307=static const struct snd_kcontrol_new tasdevice_dsp_conf_ctrl = {
--
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-311- .get = tasdevice_config_get,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c:312: .put = tasdevice_config_put,
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c-313-};
--
sound/hda/codecs/side-codecs/tas2781_hda_spi.c=510=static struct snd_kcontrol_new tas2781_prof_ctl = {
--
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-513- .get = tasdevice_get_profile_id,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c:514: .put = tasdevice_set_profile_id,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-515-};
--
sound/hda/codecs/side-codecs/tas2781_hda_spi.c=517=static struct snd_kcontrol_new tas2781_dsp_ctls[] = {
--
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-522- .get = tasdevice_program_get,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c:523: .put = tasdevice_program_put,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-524- },
--
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-529- .get = tasdevice_config_get,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c:530: .put = tasdevice_config_put,
sound/hda/codecs/side-codecs/tas2781_hda_spi.c-531- },
--
sound/hda/codecs/sigmatel.c=576=static int stac_aloopback_put(struct snd_kcontrol *kcontrol,
--
sound/hda/codecs/sigmatel.c-622- .get = stac_aloopback_get, \
sound/hda/codecs/sigmatel.c:623: .put = stac_aloopback_put, \
sound/hda/codecs/sigmatel.c-624- .private_value = verb_read | (verb_write << 16), \
--
sound/hda/codecs/sigmatel.c=880=static const struct snd_kcontrol_new stac_dig_beep_ctrl = {
--
sound/hda/codecs/sigmatel.c-884- .get = stac_dig_beep_switch_get,
sound/hda/codecs/sigmatel.c:885: .put = stac_dig_beep_switch_put,
sound/hda/codecs/sigmatel.c-886-};
--
sound/hda/codecs/sigmatel.c=933=static const struct snd_kcontrol_new stac_smux_mixer = {
--
sound/hda/codecs/sigmatel.c-938- .get = stac_smux_enum_get,
sound/hda/codecs/sigmatel.c:939: .put = stac_smux_enum_put,
sound/hda/codecs/sigmatel.c-940-};
--
sound/hda/codecs/sigmatel.c=2968=static const struct snd_kcontrol_new stac_hp_bass_sw_ctrl = {
--
sound/hda/codecs/sigmatel.c-2971- .get = stac_hp_bass_gpio_get,
sound/hda/codecs/sigmatel.c:2972: .put = stac_hp_bass_gpio_put,
sound/hda/codecs/sigmatel.c-2973-};
--
sound/hda/codecs/via.c=244=static const struct snd_kcontrol_new via_pin_power_ctl_enum = {
--
sound/hda/codecs/via.c-248- .get = via_pin_power_ctl_get,
sound/hda/codecs/via.c:249: .put = via_pin_power_ctl_put,
sound/hda/codecs/via.c-250-};
--
sound/hda/codecs/via.c=463=static const struct snd_kcontrol_new vt1708_jack_detect_ctl = {
--
sound/hda/codecs/via.c-468- .get = vt1708_jack_detect_get,
sound/hda/codecs/via.c:469: .put = vt1708_jack_detect_put,
sound/hda/codecs/via.c-470-};
--
sound/hda/codecs/via.c=817=static const struct snd_kcontrol_new vt1716s_dmic_mixer_sw = {
--
sound/hda/codecs/via.c-823- .get = vt1716s_dmic_get,
sound/hda/codecs/via.c:824: .put = vt1716s_dmic_put,
sound/hda/codecs/via.c-825-};
--
sound/hda/common/codec.c=2348=static const struct snd_kcontrol_new dig_mixes[] = {
--
sound/hda/common/codec.c-2367- .get = snd_hda_spdif_default_get,
sound/hda/common/codec.c:2368: .put = snd_hda_spdif_default_put,
sound/hda/common/codec.c-2369- },
--
sound/hda/common/codec.c-2374- .get = snd_hda_spdif_out_switch_get,
sound/hda/common/codec.c:2375: .put = snd_hda_spdif_out_switch_put,
sound/hda/common/codec.c-2376- },
--
sound/hda/common/codec.c=2548=static const struct snd_kcontrol_new spdif_share_sw = {
--
sound/hda/common/codec.c-2552- .get = spdif_share_sw_get,
sound/hda/common/codec.c:2553: .put = spdif_share_sw_put,
sound/hda/common/codec.c-2554-};
--
sound/hda/common/codec.c=2645=static const struct snd_kcontrol_new dig_in_ctls[] = {
--
sound/hda/common/codec.c-2650- .get = snd_hda_spdif_in_switch_get,
sound/hda/common/codec.c:2651: .put = snd_hda_spdif_in_switch_put,
sound/hda/common/codec.c-2652- },
--
sound/hda/common/hda_local.h-41- .get = snd_hda_mixer_amp_volume_get, \
sound/hda/common/hda_local.h:42: .put = snd_hda_mixer_amp_volume_put, \
sound/hda/common/hda_local.h-43- .tlv = { .c = snd_hda_mixer_amp_tlv }, \
--
sound/hda/common/hda_local.h-63- .get = snd_hda_mixer_amp_switch_get, \
sound/hda/common/hda_local.h:64: .put = snd_hda_mixer_amp_switch_put, \
sound/hda/common/hda_local.h-65- .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) }
--
sound/hda/common/hda_local.h-81- .get = snd_hda_mixer_amp_switch_get_beep, \
sound/hda/common/hda_local.h:82: .put = snd_hda_mixer_amp_switch_put_beep, \
sound/hda/common/hda_local.h-83- .private_value = HDA_COMPOSE_AMP_VAL(nid, channel, xindex, direction) }
--
sound/i2c/cs8427.c=473=static const struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
--
sound/i2c/cs8427.c-503- .get = snd_cs8427_spdif_get,
sound/i2c/cs8427.c:504: .put = snd_cs8427_spdif_put,
sound/i2c/cs8427.c-505- .private_value = 0
--
sound/i2c/cs8427.c-513- .get = snd_cs8427_spdif_get,
sound/i2c/cs8427.c:514: .put = snd_cs8427_spdif_put,
sound/i2c/cs8427.c-515- .private_value = 1
--
sound/i2c/other/ak4113.c=350=static const struct snd_kcontrol_new snd_ak4113_iec958_controls[] = {
--
sound/i2c/other/ak4113.c-459- .get = snd_ak4113_rx_get,
sound/i2c/other/ak4113.c:460: .put = snd_ak4113_rx_put,
sound/i2c/other/ak4113.c-461-}
--
sound/i2c/other/ak4114.c=310=static const struct snd_kcontrol_new snd_ak4114_iec958_controls[] = {
--
sound/i2c/other/ak4114.c-362- .get = snd_ak4114_spdif_playback_get,
sound/i2c/other/ak4114.c:363: .put = snd_ak4114_spdif_playback_put,
sound/i2c/other/ak4114.c-364-},
--
sound/i2c/other/ak4117.c=296=static const struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
--
sound/i2c/other/ak4117.c-393- .get = snd_ak4117_rx_get,
sound/i2c/other/ak4117.c:394: .put = snd_ak4117_rx_put,
sound/i2c/other/ak4117.c-395-}
--
sound/isa/ad1816a/ad1816a_lib.c=660=static int snd_ad1816a_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
--
sound/isa/ad1816a/ad1816a_lib.c-680- .name = xname, .info = snd_ad1816a_info_single, \
sound/isa/ad1816a/ad1816a_lib.c:681: .get = snd_ad1816a_get_single, .put = snd_ad1816a_put_single, \
sound/isa/ad1816a/ad1816a_lib.c-682- .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
--
]
|
| 102/2 |
2026/07/18 00:49 |
llm |
expert |
1m
Model:
Tokens:
input: 98996
output: 31
thoughts: 108
Thoughts: **Investigating Control Interface Logic**
Okay, let's dive into this. I'm taking a look at `sound/usb/mixer.c`, specifically the `usb_feature_unit_ctl_ro` structure. I've noticed that its `.put` function pointer is set to `NULL`. Wait a second, isn't `snd_ctl_led_get` checking for the existence of a `.get` function pointer? And yes, I see now that `usb_feature_unit_ctl_ro` *does* have a `.get` function β specifically, it's assigned `mixer_ctl_feature_get`. Hmmm, interesting. This raises the question: Are there any other control elements in this sound subsystem that have a `NULL` assigned to the `.get` function pointer? Let's quickly search the entire `sound/` directory for any instances of a function pointer assignment like `\.get\s*=\s*NULL` to get a complete picture. This will help identify other potential inconsistencies or areas that need further review.
|
| 103/2 |
2026/07/18 00:50 |
tool |
grepper |
0m
Error:
Args: map[Expression:\.get\s*=\s*NULL PathPrefix:sound/]
Results:
|
| 104/2 |
2026/07/18 00:50 |
llm |
expert |
0m
Model:
Tokens:
input: 99373
output: 38
thoughts: 325
Thoughts: **Debugging a Potentially Uninitialized Control Element**
Okay, so I'm running into a situation where a `.get` function might not be initialized, and that's causing a problem. My initial thought is to trace the flow and see where this might be happening. Let's start by looking at `sound/usb/mixer_scarlett2.c` and specifically the `scarlett2_firmware_version_ctl`. I see it uses `.get = scarlett2_firmware_version_ctl_get`, which looks standard.
Now, I'm starting to think broader and wonder if there are any instances of `snd_kcontrol_new` within the `sound/` directory that are *missing* a `.get` function altogether. That's a classic source of these kinds of bugs. To dig into this quickly, I'm going to leverage `grepper` and search for all occurrences of `struct snd_kcontrol_new` and then, manually check each instance to see if a `.get` function is defined. This should quickly highlight any potential problem cases.
Hold on... I've just had a related thought. I'm recalling `snd_ctl_led_get` being called from `snd_ctl_led_set_state`. Specifically, that code snippet from `snd_ctl_led_set_state`:
```c
list_for_each_entry(lctl, &led->controls, list) {
if (lctl->kctl == kctl && lctl->index_offset == ioff)
found = true;
UPDATE_ROUTE(route, snd_ctl_led_get(lctl));
}
```
...shows that `snd_ctl_led_get` calls `kctl->get(kctl, &value)`. This is a crucial detail because if `kctl->get` is a NULL pointer, the whole thing will crash. So, the question now is, *can* a user accidentally create a `kcontrol` without defining that `.get` function? That's what I really need to get at. To answer this, I'm going to examine `snd_ctl_elem_add` in `sound/core/control.c` to see if there is any safety net for this.
|
| 105/2 |
2026/07/18 00:50 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_elem_add]
Results: map[SourceCode:1690: static int snd_ctl_elem_add(struct snd_ctl_file *file,
1691: struct snd_ctl_elem_info *info, int replace)
1692: {
1693: struct snd_card *card = file->card;
1694: struct snd_kcontrol *kctl;
1695: unsigned int count;
1696: unsigned int access;
1697: long private_size;
1698: size_t alloc_size;
1699: struct user_element *ue;
1700: unsigned int offset;
1701: int err;
1702:
1703: if (!*info->id.name)
1704: return -EINVAL;
1705: if (strnlen(info->id.name, sizeof(info->id.name)) >= sizeof(info->id.name))
1706: return -EINVAL;
1707:
1708: /* Delete a control to replace them if needed. */
1709: if (replace) {
1710: info->id.numid = 0;
1711: err = snd_ctl_remove_user_ctl(file, &info->id);
1712: if (err)
1713: return err;
1714: }
1715:
1716: /* Check the number of elements for this userspace control. */
1717: count = info->owner;
1718: if (count == 0)
1719: count = 1;
1720: if (count > MAX_CONTROL_COUNT)
1721: return -EINVAL;
1722:
1723: /* Arrange access permissions if needed. */
1724: access = info->access;
1725: if (access == 0)
1726: access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
1727: access &= (SNDRV_CTL_ELEM_ACCESS_READWRITE |
1728: SNDRV_CTL_ELEM_ACCESS_INACTIVE |
1729: SNDRV_CTL_ELEM_ACCESS_TLV_WRITE);
1730:
1731: /* In initial state, nothing is available as TLV container. */
1732: if (access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
1733: access |= SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
1734: access |= SNDRV_CTL_ELEM_ACCESS_USER;
1735:
1736: /*
1737: * Check information and calculate the size of data specific to
1738: * this userspace control.
1739: */
1740: /* pass NULL to card for suppressing error messages */
1741: err = snd_ctl_check_elem_info(NULL, info);
1742: if (err < 0)
1743: return err;
1744: /* user-space control doesn't allow zero-size data */
1745: if (info->count < 1)
1746: return -EINVAL;
1747: private_size = value_sizes[info->type] * info->count;
1748: alloc_size = compute_user_elem_size(private_size, count);
1749:
1750: guard(rwsem_write)(&card->controls_rwsem);
1751: if (check_user_elem_overflow(card, alloc_size))
1752: return -ENOMEM;
1753:
1754: /*
1755: * Keep memory object for this userspace control. After passing this
1756: * code block, the instance should be freed by snd_ctl_free_one().
1757: *
1758: * Note that these elements in this control are locked.
1759: */
1760: err = snd_ctl_new(&kctl, count, access, file);
1761: if (err < 0)
1762: return err;
1763: memcpy(&kctl->id, &info->id, sizeof(kctl->id));
1764: ue = kzalloc(alloc_size, GFP_KERNEL);
1765: if (!ue) {
1766: kfree(kctl);
1767: return -ENOMEM;
1768: }
1769: kctl->private_data = ue;
1770: kctl->private_free = snd_ctl_elem_user_free;
1771:
1772: // increment the allocated size; decremented again at private_free.
1773: card->user_ctl_alloc_size += alloc_size;
1774:
1775: /* Set private data for this userspace control. */
1776: ue->card = card;
1777: ue->info = *info;
1778: ue->info.access = 0;
1779: ue->elem_data = (char *)ue + sizeof(*ue);
1780: ue->elem_data_size = private_size;
1781: if (ue->info.type == SNDRV_CTL_ELEM_TYPE_ENUMERATED) {
1782: err = snd_ctl_elem_init_enum_names(ue);
1783: if (err < 0) {
1784: snd_ctl_free_one(kctl);
1785: return err;
1786: }
1787: }
1788:
1789: /* Set callback functions. */
1790: if (info->type == SNDRV_CTL_ELEM_TYPE_ENUMERATED)
1791: kctl->info = snd_ctl_elem_user_enum_info;
1792: else
1793: kctl->info = snd_ctl_elem_user_info;
1794: if (access & SNDRV_CTL_ELEM_ACCESS_READ)
1795: kctl->get = snd_ctl_elem_user_get;
1796: if (access & SNDRV_CTL_ELEM_ACCESS_WRITE)
1797: kctl->put = snd_ctl_elem_user_put;
1798: if (access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
1799: kctl->tlv.c = snd_ctl_elem_user_tlv;
1800:
1801: /* This function manage to free the instance on failure. */
1802: err = __snd_ctl_add_replace(card, kctl, CTL_ADD_EXCLUSIVE);
1803: if (err < 0) {
1804: snd_ctl_free_one(kctl);
1805: return err;
1806: }
1807: offset = snd_ctl_get_ioff(kctl, &info->id);
1808: snd_ctl_build_ioff(&info->id, kctl, offset);
1809: /*
1810: * Here we cannot fill any field for the number of elements added by
1811: * this operation because there're no specific fields. The usage of
1812: * 'owner' field for this purpose may cause any bugs to userspace
1813: * applications because the field originally means PID of a process
1814: * which locks the element.
1815: */
1816: return 0;
1817: }
SourceFile:sound/core/control.c]
|
| 106/2 |
2026/07/18 00:50 |
llm |
expert |
0m
Model:
Tokens:
input: 102310
output: 35
thoughts: 385
Thoughts: **Analyzing Control Element Access in ALSA**
Okay, let's break this down. I'm looking at how user-defined controls are added within `snd_ctl_elem_add`. Specifically, the assignment of `get` and `put` handlers to the kernel control (`kctl`). The key part is:
```c
if (access & SNDRV_CTL_ELEM_ACCESS_READ)
kctl->get = snd_ctl_elem_user_get;
if (access & SNDRV_CTL_ELEM_ACCESS_WRITE)
kctl->put = snd_ctl_elem_user_put;
```
Here's the problem that immediately jumps out at me: if the `access` flags don't include `SNDRV_CTL_ELEM_ACCESS_READ`, then `kctl->get` remains NULL! That's a potential vulnerability, or at least unexpected behavior. Can a user *legitimately* create a control element that's write-only, without a read function?
Now, let's dig a bit deeper into how `access` is determined:
```c
access = info->access;
if (access == 0)
access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
access &= (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_INACTIVE |
SNDRV_CTL_ELEM_ACCESS_TLV_WRITE);
```
Okay, `info->access` is the initial value. If it's zero, we default to `SNDRV_CTL_ELEM_ACCESS_READWRITE`. But the crucial part is the bitwise AND: this restricts the `access` flags to `READWRITE`, `INACTIVE`, and `TLV_WRITE`. This seems like a sanity check, which is good.
But wait, `SNDRV_CTL_ELEM_ACCESS_READWRITE` is itself `(SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)`. That brings us back to the original question!
Suppose `info->access` is *only* `SNDRV_CTL_ELEM_ACCESS_WRITE`. The logic unfolds as follows:
1. `access` is set to `SNDRV_CTL_ELEM_ACCESS_WRITE`.
2. `access` is bitwise ANDed with (`SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE | SNDRV_CTL_ELEM_ACCESS_TLV_WRITE`). Because the `SNDRV_CTL_ELEM_ACCESS_READWRITE` bit is set in the mask, `access` remains `SNDRV_CTL_ELEM_ACCESS_WRITE`.
3. The `if (access & SNDRV_CTL_ELEM_ACCESS_READ)` statement becomes false, because the read flag is not set. Therefore, `kctl->get` will remain NULL.
So, in the scenario that the user creates a control that is *only* write-only, the `get` handler will indeed be NULL. I'm going to want to verify the implications of a NULL `get` handler when a read is attempted. I'd better check where `SNDRV_CTL_ELEM_ACCESS_WRITE` is used and consider the ramifications of an absent `get` handler in those contexts.
|
| 107/2 |
2026/07/18 00:50 |
tool |
grepper |
0m
Args: map[Expression:#define SNDRV_CTL_ELEM_ACCESS_WRITE PathPrefix:include/]
Results: map[Output:include/uapi/sound/asound.h=1085=typedef int __bitwise snd_ctl_elem_iface_t;
--
include/uapi/sound/asound.h-1095-#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
include/uapi/sound/asound.h:1096:#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
include/uapi/sound/asound.h-1097-#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
]
|
| 108/2 |
2026/07/18 00:50 |
llm |
expert |
0m
Model:
Tokens:
input: 103673
output: 51
thoughts: 357
Thoughts: **My Analysis of the Sound Control Vulnerability**
Okay, so I've been digging into this, and here's what I've got so far. A user, cleverly, can create a custom control element, and they can set the `access` to `SNDRV_CTL_ELEM_ACCESS_WRITE`βclever because with write-only access, the `kctl->get` function pointer will be `NULL`. Bingo!
The potential for a crash is there. The user then writes a specific ID of that crafted control to the `/sys/class/sound/ctl-led/.../attach` path. That's the trigger.
But wait, hold on, there's a check in `snd_ctl_led_set_id`:
```c
vd = &kctl->vd[ioff];
access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
if (access != 0 && access != group_to_access(group))
return -EXDEV;
new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
if (set)
new_access |= group_to_access(group);
if (new_access != vd->access) {
vd->access = new_access;
snd_ctl_led_notify(card, SNDRV_CTL_EVENT_MASK_INFO, kctl, ioff);
}
```
This *should* block it, right? It looks like it checks if the control's access is compatible with LED operation. If it's not, it returns `-EXDEV`. However, even if that's all true, the `snd_ctl_led_notify` function is going to be called, which, ultimately, calls `snd_ctl_led_set_state`. And *that* calls `snd_ctl_led_get`. Inside `snd_ctl_led_get` there's a call to `kctl->get(kctl, &value)`. Since we've carefully constructed `kctl` to have a `NULL` `get` function, that's where the kernel should crash.
Now I need to verify: can an unprivileged user even *create* these user-defined controls? I'll have to trace the calls to `snd_ctl_elem_add`, starting from `snd_ctl_ioctl`. I suspect the answer is yes, given the nature of the vulnerability.
|
| 109/2 |
2026/07/18 00:51 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control.c IncludeSnippetLines:0 Name:snd_ctl_elem_add SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_elem_add_user SourceFile:sound/core/control.c SourceLine:1827]] TruncatedOutput:false]
|
| 110/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 104704
output: 40
thoughts: 21
Thoughts: Here's a summary of my understanding, framed as my own thoughts:
**Dissecting the `snd_ctl_ioctl` Flow**
Okay, so I'm looking at the control interface in ALSA, and the key thing here is the connection between `snd_ctl_elem_add_user` and `snd_ctl_ioctl`. It's pretty clear: `snd_ctl_elem_add_user` gets called *from* within `snd_ctl_ioctl`. That immediately tells me a few things. First, `snd_ctl_ioctl` is the primary entry point for control operations at the user level, the system call interface, which is pretty much what I'd expect. Second, `snd_ctl_elem_add_user` is handling the specifics of actually *adding* an element to the control interface. It means the `ioctl` is responsible for handling the overall structure of the command and calls the element specific function as a sub-routine. So, whenever a user-space application wants to add a new control element using an ioctl request, the kernelβs handling happens with `snd_ctl_ioctl` β which will then call `snd_ctl_elem_add_user` to handle this particular task. This is the common pattern with `ioctl` requests, breaking the tasks into manageable pieces within the kernel. It seems a sensible design. I'll need to dig deeper into the data structures passed between them, but the overall architecture is immediately apparent.
|
| 111/2 |
2026/07/18 00:51 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_elem_add_user]
Results: map[SourceCode:1819: static int snd_ctl_elem_add_user(struct snd_ctl_file *file,
1820: struct snd_ctl_elem_info __user *_info, int replace)
1821: {
1822: struct snd_ctl_elem_info info;
1823: int err;
1824:
1825: if (copy_from_user(&info, _info, sizeof(info)))
1826: return -EFAULT;
1827: err = snd_ctl_elem_add(file, &info, replace);
1828: if (err < 0)
1829: return err;
1830: if (copy_to_user(_info, &info, sizeof(info))) {
1831: snd_ctl_remove_user_ctl(file, &info.id);
1832: return -EFAULT;
1833: }
1834:
1835: return 0;
1836: }
SourceFile:sound/core/control.c]
|
| 112/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 105381
output: 53
thoughts: 22
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience, presented in the first person:
**Navigating the Sound Control Labyrinth**
Alright, so I'm digging into the ALSA sound control code, and I'm following the flow... it's clear that `snd_ctl_elem_add_user` is a key function here. Now, where is it called from? Aha! It's invoked within `snd_ctl_ioctl`. Which means that every single sound control operation that is intended for userspace access somehow flows through the `ioctl` interface, and that in turn handles and passes on to this very function. That gives me a critical insight.
I can see that `snd_ctl_ioctl` serves as the gatekeeper for user-space control element additions. It means any user interaction involving sound control elements will inevitably pass through `snd_ctl_ioctl` on its way to `snd_ctl_elem_add_user`. I'll have to keep this link in mind as I analyze the security implications of user-provided control elements. The `ioctl` path is going to be my primary focus. I bet I will find more interesting functions connected to these.
|
| 113/2 |
2026/07/18 00:51 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control.c IncludeSnippetLines:0 Name:snd_ctl_elem_add_user SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_ioctl SourceFile:sound/core/control.c SourceLine:2006] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_ioctl SourceFile:sound/core/control.c SourceLine:2008]] TruncatedOutput:false]
|
| 114/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 105831
output: 36
thoughts: 19
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Diving into snd_ctl_ioctl**
Okay, time to dig into this. I need to take a look at `snd_ctl_ioctl`. Let's zero in around line 2006. That's where I'd expect to find the core handling logic for the control interface ioctls, given my experience with the ALSA sound driver architecture. I'm guessing that's the main entry point for user-space control operations. I want to see how it dispatches to the various control operations, handles errors, and, importantly, where the security checks are performed. I need to refresh my memory on the interactions with the control device and its associated data structures. I'm especially interested in how it validates user-supplied data and prevents potential vulnerabilities, like buffer overflows or format string bugs.
|
| 115/2 |
2026/07/18 00:51 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_ioctl]
Results: map[SourceCode:1975: static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1976: {
1977: struct snd_ctl_file *ctl;
1978: struct snd_card *card;
1979: struct snd_kctl_ioctl *p;
1980: void __user *argp = (void __user *)arg;
1981: int __user *ip = argp;
1982: int err;
1983:
1984: ctl = file->private_data;
1985: card = ctl->card;
1986: if (snd_BUG_ON(!card))
1987: return -ENXIO;
1988: switch (cmd) {
1989: case SNDRV_CTL_IOCTL_PVERSION:
1990: return put_user(SNDRV_CTL_VERSION, ip) ? -EFAULT : 0;
1991: case SNDRV_CTL_IOCTL_CARD_INFO:
1992: return snd_ctl_card_info(card, ctl, cmd, argp);
1993: case SNDRV_CTL_IOCTL_ELEM_LIST:
1994: return snd_ctl_elem_list_user(card, argp);
1995: case SNDRV_CTL_IOCTL_ELEM_INFO:
1996: return snd_ctl_elem_info_user(ctl, argp);
1997: case SNDRV_CTL_IOCTL_ELEM_READ:
1998: return snd_ctl_elem_read_user(card, argp);
1999: case SNDRV_CTL_IOCTL_ELEM_WRITE:
2000: return snd_ctl_elem_write_user(ctl, argp);
2001: case SNDRV_CTL_IOCTL_ELEM_LOCK:
2002: return snd_ctl_elem_lock(ctl, argp);
2003: case SNDRV_CTL_IOCTL_ELEM_UNLOCK:
2004: return snd_ctl_elem_unlock(ctl, argp);
2005: case SNDRV_CTL_IOCTL_ELEM_ADD:
2006: return snd_ctl_elem_add_user(ctl, argp, 0);
2007: case SNDRV_CTL_IOCTL_ELEM_REPLACE:
2008: return snd_ctl_elem_add_user(ctl, argp, 1);
2009: case SNDRV_CTL_IOCTL_ELEM_REMOVE:
2010: return snd_ctl_elem_remove(ctl, argp);
2011: case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS:
2012: return snd_ctl_subscribe_events(ctl, ip);
2013: case SNDRV_CTL_IOCTL_TLV_READ:
2014: err = snd_power_ref_and_wait(card);
2015: if (err < 0)
2016: return err;
2017: scoped_guard(rwsem_read, &card->controls_rwsem)
2018: err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ);
2019: snd_power_unref(card);
2020: return err;
2021: case SNDRV_CTL_IOCTL_TLV_WRITE:
2022: err = snd_power_ref_and_wait(card);
2023: if (err < 0)
2024: return err;
2025: scoped_guard(rwsem_write, &card->controls_rwsem)
2026: err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE);
2027: snd_power_unref(card);
2028: return err;
2029: case SNDRV_CTL_IOCTL_TLV_COMMAND:
2030: err = snd_power_ref_and_wait(card);
2031: if (err < 0)
2032: return err;
2033: scoped_guard(rwsem_write, &card->controls_rwsem)
2034: err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD);
2035: snd_power_unref(card);
2036: return err;
2037: case SNDRV_CTL_IOCTL_POWER:
2038: return -ENOPROTOOPT;
2039: case SNDRV_CTL_IOCTL_POWER_STATE:
2040: return put_user(SNDRV_CTL_POWER_D0, ip) ? -EFAULT : 0;
2041: }
2042:
2043: guard(rwsem_read)(&snd_ioctl_rwsem);
2044: list_for_each_entry(p, &snd_control_ioctls, list) {
2045: err = p->fioctl(card, ctl, cmd, arg);
2046: if (err != -ENOIOCTLCMD)
2047: return err;
2048: }
2049: dev_dbg(card->dev, "unknown ioctl = 0x%x\n", cmd);
2050: return -ENOTTY;
2051: }
SourceFile:sound/core/control.c]
|
| 116/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 107553
output: 49
thoughts: 140
Thoughts: **Investigating a Potential Privilege Escalation**
Okay, so I'm digging into this sound system driver, and a potential vulnerability just popped into my head. It looks like an unprivileged user can open `/dev/snd/controlC0` and call `SNDRV_CTL_IOCTL_ELEM_ADD` to add a custom control element, which is a bit concerning. They can even specify `access = SNDRV_CTL_ELEM_ACCESS_WRITE`, which is where my eyebrows started to raise. This would create a control, and, importantly, it looks like `kctl->get` is set to `NULL` for it. Hmm, that's interesting.
Now, here's where it gets really interesting: they can write to `/sys/class/sound/ctl-led/.../attach` with the ID of this newly created control. The question that's burning in my mind is: can an unprivileged user actually *write* to `/sys/class/sound/ctl-led/.../attach`? That's the crux of this potential exploit. If they can, it could be a significant problem.
My next step is clear. I need to immediately check the permissions of those sysfs files. That's where the answer lies. This could be a blind alley, or I may have just hit the motherlode... time to get cracking on the `stat` calls.
|
| 117/2 |
2026/07/18 00:51 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control_led.c IncludeSnippetLines:0 Name:attach_store SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:dev_attr_attach SourceFile:sound/core/control_led.c SourceLine:621] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:dev_attr_attach SourceFile:sound/core/control_led.c SourceLine:621] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:dev_attr_attach SourceFile:sound/core/control_led.c SourceLine:621]] TruncatedOutput:false]
|
| 118/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 108231
output: 38
thoughts: 11
Thoughts: Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:
**Analyzing `dev_attr_attach`**
Alright, let's take a look at `dev_attr_attach`. It looks like we're connecting a device attribute here. My mind's immediately going to the implications β what's the lifecycle of this attribute? What's the context? Is it static, dynamically added, or something else? I need to understand the underlying infrastructure. Are we talking about the sysfs interface, udev, something more internal? Knowing the framework will drastically change how I approach this. Iβm thinking about potential race conditions or locking issues that could arise when multiple threads or processes might be accessing or modifying this attribute simultaneously, this needs to be guarded against. What happens when the device is detached? How does the system handle attribute removals? I need to check for the proper error handling, making sure memory isnβt leaked if something goes wrong during the attaching process. Letβs consider any implications on driver model, if this is a platform device or some other type of device, that can affect the handling of the attribute. This might involve a deeper dive into the surrounding code and associated data structures to gain a fuller understanding, but it seems there's a good place to start!
|
| 119/2 |
2026/07/18 00:51 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:dev_attr_attach]
Results: map[SourceCode: 621: static DEVICE_ATTR_WO(attach);
SourceFile:sound/core/control_led.c]
|
| 120/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 108607
output: 29
thoughts: 28
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**Diving into Write-Only Attributes**
Right, so we're dealing with `DEVICE_ATTR_WO`. The name tells me it's a "write-only" attribute. My immediate next thought is, let's nail down precisely what that definition entails, because subtle differences in implementation can be crucial. I need to make sure I'm crystal clear on the implications. Let's pull up that definition and clarify it.
|
| 121/2 |
2026/07/18 00:51 |
tool |
grepper |
0m
Args: map[Expression:#define DEVICE_ATTR_WO PathPrefix:include/]
Results: map[Output:include/linux/device.h=147=typedef ssize_t __device_store_handler_const(struct device *dev, const struct device_attribute *attr,
--
include/linux/device.h-310- */
include/linux/device.h:311:#define DEVICE_ATTR_WO(_name) \
include/linux/device.h-312- struct device_attribute dev_attr_##_name = __DEVICE_ATTR_WO(_name)
--
include/linux/device.h-322- */
include/linux/device.h:323:#define DEVICE_ATTR_WO_NAMED(_name, _attrname) \
include/linux/device.h-324- struct device_attribute dev_attr_##_name = { \
]
|
| 122/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 108977
output: 30
thoughts: 12
Thoughts: Here's a summary of my thought process:
**Diving into Device Attributes**
Okay, time to zero in. I need to take a look at `__DEVICE_ATTR_WO`. I know this is likely a crucial macro related to defining a write-only device attribute. My experience suggests this macro will play a significant role in how the kernel handles the interface for a device property. It's likely involved in setting up the attributes that expose write-only values in the sysfs. I need to refresh my understanding of where this macro is defined and what other macros and structures it interacts with, maybe within the device model core or specific driver interfaces. Understanding the definition will illuminate the precise mechanisms behind attribute declaration and handling, especially around any permissions checks or data validation that might be implemented. This is a foundational element for secure and properly controlled device interactions. I'm aiming for a deep dive to ensure I have a complete grasp.
|
| 123/2 |
2026/07/18 00:51 |
tool |
grepper |
0m
Args: map[Expression:#define __DEVICE_ATTR_WO PathPrefix:include/]
Results: map[Output:include/linux/device.h=147=typedef ssize_t __device_store_handler_const(struct device *dev, const struct device_attribute *attr,
--
include/linux/device.h-196-
include/linux/device.h:197:#define __DEVICE_ATTR_WO(_name) \
include/linux/device.h-198- __DEVICE_ATTR(_name, 0200, NULL, _name##_store)
]
|
| 124/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 109336
output: 55
thoughts: 93
Thoughts: **Analyzing Sound LED Control Permissions**
Okay, so the `0200` permission on that `/sys/class/sound/ctl-led/.../attach` file really sticks out. That means only the owner, presumably root, can write to it. A standard unprivileged user is completely locked out of directly controlling the sound LED attach process through that particular avenue. That's good security, assuming it's intended.
Now, hold on a second. I need to think this through completely. Is this the *only* way to get the `set_led_id` function, and by extension `snd_ctl_led_set_id`, to execute? If there's another point of entry, then the direct file permission is less critical. My intuition is that it's important to look beyond just the file system to see how this function is triggered.
Time to dive into the code. I need to track down all the calls to `snd_ctl_led_set_id`. That's the key to finding any alternative access paths. Gotta see if there are any other mechanisms, perhaps through ioctls or some other interface, that might indirectly allow a user to influence the sound LED ID setting, even if they can't directly write to that sysfs file. Let's see what the source code reveals.
|
| 125/2 |
2026/07/18 00:51 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control_led.c IncludeSnippetLines:0 Name:snd_ctl_led_set_id SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:set_led_id SourceFile:sound/core/control_led.c SourceLine:557]] TruncatedOutput:false]
|
| 126/2 |
2026/07/18 00:51 |
llm |
expert |
0m
Model:
Tokens:
input: 109834
output: 53
thoughts: 118
Thoughts: Okay, let's see what I'm thinking here about this LED control system...
**LED ID Assignment and Permissions**
Hmm, this `set_led_id` function is the key. It looks like the only places it's called are within `attach_store` and `detach_store`. Interesting. Both of those seem to be `DEVICE_ATTR_WO` which means writable-only device attributes. Right, that implies that only root can write to those sysfs attributes. So, at least for setting and unsetting those IDs, we have pretty tight security.
But wait... what about `snd_ctl_led_notify`? It is used in `snd_ctl_led_set_id`. That looks fine. But, did I also see it in `snd_ctl_led_sysfs_add`? Let me double-check the references to `snd_ctl_led_notify` again, to be sure. It's best to be thorough, especially when dealing with potentially privileged operations like LED control. I need to make certain this function is called safely in all cases.
|
| 127/2 |
2026/07/18 00:52 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control_led.c IncludeSnippetLines:0 Name:snd_ctl_led_notify SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_register SourceFile:sound/core/control_led.c SourceLine:343] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_set_id SourceFile:sound/core/control_led.c SourceLine:268] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:snd_ctl_led_lops SourceFile:sound/core/control_led.c SourceLine:715]] TruncatedOutput:false]
|
| 128/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 110427
output: 41
thoughts: 13
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Kernel Subsystem Panic - LED Control**
Okay, hold on a second... `snd_ctl_led_lops`... that's the audio control LED operations structure, isn't it? Specifically, it's dealing with the Low-level operations used to control LEDs linked to audio devices within the ALSA subsystem. My immediate thought is, what's triggered this line of thinking? Are we talking about a driver issue, hardware interaction, or perhaps a conflict within the kernel's audio management? Is there an issue with a specific device's LED state? It is important to know which ALSA API is involved. Was it set by userspace or kernel code, or a race condition or deadlock? Need more context, but this keyword is a direct connection to a very specific and often overlooked part of audio driver development, so it is important.
|
| 129/2 |
2026/07/18 00:52 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:snd_ctl_led_lops]
Results: map[SourceCode: 708: /*
709: * Control layer registration
710: */
711: static struct snd_ctl_layer_ops snd_ctl_led_lops = {
712: .module_name = SND_CTL_LAYER_MODULE_LED,
713: .lregister = snd_ctl_led_register,
714: .ldisconnect = snd_ctl_led_disconnect,
715: .lnotify = snd_ctl_led_notify,
716: };
SourceFile:sound/core/control_led.c]
|
| 130/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 110850
output: 46
thoughts: 60
Thoughts: **Delving into the ALSA Control Layer**
Okay, so I see `snd_ctl_led_notify` β interesting, it's registered as the callback function for `lnotify` within the `snd_ctl_layer_ops` structure. This immediately sparks a question in my mind: when *exactly* does this `lnotify` mechanism actually get triggered? I need to understand the control flow. Let's dig in and quickly trace back its execution. My next step is to head over to `sound/core/control.c`, since thatβs where I'd expect to find the implementation of `lnotify`. That should give me the context I need to figure out what's going on.
|
| 131/2 |
2026/07/18 00:52 |
tool |
codesearch-find-references |
0m
Error:
Args: map[ContextFile:sound/core/control.c IncludeSnippetLines:0 Name:lnotify SourceTreePrefix:]
Results: map[References:<nil> TruncatedOutput:false]
|
| 132/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 111128
output: 36
thoughts: 22
Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience:
**Investigating `snd_ctl_notify` in `sound/core/control.c`**
Alright, time to dive in. My initial thought process is pretty straightforward: I need to understand what's happening with `snd_ctl_notify`. Given my familiarity with the ALSA kernel subsystem, I instinctively know where to start looking. The obvious first step is to locate the implementation of that function, and the most logical place to begin that search is within `sound/core/control.c`. It's a key file for ALSA control functionality, and it's practically guaranteed to hold the core logic related to control notifications. From there, I'll assess the surrounding context to understand how the function is used, what data structures it manipulates, and its interactions with the broader ALSA framework. I anticipate that this will be the gateway to understanding the notification mechanism, and probably where the interesting locking and synchronization aspects reside.
|
| 133/2 |
2026/07/18 00:52 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_notify]
Results: map[SourceCode: 146: /**
147: * snd_ctl_notify - Send notification to user-space for a control change
148: * @card: the card to send notification
149: * @mask: the event mask, SNDRV_CTL_EVENT_*
150: * @id: the ctl element id to send notification
151: *
152: * This function adds an event record with the given id and mask, appends
153: * to the list and wakes up the user-space for notification. This can be
154: * called in the atomic context.
155: */
156: void snd_ctl_notify(struct snd_card *card, unsigned int mask,
157: struct snd_ctl_elem_id *id)
158: {
159: struct snd_ctl_file *ctl;
160: struct snd_kctl_event *ev;
161:
162: if (snd_BUG_ON(!card || !id))
163: return;
164: if (card->shutdown)
165: return;
166:
167: guard(read_lock_irqsave)(&card->controls_rwlock);
168: #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
169: card->mixer_oss_change_count++;
170: #endif
171: list_for_each_entry(ctl, &card->ctl_files, list) {
172: if (!ctl->subscribed)
173: continue;
174: scoped_guard(spinlock, &ctl->read_lock) {
175: list_for_each_entry(ev, &ctl->events, list) {
176: if (ev->id.numid == id->numid) {
177: ev->mask |= mask;
178: goto _found;
179: }
180: }
181: ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
182: if (ev) {
183: ev->id = *id;
184: ev->mask = mask;
185: list_add_tail(&ev->list, &ctl->events);
186: } else {
187: dev_err(card->dev, "No memory available to allocate event\n");
188: }
189: _found:
190: wake_up(&ctl->change_sleep);
191: }
192: snd_kill_fasync(ctl->fasync, SIGIO, POLL_IN);
193: }
194: }
SourceFile:sound/core/control.c]
|
| 134/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 112176
output: 26
thoughts: 37
Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, as if they were my own:
**Investigating the `snd_ctl_notify` Implementation**
Hmm, hold on a second...something's not quite right with my mental model of the ALSA control interface. I was under the impression that `snd_ctl_notify` was somehow linked to `lnotify`, but a quick check reveals that's not the case. The signal propagation is clearly different than I was expecting.
Alright, time to dig deeper. I need to understand how the notification mechanism *actually* works, especially in relation to the local notification system. Let me jump into the `sound/core/control.c` file and start by grepping for any instances of `lnotify`. That should show me where that function *is* used, giving me clues to how it might relate to my other, non-local, notification systems.
|
| 135/2 |
2026/07/18 00:52 |
tool |
grepper |
0m
Args: map[Expression:lnotify PathPrefix:sound/core/]
Results: map[Output:sound/core/control.c=207=void snd_ctl_notify_one(struct snd_card *card, unsigned int mask,
--
sound/core/control.c-217- for (lops = snd_ctl_layer; lops; lops = lops->next)
sound/core/control.c:218: lops->lnotify(card, mask, kctl, ioff);
sound/core/control.c-219-}
--
sound/core/control_led.c=711=static struct snd_ctl_layer_ops snd_ctl_led_lops = {
--
sound/core/control_led.c-714- .ldisconnect = snd_ctl_led_disconnect,
sound/core/control_led.c:715: .lnotify = snd_ctl_led_notify,
sound/core/control_led.c-716-};
]
|
| 136/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 109126
output: 38
thoughts: 0
|
| 137/2 |
2026/07/18 00:52 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_notify_one]
Results: map[SourceCode: 197: /**
198: * snd_ctl_notify_one - Send notification to user-space for a control change
199: * @card: the card to send notification
200: * @mask: the event mask, SNDRV_CTL_EVENT_*
201: * @kctl: the pointer with the control instance
202: * @ioff: the additional offset to the control index
203: *
204: * This function calls snd_ctl_notify() and does additional jobs
205: * like LED state changes.
206: */
207: void snd_ctl_notify_one(struct snd_card *card, unsigned int mask,
208: struct snd_kcontrol *kctl, unsigned int ioff)
209: {
210: struct snd_ctl_elem_id id = kctl->id;
211: struct snd_ctl_layer_ops *lops;
212:
213: id.index += ioff;
214: id.numid += ioff;
215: snd_ctl_notify(card, mask, &id);
216: guard(rwsem_read)(&snd_ctl_layer_rwsem);
217: for (lops = snd_ctl_layer; lops; lops = lops->next)
218: lops->lnotify(card, mask, kctl, ioff);
219: }
SourceFile:sound/core/control.c]
|
| 138/2 |
2026/07/18 00:52 |
llm |
expert |
0m
Model:
Tokens:
input: 113136
output: 51
thoughts: 29
Thoughts: Okay, here's my interpretation of that thought process, from an expert's perspective:
**Diving into ALSA Control Notifications**
Alright, let's break this down. My mind is immediately drawn to the connection between `snd_ctl_notify_one` and `lnotify`. This suggests we're dealing with an ALSA control notification mechanism, likely within the Linux kernel sound system. I know `lnotify` is involved in sending notifications, so the core question then becomes: *under what circumstances does `snd_ctl_notify_one` get called?* Is it triggered by control changes, device events, or something else entirely? Understanding the calling context is crucial for tracing the notification path and pinpointing the trigger points. I need to figure out the use-cases and the specific scenarios where a control notification is generated. This will give me a better understanding of how the ALSA control interface works.
|
| 139/2 |
2026/07/18 00:52 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control.c IncludeSnippetLines:0 Name:snd_ctl_notify_one SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__snd_ctl_add_replace SourceFile:sound/core/control.c SourceLine:511] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__snd_ctl_remove SourceFile:sound/core/control.c SourceLine:601] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:notify_spdif_share_sw SourceFile:sound/hda/common/codec.c SourceLine:2560] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:replace_user_tlv SourceFile:sound/core/control.c SourceLine:1595] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_activate_id SourceFile:sound/core/control.c SourceLine:725] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_elem_write SourceFile:sound/core/control.c SourceLine:1385] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__UNIQUE_ID_addressable_snd_ctl_notify_one_840 SourceFile:sound/core/control.c SourceLine:220] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_notify_one SourceFile:sound/core/control.c SourceLine:220] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_notify_one SourceFile:sound/core/control.c SourceLine:220]] TruncatedOutput:false]
|
| 140/2 |
2026/07/18 00:52 |
llm |
expert |
1m
Model:
Tokens:
input: 113940
output: 38
thoughts: 36
Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:
**Connecting the Dots in ALSA: Control Element Updates and Notifications**
Right, so I see a call to `snd_ctl_elem_write`. My brain immediately jumps to the underlying mechanism. Ah, got it! `snd_ctl_elem_write` is firing off a `snd_ctl_notify_one` call. That makes perfect sense; any change to a control element should trigger a notification. Now, I need to understand this better. I need to refresh my memory on `snd_ctl_elem_write` itself and how the notification is triggered within the execution path. Let's delve back into the source, starting with how `snd_ctl_elem_write` handles the specifics of the data write. I want to see how the notification is set up, what conditions trigger it, and what data is being passed in that notification. Are we just sending generic "something changed" alerts, or are there specific event codes involved? It's essential to understand the granularity and the potential for optimization there, especially in performance-critical applications.
|
| 141/2 |
2026/07/18 00:53 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_elem_write]
Results: map[SourceCode:1340: static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file,
1341: struct snd_ctl_elem_value *control)
1342: {
1343: struct snd_kcontrol *kctl;
1344: struct snd_kcontrol_volatile *vd;
1345: unsigned int index_offset;
1346: int result = 0;
1347:
1348: down_write(&card->controls_rwsem);
1349: kctl = snd_ctl_find_id(card, &control->id);
1350: if (kctl == NULL) {
1351: up_write(&card->controls_rwsem);
1352: return -ENOENT;
1353: }
1354:
1355: index_offset = snd_ctl_get_ioff(kctl, &control->id);
1356: vd = &kctl->vd[index_offset];
1357: if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE) || kctl->put == NULL ||
1358: (file && vd->owner && vd->owner != file)) {
1359: up_write(&card->controls_rwsem);
1360: return -EPERM;
1361: }
1362:
1363: snd_ctl_build_ioff(&control->id, kctl, index_offset);
1364: /* validate input values */
1365: if (IS_ENABLED(CONFIG_SND_CTL_INPUT_VALIDATION)) {
1366: struct snd_ctl_elem_info info;
1367:
1368: memset(&info, 0, sizeof(info));
1369: info.id = control->id;
1370: result = __snd_ctl_elem_info(card, kctl, &info, NULL);
1371: if (!result)
1372: result = sanity_check_input_values(card, control, &info,
1373: false);
1374: }
1375: if (!result)
1376: result = snd_ctl_put(card, kctl, control, vd->access);
1377:
1378: if (result < 0) {
1379: up_write(&card->controls_rwsem);
1380: return result;
1381: }
1382:
1383: if (result > 0) {
1384: downgrade_write(&card->controls_rwsem);
1385: snd_ctl_notify_one(card, SNDRV_CTL_EVENT_MASK_VALUE, kctl, index_offset);
1386: up_read(&card->controls_rwsem);
1387: } else {
1388: up_write(&card->controls_rwsem);
1389: }
1390:
1391: return 0;
1392: }
SourceFile:sound/core/control.c]
|
| 142/2 |
2026/07/18 00:53 |
llm |
expert |
0m
Model:
Tokens:
input: 115122
output: 37
thoughts: 279
Thoughts: **My Analysis of LED Control Notification**
Okay, so I'm tracing the path of an LED state change notification after a control value is written to, resulting in `result > 0`. The first thing that jumps out is the call to `snd_ctl_notify_one`. This, in turn, calls `lnotify`, which ultimately resolves to `snd_ctl_led_notify`. This looks like the main function for handling LED-related events.
Now, looking at the code within `snd_ctl_led_notify`, there's a specific block that checks for these event masks: `SNDRV_CTL_EVENT_MASK_ADD` or `SNDRV_CTL_EVENT_MASK_VALUE`. I see that the code then grabs `vd` using the offset, and this is where it gets interesting, with the line `access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;`. Essentially, a bitwise AND operation.
The key here is that if `access` is non-zero after this operation, it calls `snd_ctl_led_set_state`. So, the question is, how does a control *get* `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set in its `vd->access` field? That bitmask is what determines if the control's changes are related to an LED and need further processing. The definition itself of `SNDRV_CTL_ELEM_ACCESS_LED_MASK` is the next piece of the puzzle I need. I need to understand how the access flags are set during control registration or creation to follow this chain completely.
|
| 143/2 |
2026/07/18 00:53 |
tool |
grepper |
0m
Args: map[Expression:#define SNDRV_CTL_ELEM_ACCESS_LED_MASK PathPrefix:include/]
Results: map[Output:include/sound/control.h=20=typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol,
--
include/sound/control.h-36-#define SNDRV_CTL_ELEM_ACCESS_LED_SHIFT 25
include/sound/control.h:37:#define SNDRV_CTL_ELEM_ACCESS_LED_MASK (7<<25) /* kernel three bits - LED group */
include/sound/control.h-38-#define SNDRV_CTL_ELEM_ACCESS_SPK_LED (1<<25) /* kernel speaker (output) LED flag */
]
|
| 144/2 |
2026/07/18 00:53 |
llm |
expert |
0m
Model:
Tokens:
input: 115952
output: 36
thoughts: 593
Thoughts: **Analyzing Control Element Access and LED Masking**
Okay, so I'm looking at how we handle access rights for control elements, specifically concerning bits 25-27. The question is: can a user-defined control have the `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set? My initial thought is to check `snd_ctl_elem_add`. The relevant snippet in the code confirms this:
```c
access = info->access;
if (access == 0)
access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
access &= (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_INACTIVE |
SNDRV_CTL_ELEM_ACCESS_TLV_WRITE);
```
Essentially, `access` gets masked. `SNDRV_CTL_ELEM_ACCESS_READWRITE` is a combination of bits 0 and 1, `SNDRV_CTL_ELEM_ACCESS_INACTIVE` is bit 8, and `SNDRV_CTL_ELEM_ACCESS_TLV_WRITE` is bit 5. This masking operation *clears* bits 25-27, meaning, as far as this function goes, a user-defined control *cannot* directly be created with `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set.
However, that doesn't tell the whole story. I recall `snd_ctl_led_set_id`, which seems to *specifically* set `SNDRV_CTL_ELEM_ACCESS_LED_MASK` on *any* control. The code confirms this:
```c
vd = &kctl->vd[ioff];
access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
if (access != 0 && access != group_to_access(group))
return -EXDEV;
new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
if (set)
new_access |= group_to_access(group);
if (new_access != vd->access) {
vd->access = new_access;
snd_ctl_led_notify(card, SNDRV_CTL_EVENT_MASK_INFO, kctl, ioff);
}
```
So `snd_ctl_led_set_id` can modify the access. This function is called from `set_led_id`, which is, in turn, called from `attach_store` and `detach_store`. But a quick check reveals that `attach_store` and `detach_store` are defined as `DEVICE_ATTR_WO` which means they are only writable by root. So that's out.
The remaining question is: is there *any* other mechanism, besides these root-protected paths, to call `snd_ctl_led_set_id` or directly set `SNDRV_CTL_ELEM_ACCESS_LED_MASK`? I'd better search the `sound/` directory for any other occurrences of `SNDRV_CTL_ELEM_ACCESS_LED_MASK` to be sure.
|
| 145/2 |
2026/07/18 00:53 |
tool |
grepper |
0m
Args: map[Expression:SNDRV_CTL_ELEM_ACCESS_LED_MASK PathPrefix:sound/]
Results: map[Output:sound/core/control.c=267=struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
--
sound/core/control.c-290- SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK |
sound/core/control.c:291: SNDRV_CTL_ELEM_ACCESS_LED_MASK |
sound/core/control.c-292- SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK);
--
sound/core/control.c=1179=static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,
--
sound/core/control.c-1196- info.access &= ~(SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK|
sound/core/control.c:1197: SNDRV_CTL_ELEM_ACCESS_LED_MASK);
sound/core/control.c-1198- if (copy_to_user(_info, &info, sizeof(info)))
--
sound/core/control_led.c=82=static inline unsigned int access_to_group(unsigned int access)
sound/core/control_led.c-83-{
sound/core/control_led.c:84: return ((access & SNDRV_CTL_ELEM_ACCESS_LED_MASK) >>
sound/core/control_led.c-85- SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) - 1;
--
sound/core/control_led.c=216=static void snd_ctl_led_notify(struct snd_card *card, unsigned int mask,
--
sound/core/control_led.c-227- vd = &kctl->vd[ioff];
sound/core/control_led.c:228: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/core/control_led.c-229- access2 = snd_ctl_led_remove(kctl, ioff, access);
--
sound/core/control_led.c-236- vd = &kctl->vd[ioff];
sound/core/control_led.c:237: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/core/control_led.c-238- if (access)
--
sound/core/control_led.c=243=static int snd_ctl_led_set_id(int card_number, struct snd_ctl_elem_id *id,
--
sound/core/control_led.c-259- vd = &kctl->vd[ioff];
sound/core/control_led.c:260: access = vd->access & SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/core/control_led.c-261- if (access != 0 && access != group_to_access(group))
sound/core/control_led.c-262- return -EXDEV;
sound/core/control_led.c:263: new_access = vd->access & ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/core/control_led.c-264- if (set)
--
sound/soc/sof/topology.c=840=static int sof_control_load_volume(struct snd_soc_component *scomp,
--
sound/soc/sof/topology.c-900- SNDRV_CTL_ELEM_ACCESS_SPK_LED;
sound/soc/sof/topology.c:901: scontrol->access &= ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/soc/sof/topology.c-902- scontrol->access |= mask;
sound/soc/sof/topology.c:903: kc->access &= ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
sound/soc/sof/topology.c-904- kc->access |= mask;
]
|
| 146/2 |
2026/07/18 00:53 |
llm |
expert |
0m
Model:
Tokens:
input: 118330
output: 40
thoughts: 1255
Thoughts: **Analyzing the `snd_ctl_led_get` Bug**
Okay, so I'm looking at this bug report. It seems that `sound/soc/sof/topology.c` can set `SNDRV_CTL_ELEM_ACCESS_LED_MASK`. My initial thought was that this only applied to SOF topology, which is loaded from firmware or user space. However, the call trace points directly to `snd_ctl_led_get` being the culprit. Let me break this down.
The call trace indicates the bug is triggered by writing to a sysfs file. `sysfs_kf_write` calls `dev_attr_store`, which leads to `set_led_id`. This `set_led_id` function is called from `attach_store` or `detach_store` that uses `DEVICE_ATTR_WO`. This implies it's a sysfs write-only attribute. Now, I remember those files have `0200` permissions. That means only root can write to them.
Could an unprivileged user somehow write to this sysfs file? Normally, no. Sysfs is mounted with the `sysfs` filesystem, and root owns the files. The only way around this would be a udev rule that changes the ownership or permissions of `/sys/class/sound/ctl-led/.../attach`. But usually, `/sys/class/sound/ctl-led` isn't accessible to unprivileged users anyway.
Aha, but wait! The report mentions syzkaller is running as root (`UID: 0 PID: 12845`). So, it *can* write to sysfs. That clears that up. The next question is, is this a path that could be taken by an unprivileged user? No, because it requires writing to a root-owned sysfs file. Could it be a user namespace issue? No, because sysfs is not fully mountable in unprivileged user namespaces and even if it were, the files are owned by the global root. The uid in a user namespace is not the same. It's not a network namespace issue either, since this is sound.
Let's double-check how `snd_ctl_led_set_id` is reached. It seems the only way is via sysfs through `set_led_id` and then `attach_store` and `detach_store`.
Now, is there any other way `snd_ctl_led_get` could be called with a NULL `kctl->get`? I see `snd_ctl_led_get` is called from `snd_ctl_led_set_state`. That then gets called by `snd_ctl_led_notify`. Interestingly, `snd_ctl_led_notify` is called by `snd_ctl_led_set_id` *and* by `snd_ctl_notify_one` (via `lnotify`). `snd_ctl_notify_one` is called when a control is written to using `snd_ctl_elem_write`.
Okay, if a user-defined control has `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set, writing to it could trigger this whole chain: `snd_ctl_led_notify` -> `snd_ctl_led_set_state` -> `snd_ctl_led_get`. But, I remember that `snd_ctl_elem_add` clears `SNDRV_CTL_ELEM_ACCESS_LED_MASK` from user-defined controls.
But what if a kernel driver *creates* a control with that flag set, but without a `.get` function? That's a possibility. I just need to check if any kernel drivers do this. I'll search for `SNDRV_CTL_ELEM_ACCESS_LED_MASK` in the code, and I see it in `sound/soc/sof/topology.c`. So that's the likely culprit and probably where I should focus further investigation.
|
| 147/2 |
2026/07/18 00:54 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:sound/soc/sof/topology.c Name:sof_control_load_volume]
Results: map[SourceCode: SourceFile:]
|
| 148/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 120501
output: 38
thoughts: 30
Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience:
**Diving into the SOF Topology Code**
Okay, so I need to understand how volume loading works in SOF, and where that `sof_control_load_volume` function lives. Right, it's not buried deep in some driver-specific code, it's actually in `sound/soc/sof/topology.c`. That makes sense; it's probably part of the core topology management. Excellent, that's where I need to start. Time to pull up that file and get reading; I need to understand how the volume control is integrated within the SOF architecture. This function is likely the key to tracing the path of audio configuration.
|
| 149/2 |
2026/07/18 00:54 |
tool |
read-file |
0m
Args: map[File:sound/soc/sof/topology.c FirstLine:840 LineCount:100]
Results: map[Contents: 840: static int sof_control_load_volume(struct snd_soc_component *scomp,
841: struct snd_sof_control *scontrol,
842: struct snd_kcontrol_new *kc,
843: struct snd_soc_tplg_ctl_hdr *hdr)
844: {
845: struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
846: struct snd_soc_tplg_mixer_control *mc =
847: container_of(hdr, struct snd_soc_tplg_mixer_control, hdr);
848: int tlv[SOF_TLV_ITEMS];
849: unsigned int mask;
850: int ret;
851:
852: /* validate topology data */
853: if (le32_to_cpu(mc->num_channels) > SND_SOC_TPLG_MAX_CHAN)
854: return -EINVAL;
855:
856: /*
857: * If control has more than 2 channels we need to override the info. This is because even if
858: * ASoC layer has defined topology's max channel count to SND_SOC_TPLG_MAX_CHAN = 8, the
859: * pre-defined dapm control types (and related functions) creating the actual control
860: * restrict the channels only to mono or stereo.
861: */
862: if (le32_to_cpu(mc->num_channels) > 2)
863: kc->info = snd_sof_volume_info;
864:
865: scontrol->comp_id = sdev->next_comp_id;
866: scontrol->min_volume_step = le32_to_cpu(mc->min);
867: scontrol->max_volume_step = le32_to_cpu(mc->max);
868: scontrol->num_channels = le32_to_cpu(mc->num_channels);
869:
870: scontrol->max = le32_to_cpu(mc->max);
871: if (le32_to_cpu(mc->max) == 1)
872: goto skip;
873:
874: /* extract tlv data */
875: if (!kc->tlv.p || get_tlv_data(kc->tlv.p, tlv) < 0) {
876: dev_err(scomp->dev, "error: invalid TLV data\n");
877: return -EINVAL;
878: }
879:
880: /* set up volume table */
881: ret = set_up_volume_table(scontrol, tlv, le32_to_cpu(mc->max) + 1);
882: if (ret < 0) {
883: dev_err(scomp->dev, "error: setting up volume table\n");
884: return ret;
885: }
886:
887: skip:
888: /* set up possible led control from mixer private data */
889: ret = sof_parse_tokens(scomp, &scontrol->led_ctl, led_tokens,
890: ARRAY_SIZE(led_tokens), mc->priv.array,
891: le32_to_cpu(mc->priv.size));
892: if (ret != 0) {
893: dev_err(scomp->dev, "error: parse led tokens failed %u\n",
894: le32_to_cpu(mc->priv.size));
895: goto err;
896: }
897:
898: if (scontrol->led_ctl.use_led) {
899: mask = scontrol->led_ctl.direction ? SNDRV_CTL_ELEM_ACCESS_MIC_LED :
900: SNDRV_CTL_ELEM_ACCESS_SPK_LED;
901: scontrol->access &= ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
902: scontrol->access |= mask;
903: kc->access &= ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
904: kc->access |= mask;
905: sdev->led_present = true;
906: }
907:
908: dev_dbg(scomp->dev, "tplg: load kcontrol index %d chans %d\n",
909: scontrol->comp_id, scontrol->num_channels);
910:
911: return 0;
912:
913: err:
914: if (le32_to_cpu(mc->max) > 1)
915: kfree(scontrol->volume_table);
916:
917: return ret;
918: }
919:
920: static int sof_control_load_enum(struct snd_soc_component *scomp,
921: struct snd_sof_control *scontrol,
922: struct snd_kcontrol_new *kc,
923: struct snd_soc_tplg_ctl_hdr *hdr)
924: {
925: struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
926: struct snd_soc_tplg_enum_control *ec =
927: container_of(hdr, struct snd_soc_tplg_enum_control, hdr);
928:
929: /* validate topology data */
930: if (le32_to_cpu(ec->num_channels) > SND_SOC_TPLG_MAX_CHAN)
931: return -EINVAL;
932:
933: scontrol->comp_id = sdev->next_comp_id;
934: scontrol->num_channels = le32_to_cpu(ec->num_channels);
935:
936: dev_dbg(scomp->dev, "tplg: load kcontrol index %d chans %d comp_id %d\n",
937: scontrol->comp_id, scontrol->num_channels, scontrol->comp_id);
938:
939: return 0;
]
|
| 150/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 122525
output: 46
thoughts: 105
Thoughts: **Analyzing the Volume Control and its Origins**
Okay, so I'm looking at `sof_control_load_volume` and it's setting `SNDRV_CTL_ELEM_ACCESS_LED_MASK` on `kc->access`. Right, `kc` is a `struct snd_kcontrol_new`, standard kernel audio control structure. Makes sense. But where is this `kc` coming from? It's originating from ASoC topology loading, which is precisely how these controls are usually set up in SoCs. Now, I need to confirm something crucial: does the ASoC topology loading guarantee that the `kc->get` function pointer isn't null? It's essential that the `get` method is correctly initialized for any control to function. I'll need to double-check that this is handled correctly by the `snd_soc_tplg_kcontrol_bind_io` function. I will examine that function to ensure that no null pointer dereference occurs, because the kernel would crash.
|
| 151/2 |
2026/07/18 00:54 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:sound/soc/soc-topology.c Name:snd_soc_tplg_kcontrol_bind_io]
Results: map[SourceCode: SourceFile:]
|
| 152/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 122915
output: 37
thoughts: 27
Thoughts: Here's my thought process, summarized as you requested:
**Navigating the Audio System Source Code**
Okay, so I need to find the definition or usage of `snd_soc_tplg_kcontrol_bind_io`. Given that it's clearly related to the sound subsystem, my first instinct is to dive into the `sound/soc/` directory within the kernel source. That seems like the logical starting point for anything related to Sound Open Firmware or Sound Class drivers. I'm assuming "tplg" refers to Topology, so I'm expecting something in that general area, specifically within the System On Chip (SoC) framework. The "kcontrol" suggests this function will be somewhere within the kernel control structure, binding to an Input/Output (I/O) setup. Let's start the search there!
|
| 153/2 |
2026/07/18 00:54 |
tool |
grepper |
0m
Error:
Args: map[Expression:snd_soc_tplg_kcontrol_bind_io PathPrefix:sound/soc/]
Results:
|
| 154/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 123168
output: 30
thoughts: 20
Thoughts: Okay, here's my summary, presented as a stream of thought:
**Diving into the SoC Sound Driver Landscape**
Right, let's get down to brass tacks. I need to understand how this audio subsystem is interacting with the hardware. I have a hunch about a particular function, `kcontrol_bind_io`, that might be relevant to the issue I'm investigating. To get a handle on its role, I'll start by searching for its definition and usage within the kernel's sound subsystem. Specifically, I'll focus my search within the `sound/soc/` directory. That's the logical place to start digging, given my understanding of the Sound Open Firmware architecture, and how it is organized by the sound subsystem. I know this will reveal the driver binding logic and other associated operations. This should provide some solid context regarding the inner workings of the driver. From there, I'll be able to better assess the code and see how it fits into the broader picture. Let's see what we find!
|
| 155/2 |
2026/07/18 00:54 |
tool |
grepper |
0m
Args: map[Expression:kcontrol_bind_io PathPrefix:sound/soc/]
Results: map[Output:sound/soc/soc-topology.c=444=static void remove_backend_link(struct snd_soc_component *comp,
--
sound/soc/soc-topology.c-462-/* bind a kcontrol to it's IO handlers */
sound/soc/soc-topology.c:463:static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
sound/soc/soc-topology.c-464- struct snd_kcontrol_new *k,
--
sound/soc/soc-topology.c=641=static int soc_tplg_control_dmixer_create(struct soc_tplg *tplg, struct snd_kcontrol_new *kc)
--
sound/soc/soc-topology.c-681- /* map io handlers */
sound/soc/soc-topology.c:682: err = soc_tplg_kcontrol_bind_io(&mc->hdr, kc, tplg);
sound/soc/soc-topology.c-683- if (err) {
--
sound/soc/soc-topology.c=765=static int soc_tplg_control_denum_create(struct soc_tplg *tplg, struct snd_kcontrol_new *kc)
--
sound/soc/soc-topology.c-823- /* map io handlers */
sound/soc/soc-topology.c:824: err = soc_tplg_kcontrol_bind_io(&ec->hdr, kc, tplg);
sound/soc/soc-topology.c-825- if (err) {
--
sound/soc/soc-topology.c=834=static int soc_tplg_control_dbytes_create(struct soc_tplg *tplg, struct snd_kcontrol_new *kc)
--
sound/soc/soc-topology.c-864- /* map standard io handlers and check for external handlers */
sound/soc/soc-topology.c:865: err = soc_tplg_kcontrol_bind_io(&be->hdr, kc, tplg);
sound/soc/soc-topology.c-866- if (err) {
]
|
| 156/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 123984
output: 44
thoughts: 0
|
| 157/2 |
2026/07/18 00:54 |
tool |
codesearch-definition-source |
0m
Error:
Args: map[ContextFile:sound/soc/soc-topology.c Name:soc_tplg_kcontrol_bind_io]
Results: map[SourceCode: SourceFile:]
|
| 158/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 124049
output: 37
thoughts: 22
Thoughts: Here's my take on the thought process, as requested:
**Diving into `soc-topology.c`**
Alright, let's get down to brass tacks. I need to understand something specific about the SoC topology handling, and the likely place to find that code is within the `sound/soc` directory. I'm going to jump into `soc-topology.c` β a logical place for the core architecture implementation, and I suspect the answer I'm looking for might be around the `463` line. It's a targeted investigation, focusing my attention on a specific section of code that I anticipate will hold the key to the concept I'm wrestling with. Let's see what we can uncover!
|
| 159/2 |
2026/07/18 00:54 |
tool |
read-file |
0m
Args: map[File:sound/soc/soc-topology.c FirstLine:463 LineCount:50]
Results: map[Contents: 463: static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
464: struct snd_kcontrol_new *k,
465: const struct soc_tplg *tplg)
466: {
467: const struct snd_soc_tplg_kcontrol_ops *ops;
468: const struct snd_soc_tplg_bytes_ext_ops *ext_ops;
469: int num_ops, i;
470:
471: if (le32_to_cpu(hdr->ops.info) == SND_SOC_TPLG_CTL_BYTES
472: && k->iface & SNDRV_CTL_ELEM_IFACE_MIXER
473: && (k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ
474: || k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
475: && k->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
476: struct soc_bytes_ext *sbe;
477: struct snd_soc_tplg_bytes_control *be;
478:
479: sbe = (struct soc_bytes_ext *)k->private_value;
480: be = container_of(hdr, struct snd_soc_tplg_bytes_control, hdr);
481:
482: /* TLV bytes controls need standard kcontrol info handler,
483: * TLV callback and extended put/get handlers.
484: */
485: k->info = snd_soc_bytes_info_ext;
486: k->tlv.c = snd_soc_bytes_tlv_callback;
487:
488: /*
489: * When a topology-based implementation abuses the
490: * control interface and uses bytes_ext controls of
491: * more than 512 bytes, we need to disable the size
492: * checks, otherwise accesses to such controls will
493: * return an -EINVAL error and prevent the card from
494: * being configured.
495: */
496: if (sbe->max > 512)
497: k->access |= SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK;
498:
499: ext_ops = tplg->bytes_ext_ops;
500: num_ops = tplg->bytes_ext_ops_count;
501: for (i = 0; i < num_ops; i++) {
502: if (!sbe->put &&
503: ext_ops[i].id == le32_to_cpu(be->ext_ops.put))
504: sbe->put = ext_ops[i].put;
505: if (!sbe->get &&
506: ext_ops[i].id == le32_to_cpu(be->ext_ops.get))
507: sbe->get = ext_ops[i].get;
508: }
509:
510: if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) && !sbe->get)
511: return -EINVAL;
512: if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) && !sbe->put)
]
|
| 160/2 |
2026/07/18 00:54 |
llm |
expert |
0m
Model:
Tokens:
input: 125230
output: 37
thoughts: 6
Thoughts: Okay, I'm ready. Let's get to it.
***
**My Initial Assessment and Anticipation**
Alright, let's dive in. The instruction is pretty straightforward - I'm supposed to process this text and represent it as my own thought process, in first-person, as though I'm reading it and formulating my understanding. Given my expertise, I anticipate this will be a relatively quick and efficient task. It's about distilling the core ideas and internalizing them. Now, let's see what we've got. Let's see what's on the page.
|
| 161/2 |
2026/07/18 00:54 |
tool |
read-file |
0m
Args: map[File:sound/soc/soc-topology.c FirstLine:513 LineCount:50]
Results: map[Contents: 513: return -EINVAL;
514: return 0;
515: }
516:
517: /* try and map vendor specific kcontrol handlers first */
518: ops = tplg->io_ops;
519: num_ops = tplg->io_ops_count;
520: for (i = 0; i < num_ops; i++) {
521:
522: if (k->put == NULL && ops[i].id == le32_to_cpu(hdr->ops.put))
523: k->put = ops[i].put;
524: if (k->get == NULL && ops[i].id == le32_to_cpu(hdr->ops.get))
525: k->get = ops[i].get;
526: if (k->info == NULL && ops[i].id == le32_to_cpu(hdr->ops.info))
527: k->info = ops[i].info;
528: }
529:
530: /* vendor specific handlers found ? */
531: if (k->put && k->get && k->info)
532: return 0;
533:
534: /* none found so try standard kcontrol handlers */
535: ops = io_ops;
536: num_ops = ARRAY_SIZE(io_ops);
537: for (i = 0; i < num_ops; i++) {
538:
539: if (k->put == NULL && ops[i].id == le32_to_cpu(hdr->ops.put))
540: k->put = ops[i].put;
541: if (k->get == NULL && ops[i].id == le32_to_cpu(hdr->ops.get))
542: k->get = ops[i].get;
543: if (k->info == NULL && ops[i].id == le32_to_cpu(hdr->ops.info))
544: k->info = ops[i].info;
545: }
546:
547: /* standard handlers found ? */
548: if (k->put && k->get && k->info)
549: return 0;
550:
551: /* nothing to bind */
552: return -EINVAL;
553: }
554:
555: /* bind a widgets to it's evnt handlers */
556: int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,
557: const struct snd_soc_tplg_widget_events *events,
558: int num_events, u16 event_type)
559: {
560: int i;
561:
562: w->event = NULL;
]
|
| 162/2 |
2026/07/18 00:54 |
llm |
expert |
1m
Model:
Tokens:
input: 126233
output: 38
thoughts: 336
Thoughts: **My Analysis of ASoC Topology Control Handling**
Okay, so `soc_tplg_kcontrol_bind_io` is throwing an `-EINVAL` if the `k->get` function pointer is NULL. I knew that, but let me reconfirm:
```c
/* standard handlers found ? */
if (k->put && k->get && k->info)
return 0;
/* nothing to bind */
return -EINVAL;
```
Ah, it also returns `-EINVAL` if `k->put` is NULL. So, ASoC topology controls *absolutely* require `get`, `put`, and `info` to be defined! This means that code like `sof_control_load_volume` should not be able to create a control where `get` is NULL.
I need to make sure I understand how this plays out in the wider system. Let me check `sound/usb/mixer.c`, specifically `usb_feature_unit_ctl_ro`. This has a `.put = NULL`. I wonder if this code path crashes? No, I see that the `snd_ctl_led_get` function only calls `kctl->get`.
So, are there cases where `get` is NULL?
Let's look at `snd_ctl_elem_write` again.
```c
if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE) || kctl->put == NULL ||
(file && vd->owner && vd->owner != file)) {
up_write(&card->controls_rwsem);
return -EPERM;
}
```
If `kctl->put` is NULL, the write access returns `-EPERM`. What about a read?
|
| 163/2 |
2026/07/18 00:55 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control.c Name:snd_ctl_elem_read]
Results: map[SourceCode:1203: static int snd_ctl_elem_read(struct snd_card *card,
1204: struct snd_ctl_elem_value *control)
1205: {
1206: struct snd_kcontrol *kctl;
1207: struct snd_kcontrol_volatile *vd;
1208: unsigned int index_offset;
1209: struct snd_ctl_elem_info info;
1210: const u32 pattern = 0xdeadbeef;
1211: int ret;
1212:
1213: guard(rwsem_read)(&card->controls_rwsem);
1214: kctl = snd_ctl_find_id(card, &control->id);
1215: if (!kctl)
1216: return -ENOENT;
1217:
1218: index_offset = snd_ctl_get_ioff(kctl, &control->id);
1219: vd = &kctl->vd[index_offset];
1220: if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || !kctl->get)
1221: return -EPERM;
1222:
1223: snd_ctl_build_ioff(&control->id, kctl, index_offset);
1224:
1225: #ifdef CONFIG_SND_CTL_DEBUG
1226: /* info is needed only for validation */
1227: memset(&info, 0, sizeof(info));
1228: info.id = control->id;
1229: ret = __snd_ctl_elem_info(card, kctl, &info, NULL);
1230: if (ret < 0)
1231: return ret;
1232: #endif
1233:
1234: if (!snd_ctl_skip_validation(&info))
1235: fill_remaining_elem_value(control, &info, pattern);
1236: ret = kctl->get(kctl, control);
1237: if (ret < 0)
1238: return ret;
1239: if (!snd_ctl_skip_validation(&info) &&
1240: sanity_check_elem_value(card, control, &info, pattern) < 0) {
1241: dev_err(card->dev,
1242: "control %i:%i:%i:%s:%i: access overflow\n",
1243: control->id.iface, control->id.device,
1244: control->id.subdevice, control->id.name,
1245: control->id.index);
1246: return -EINVAL;
1247: }
1248: return 0;
1249: }
SourceFile:sound/core/control.c]
|
| 164/2 |
2026/07/18 00:55 |
llm |
expert |
0m
Model:
Tokens:
input: 127786
output: 37
thoughts: 617
Thoughts: **Analyzing a Potential Kernel Crash**
Okay, so I'm digging into this audio control code and something's bugging me. Specifically, I'm concerned about a potential null pointer dereference. I've noticed that `kctl->get` can return `-EPERM` if it's invalid, which implies it *could* be NULL under the right conditions. The existing code, `snd_ctl_elem_read`, handles a NULL `kctl->get` gracefully. However, `snd_ctl_led_get` doesn't seem to check for a NULL pointer before dereferencing, which is a problem.
The crux of the issue is this line: `result = kctl->get(kctl, &value);`. If `kctl->get` is NULL, this will cause a crash. Now, how does a control get added to LED controls in the first place? I see two primary routes.
First, someone could write directly to `/sys/class/sound/ctl-led/.../attach` with the control's ID, which requires either root access or explicit sysfs file write permissions. That's a possibility, but let's assume a less direct method.
Second, the control might have `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set in its `vd->access` flags. I recall that `snd_ctl_elem_add` *clears* this LED mask for user-defined controls, so that's not the worry. But what about kernel-defined controls? Is it even *possible* for a kernel driver to create a control that has `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set, *and* simultaneously have `kctl->get == NULL`? That's the real question. I need to figure out if any kernel driver does this.
I remember searching the codebase for `SNDRV_CTL_ELEM_ACCESS_LED_MASK` earlier and found it being used in `sound/core/control.c` (within `snd_ctl_new1` and `snd_ctl_elem_info_user`), `sound/core/control_led.c` (the LED code itself), and `sound/soc/sof/topology.c` (related to SOF topology loading).
Looking at `snd_ctl_new1`, I see it allows the `SNDRV_CTL_ELEM_ACCESS_LED_MASK` to be passed in `ncontrol->access`:
```c
access &= (SNDRV_CTL_ELEM_ACCESS_READWRITE |
SNDRV_CTL_ELEM_ACCESS_VOLATILE |
SNDRV_CTL_ELEM_ACCESS_INACTIVE |
SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE |
SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND |
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK |
SNDRV_CTL_ELEM_ACCESS_LED_MASK |
SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK);
```
So it doesn't *prevent* the mask from being set, just allows it to be passed. Next, I should try searching for `SNDRV_CTL_ELEM_ACCESS_SPK_LED` and `SNDRV_CTL_ELEM_ACCESS_MIC_LED` to see if those flags are used, as that might be a more specific indicator. I need to determine if any existing drivers *actually* create such controls.
|
| 165/2 |
2026/07/18 00:55 |
tool |
grepper |
0m
Args: map[Expression:SNDRV_CTL_ELEM_ACCESS_SPK_LED PathPrefix:sound/]
Results: map[Output:sound/core/control_led.c=15=MODULE_LICENSE("GPL");
sound/core/control_led.c-16-
sound/core/control_led.c:17:#define MAX_LED (((SNDRV_CTL_ELEM_ACCESS_MIC_LED - SNDRV_CTL_ELEM_ACCESS_SPK_LED) \
sound/core/control_led.c-18- >> SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) + 1)
--
sound/core/control_led.c=57=static struct snd_ctl_led snd_ctl_leds[MAX_LED] = {
--
sound/core/control_led.c-59- .name = "speaker",
sound/core/control_led.c:60: .group = (SNDRV_CTL_ELEM_ACCESS_SPK_LED >> SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) - 1,
sound/core/control_led.c-61- .trigger_type = LED_AUDIO_MUTE,
--
sound/hda/codecs/generic.c=5222=int snd_hda_gen_build_controls(struct hda_codec *codec)
--
sound/hda/codecs/generic.c-5268- spec->vmaster_mute_led ?
sound/hda/codecs/generic.c:5269: SNDRV_CTL_ELEM_ACCESS_SPK_LED : 0,
sound/hda/codecs/generic.c-5270- &spec->vmaster_mute.sw_kctl);
--
sound/soc/sof/topology.c=840=static int sof_control_load_volume(struct snd_soc_component *scomp,
--
sound/soc/sof/topology.c-899- mask = scontrol->led_ctl.direction ? SNDRV_CTL_ELEM_ACCESS_MIC_LED :
sound/soc/sof/topology.c:900: SNDRV_CTL_ELEM_ACCESS_SPK_LED;
sound/soc/sof/topology.c-901- scontrol->access &= ~SNDRV_CTL_ELEM_ACCESS_LED_MASK;
]
|
| 166/2 |
2026/07/18 00:55 |
llm |
expert |
0m
Model:
Tokens:
input: 129783
output: 45
thoughts: 64
Thoughts: **Investigating the Sound Driver's Control Element Access**
Okay, so I'm digging into this sound driver code, and I see something interesting: `snd_hda_gen_build_controls` in `sound/hda/codecs/generic.c`. Specifically, it appears to be setting `SNDRV_CTL_ELEM_ACCESS_SPK_LED`. That's a good starting point, so my next step is clear. I need to take a closer look at what `snd_hda_gen_build_controls` is actually doing. Understanding its logic and the context of that flag is crucial to figuring out the driver's behaviour here. Let's see what's happening.
|
| 167/2 |
2026/07/18 00:55 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/hda/codecs/generic.c Name:snd_hda_gen_build_controls]
Results: map[SourceCode:5216: /**
5217: * snd_hda_gen_build_controls - Build controls from the parsed results
5218: * @codec: the HDA codec
5219: *
5220: * Pass this to build_controls hda_codec_ops.
5221: */
5222: int snd_hda_gen_build_controls(struct hda_codec *codec)
5223: {
5224: struct hda_gen_spec *spec = codec->spec;
5225: int err;
5226:
5227: if (spec->kctls.used) {
5228: err = snd_hda_add_new_ctls(codec, spec->kctls.list);
5229: if (err < 0)
5230: return err;
5231: }
5232:
5233: if (spec->multiout.dig_out_nid) {
5234: err = snd_hda_create_dig_out_ctls(codec,
5235: spec->multiout.dig_out_nid,
5236: spec->multiout.dig_out_nid,
5237: spec->pcm_rec[1]->pcm_type);
5238: if (err < 0)
5239: return err;
5240: if (!spec->no_analog) {
5241: err = snd_hda_create_spdif_share_sw(codec,
5242: &spec->multiout);
5243: if (err < 0)
5244: return err;
5245: spec->multiout.share_spdif = 1;
5246: }
5247: }
5248: if (spec->dig_in_nid) {
5249: err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
5250: if (err < 0)
5251: return err;
5252: }
5253:
5254: /* if we have no master control, let's create it */
5255: if (!spec->no_analog && !spec->suppress_vmaster &&
5256: !snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
5257: err = snd_hda_add_vmaster(codec, "Master Playback Volume",
5258: spec->vmaster_tlv, follower_pfxs,
5259: "Playback Volume", 0);
5260: if (err < 0)
5261: return err;
5262: }
5263: if (!spec->no_analog && !spec->suppress_vmaster &&
5264: !snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
5265: err = __snd_hda_add_vmaster(codec, "Master Playback Switch",
5266: NULL, follower_pfxs,
5267: "Playback Switch", true,
5268: spec->vmaster_mute_led ?
5269: SNDRV_CTL_ELEM_ACCESS_SPK_LED : 0,
5270: &spec->vmaster_mute.sw_kctl);
5271: if (err < 0)
5272: return err;
5273: if (spec->vmaster_mute.hook) {
5274: snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute);
5275: snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
5276: }
5277: }
5278:
5279: free_kctls(spec); /* no longer needed */
5280:
5281: err = snd_hda_jack_add_kctls(codec, &spec->autocfg);
5282: if (err < 0)
5283: return err;
5284:
5285: return 0;
5286: }
SourceFile:sound/hda/codecs/generic.c]
|
| 168/2 |
2026/07/18 00:55 |
llm |
expert |
0m
Model:
Tokens:
input: 131233
output: 41
thoughts: 58
Thoughts: Okay, here's my take on those thoughts, framed as my own mental process, given my expertise:
**Vmaster Control Investigation**
Right, so `__snd_hda_add_vmaster`... that's where we conjure up a virtual master control, isn't it? My immediate question is, does this vmaster actually expose a `.get` function like a standard control? I need to know if we can directly read the value or state of this thing. That's fundamental for managing the mixer functionality.
Okay, let's trace back to its origin. The code is calling `__snd_hda_add_vmaster`... let's see, that expands to `snd_ctl_make_virtual_master`, yep, that's it. That's the function where this virtual control is actually constructed. Now I can work backward from there to figure out if it implements retrieval functions.
|
| 169/2 |
2026/07/18 00:55 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/vmaster.c Name:snd_ctl_make_virtual_master]
Results: map[SourceCode: 403: /**
404: * snd_ctl_make_virtual_master - Create a virtual master control
405: * @name: name string of the control element to create
406: * @tlv: optional TLV int array for dB information
407: *
408: * Creates a virtual master control with the given name string.
409: *
410: * After creating a vmaster element, you can add the follower controls
411: * via snd_ctl_add_follower() or snd_ctl_add_follower_uncached().
412: *
413: * The optional argument @tlv can be used to specify the TLV information
414: * for dB scale of the master control. It should be a single element
415: * with #SNDRV_CTL_TLVT_DB_SCALE, #SNDRV_CTL_TLV_DB_MINMAX or
416: * #SNDRV_CTL_TLVT_DB_MINMAX_MUTE type, and should be the max 0dB.
417: *
418: * Return: The created control element, or %NULL for errors (ENOMEM).
419: */
420: struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
421: const unsigned int *tlv)
422: {
423: struct link_master *master;
424: struct snd_kcontrol *kctl;
425: struct snd_kcontrol_new knew;
426:
427: memset(&knew, 0, sizeof(knew));
428: knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
429: knew.name = name;
430: knew.info = master_info;
431:
432: master = kzalloc_obj(*master);
433: if (!master)
434: return NULL;
435: INIT_LIST_HEAD(&master->followers);
436:
437: kctl = snd_ctl_new1(&knew, master);
438: if (!kctl) {
439: kfree(master);
440: return NULL;
441: }
442: /* override some callbacks */
443: kctl->info = master_info;
444: kctl->get = master_get;
445: kctl->put = master_put;
446: kctl->private_free = master_free;
447:
448: /* additional (constant) TLV read */
449: if (tlv) {
450: unsigned int type = tlv[SNDRV_CTL_TLVO_TYPE];
451: if (type == SNDRV_CTL_TLVT_DB_SCALE ||
452: type == SNDRV_CTL_TLVT_DB_MINMAX ||
453: type == SNDRV_CTL_TLVT_DB_MINMAX_MUTE) {
454: kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
455: memcpy(master->tlv, tlv, sizeof(master->tlv));
456: kctl->tlv.p = master->tlv;
457: }
458: }
459:
460: return kctl;
461: }
SourceFile:sound/core/vmaster.c]
|
| 170/2 |
2026/07/18 00:55 |
llm |
expert |
0m
Model:
Tokens:
input: 125498
output: 54
thoughts: 0
|
| 171/2 |
2026/07/18 00:56 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/vmaster.c IncludeSnippetLines:0 Name:snd_ctl_make_virtual_master SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:__snd_hda_add_vmaster SourceFile:sound/hda/common/codec.c SourceLine:1964] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:usb6fire_control_add_virtual SourceFile:sound/usb/6fire/control.c SourceLine:527] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__UNIQUE_ID_addressable_snd_ctl_make_virtual_master_757 SourceFile:sound/core/vmaster.c SourceLine:462] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_make_virtual_master SourceFile:sound/core/vmaster.c SourceLine:462] map[ReferenceKind:takes-address-of ReferencingEntityKind:global_variable ReferencingEntityName:__gendwarfksyms_ptr_snd_ctl_make_virtual_master SourceFile:sound/core/vmaster.c SourceLine:462]] TruncatedOutput:false]
|
| 172/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 132920
output: 32
thoughts: 206
Thoughts: **Analyzing Kernel Control Structures**
Okay, so I'm tracing through this code, trying to understand how these sound control elements are structured. Right now, I'm focused on potential null pointer dereferences. I've just seen that `snd_ctl_make_virtual_master` definitely sets the `.get` function pointer, which means it has a getter function. Excellent.
Now, I'm looking at `sof_control_load_volume`. It looks like it's setting `SNDRV_CTL_ELEM_ACCESS_SPK_LED` on the control's access flags. And I remember seeing that `soc_tplg_kcontrol_bind_io` needs the `.get` member to *not* be NULL. So, that implies this also has a getter function. So far, so good, both examples are setting get.
The question I have now is whether there are any kernel controls out there that have the `SNDRV_CTL_ELEM_ACCESS_LED_MASK` access flag but somehow *lack* a getter function. I'm thinking that's probably not the case, but I have to be certain.
Given the apparent reliance on `.get` and the LED access flags, I'm getting suspicious that the only way to trigger a crash would be by interacting with `/sys/class/sound/ctl-led/.../attach`.
Wait... is there any other place a sysfs file is involved? I should really check `sound/core/control_led.c` for any other `DEVICE_ATTR` definitions. I need to make sure I don't miss something. Let's see if this reveals other code paths.
|
| 173/2 |
2026/07/18 00:56 |
tool |
grepper |
0m
Args: map[Expression:DEVICE_ATTR PathPrefix:sound/core/control_led.c]
Results: map[Output:sound/core/control_led.c=421=static ssize_t brightness_show(struct device *dev,
--
sound/core/control_led.c-429-
sound/core/control_led.c:430:static DEVICE_ATTR_RW(mode);
sound/core/control_led.c:431:static DEVICE_ATTR_RO(brightness);
sound/core/control_led.c-432-
--
sound/core/control_led.c=595=static ssize_t list_show(struct device *dev,
--
sound/core/control_led.c-620-
sound/core/control_led.c:621:static DEVICE_ATTR_WO(attach);
sound/core/control_led.c:622:static DEVICE_ATTR_WO(detach);
sound/core/control_led.c:623:static DEVICE_ATTR_WO(reset);
sound/core/control_led.c:624:static DEVICE_ATTR_RO(list);
sound/core/control_led.c-625-
]
|
| 174/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 133793
output: 55
thoughts: 1353
Thoughts: **Vulnerability Analysis: Sound Control LED Crash**
Okay, let's break this down systematically. My initial thought was that the `attach`, `detach`, and `reset` attributes, all `DEVICE_ATTR_WO`, were the trigger. These, having `0200` permissions, are writeable only by root, which means unprivileged processes are immediately ruled out. The `mode`, `brightness`, and `list` attributes are irrelevant.
Then I checked if there was another entrypoint to `snd_ctl_led_set_id`. Nope, itβs exclusively called through `set_led_id`, which is called through the `attach_store` and `detach_store` functions.
Could a user-defined control offer another vector? What if a control is created with `SNDRV_CTL_ELEM_ACCESS_WRITE`, and the user writes to it? I confirmed that `snd_ctl_elem_add` *clears* the `SNDRV_CTL_ELEM_ACCESS_LED_MASK`. So, writing to it would trigger `snd_ctl_notify_one`, then `snd_ctl_led_notify`. However, `snd_ctl_led_notify` checks the access mask, which, in this scenario, would be zero. Thus, `snd_ctl_led_set_state` *wouldn't* be called. Safe.
Now, here's where it gets interesting. What if root *adds* the user-defined control to the LED via the `attach` file? If root writes to `attach`, `snd_ctl_led_set_id` is called, which then sets the `SNDRV_CTL_ELEM_ACCESS_LED_MASK` on the user-defined control. This triggers `snd_ctl_led_notify` with `SNDRV_CTL_EVENT_MASK_INFO`. This then calls `snd_ctl_led_set_state`, which calls `snd_ctl_led_get` β and, since it's a user defined control, `kctl->get` is NULL. Boom β NULL pointer dereference! This leads to a crash.
So, to exploit this, root must:
1. Create a user-defined control with the correct access rights (effectively read and write but no LED access set).
2. Write the ID of this control to `/sys/class/sound/ctl-led/.../attach`.
The crash occurs due to a null pointer dereference because `kctl->get` is NULL. The crash is directly triggered by the root process writing to the sysfs file.
Since root privileges are required to write to this sysfs file, this means that this is not accessible from unprivileged processes.
Could a process in a user namespace trigger this? Given that sysfs isn't fully mountable in user namespaces and the device attributes are owned by the global root, the answer is no. A process within a user namespace cannot write to `/sys/class/sound/ctl-led/.../attach`.
But, what if root has *already* attached the user-defined control? It crashes IMMEDIATELY during the `attach` operation as `snd_ctl_led_set_id` calls `snd_ctl_led_notify` with `SNDRV_CTL_EVENT_MASK_INFO`, leading to the call stack of `snd_ctl_led_set_state`, `snd_ctl_led_get` with the NULL dereference. Only root's actions can cause this initial crash.
Finally, can any other control end up with the `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set and a NULL `get` function? Checked the kernel controls - nothing. `snd_ctl_elem_add_user` clears the LED mask. The only path is via that `attach` sysfs file.
Let's do a final check on another entry point to `snd_ctl_led_set_state`. `snd_ctl_led_set_state` is also called by `snd_ctl_led_sysfs_add`. Need to keep that in mind.
|
| 175/2 |
2026/07/18 00:56 |
tool |
codesearch-find-references |
0m
Args: map[ContextFile:sound/core/control_led.c IncludeSnippetLines:0 Name:snd_ctl_led_set_state SourceTreePrefix:]
Results: map[References:[map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:mode_store SourceFile:sound/core/control_led.c SourceLine:417] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_notify SourceFile:sound/core/control_led.c SourceLine:225] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_notify SourceFile:sound/core/control_led.c SourceLine:231] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_notify SourceFile:sound/core/control_led.c SourceLine:233] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_notify SourceFile:sound/core/control_led.c SourceLine:239] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_refresh SourceFile:sound/core/control_led.c SourceLine:278] map[ReferenceKind:calls ReferencingEntityKind:function ReferencingEntityName:snd_ctl_led_reset SourceFile:sound/core/control_led.c SourceLine:326]] TruncatedOutput:false]
|
| 176/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 136476
output: 36
thoughts: 9
Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deeply familiar with code and data structures:
**Checking the `mode_store`**
Alright, time to dive in. My immediate thought is, "Let's check the `mode_store`". Itβs a crucial component, undoubtedly, and likely the source of some current behavior or the setting of a crucial operation. I need to understand its current state. I'm visualizing the data structure in my head already - what kind of store is it? Is it a key-value store, a database, an in-memory cache? The specifics will drive my next questions. What is it storing? Is it accessible, what read-write rules apply? The `mode_store` likely holds the current operational mode of a system, an application, or a specific process. Understanding it is paramount to the next steps. I need to be sure before I move forward, so I'm making sure to start here.
|
| 177/2 |
2026/07/18 00:56 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/core/control_led.c Name:mode_store]
Results: map[SourceCode: 392: static ssize_t mode_store(struct device *dev,
393: struct device_attribute *attr,
394: const char *buf, size_t count)
395: {
396: struct snd_ctl_led *led = container_of(dev, struct snd_ctl_led, dev);
397: char _buf[16];
398: size_t l = min(count, sizeof(_buf) - 1);
399: enum snd_ctl_led_mode mode;
400:
401: memcpy(_buf, buf, l);
402: _buf[l] = '\0';
403: if (strstr(_buf, "mute"))
404: mode = MODE_FOLLOW_MUTE;
405: else if (strstr(_buf, "route"))
406: mode = MODE_FOLLOW_ROUTE;
407: else if (strncmp(_buf, "off", 3) == 0 || strncmp(_buf, "0", 1) == 0)
408: mode = MODE_OFF;
409: else if (strncmp(_buf, "on", 2) == 0 || strncmp(_buf, "1", 1) == 0)
410: mode = MODE_ON;
411: else
412: return count;
413:
414: scoped_guard(mutex, &snd_ctl_led_mutex)
415: led->mode = mode;
416:
417: snd_ctl_led_set_state(NULL, group_to_access(led->group), NULL, 0);
418: return count;
419: }
SourceFile:sound/core/control_led.c]
|
| 178/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 137235
output: 39
thoughts: 1305
Thoughts: **Analyzing the Sound Control LED Vulnerability**
Okay, let's break this down. My initial thought is to trace the potential attack vectors for this `snd_ctl_led` issue. `mode_store` and `reset_store` are the key entry points here, both controlled through sysfs in `/sys/class/sound/ctl-led/`. These are root-owned and have restrictive permissions (`0200` or `0644`). Therefore, a standard unprivileged user can't directly trigger this. Good.
But... I need to consider all possibilities. What if a kernel driver creates a control with `get == NULL` *and* `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set? We did a quick check, but let's assume one exists. Even if it's there, a standard write to that control's sysfs entry will just return `-EPERM` because the write function (`kctl->put`) is null.
Okay, let's keep probing. What if `put != NULL` but `get == NULL`? We already checked, but if a write *did* happen, without the `SNDRV_CTL_ELEM_ACCESS_LED_MASK`, it would trigger `snd_ctl_notify_one` which would call `snd_ctl_led_notify`. That function *does* check the access mask. If the mask is zero, it just bails out, so no crash. The only way it would get through is if `SNDRV_CTL_ELEM_ACCESS_LED_MASK` is set.
So, the only way to reach the crash is if a control has `get == NULL` *and* `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set. And this is only settable via the `attach` sysfs file, which requires root privileges. That makes it clear that the bug is triggered by something like syzkaller running as root, and an unprivileged user cannot.
Now, let's look at the bug report. The call trace matches perfectly: sysfs write through the attribute store functions, and ultimately calls `snd_ctl_led_get` which is the root cause. This confirms writing to the `/sys/class/sound/ctl-led/attach` file is the way. Syzkaller's root privileges allow it to do this.
Is there any other path for this code to be accessed? I need to consider all the angles. No, the VFS layer checks permissions during `open()`. A restricted file owned by root cannot be opened for writing by an unprivileged user.
Could a malicious USB device be the source? If a USB device provides a mixer control with `get == NULL` and it gets attached to the LED? Does the system *automatically* attach? I need to check if those flags are automatically set for USB devices, especially `SNDRV_CTL_ELEM_ACCESS_LED_MASK`. I didn't see it explicitly. Let me quickly broaden the search to look for the other LED access masks. Wait, what about `SNDRV_CTL_ELEM_ACCESS_SPK_LED` or `SNDRV_CTL_ELEM_ACCESS_MIC_LED`?
|
| 179/2 |
2026/07/18 00:56 |
tool |
grepper |
0m
Error:
Args: map[Expression:SNDRV_CTL_ELEM_ACCESS_SPK_LED PathPrefix:sound/usb/]
Results:
|
| 180/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 139290
output: 38
thoughts: 19
Thoughts: Okay, here's my attempt at summarizing those thoughts from an expert's perspective, using a first-person perspective:
**Thinking Through Audio Device Control Elements**
Alright, let's see... *SNDRV_CTL_ELEM_ACCESS_MIC_LED*. Hmm, now that I'm considering audio control elements, that specific one is jumping out at me. I'm immediately thinking about its implications within the ALSA framework. What's the best way to interact with that control? Is it read-only? Read/write? Is there an inherent security concern given it's controlling a microphone-related LED? What's the standard access protocol on a per-device basis? Are there potential driver-specific quirks I need to be aware of? I'm picturing it being used to signify when the mic is active, mute, etc. How is the kernel likely to be handling this within its control structure? Itβs important to remember the intricacies of audio hardware on various platforms. Okay, I need to dig into the definition and usage of that control element to get a clearer understanding of its specific functionality and potential use cases. I need to be considering the security implications of its use as well.
|
| 181/2 |
2026/07/18 00:56 |
tool |
grepper |
0m
Error:
Args: map[Expression:SNDRV_CTL_ELEM_ACCESS_MIC_LED PathPrefix:sound/usb/]
Results:
|
| 182/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 139614
output: 36
thoughts: 79
Thoughts: Okay, let me break this down.
**USB LED Mask Conundrum**
Alright, so here's the deal. I was under the impression that USB devices *should* automatically get their LED masks set up. But it doesn't seem to be happening. Curious. Even if that were the case, I went digging in the `sound/usb/` directory, specifically looking for any instances where `get == NULL`, figuring there might be some kind of default behavior I could exploit. Came up empty there. Hmm, that's not right.
Wait a second⦠what if the USB device itself is the culprit? What if it's sending a malformed or corrupted descriptor? If the descriptor is messed up enough, could that somehow lead to the `get` function being set to `NULL`? That's a definite possibility. I should check that.
Now, where was it? Aha, in `sound/usb/mixer.c`, that's where the control creation happens via `build_feature_ctl`. That's where I need to focus my attention. It's time to dig into the descriptor handling and see what's going on with the control build-up process. Something is clearly not right, and I'm guessing the USB descriptor itself might be the key to this mystery.
|
| 183/2 |
2026/07/18 00:56 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer.c Name:build_feature_ctl]
Results: map[SourceCode:2020: static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
2021: u64 ctl_mask, int control,
2022: struct usb_audio_term *iterm, int unitid,
2023: int readonly_mask)
2024: {
2025: struct uac_feature_unit_descriptor *desc = raw_desc;
2026: int nameid = uac_feature_unit_iFeature(desc);
2027:
2028: __build_feature_ctl(state->mixer, state->map, ctl_mask, control,
2029: iterm, &state->oterm, unitid, nameid, readonly_mask);
2030: }
SourceFile:sound/usb/mixer.c]
|
| 184/2 |
2026/07/18 00:56 |
llm |
expert |
0m
Model:
Tokens:
input: 140240
output: 37
thoughts: 12
Thoughts: Okay, here's my summary, presented as a stream of thought:
**Checking `__build_feature_ctl`**
Right, let's dive in. First, I need to remind myself, what was the context again? Ah yes, probably something related to feature control, most likely during a build process. It's almost certainly part of the underlying framework. Let me check the name... `__build_feature_ctl`. Okay, that suggests it's likely a lower-level function, maybe a helper. I should start by looking at its purpose; what exactly is this function designed to control? I'll bet it's something like enabling, disabling, or modifying features during the build based on environment variables, configuration files, or command-line arguments. Let's start with a code search to get a sense of where and how it's used. I'll be looking for references to the function itself and any associated data structures or configuration parameters. I need to understand the logic flow around it, so I can see what influences the outcome of its decision-making. I will review the input it takes and what it returns. Knowing the inputs, the processing logic, and the outputs is critical. Based on the way the function is structured, I should quickly be able to determine its role in the whole process.
|
| 185/2 |
2026/07/18 00:57 |
tool |
codesearch-definition-source |
0m
Args: map[ContextFile:sound/usb/mixer.c Name:__build_feature_ctl]
Results: map[SourceCode:1856: static void __build_feature_ctl(struct usb_mixer_interface *mixer,
1857: const struct usbmix_name_map *imap,
1858: u64 ctl_mask, int control,
1859: struct usb_audio_term *iterm,
1860: struct usb_audio_term *oterm,
1861: int unitid, int nameid, int readonly_mask)
1862: {
1863: const struct usb_feature_control_info *ctl_info;
1864: unsigned int len = 0;
1865: int mapped_name = 0;
1866: struct snd_kcontrol *kctl;
1867: struct usb_mixer_elem_info *cval;
1868: const struct usbmix_name_map *map;
1869: int ret;
1870:
1871: if (control == UAC_FU_GRAPHIC_EQUALIZER) {
1872: /* FIXME: not supported yet */
1873: return;
1874: }
1875:
1876: map = find_map(imap, unitid, control);
1877: if (check_ignored_ctl(map))
1878: return;
1879:
1880: cval = kzalloc_obj(*cval);
1881: if (!cval)
1882: return;
1883: snd_usb_mixer_elem_init_std(&cval->head, mixer, unitid);
1884: cval->control = control;
1885: cval->cmask = ctl_mask;
1886:
1887: ctl_info = get_feature_control_info(control);
1888: if (!ctl_info) {
1889: usb_mixer_elem_info_free(cval);
1890: return;
1891: }
1892: if (mixer->protocol == UAC_VERSION_1)
1893: cval->val_type = ctl_info->type;
1894: else /* UAC_VERSION_2 */
1895: cval->val_type = ctl_info->type_uac2 >= 0 ?
1896: ctl_info->type_uac2 : ctl_info->type;
1897:
1898: if (ctl_mask == 0) {
1899: cval->channels = 1; /* master channel */
1900: cval->master_readonly = readonly_mask;
1901: } else {
1902: int i, c = 0;
1903: for (i = 0; i < MAX_CHANNELS; i++)
1904: if (ctl_mask & BIT(i))
1905: c++;
1906: cval->channels = c;
1907: cval->ch_readonly = readonly_mask;
1908: }
1909:
1910: /*
1911: * If all channels in the mask are marked read-only, make the control
1912: * read-only. snd_usb_set_cur_mix_value() will check the mask again and won't
1913: * issue write commands to read-only channels.
1914: */
1915: if (cval->channels == readonly_mask)
1916: kctl = snd_ctl_new1(&usb_feature_unit_ctl_ro, cval);
1917: else
1918: kctl = snd_ctl_new1(&usb_feature_unit_ctl, cval);
1919:
1920: if (!kctl) {
1921: usb_audio_err(mixer->chip, "cannot malloc kcontrol\n");
1922: usb_mixer_elem_info_free(cval);
1923: return;
1924: }
1925: kctl->private_free = snd_usb_mixer_elem_free;
1926:
1927: len = check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name));
1928: mapped_name = len != 0;
1929: if (!len && nameid)
1930: len = snd_usb_copy_string_desc(mixer->chip, nameid,
1931: kctl->id.name, sizeof(kctl->id.name));
1932:
1933: switch (control) {
1934: case UAC_FU_MUTE:
1935: case UAC_FU_VOLUME:
1936: /*
1937: * determine the control name. the rule is:
1938: * - if a name id is given in descriptor, use it.
1939: * - if the connected input can be determined, then use the name
1940: * of terminal type.
1941: * - if the connected output can be determined, use it.
1942: * - otherwise, anonymous name.
1943: */
1944: if (!len) {
1945: if (iterm)
1946: len = get_term_name(mixer->chip, iterm,
1947: kctl->id.name,
1948: sizeof(kctl->id.name), 1);
1949: if (!len && oterm)
1950: len = get_term_name(mixer->chip, oterm,
1951: kctl->id.name,
1952: sizeof(kctl->id.name), 1);
1953: if (!len)
1954: snprintf(kctl->id.name, sizeof(kctl->id.name),
1955: "Feature %d", unitid);
1956: }
1957:
1958: if (!mapped_name)
1959: check_no_speaker_on_headset(kctl, mixer->chip->card);
1960:
1961: /*
1962: * determine the stream direction:
1963: * if the connected output is USB stream, then it's likely a
1964: * capture stream. otherwise it should be playback (hopefully :)
1965: */
1966: if (!mapped_name && oterm && !(oterm->type >> 16)) {
1967: if ((oterm->type & 0xff00) == 0x0100)
1968: append_ctl_name(kctl, " Capture");
1969: else
1970: append_ctl_name(kctl, " Playback");
1971: }
1972: append_ctl_name(kctl, control == UAC_FU_MUTE ?
1973: " Switch" : " Volume");
1974: break;
1975: default:
1976: if (!len)
1977: strscpy(kctl->id.name, audio_feature_info[control-1].name,
1978: sizeof(kctl->id.name));
1979: break;
1980: }
1981:
1982: /* get min/max values */
1983: ret = get_min_max_with_quirks(cval, 0, kctl);
1984:
1985: /* skip a bogus volume range */
1986: if ((ret < 0 && ret != -EAGAIN) || cval->max <= cval->min) {
1987: usb_audio_dbg(mixer->chip,
1988: "[%d] FU [%s] skipped due to invalid volume\n",
1989: cval->head.id, kctl->id.name);
1990: snd_ctl_free_one(kctl);
1991: return;
1992: }
1993:
1994:
1995: if (control == UAC_FU_VOLUME) {
1996: check_mapped_dB(map, cval);
1997: if (cval->dBmin < cval->dBmax || !cval->initialized) {
1998: kctl->tlv.c = snd_usb_mixer_vol_tlv;
1999: kctl->vd[0].access |=
2000: SNDRV_CTL_ELEM_ACCESS_TLV_READ |
2001: SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
2002: }
2003: }
2004:
2005: snd_usb_mixer_fu_apply_quirk(mixer, cval, unitid, kctl);
2006:
2007: if (check_insane_volume_range(mixer, kctl, cval)) {
2008: usb_audio_warn(mixer->chip, "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
2009: cval->head.id, kctl->id.name, cval->channels,
2010: cval->min, cval->max, cval->res);
2011: } else {
2012: usb_audio_dbg(mixer->chip, "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
2013: cval->head.id, kctl->id.name, cval->channels,
2014: cval->min, cval->max, cval->res);
2015: }
2016:
2017: snd_usb_mixer_add_control(&cval->head, kctl);
2018: }
SourceFile:sound/usb/mixer.c]
|
| 186/2 |
2026/07/18 00:57 |
llm |
expert |
0m
Model:
Tokens:
input: 143273
output: 66
thoughts: 1740
Thoughts: **Analysis of the USB Sound Control Vulnerability**
Okay, let's break this down systematically. The core issue revolves around a NULL pointer dereference, specifically within the sound subsystem when dealing with user-defined controls attached to LEDs.
First, I see that the `usb_feature_unit_ctl_ro` control *does* have a `.get` function. This initial observation is crucial because it helps establish the expected behavior of controls within the USB sound framework. Every other control created in `sound/usb/` also includes a `.get` function. This means that a malicious USB device can't, in and of itself, create a control with a NULL `.get` pointer.
The only vector I've identified for triggering this bug is via the `attach` file within the sysfs interface. Critically, this file is only writable by root. Consequently, the bug is inaccessible to any unprivileged process. User namespaces are also irrelevant. It's *not* exploitable via a malicious USB device (Peripheral Trigger), nor over a network. It's solely a root-privileged issue.
Now, let's assess exploitability and impact:
* **Exploitable:** No. This is a NULL pointer dereference, which *generally* shouldn't be exploitable on modern systems due to `mmap_min_addr`. But, even if there was a way to exploit it, root access is required, making it *not* a security vulnerability.
* **Denial of Service:** Yes, it does crash the kernel. However, root can already crash the kernel in numerous ways.
* **Access from Unprivileged Processes:** No.
* **Access from User Namespaces:** No.
* **VM Guest Trigger:** No.
* **VM Host Trigger:** No.
* **Ethernet Network Trigger:** No.
* **Other Remote Trigger:** No.
* **Peripheral Trigger:** No.
* **Malicious Filesystem Trigger:** No.
I keep thinking... how else can `SNDRV_CTL_ELEM_ACCESS_LED_MASK` be set? I reviewed the code:
* `snd_ctl_elem_add` clears the mask.
* `snd_ctl_led_set_id` sets the mask, but it's reachable only via `attach`, root-only.
* `snd_hda_gen_build_controls` sets `SNDRV_CTL_ELEM_ACCESS_SPK_LED`, but it uses `__snd_hda_add_vmaster` which creates a control with `.get` (not NULL).
* `sof_control_load_volume` sets `SNDRV_CTL_ELEM_ACCESS_SPK_LED`, but it requires the control to have `.get`.
So, there's *no* way to reach this bug without root privileges. This is a NULL pointer dereference caused when root writes to a sysfs file to attach a control (which lacks a `.get` method) to a sound LED. Because of the root requirement, it's *not* a security vulnerability.
Let's verify that `DEVICE_ATTR_WO` is writeable by a group:
`__DEVICE_ATTR(_name, 0200, NULL, _name##_store)`.
`0200` equals `S_IWUSR`, which means write by the owner. The sysfs file's owner is root. So, only root can write.
And what about `snd_ctl_elem_add_user` being called by an unprivileged user?
Yes, `/dev/snd/controlC*` is typically owned by `root:audio` with permissions `0660` or `0664`.
An unprivileged user (in the `audio` group or logged in locally) *can* open `/dev/snd/controlC*` and call `SNDRV_CTL_IOCTL_ELEM_ADD`. This *would* allow them to create a control with `get == NULL`, but they *still* cannot write `/sys/class/sound/ctl-led/.../attach` because its owned by root and has permissions `0200`. They *cannot* trigger the bug.
What about a root script that auto-attaches all controls?
That is highly unlikely. It is a misconfiguration at best.
Does `snd_ctl_led_set_state` have any other trigger for this control?
If the user control is created, then `vd->access` won't have `SNDRV_CTL_ELEM_ACCESS_LED_MASK` set.
If the user writes, then `snd_ctl_notify_one` is called.
`
|
| 187/2 |
2026/07/18 00:57 |
tool |
set-results |
0m
Args: map[DenialOfService:false Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
Results: map[DenialOfService:false Exploitable:false FilesystemTrigger:false NetworkTrigger:false PeripheralTrigger:false RemoteTrigger:false Unprivileged:false UserNamespace:false VMGuestTrigger:false VMHostTrigger:false]
|
| 188/2 |
2026/07/18 00:57 |
llm |
expert |
0m
Model:
Tokens:
input: 146168
output: 716
thoughts: 304
Thoughts: **Final Response: Assessment Complete**
Okay, the analysis is done. Time to synthesize this into a final response. Let's see, the crash itself is unequivocally a NULL pointer dereference in `snd_ctl_led_get` at address `0x0`. The smoking gun is that `kctl->get` is null, which is pretty straightforward to pinpoint.
Now, how does this happen? Well, `snd_ctl_led_get` gets invoked when you go through the sysfs `attach` file mechanism for sound LEDs. So, writing something to the `/sys/class/sound/ctl-led/speaker/attach` file triggers the function, which makes sense.
Alright, the next part is key. A control can end up with a null `kctl->get` if it's a user-defined control created with the `SNDRV_CTL_IOCTL_ELEM_ADD` ioctl *and* the control wasn't created with the `SNDRV_CTL_ELEM_ACCESS_READ` flag. That's a reasonable oversight, given the complexity.
Here's where it gets interesting from a security perspective. While an unprivileged user *could* potentially create this malformed control through `/dev/snd/controlC*`, they can't attach it to the LED. The `attach` file has `DEVICE_ATTR_WO` properties, resulting in write-only permissions controlled by the owner, which is `root`. Therefore, to trigger this particular bug, you'd *need* root privileges. The critical factor is writing the control's ID into the sysfs `attach` file.
Thus, given the requirement for root privileges, it can't be considered a security vulnerability. Root can, after all, crash the system in myriad ways, including more direct methods than this one. So, in summary, it's a crash, but not a security issue, and it's well-understood why.
|
| 189/1 |
2026/07/18 00:57 |
action |
format-explanation |
0m
Results: map[Explanation:Based on the analysis of the kernel bug report and the source code, here is the
assessment of the bug's security impact:
**Bug Mechanism:**
The crash is a NULL pointer dereference (`address: 0000000000000000`) occurring
in `snd_ctl_led_get()` at `sound/core/control_led.c`.
This happens because the function attempts to call the `get` callback of a sound
control (`kctl->get(kctl, &value)`), but the `get` function pointer is `NULL`.
The call trace shows this is triggered by a write to a sysfs file:
`sysfs_kf_write` -> `dev_attr_store` -> `set_led_id` -> `snd_ctl_led_set_id` ->
`snd_ctl_led_notify` -> `snd_ctl_led_set_state` -> `snd_ctl_led_get`.
Specifically, this occurs when a control ID is written to the `attach` sysfs
attribute of a sound LED (e.g., `/sys/class/sound/ctl-led/speaker/attach`).
**How `kctl->get` becomes NULL:**
A sound control can have a `NULL` `get` callback if it is a user-defined control
created via the `SNDRV_CTL_IOCTL_ELEM_ADD` ioctl on `/dev/snd/controlC*`. If the
user creates the control without specifying the `SNDRV_CTL_ELEM_ACCESS_READ`
flag (e.g., a write-only control), the kernel's `snd_ctl_elem_add()` function
leaves `kctl->get` uninitialized (`NULL`).
**Exploitability & Accessibility:**
While an unprivileged user (who is in the `audio` group or has ACL access to the
sound device) can create a user-defined control with a `NULL` `get` callback,
they **cannot** trigger the crash.
To trigger the crash, the malformed control must be attached to the LED
subsystem by writing its ID to the `attach` sysfs file. However, the `attach`
attribute is defined using `DEVICE_ATTR_WO(attach)`, which hardcodes the file
permissions to `0200` (write-only by the file owner). In sysfs, these files are
owned by `root:root`.
Therefore, an unprivileged user cannot write to the `attach` file. The bug can
only be triggered by the `root` user intentionally creating a write-only user
control and then explicitly attaching it to the LED subsystem via sysfs.
Since triggering the bug strictly requires `root` privileges (and root can
already crash or modify the system at will), this is **not a security
vulnerability**. It is a local Denial-of-Service that crosses no privilege
boundaries.
**Conclusion:**
- **Exploitable:** No (NULL pointer dereference requiring root).
- **Accessible From Unprivileged Processes:** No (blocked by sysfs `0200`
root-only permissions).
- **Accessible From User Namespaces:** No (sysfs device attributes are owned by
the global root and cannot be written to from within an unprivileged user
namespace).
- **Remote / Network / Peripheral Trigger:** No.]
|