sound/soc/samsung/i2s.c
Source file repositories/reference/linux-study-clean/sound/soc/samsung/i2s.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/samsung/i2s.c- Extension
.c- Size
- 42140 bytes
- Lines
- 1737
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
dt-bindings/sound/samsung-i2s.hlinux/delay.hlinux/slab.hlinux/clk.hlinux/clk-provider.hlinux/io.hlinux/module.hlinux/of.hlinux/pm_runtime.hsound/soc.hsound/pcm_params.hlinux/platform_data/asoc-s3c.hdma.hidma.hi2s.hi2s-regs.h
Detected Declarations
struct samsung_i2s_variant_regsstruct samsung_i2s_dai_datastruct i2s_daistruct samsung_i2s_privfunction is_secondaryfunction tx_activefunction other_tx_activefunction any_tx_activefunction rx_activefunction other_rx_activefunction any_rx_activefunction other_activefunction this_activefunction any_activefunction is_openedfunction is_managerfunction get_rfsfunction set_rfsfunction get_bfsfunction set_bfsfunction get_blcfunction i2s_txctrlfunction i2s_rxctrlfunction i2s_fifofunction i2s_set_sysclkfunction scoped_guardfunction i2s_set_fmtfunction i2s_hw_paramsfunction scoped_guardfunction i2s_startupfunction i2s_shutdownfunction scoped_guardfunction config_setupfunction i2s_triggerfunction scoped_guardfunction scoped_guardfunction i2s_set_clkdivfunction i2s_delayfunction i2s_suspendfunction i2s_resumefunction samsung_i2s_dai_probefunction scoped_guardfunction samsung_i2s_dai_removefunction i2s_alloc_daisfunction i2s_runtime_suspendfunction i2s_runtime_resumefunction i2s_unregister_clocksfunction i2s_unregister_clock_provider
Annotated Snippet
struct samsung_i2s_variant_regs {
unsigned int bfs_off;
unsigned int rfs_off;
unsigned int sdf_off;
unsigned int txr_off;
unsigned int rclksrc_off;
unsigned int mss_off;
unsigned int cdclkcon_off;
unsigned int lrp_off;
unsigned int bfs_mask;
unsigned int rfs_mask;
unsigned int ftx0cnt_off;
};
struct samsung_i2s_dai_data {
u32 quirks;
unsigned int pcm_rates;
const struct samsung_i2s_variant_regs *i2s_variant_regs;
void (*fixup_early)(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
void (*fixup_late)(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
};
struct i2s_dai {
/* Platform device for this DAI */
struct platform_device *pdev;
/* Frame clock */
unsigned frmclk;
/*
* Specifically requested RCLK, BCLK by machine driver.
* 0 indicates CPU driver is free to choose any value.
*/
unsigned rfs, bfs;
/* Pointer to the Primary_Fifo if this is Sec_Fifo, NULL otherwise */
struct i2s_dai *pri_dai;
/* Pointer to the Secondary_Fifo if it has one, NULL otherwise */
struct i2s_dai *sec_dai;
#define DAI_OPENED (1 << 0) /* DAI is opened */
#define DAI_MANAGER (1 << 1) /* DAI is the manager */
unsigned mode;
/* Driver for this DAI */
struct snd_soc_dai_driver *drv;
/* DMA parameters */
struct snd_dmaengine_dai_dma_data dma_playback;
struct snd_dmaengine_dai_dma_data dma_capture;
struct snd_dmaengine_dai_dma_data idma_playback;
dma_filter_fn filter;
struct samsung_i2s_priv *priv;
};
struct samsung_i2s_priv {
struct platform_device *pdev;
struct platform_device *pdev_sec;
/* Lock for cross interface checks */
spinlock_t pcm_lock;
/* CPU DAIs and their corresponding drivers */
struct i2s_dai *dai;
struct snd_soc_dai_driver *dai_drv;
int num_dais;
/* The I2S controller's core clock */
struct clk *clk;
/* Clock for generating I2S signals */
struct clk *op_clk;
/* Rate of RCLK source clock */
unsigned long rclk_srcrate;
/* Cache of selected I2S registers for system suspend */
u32 suspend_i2smod;
u32 suspend_i2scon;
u32 suspend_i2spsr;
const struct samsung_i2s_variant_regs *variant_regs;
void (*fixup_early)(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
void (*fixup_late)(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai);
u32 quirks;
/* The clock provider's data */
Annotation
- Immediate include surface: `dt-bindings/sound/samsung-i2s.h`, `linux/delay.h`, `linux/slab.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct samsung_i2s_variant_regs`, `struct samsung_i2s_dai_data`, `struct i2s_dai`, `struct samsung_i2s_priv`, `function is_secondary`, `function tx_active`, `function other_tx_active`, `function any_tx_active`, `function rx_active`, `function other_rx_active`.
- Atlas domain: Driver Families / sound/soc.
- 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.