sound/soc/sof/imx/imx8.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/imx/imx8.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/imx/imx8.c- Extension
.c- Size
- 12021 bytes
- Lines
- 474
- 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
dt-bindings/firmware/imx/rsrc.hlinux/arm-smccc.hlinux/firmware/imx/svc/misc.hlinux/mfd/syscon.hlinux/reset.himx-common.h
Detected Declarations
struct imx8m_chip_datafunction imx8_shutdownfunction imx8x_runfunction imx8_runfunction imx8_probefunction imx8m_resetfunction imx8m_runfunction imx8m_probefunction imx8ulp_runfunction imx8ulp_resetfunction imx8ulp_probefunction imx8_ops_init
Annotated Snippet
struct imx8m_chip_data {
void __iomem *dap;
struct regmap *regmap;
struct reset_control *run_stall;
};
static int imx8_shutdown(struct snd_sof_dev *sdev)
{
/*
* Force the DSP to stall. After the firmware image is loaded,
* the stall will be removed during run() by a matching
* imx_sc_pm_cpu_start() call.
*/
imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, false,
RESET_VECTOR_VADDR);
return 0;
}
/*
* DSP control.
*/
static int imx8x_run(struct snd_sof_dev *sdev)
{
int ret;
ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
IMX_SC_C_OFS_SEL, 1);
if (ret < 0) {
dev_err(sdev->dev, "Error system address offset source select\n");
return ret;
}
ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
IMX_SC_C_OFS_AUDIO, 0x80);
if (ret < 0) {
dev_err(sdev->dev, "Error system address offset of AUDIO\n");
return ret;
}
ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
IMX_SC_C_OFS_PERIPH, 0x5A);
if (ret < 0) {
dev_err(sdev->dev, "Error system address offset of PERIPH %d\n",
ret);
return ret;
}
ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
IMX_SC_C_OFS_IRQ, 0x51);
if (ret < 0) {
dev_err(sdev->dev, "Error system address offset of IRQ\n");
return ret;
}
imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
RESET_VECTOR_VADDR);
return 0;
}
static int imx8_run(struct snd_sof_dev *sdev)
{
int ret;
ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
IMX_SC_C_OFS_SEL, 0);
if (ret < 0) {
dev_err(sdev->dev, "Error system address offset source select\n");
return ret;
}
imx_sc_pm_cpu_start(get_chip_pdata(sdev), IMX_SC_R_DSP, true,
RESET_VECTOR_VADDR);
return 0;
}
static int imx8_probe(struct snd_sof_dev *sdev)
{
struct imx_sc_ipc *sc_ipc_handle;
struct imx_common_data *common;
int ret;
common = sdev->pdata->hw_pdata;
ret = imx_scu_get_handle(&sc_ipc_handle);
if (ret < 0)
return dev_err_probe(sdev->dev, ret,
"failed to fetch SC IPC handle\n");
Annotation
- Immediate include surface: `dt-bindings/firmware/imx/rsrc.h`, `linux/arm-smccc.h`, `linux/firmware/imx/svc/misc.h`, `linux/mfd/syscon.h`, `linux/reset.h`, `imx-common.h`.
- Detected declarations: `struct imx8m_chip_data`, `function imx8_shutdown`, `function imx8x_run`, `function imx8_run`, `function imx8_probe`, `function imx8m_reset`, `function imx8m_run`, `function imx8m_probe`, `function imx8ulp_run`, `function imx8ulp_reset`.
- 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.