sound/soc/sdca/sdca_asoc.c
Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_asoc.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sdca/sdca_asoc.c- Extension
.c- Size
- 49298 bytes
- Lines
- 1781
- 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/bits.hlinux/bitmap.hlinux/build_bug.hlinux/delay.hlinux/dev_printk.hlinux/device.hlinux/minmax.hlinux/module.hlinux/overflow.hlinux/pm_runtime.hlinux/regmap.hlinux/soundwire/sdw_registers.hlinux/string_helpers.hlinux/types.hsound/control.hsound/pcm.hsound/pcm_params.hsound/sdca.hsound/sdca_asoc.hsound/sdca_function.hsound/soc.hsound/soc-component.hsound/soc-dai.hsound/soc-dapm.hsound/tlv.h
Detected Declarations
function exported_controlfunction readonly_controlfunction ge_count_routesfunction sdca_asoc_count_componentfunction ge_put_enum_doublefunction entity_early_parse_gefunction add_routefunction entity_parse_simplefunction entity_parse_itfunction entity_parse_otfunction sdca_asoc_pde_poll_actual_psfunction entity_pde_eventfunction entity_parse_pdefunction entity_parse_su_devicefunction entity_parse_su_classfunction entity_parse_sufunction entity_parse_mufunction entity_cs_eventfunction entity_parse_csfunction sdca_asoc_populate_dapmfunction q78_writefunction sdca_asoc_q78_put_volswfunction q78_readfunction sdca_asoc_q78_get_volswfunction control_limit_kctlfunction volatile_get_volswfunction volatile_put_volswfunction populate_controlfunction for_each_set_bitfunction populate_pin_switchfunction sdca_asoc_populate_controlsfunction rate_find_maskfunction width_find_maskfunction populate_rate_formatfunction sdca_asoc_populate_daisfunction sdca_asoc_populate_componentfunction startupfunction shutdownfunction hw_paramsfunction set_clusterfunction set_clockfunction set_usagefunction hw_params
Annotated Snippet
switch (entity->type) {
case SDCA_ENTITY_TYPE_IT:
case SDCA_ENTITY_TYPE_OT:
*num_routes += !!entity->iot.clock;
*num_routes += !!entity->iot.is_dataport;
*num_controls += !entity->iot.is_dataport;
*num_dais += !!entity->iot.is_dataport;
break;
case SDCA_ENTITY_TYPE_PDE:
*num_routes += entity->pde.num_managed;
break;
case SDCA_ENTITY_TYPE_GE:
*num_routes += ge_count_routes(entity);
skip_primary_routes = true;
break;
case SDCA_ENTITY_TYPE_SU:
control = sdca_selector_find_control(dev, entity, SDCA_CTL_SU_SELECTOR);
if (!control)
return -EINVAL;
skip_primary_routes = (control->layers == SDCA_ACCESS_LAYER_DEVICE);
break;
default:
break;
}
if (entity->group)
(*num_routes)++;
/* Add primary entity connections from DisCo */
if (!skip_primary_routes)
*num_routes += entity->num_sources;
for (j = 0; j < entity->num_controls; j++) {
if (exported_control(entity, &entity->controls[j]))
(*num_controls)++;
}
}
return 0;
}
EXPORT_SYMBOL_NS(sdca_asoc_count_component, "SND_SOC_SDCA");
static int ge_put_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_to_dapm(kcontrol);
struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
struct device *dev = component->dev;
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
unsigned int *item = ucontrol->value.enumerated.item;
unsigned int reg = e->reg;
int ret;
reg &= ~SDW_SDCA_CTL_CSEL(0x3F);
reg |= SDW_SDCA_CTL_CSEL(SDCA_CTL_GE_DETECTED_MODE);
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "failed to resume writing %s: %d\n",
kcontrol->id.name, ret);
return ret;
}
ret = snd_soc_component_read(component, reg);
pm_runtime_put(dev);
if (ret < 0)
return ret;
else if (ret <= SDCA_DETECTED_MODE_DETECTION_IN_PROGRESS)
return -EBUSY;
ret = snd_soc_enum_item_to_val(e, item[0]);
if (ret <= SDCA_DETECTED_MODE_DETECTION_IN_PROGRESS)
return -EINVAL;
return snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
}
static int entity_early_parse_ge(struct device *dev,
struct sdca_function_data *function,
struct sdca_entity *entity)
{
struct sdca_control_range *range;
struct sdca_control *control;
struct snd_kcontrol_new *kctl;
struct soc_enum *soc_enum;
const char *control_name;
unsigned int *values;
const char **texts;
int i;
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitmap.h`, `linux/build_bug.h`, `linux/delay.h`, `linux/dev_printk.h`, `linux/device.h`, `linux/minmax.h`, `linux/module.h`.
- Detected declarations: `function exported_control`, `function readonly_control`, `function ge_count_routes`, `function sdca_asoc_count_component`, `function ge_put_enum_double`, `function entity_early_parse_ge`, `function add_route`, `function entity_parse_simple`, `function entity_parse_it`, `function entity_parse_ot`.
- 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.