sound/soc/renesas/rcar/core.c
Source file repositories/reference/linux-study-clean/sound/soc/renesas/rcar/core.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/renesas/rcar/core.c- Extension
.c- Size
- 53355 bytes
- Lines
- 2240
- 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
linux/pm_runtime.hlinux/of_graph.hrsnd.h
Detected Declarations
function rsnd_mod_make_surefunction rsnd_mod_id_rawfunction rsnd_mod_idfunction rsnd_mod_id_subfunction rsnd_mod_initfunction rsnd_mod_quitfunction rsnd_mod_interruptfunction for_each_rsnd_daifunction rsnd_io_is_workingfunction rsnd_runtime_channel_original_with_paramsfunction rsnd_runtime_channel_after_ctu_with_paramsfunction rsnd_channel_normalizationfunction rsnd_runtime_channel_for_ssi_with_paramsfunction rsnd_runtime_is_multi_ssifunction rsnd_runtime_is_tdmfunction rsnd_runtime_is_tdm_splitfunction rsnd_get_adinr_bitfunction rsnd_get_dalignfunction rsnd_get_busif_shiftfunction rsnd_status_updatefunction rsnd_dai_connectfunction rsnd_dai_disconnectfunction rsnd_rdai_channels_ctrlfunction rsnd_rdai_ssi_lane_ctrlfunction rsnd_rdai_width_ctrlfunction rsnd_dai_stream_initfunction rsnd_dai_stream_quitfunction rsnd_soc_dai_triggerfunction rsnd_soc_dai_set_fmtfunction rsnd_soc_set_dai_tdm_slotfunction rsnd_soc_hw_rulefunction rsnd_soc_hw_rule_ratefunction rsnd_soc_hw_rule_channelsfunction rsnd_soc_dai_startupfunction rsnd_soc_dai_shutdownfunction rsnd_soc_dai_preparefunction rsnd_parse_tdm_split_modefunction for_each_child_of_node_scopedfunction rsnd_parse_connect_simplefunction rsnd_parse_connect_graphfunction rsnd_parse_connect_commonfunction rsnd_node_fixed_indexfunction rsnd_node_countfunction conventionfunction rsnd_devm_reset_control_get_optional_indexedfunction rsnd_pick_endpoint_node_for_portsfunction rsnd_dai_of_nodefunction for_each_child_of_node_scoped
Annotated Snippet
if (rsnd_runtime_is_tdm_split(io)) {
struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io));
dev_err(dev, "CTU and TDM Split should be used\n");
}
if (converted_chan)
return converted_chan;
}
return chan;
}
int rsnd_channel_normalization(int chan)
{
if (WARN_ON((chan > 8) || (chan < 0)))
return 0;
/* TDM Extend Mode needs 8ch */
if (chan == 6)
chan = 8;
return chan;
}
int rsnd_runtime_channel_for_ssi_with_params(struct rsnd_dai_stream *io,
struct snd_pcm_hw_params *params)
{
struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
int chan = rsnd_io_is_play(io) ?
rsnd_runtime_channel_after_ctu_with_params(io, params) :
rsnd_runtime_channel_original_with_params(io, params);
/* Use Multi SSI */
if (rsnd_runtime_is_multi_ssi(io))
chan /= rsnd_rdai_ssi_lane_get(rdai);
return rsnd_channel_normalization(chan);
}
int rsnd_runtime_is_multi_ssi(struct rsnd_dai_stream *io)
{
struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
int lane = rsnd_rdai_ssi_lane_get(rdai);
int chan = rsnd_io_is_play(io) ?
rsnd_runtime_channel_after_ctu(io) :
rsnd_runtime_channel_original(io);
return (chan > 2) && (lane > 1);
}
int rsnd_runtime_is_tdm(struct rsnd_dai_stream *io)
{
return rsnd_runtime_channel_for_ssi(io) >= 6;
}
int rsnd_runtime_is_tdm_split(struct rsnd_dai_stream *io)
{
return !!rsnd_flags_has(io, RSND_STREAM_TDM_SPLIT);
}
/*
* ADINR function
*/
u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
struct device *dev = rsnd_priv_to_dev(priv);
switch (snd_pcm_format_width(runtime->format)) {
case 8:
return 16 << 16;
case 16:
return 8 << 16;
case 24:
return 0 << 16;
}
dev_warn(dev, "not supported sample bits\n");
return 0;
}
/*
* DALIGN function
*/
u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
{
static const u32 dalign_values[8] = {
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `linux/of_graph.h`, `rsnd.h`.
- Detected declarations: `function rsnd_mod_make_sure`, `function rsnd_mod_id_raw`, `function rsnd_mod_id`, `function rsnd_mod_id_sub`, `function rsnd_mod_init`, `function rsnd_mod_quit`, `function rsnd_mod_interrupt`, `function for_each_rsnd_dai`, `function rsnd_io_is_working`, `function rsnd_runtime_channel_original_with_params`.
- 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.