sound/soc/bcm/cygnus-ssp.c
Source file repositories/reference/linux-study-clean/sound/soc/bcm/cygnus-ssp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/bcm/cygnus-ssp.c- Extension
.c- Size
- 38334 bytes
- Lines
- 1404
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/clk.hlinux/delay.hlinux/init.hlinux/io.hlinux/module.hlinux/of.hlinux/slab.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dai.hcygnus-ssp.h
Detected Declarations
struct pll_macro_entryfunction audio_ssp_init_portregsfunction audio_ssp_in_enablefunction audio_ssp_in_disablefunction audio_ssp_out_enablefunction audio_ssp_out_disablefunction pll_configure_mclkfunction cygnus_ssp_set_clocksfunction cygnus_ssp_hw_paramsfunction cygnus_ssp_set_sysclkfunction cygnus_ssp_startupfunction cygnus_ssp_shutdownfunction Modefunction cygnus_ssp_set_fmtfunction cygnus_ssp_triggerfunction cygnus_set_dai_tdm_slotfunction __cygnus_ssp_suspendfunction cygnus_ssp_suspendfunction __cygnus_ssp_resumefunction cygnus_ssp_resumefunction parse_ssp_child_nodefunction audio_clk_initfunction cygnus_ssp_probefunction for_each_available_child_of_node_scopedfunction cygnus_ssp_removeexport cygnus_ssp_set_custom_fsync_width
Annotated Snippet
struct pll_macro_entry {
u32 mclk;
u32 pll_ch_num;
};
/*
* PLL has 3 output channels (1x, 2x, and 4x). Below are
* the common MCLK frequencies used by audio driver
*/
static const struct pll_macro_entry pll_predef_mclk[] = {
{ 4096000, 0},
{ 8192000, 1},
{16384000, 2},
{ 5644800, 0},
{11289600, 1},
{22579200, 2},
{ 6144000, 0},
{12288000, 1},
{24576000, 2},
{12288000, 0},
{24576000, 1},
{49152000, 2},
{22579200, 0},
{45158400, 1},
{90316800, 2},
{24576000, 0},
{49152000, 1},
{98304000, 2},
};
#define CYGNUS_RATE_MIN 8000
#define CYGNUS_RATE_MAX 384000
/* List of valid frame sizes for tdm mode */
static const int ssp_valid_tdm_framesize[] = {32, 64, 128, 256, 512};
static const unsigned int cygnus_rates[] = {
8000, 11025, 16000, 22050, 32000, 44100, 48000,
88200, 96000, 176400, 192000, 352800, 384000
};
static const struct snd_pcm_hw_constraint_list cygnus_rate_constraint = {
.count = ARRAY_SIZE(cygnus_rates),
.list = cygnus_rates,
};
static struct cygnus_aio_port *cygnus_dai_get_portinfo(struct snd_soc_dai *dai)
{
struct cygnus_audio *cygaud = snd_soc_dai_get_drvdata(dai);
return &cygaud->portinfo[dai->id];
}
static int audio_ssp_init_portregs(struct cygnus_aio_port *aio)
{
u32 value, fci_id;
int status = 0;
switch (aio->port_type) {
case PORT_TDM:
value = readl(aio->cygaud->audio + aio->regs.i2s_stream_cfg);
value &= ~I2S_STREAM_CFG_MASK;
/* Set Group ID */
writel(aio->portnum,
aio->cygaud->audio + aio->regs.bf_sourcech_grp);
/* Configure the AUD_FMM_IOP_OUT_I2S_x_STREAM_CFG reg */
value |= aio->portnum << I2S_OUT_STREAM_CFG_GROUP_ID;
value |= aio->portnum; /* FCI ID is the port num */
value |= CH_GRP_STEREO << I2S_OUT_STREAM_CFG_CHANNEL_GROUPING;
writel(value, aio->cygaud->audio + aio->regs.i2s_stream_cfg);
/* Configure the AUD_FMM_BF_CTRL_SOURCECH_CFGX reg */
value = readl(aio->cygaud->audio + aio->regs.bf_sourcech_cfg);
value &= ~BIT(BF_SRC_CFGX_NOT_PAUSE_WHEN_EMPTY);
value |= BIT(BF_SRC_CFGX_SFIFO_SZ_DOUBLE);
value |= BIT(BF_SRC_CFGX_PROCESS_SEQ_ID_VALID);
writel(value, aio->cygaud->audio + aio->regs.bf_sourcech_cfg);
/* Configure the AUD_FMM_IOP_IN_I2S_x_CAP_STREAM_CFG_0 reg */
value = readl(aio->cygaud->i2s_in +
aio->regs.i2s_cap_stream_cfg);
value &= ~I2S_CAP_STREAM_CFG_MASK;
value |= aio->portnum << I2S_IN_STREAM_CFG_0_GROUP_ID;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/init.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/slab.h`, `sound/core.h`.
- Detected declarations: `struct pll_macro_entry`, `function audio_ssp_init_portregs`, `function audio_ssp_in_enable`, `function audio_ssp_in_disable`, `function audio_ssp_out_enable`, `function audio_ssp_out_disable`, `function pll_configure_mclk`, `function cygnus_ssp_set_clocks`, `function cygnus_ssp_hw_params`, `function cygnus_ssp_set_sysclk`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.