sound/soc/sti/sti_uniperif.c
Source file repositories/reference/linux-study-clean/sound/soc/sti/sti_uniperif.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sti/sti_uniperif.c- Extension
.c- Size
- 13301 bytes
- Lines
- 507
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/pinctrl/consumer.hlinux/delay.huniperif.h
Detected Declarations
struct sti_uniperiph_dev_datafunction sti_uniperiph_resetfunction sti_uniperiph_set_tdm_slotfunction sti_uniperiph_fix_tdm_chanfunction sti_uniperiph_fix_tdm_formatfunction sti_uniperiph_get_tdm_word_posfunction sti_uniperiph_dai_create_ctrlfunction sti_uniperiph_dai_hw_paramsfunction sti_uniperiph_dai_set_fmtfunction sti_uniperiph_suspendfunction sti_uniperiph_resumefunction sti_uniperiph_dai_probefunction sti_uniperiph_cpu_dai_offunction sti_uniperiph_probe
Annotated Snippet
struct sti_uniperiph_dev_data {
unsigned int id; /* Nb available player instances */
unsigned int version; /* player IP version */
unsigned int stream;
const char *dai_names;
enum uniperif_type type;
};
static const struct sti_uniperiph_dev_data sti_uniplayer_hdmi = {
.id = 0,
.version = SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0,
.stream = SNDRV_PCM_STREAM_PLAYBACK,
.dai_names = "Uni Player #0 (HDMI)",
.type = SND_ST_UNIPERIF_TYPE_HDMI
};
static const struct sti_uniperiph_dev_data sti_uniplayer_pcm_out = {
.id = 1,
.version = SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0,
.stream = SNDRV_PCM_STREAM_PLAYBACK,
.dai_names = "Uni Player #1 (PCM OUT)",
.type = SND_ST_UNIPERIF_TYPE_PCM | SND_ST_UNIPERIF_TYPE_TDM,
};
static const struct sti_uniperiph_dev_data sti_uniplayer_dac = {
.id = 2,
.version = SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0,
.stream = SNDRV_PCM_STREAM_PLAYBACK,
.dai_names = "Uni Player #2 (DAC)",
.type = SND_ST_UNIPERIF_TYPE_PCM,
};
static const struct sti_uniperiph_dev_data sti_uniplayer_spdif = {
.id = 3,
.version = SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0,
.stream = SNDRV_PCM_STREAM_PLAYBACK,
.dai_names = "Uni Player #3 (SPDIF)",
.type = SND_ST_UNIPERIF_TYPE_SPDIF
};
static const struct sti_uniperiph_dev_data sti_unireader_pcm_in = {
.id = 0,
.version = SND_ST_UNIPERIF_VERSION_UNI_RDR_1_0,
.stream = SNDRV_PCM_STREAM_CAPTURE,
.dai_names = "Uni Reader #0 (PCM IN)",
.type = SND_ST_UNIPERIF_TYPE_PCM | SND_ST_UNIPERIF_TYPE_TDM,
};
static const struct sti_uniperiph_dev_data sti_unireader_hdmi_in = {
.id = 1,
.version = SND_ST_UNIPERIF_VERSION_UNI_RDR_1_0,
.stream = SNDRV_PCM_STREAM_CAPTURE,
.dai_names = "Uni Reader #1 (HDMI IN)",
.type = SND_ST_UNIPERIF_TYPE_PCM,
};
static const struct of_device_id snd_soc_sti_match[] = {
{ .compatible = "st,stih407-uni-player-hdmi",
.data = &sti_uniplayer_hdmi
},
{ .compatible = "st,stih407-uni-player-pcm-out",
.data = &sti_uniplayer_pcm_out
},
{ .compatible = "st,stih407-uni-player-dac",
.data = &sti_uniplayer_dac
},
{ .compatible = "st,stih407-uni-player-spdif",
.data = &sti_uniplayer_spdif
},
{ .compatible = "st,stih407-uni-reader-pcm_in",
.data = &sti_unireader_pcm_in
},
{ .compatible = "st,stih407-uni-reader-hdmi",
.data = &sti_unireader_hdmi_in
},
{},
};
MODULE_DEVICE_TABLE(of, snd_soc_sti_match);
int sti_uniperiph_reset(struct uniperif *uni)
{
int count = 10;
/* Reset uniperipheral uni */
SET_UNIPERIF_SOFT_RST_SOFT_RST(uni);
if (uni->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) {
while (GET_UNIPERIF_SOFT_RST_SOFT_RST(uni) && count) {
udelay(5);
count--;
Annotation
- Immediate include surface: `linux/module.h`, `linux/pinctrl/consumer.h`, `linux/delay.h`, `uniperif.h`.
- Detected declarations: `struct sti_uniperiph_dev_data`, `function sti_uniperiph_reset`, `function sti_uniperiph_set_tdm_slot`, `function sti_uniperiph_fix_tdm_chan`, `function sti_uniperiph_fix_tdm_format`, `function sti_uniperiph_get_tdm_word_pos`, `function sti_uniperiph_dai_create_ctrl`, `function sti_uniperiph_dai_hw_params`, `function sti_uniperiph_dai_set_fmt`, `function sti_uniperiph_suspend`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
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.