sound/soc/renesas/rcar/ssiu.c
Source file repositories/reference/linux-study-clean/sound/soc/renesas/rcar/ssiu.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/renesas/rcar/ssiu.c- Extension
.c- Size
- 14656 bytes
- Lines
- 652
- 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
rsnd.h
Detected Declarations
struct rsnd_ssiustruct rsnd_ssiu_ctrlfunction rsnd_ssiu_busif_err_irq_ctrlfunction rsnd_ssiu_busif_err_status_clearfunction rsnd_ssiu_initfunction rsnd_ssiu_quitfunction rsnd_ssiu_init_gen2function for_each_rsnd_mod_arrayfunction rsnd_ssiu_start_gen2function rsnd_ssiu_stop_gen2function rsnd_ssiu_idfunction rsnd_ssiu_id_subfunction rsnd_ssiu_debug_infofunction rsnd_parse_connect_ssiu_compatiblefunction rsnd_parse_connect_ssiufunction for_each_child_of_node_scopedfunction rsnd_ssiu_probefunction for_each_rsnd_ssiufunction rsnd_ssiu_removefunction for_each_rsnd_ssiufunction rsnd_ssiu_suspendfunction rsnd_ssiu_resume
Annotated Snippet
struct rsnd_ssiu {
struct rsnd_mod mod;
u32 busif_status[8]; /* for BUSIF0 - BUSIF7 */
unsigned int usrcnt;
int id;
int id_sub;
};
/* SSI_MODE */
#define TDM_EXT (1 << 0)
#define TDM_SPLIT (1 << 8)
#define rsnd_ssiu_nr(priv) ((priv)->ssiu_nr)
#define rsnd_mod_to_ssiu(_mod) container_of((_mod), struct rsnd_ssiu, mod)
#define for_each_rsnd_ssiu(pos, priv, i) \
for (i = 0; \
(i < rsnd_ssiu_nr(priv)) && \
((pos) = ((struct rsnd_ssiu *)(priv)->ssiu + i)); \
i++)
/*
* SSI Gen2 Gen3 Gen4 RZ/G3E
* 0 BUSIF0-3 BUSIF0-7 BUSIF0-7 BUSIF0-3
* 1 BUSIF0-3 BUSIF0-7 BUSIF0-3
* 2 BUSIF0-3 BUSIF0-7 BUSIF0-3
* 3 BUSIF0 BUSIF0-7 BUSIF0-3
* 4 BUSIF0 BUSIF0-7 BUSIF0-3
* 5 BUSIF0 BUSIF0 BUSIF0
* 6 BUSIF0 BUSIF0 BUSIF0
* 7 BUSIF0 BUSIF0 BUSIF0
* 8 BUSIF0 BUSIF0 BUSIF0
* 9 BUSIF0-3 BUSIF0-7 BUSIF0-3
* total 22 52 8 28
*/
static const int gen2_id[] = { 0, 4, 8, 12, 13, 14, 15, 16, 17, 18 };
static const int gen3_id[] = { 0, 8, 16, 24, 32, 40, 41, 42, 43, 44 };
static const int gen4_id[] = { 0 };
static const int rzg3e_id[] = { 0, 4, 8, 12, 16, 20, 21, 22, 23, 24 };
struct rsnd_ssiu_ctrl {
unsigned int busif_status_count;
};
#define rsnd_priv_to_ssiu_ctrl(priv) \
((struct rsnd_ssiu_ctrl *)(priv)->ssiu_ctrl)
/* enable busif buffer over/under run interrupt. */
#define rsnd_ssiu_busif_err_irq_enable(mod) rsnd_ssiu_busif_err_irq_ctrl(mod, 1)
#define rsnd_ssiu_busif_err_irq_disable(mod) rsnd_ssiu_busif_err_irq_ctrl(mod, 0)
static void rsnd_ssiu_busif_err_irq_ctrl(struct rsnd_mod *mod, int enable)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
int id = rsnd_mod_id(mod);
int shift, offset;
switch (id) {
case 0:
case 1:
case 2:
case 3:
case 4:
shift = id;
offset = 0;
break;
case 9:
shift = 1;
offset = 1;
break;
default:
return;
}
for (unsigned int i = 0; i < rsnd_priv_to_ssiu_ctrl(priv)->busif_status_count; i++) {
enum rsnd_reg reg = SSI_SYS_INT_ENABLE((i * 2) + offset);
u32 val = 0xf << (shift * 4);
u32 sys_int_enable = rsnd_mod_read(mod, reg);
if (enable)
sys_int_enable |= val;
else
sys_int_enable &= ~val;
rsnd_mod_write(mod, reg, sys_int_enable);
}
}
bool rsnd_ssiu_busif_err_status_clear(struct rsnd_mod *mod)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
bool error = false;
int id = rsnd_mod_id(mod);
Annotation
- Immediate include surface: `rsnd.h`.
- Detected declarations: `struct rsnd_ssiu`, `struct rsnd_ssiu_ctrl`, `function rsnd_ssiu_busif_err_irq_ctrl`, `function rsnd_ssiu_busif_err_status_clear`, `function rsnd_ssiu_init`, `function rsnd_ssiu_quit`, `function rsnd_ssiu_init_gen2`, `function for_each_rsnd_mod_array`, `function rsnd_ssiu_start_gen2`, `function rsnd_ssiu_stop_gen2`.
- 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.