drivers/media/pci/ivtv/ivtv-alsa.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/ivtv/ivtv-alsa.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ivtv/ivtv-alsa.h- Extension
.h- Size
- 1715 bytes
- Lines
- 62
- Domain
- Driver Families
- Bucket
- drivers/media
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct snd_cardstruct snd_ivtv_cardfunction snd_ivtv_lockfunction snd_ivtv_unlock
Annotated Snippet
struct snd_ivtv_card {
struct v4l2_device *v4l2_dev;
struct snd_card *sc;
unsigned int capture_transfer_done;
unsigned int hwptr_done_capture;
struct snd_pcm_substream *capture_pcm_substream;
spinlock_t slock;
};
extern int ivtv_alsa_debug;
/*
* File operations that manipulate the encoder or video or audio subdevices
* need to be serialized. Use the same lock we use for v4l2 file ops.
*/
static inline void snd_ivtv_lock(struct snd_ivtv_card *itvsc)
{
struct ivtv *itv = to_ivtv(itvsc->v4l2_dev);
mutex_lock(&itv->serialize_lock);
}
static inline void snd_ivtv_unlock(struct snd_ivtv_card *itvsc)
{
struct ivtv *itv = to_ivtv(itvsc->v4l2_dev);
mutex_unlock(&itv->serialize_lock);
}
#define IVTV_ALSA_DBGFLG_WARN (1 << 0)
#define IVTV_ALSA_DBGFLG_INFO (1 << 1)
#define IVTV_ALSA_DEBUG(x, type, fmt, args...) \
do { \
if ((x) & ivtv_alsa_debug) \
pr_info("%s-alsa: " type ": " fmt, \
v4l2_dev->name , ## args); \
} while (0)
#define IVTV_ALSA_DEBUG_WARN(fmt, args...) \
IVTV_ALSA_DEBUG(IVTV_ALSA_DBGFLG_WARN, "warning", fmt , ## args)
#define IVTV_ALSA_DEBUG_INFO(fmt, args...) \
IVTV_ALSA_DEBUG(IVTV_ALSA_DBGFLG_INFO, "info", fmt , ## args)
#define IVTV_ALSA_ERR(fmt, args...) \
pr_err("%s-alsa: " fmt, v4l2_dev->name , ## args)
#define IVTV_ALSA_WARN(fmt, args...) \
pr_warn("%s-alsa: " fmt, v4l2_dev->name , ## args)
#define IVTV_ALSA_INFO(fmt, args...) \
pr_info("%s-alsa: " fmt, v4l2_dev->name , ## args)
Annotation
- Detected declarations: `struct snd_card`, `struct snd_ivtv_card`, `function snd_ivtv_lock`, `function snd_ivtv_unlock`.
- Atlas domain: Driver Families / drivers/media.
- 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.