include/sound/mpu401.h
Source file repositories/reference/linux-study-clean/include/sound/mpu401.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/mpu401.h- Extension
.h- Size
- 3905 bytes
- Lines
- 124
- Domain
- Driver Families
- Bucket
- include/sound
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/rawmidi.hlinux/interrupt.h
Detected Declarations
struct snd_mpu401
Annotated Snippet
struct snd_mpu401 {
struct snd_rawmidi *rmidi;
unsigned short hardware; /* MPU401_HW_XXXX */
unsigned int info_flags; /* MPU401_INFO_XXX */
unsigned long port; /* base port of MPU-401 chip */
unsigned long cport; /* port + 1 (usually) */
struct resource *res; /* port resource */
int irq; /* IRQ number of MPU-401 chip */
unsigned long mode; /* MPU401_MODE_XXXX */
int timer_invoked;
int (*open_input) (struct snd_mpu401 * mpu);
void (*close_input) (struct snd_mpu401 * mpu);
int (*open_output) (struct snd_mpu401 * mpu);
void (*close_output) (struct snd_mpu401 * mpu);
void *private_data;
struct snd_rawmidi_substream *substream_input;
struct snd_rawmidi_substream *substream_output;
spinlock_t input_lock;
spinlock_t output_lock;
spinlock_t timer_lock;
struct timer_list timer;
void (*write) (struct snd_mpu401 * mpu, unsigned char data, unsigned long addr);
unsigned char (*read) (struct snd_mpu401 *mpu, unsigned long addr);
};
/* I/O ports */
#define MPU401C(mpu) (mpu)->cport
#define MPU401D(mpu) (mpu)->port
/*
* control register bits
*/
/* read MPU401C() */
#define MPU401_RX_EMPTY 0x80
#define MPU401_TX_FULL 0x40
/* write MPU401C() */
#define MPU401_RESET 0xff
#define MPU401_ENTER_UART 0x3f
/* read MPU401D() */
#define MPU401_ACK 0xfe
/*
*/
irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id);
irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id);
int snd_mpu401_uart_new(struct snd_card *card,
int device,
unsigned short hardware,
unsigned long port,
unsigned int info_flags,
int irq,
struct snd_rawmidi ** rrawmidi);
#endif /* __SOUND_MPU401_H */
Annotation
- Immediate include surface: `sound/rawmidi.h`, `linux/interrupt.h`.
- Detected declarations: `struct snd_mpu401`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.