sound/soc/intel/atom/sst-atom-controls.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/atom/sst-atom-controls.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/atom/sst-atom-controls.c- Extension
.c- Size
- 50078 bytes
- Lines
- 1578
- 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/slab.hsound/soc.hsound/tlv.hsst-mfld-platform.hsst-atom-controls.h
Detected Declarations
function Copyrightfunction sst_fill_and_send_cmd_unlockedfunction sst_fill_and_send_cmdfunction sst_send_slot_mapfunction sst_slot_enum_infofunction sst_slot_getfunction sst_check_and_send_slot_mapfunction sst_slot_putfunction sst_send_algo_cmdfunction sst_find_and_send_pipe_algofunction list_for_each_entryfunction sst_algo_bytes_ctl_infofunction sst_algo_control_getfunction sst_algo_control_setfunction sst_gain_ctl_infofunction OFFfunction sst_gain_getfunction sst_gain_putfunction sst_send_pipe_module_paramsfunction sst_generic_modules_eventfunction fill_swm_inputfunction sst_set_pipe_gainfunction list_for_each_entryfunction sst_swm_mixer_eventfunction sst_handle_vb_timerfunction sst_fill_ssp_slotfunction sst_get_frame_sync_polarityfunction sst_get_ssp_modefunction sst_fill_ssp_configfunction sst_fill_ssp_defaultsfunction send_ssp_cmdfunction sst_set_be_modulesfunction sst_set_media_pathfunction sst_set_media_loopfunction sst_algo_control_initfunction is_sst_dapm_widgetfunction digital_mutefunction snd_soc_dapm_widget_for_each_source_pathfunction sst_fill_module_listfunction sst_fill_widget_module_infofunction list_for_each_entryfunction sst_fill_linked_widgetsfunction list_for_each_entryfunction sst_map_modules_to_pipefunction list_for_each_entryfunction sst_dsp_init_v2_dpcm
Annotated Snippet
if (nb_inputs == SST_CMD_SWM_MAX_INPUTS) {
dev_warn(cmpnt->dev, "SET_SWM cmd max inputs reached");
break;
}
}
return nb_inputs;
}
/*
* called with lock held
*/
static int sst_set_pipe_gain(struct sst_ids *ids,
struct sst_data *drv, int mute)
{
int ret = 0;
struct sst_gain_mixer_control *mc;
struct sst_gain_value *gv;
struct sst_module *gain;
list_for_each_entry(gain, &ids->gain_list, node) {
struct snd_kcontrol *kctl = gain->kctl;
dev_dbg(&drv->pdev->dev, "control name=%s\n", kctl->id.name);
mc = (void *)kctl->private_value;
gv = mc->gain_val;
ret = sst_send_gain_cmd(drv, gv, mc->task_id,
mc->pipe_id | mc->instance_id, mc->module_id, mute);
if (ret)
return ret;
}
return ret;
}
static int sst_swm_mixer_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
struct sst_cmd_set_swm cmd;
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct sst_data *drv = snd_soc_component_get_drvdata(cmpnt);
struct sst_ids *ids = w->priv;
bool set_mixer = false;
struct soc_mixer_control *mc;
int val = 0;
int i = 0;
dev_dbg(cmpnt->dev, "widget = %s\n", w->name);
/*
* Identify which mixer input is on and send the bitmap of the
* inputs as an IPC to the DSP.
*/
for (i = 0; i < w->num_kcontrols; i++) {
if (snd_soc_dapm_kcontrol_get_value(w->kcontrols[i])) {
mc = (struct soc_mixer_control *)(w->kcontrols[i])->private_value;
val |= 1 << mc->shift;
}
}
dev_dbg(cmpnt->dev, "val = %#x\n", val);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
case SND_SOC_DAPM_POST_PMD:
set_mixer = true;
break;
case SND_SOC_DAPM_POST_REG:
if (w->power)
set_mixer = true;
break;
default:
set_mixer = false;
}
if (!set_mixer)
return 0;
if (SND_SOC_DAPM_EVENT_ON(event) ||
event == SND_SOC_DAPM_POST_REG)
cmd.switch_state = SST_SWM_ON;
else
cmd.switch_state = SST_SWM_OFF;
SST_FILL_DEFAULT_DESTINATION(cmd.header.dst);
/* MMX_SET_SWM == SBA_SET_SWM */
cmd.header.command_id = SBA_SET_SWM;
SST_FILL_DESTINATION(2, cmd.output_id,
ids->location_id, SST_DEFAULT_MODULE_ID);
cmd.nb_inputs = fill_swm_input(cmpnt, &cmd.input[0], val);
cmd.header.length = offsetof(struct sst_cmd_set_swm, input)
Annotation
- Immediate include surface: `linux/slab.h`, `sound/soc.h`, `sound/tlv.h`, `sst-mfld-platform.h`, `sst-atom-controls.h`.
- Detected declarations: `function Copyright`, `function sst_fill_and_send_cmd_unlocked`, `function sst_fill_and_send_cmd`, `function sst_send_slot_map`, `function sst_slot_enum_info`, `function sst_slot_get`, `function sst_check_and_send_slot_map`, `function sst_slot_put`, `function sst_send_algo_cmd`, `function sst_find_and_send_pipe_algo`.
- 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.