sound/soc/meson/axg-tdm.h
Source file repositories/reference/linux-study-clean/sound/soc/meson/axg-tdm.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/meson/axg-tdm.h- Extension
.h- Size
- 2032 bytes
- Lines
- 82
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/regmap.hsound/pcm.hsound/soc.hsound/soc-dai.h
Detected Declarations
struct axg_tdm_ifacestruct axg_tdm_streamfunction axg_tdm_lrclk_invertfunction axg_tdm_sclk_invertfunction axg_tdm_stream_reset
Annotated Snippet
struct axg_tdm_iface {
struct clk *sclk;
struct clk *lrclk;
struct clk *mclk;
unsigned long mclk_rate;
/* format is common to all the DAIs of the iface */
unsigned int fmt;
unsigned int slots;
unsigned int slot_width;
/* For component wide symmetry */
int rate;
};
static inline bool axg_tdm_lrclk_invert(unsigned int fmt)
{
return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^
!!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF));
}
static inline bool axg_tdm_sclk_invert(unsigned int fmt)
{
return fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_IB_NF);
}
struct axg_tdm_stream {
struct axg_tdm_iface *iface;
struct list_head formatter_list;
struct mutex lock;
unsigned int channels;
unsigned int width;
unsigned int physical_width;
u32 *mask;
bool ready;
/* For continuous clock tracking */
bool clk_enabled;
};
struct axg_tdm_stream *axg_tdm_stream_alloc(struct axg_tdm_iface *iface);
void axg_tdm_stream_free(struct axg_tdm_stream *ts);
int axg_tdm_stream_start(struct axg_tdm_stream *ts);
void axg_tdm_stream_stop(struct axg_tdm_stream *ts);
int axg_tdm_stream_set_cont_clocks(struct axg_tdm_stream *ts,
unsigned int fmt);
static inline int axg_tdm_stream_reset(struct axg_tdm_stream *ts)
{
axg_tdm_stream_stop(ts);
return axg_tdm_stream_start(ts);
}
int axg_tdm_set_tdm_slots(struct snd_soc_dai *dai, u32 *tx_mask,
u32 *rx_mask, unsigned int slots,
unsigned int slot_width);
#endif /* _MESON_AXG_TDM_H */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/regmap.h`, `sound/pcm.h`, `sound/soc.h`, `sound/soc-dai.h`.
- Detected declarations: `struct axg_tdm_iface`, `struct axg_tdm_stream`, `function axg_tdm_lrclk_invert`, `function axg_tdm_sclk_invert`, `function axg_tdm_stream_reset`.
- 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.