sound/drivers/pcsp/pcsp_input.c
Source file repositories/reference/linux-study-clean/sound/drivers/pcsp/pcsp_input.c
File Facts
- System
- Linux kernel
- Corpus path
sound/drivers/pcsp/pcsp_input.c- Extension
.c- Size
- 1984 bytes
- Lines
- 104
- Domain
- Driver Families
- Bucket
- sound/drivers
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/input.hlinux/io.hpcsp.hpcsp_input.h
Detected Declarations
function Copyrightfunction pcspkr_stop_soundfunction pcspkr_input_eventfunction pcspkr_input_init
Annotated Snippet
switch (code) {
case SND_BELL:
if (value)
value = 1000;
break;
case SND_TONE:
break;
default:
return -1;
}
break;
default:
return -1;
}
if (value > 20 && value < 32767)
count = PIT_TICK_RATE / value;
pcspkr_do_sound(count);
return 0;
}
int pcspkr_input_init(struct input_dev **rdev, struct device *dev)
{
int err;
struct input_dev *input_dev = devm_input_allocate_device(dev);
if (!input_dev)
return -ENOMEM;
input_dev->name = "PC Speaker";
input_dev->phys = "isa0061/input0";
input_dev->id.bustype = BUS_ISA;
input_dev->id.vendor = 0x001f;
input_dev->id.product = 0x0001;
input_dev->id.version = 0x0100;
input_dev->dev.parent = dev;
input_dev->evbit[0] = BIT(EV_SND);
input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
input_dev->event = pcspkr_input_event;
err = input_register_device(input_dev);
if (err)
return err;
*rdev = input_dev;
return 0;
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/input.h`, `linux/io.h`, `pcsp.h`, `pcsp_input.h`.
- Detected declarations: `function Copyright`, `function pcspkr_stop_sound`, `function pcspkr_input_event`, `function pcspkr_input_init`.
- Atlas domain: Driver Families / sound/drivers.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.