sound/soc/sti/uniperif.h
Source file repositories/reference/linux-study-clean/sound/soc/sti/uniperif.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sti/uniperif.h- Extension
.h- Size
- 49614 bytes
- Lines
- 1418
- Domain
- Driver Families
- Bucket
- sound/soc
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/regmap.hsound/dmaengine_pcm.h
Detected Declarations
struct uniperif_iec958_settingsstruct dai_tdm_slotstruct uniperifstruct sti_uniperiph_daistruct sti_uniperiph_dataenum uniperif_versionenum uniperif_typeenum uniperif_stateenum uniperif_iec958_encoding_modeenum uniperif_word_posfunction sti_uniperiph_get_user_frame_sizefunction sti_uniperiph_get_unip_tdm_frame_size
Annotated Snippet
struct uniperif_iec958_settings {
enum uniperif_iec958_encoding_mode encoding_mode;
struct snd_aes_iec958 iec958;
};
struct dai_tdm_slot {
unsigned int mask;
int slots;
int slot_width;
unsigned int avail_slots;
};
struct uniperif {
/* System information */
enum uniperif_type type;
int underflow_enabled; /* Underflow recovery mode */
struct device *dev;
int id; /* instance value of the uniperipheral IP */
int ver; /* IP version, used by register access macros */
struct regmap_field *clk_sel;
struct regmap_field *valid_sel;
spinlock_t irq_lock; /* use to prevent race condition with IRQ */
/* capabilities */
const struct snd_pcm_hardware *hw;
/* Resources */
struct resource *mem_region;
void __iomem *base;
unsigned long fifo_phys_address;
int irq;
/* Clocks */
struct clk *clk;
int mclk;
int clk_adj;
/* Runtime data */
enum uniperif_state state;
struct snd_pcm_substream *substream;
/* Specific to IEC958 player */
struct uniperif_iec958_settings stream_settings;
struct mutex ctrl_lock; /* For resource updated by stream and controls*/
/*alsa ctrl*/
struct snd_kcontrol_new *snd_ctrls;
int num_ctrls;
/* dai properties */
unsigned int daifmt;
struct dai_tdm_slot tdm_slot;
/* DAI callbacks */
const struct snd_soc_dai_ops *dai_ops;
};
struct sti_uniperiph_dai {
int stream;
struct uniperif *uni;
struct snd_dmaengine_dai_dma_data dma_data;
};
struct sti_uniperiph_data {
struct platform_device *pdev;
struct snd_soc_dai_driver *dai;
struct sti_uniperiph_dai dai_data;
};
static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {
.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID,
.formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 32,
.periods_min = 2,
.periods_max = 10,
.period_bytes_min = 128,
.period_bytes_max = 64 * PAGE_SIZE,
.buffer_bytes_max = 256 * PAGE_SIZE
Annotation
- Immediate include surface: `linux/regmap.h`, `sound/dmaengine_pcm.h`.
- Detected declarations: `struct uniperif_iec958_settings`, `struct dai_tdm_slot`, `struct uniperif`, `struct sti_uniperiph_dai`, `struct sti_uniperiph_data`, `enum uniperif_version`, `enum uniperif_type`, `enum uniperif_state`, `enum uniperif_iec958_encoding_mode`, `enum uniperif_word_pos`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.