sound/usb/caiaq/input.c
Source file repositories/reference/linux-study-clean/sound/usb/caiaq/input.c
File Facts
- System
- Linux kernel
- Corpus path
sound/usb/caiaq/input.c- Extension
.c- Size
- 26750 bytes
- Lines
- 850
- Domain
- Driver Families
- Bucket
- sound/usb
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/gfp.hlinux/init.hlinux/usb.hlinux/usb/input.hsound/core.hsound/pcm.hdevice.hinput.h
Detected Declarations
function decode_erpfunction snd_caiaq_input_report_absfunction snd_caiaq_input_read_analogfunction snd_caiaq_input_read_erpfunction snd_caiaq_input_read_iofunction snd_usb_caiaq_tks4_dispatchfunction snd_usb_caiaq_maschine_dispatchfunction snd_usb_caiaq_ep4_reply_dispatchfunction snd_usb_caiaq_input_openfunction snd_usb_caiaq_input_closefunction snd_usb_caiaq_input_dispatchfunction snd_usb_caiaq_input_initfunction snd_usb_caiaq_input_disconnectfunction snd_usb_caiaq_input_free
Annotated Snippet
switch (block_id) {
case 0:
/* buttons */
for (i = 0; i < KONTROLS4_BUTTONS; i++)
input_report_key(cdev->input_dev, KONTROLS4_BUTTON(i),
(buf[4 + (i / 8)] >> (i % 8)) & 1);
break;
case 1:
/* left wheel */
input_report_abs(cdev->input_dev, KONTROLS4_ABS(36), buf[9] | ((buf[8] & 0x3) << 8));
/* right wheel */
input_report_abs(cdev->input_dev, KONTROLS4_ABS(37), buf[13] | ((buf[12] & 0x3) << 8));
/* rotary encoders */
input_report_abs(cdev->input_dev, KONTROLS4_ABS(38), buf[3] & 0xf);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(39), buf[4] >> 4);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(40), buf[4] & 0xf);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(41), buf[5] >> 4);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(42), buf[5] & 0xf);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(43), buf[6] >> 4);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(44), buf[6] & 0xf);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(45), buf[7] >> 4);
input_report_abs(cdev->input_dev, KONTROLS4_ABS(46), buf[7] & 0xf);
break;
case 2:
/* Volume Fader Channel D */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(0), buf, 1);
/* Volume Fader Channel B */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(1), buf, 2);
/* Volume Fader Channel A */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(2), buf, 3);
/* Volume Fader Channel C */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(3), buf, 4);
/* Loop Volume */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(4), buf, 6);
/* Crossfader */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(7), buf, 7);
break;
case 3:
/* Tempo Fader R */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(6), buf, 3);
/* Tempo Fader L */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(5), buf, 4);
/* Mic Volume */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(8), buf, 6);
/* Cue Mix */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(9), buf, 7);
break;
case 4:
/* Wheel distance sensor L */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(10), buf, 1);
/* Wheel distance sensor R */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(11), buf, 2);
/* Channel D EQ - Filter */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(12), buf, 3);
/* Channel D EQ - Low */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(13), buf, 4);
/* Channel D EQ - Mid */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(14), buf, 5);
/* Channel D EQ - Hi */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(15), buf, 6);
/* FX2 - dry/wet */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(16), buf, 7);
break;
case 5:
/* FX2 - 1 */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(17), buf, 1);
/* FX2 - 2 */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(18), buf, 2);
/* FX2 - 3 */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(19), buf, 3);
/* Channel B EQ - Filter */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(20), buf, 4);
/* Channel B EQ - Low */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(21), buf, 5);
/* Channel B EQ - Mid */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(22), buf, 6);
/* Channel B EQ - Hi */
snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(23), buf, 7);
break;
Annotation
- Immediate include surface: `linux/device.h`, `linux/gfp.h`, `linux/init.h`, `linux/usb.h`, `linux/usb/input.h`, `sound/core.h`, `sound/pcm.h`, `device.h`.
- Detected declarations: `function decode_erp`, `function snd_caiaq_input_report_abs`, `function snd_caiaq_input_read_analog`, `function snd_caiaq_input_read_erp`, `function snd_caiaq_input_read_io`, `function snd_usb_caiaq_tks4_dispatch`, `function snd_usb_caiaq_maschine_dispatch`, `function snd_usb_caiaq_ep4_reply_dispatch`, `function snd_usb_caiaq_input_open`, `function snd_usb_caiaq_input_close`.
- Atlas domain: Driver Families / sound/usb.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.