drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
Source file repositories/reference/linux-study-clean/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/vc04_services/bcm2835-audio/bcm2835.h- Extension
.h- Size
- 3110 bytes
- Lines
- 113
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/device.hlinux/raspberrypi/vchiq.hlinux/wait.hsound/core.hsound/pcm.hsound/pcm-indirect.h
Detected Declarations
struct bcm2835_vchi_ctxstruct bcm2835_chipstruct bcm2835_alsa_streamenum snd_bcm2835_routeenum snd_bcm2835_ctrl
Annotated Snippet
struct bcm2835_vchi_ctx {
struct vchiq_instance *instance;
};
/* definition of the chip-specific record */
struct bcm2835_chip {
struct snd_card *card;
struct snd_pcm *pcm;
struct snd_pcm *pcm_spdif;
struct device *dev;
struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS];
int volume;
int dest;
int mute;
unsigned int opened;
unsigned int spdif_status;
struct mutex audio_mutex; /* Serialize chip data access */
struct bcm2835_vchi_ctx *vchi_ctx;
};
struct bcm2835_alsa_stream {
struct bcm2835_chip *chip;
struct snd_pcm_substream *substream;
struct snd_pcm_indirect pcm_indirect;
int draining;
atomic_t pos;
unsigned int period_offset;
unsigned int buffer_size;
unsigned int period_size;
ktime_t interpolate_start;
struct bcm2835_audio_instance *instance;
int idx;
};
int snd_bcm2835_new_pcm(struct bcm2835_chip *chip, const char *name,
int idx, enum snd_bcm2835_route route,
u32 numchannels, bool spdif);
int snd_bcm2835_new_hdmi_ctl(struct bcm2835_chip *chip);
int snd_bcm2835_new_headphones_ctl(struct bcm2835_chip *chip);
int bcm2835_new_vchi_ctx(struct device *dev, struct bcm2835_vchi_ctx *vchi_ctx);
void bcm2835_free_vchi_ctx(struct bcm2835_vchi_ctx *vchi_ctx);
int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_close(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_set_params(struct bcm2835_alsa_stream *alsa_stream,
unsigned int channels, unsigned int samplerate,
unsigned int bps);
int bcm2835_audio_start(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_set_ctls(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
unsigned int count,
void *src);
void bcm2835_playback_fifo(struct bcm2835_alsa_stream *alsa_stream,
unsigned int size);
unsigned int bcm2835_audio_retrieve_buffers(struct bcm2835_alsa_stream *alsa_stream);
#endif /* __SOUND_ARM_BCM2835_H */
Annotation
- Immediate include surface: `linux/device.h`, `linux/raspberrypi/vchiq.h`, `linux/wait.h`, `sound/core.h`, `sound/pcm.h`, `sound/pcm-indirect.h`.
- Detected declarations: `struct bcm2835_vchi_ctx`, `struct bcm2835_chip`, `struct bcm2835_alsa_stream`, `enum snd_bcm2835_route`, `enum snd_bcm2835_ctrl`.
- Atlas domain: Driver Families / drivers/staging.
- 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.