sound/soc/qcom/lpass-cpu.c
Source file repositories/reference/linux-study-clean/sound/soc/qcom/lpass-cpu.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/qcom/lpass-cpu.c- Extension
.c- Size
- 37146 bytes
- Lines
- 1304
- 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
dt-bindings/sound/qcom,lpass.hlinux/clk.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hsound/pcm.hsound/pcm_params.hlinux/regmap.hsound/soc.hsound/soc-dai.hlpass-lpaif-reg.hlpass.h
Detected Declarations
function lpass_cpu_init_i2sctl_bitfieldsfunction lpass_cpu_daiops_set_sysclkfunction lpass_cpu_daiops_startupfunction lpass_cpu_daiops_shutdownfunction lpass_cpu_daiops_hw_paramsfunction lpass_cpu_daiops_triggerfunction lpass_cpu_daiops_preparefunction lpass_cpu_daiops_pcm_newfunction lpass_cpu_daiops_probefunction asoc_qcom_of_xlate_dai_namefunction lpass_cpu_regmap_writeablefunction lpass_cpu_regmap_readablefunction lpass_cpu_regmap_volatilefunction lpass_hdmi_init_bitfieldsfunction lpass_hdmi_regmap_writeablefunction lpass_hdmi_regmap_readablefunction lpass_hdmi_regmap_volatilefunction __lpass_rxtx_regmap_accessiblefunction lpass_rxtx_regmap_writeablefunction lpass_rxtx_regmap_readablefunction lpass_rxtx_regmap_volatilefunction __lpass_va_regmap_accessiblefunction lpass_va_regmap_writeablefunction lpass_va_regmap_readablefunction lpass_va_regmap_volatilefunction of_lpass_cpu_parse_sd_linesfunction of_lpass_cpu_parse_dai_datafunction for_each_child_of_nodefunction of_lpass_cdc_dma_clks_parsefunction asoc_qcom_lpass_cpu_platform_probefunction asoc_qcom_lpass_cpu_platform_removefunction asoc_qcom_lpass_cpu_platform_shutdownexport asoc_qcom_lpass_cpu_dai_opsexport asoc_qcom_lpass_cpu_dai_ops2export asoc_qcom_lpass_cpu_platform_probeexport asoc_qcom_lpass_cpu_platform_removeexport asoc_qcom_lpass_cpu_platform_shutdown
Annotated Snippet
switch (mode) {
case LPAIF_I2SCTL_MODE_QUAD01:
case LPAIF_I2SCTL_MODE_6CH:
case LPAIF_I2SCTL_MODE_8CH:
mode = LPAIF_I2SCTL_MODE_SD0;
break;
case LPAIF_I2SCTL_MODE_QUAD23:
mode = LPAIF_I2SCTL_MODE_SD2;
break;
}
break;
case 4:
if (mode < LPAIF_I2SCTL_MODE_QUAD01) {
dev_err(dai->dev, "cannot configure 4 channels with mode %d\n",
mode);
return -EINVAL;
}
switch (mode) {
case LPAIF_I2SCTL_MODE_6CH:
case LPAIF_I2SCTL_MODE_8CH:
mode = LPAIF_I2SCTL_MODE_QUAD01;
break;
}
break;
case 6:
if (mode < LPAIF_I2SCTL_MODE_6CH) {
dev_err(dai->dev, "cannot configure 6 channels with mode %d\n",
mode);
return -EINVAL;
}
switch (mode) {
case LPAIF_I2SCTL_MODE_8CH:
mode = LPAIF_I2SCTL_MODE_6CH;
break;
}
break;
case 8:
if (mode < LPAIF_I2SCTL_MODE_8CH) {
dev_err(dai->dev, "cannot configure 8 channels with mode %d\n",
mode);
return -EINVAL;
}
break;
default:
dev_err(dai->dev, "invalid channels given: %u\n", channels);
return -EINVAL;
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
ret = regmap_fields_write(i2sctl->spkmode, id,
LPAIF_I2SCTL_SPKMODE(mode));
if (ret) {
dev_err(dai->dev, "error writing to i2sctl spkr mode: %d\n",
ret);
return ret;
}
if (channels >= 2)
ret = regmap_fields_write(i2sctl->spkmono, id,
LPAIF_I2SCTL_SPKMONO_STEREO);
else
ret = regmap_fields_write(i2sctl->spkmono, id,
LPAIF_I2SCTL_SPKMONO_MONO);
} else {
ret = regmap_fields_write(i2sctl->micmode, id,
LPAIF_I2SCTL_MICMODE(mode));
if (ret) {
dev_err(dai->dev, "error writing to i2sctl mic mode: %d\n",
ret);
return ret;
}
if (channels >= 2)
ret = regmap_fields_write(i2sctl->micmono, id,
LPAIF_I2SCTL_MICMONO_STEREO);
else
ret = regmap_fields_write(i2sctl->micmono, id,
LPAIF_I2SCTL_MICMONO_MONO);
}
if (ret) {
dev_err(dai->dev, "error writing to i2sctl channels mode: %d\n",
ret);
return ret;
}
ret = clk_set_rate(drvdata->mi2s_bit_clk[id],
rate * bitwidth * 2);
if (ret) {
Annotation
- Immediate include surface: `dt-bindings/sound/qcom,lpass.h`, `linux/clk.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `sound/pcm.h`, `sound/pcm_params.h`.
- Detected declarations: `function lpass_cpu_init_i2sctl_bitfields`, `function lpass_cpu_daiops_set_sysclk`, `function lpass_cpu_daiops_startup`, `function lpass_cpu_daiops_shutdown`, `function lpass_cpu_daiops_hw_params`, `function lpass_cpu_daiops_trigger`, `function lpass_cpu_daiops_prepare`, `function lpass_cpu_daiops_pcm_new`, `function lpass_cpu_daiops_probe`, `function asoc_qcom_of_xlate_dai_name`.
- 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.