Lines Matching defs:sdev

31 static int mt8195_get_mailbox_offset(struct snd_sof_dev *sdev)
36 static int mt8195_get_window_offset(struct snd_sof_dev *sdev, u32 id)
41 static int mt8195_send_msg(struct snd_sof_dev *sdev,
44 struct adsp_priv *priv = sdev->pdata->hw_pdata;
46 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data,
57 spin_lock_irqsave(&priv->sdev->ipc_lock, flags);
58 snd_sof_ipc_process_reply(priv->sdev, 0);
59 spin_unlock_irqrestore(&priv->sdev->ipc_lock, flags);
69 sof_mailbox_read(priv->sdev, priv->sdev->debug_box.offset + 4,
74 snd_sof_dsp_panic(priv->sdev, p, true);
76 snd_sof_ipc_msgs_rx(priv->sdev);
261 static int mt8195_run(struct snd_sof_dev *sdev)
266 dev_dbg(sdev->dev, "HIFIxDSP boot from base : 0x%08X\n", adsp_bootup_addr);
267 sof_hifixdsp_boot_sequence(sdev, adsp_bootup_addr);
272 static int mt8195_dsp_probe(struct snd_sof_dev *sdev)
274 struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev);
282 sdev->pdata->hw_pdata = priv;
283 priv->dev = sdev->dev;
284 priv->sdev = sdev;
294 ret = mt8195_adsp_init_clock(sdev);
296 dev_err(sdev->dev, "mt8195_adsp_init_clock failed\n");
300 ret = adsp_clock_on(sdev);
302 dev_err(sdev->dev, "adsp_clock_on fail!\n");
306 ret = adsp_sram_power_on(sdev->dev, true);
308 dev_err(sdev->dev, "adsp_sram_power_on fail!\n");
314 dev_err(sdev->dev, "adsp_memory_remap_init fail!\n");
318 sdev->bar[SOF_FW_BLK_TYPE_IRAM] = devm_ioremap(sdev->dev,
321 if (!sdev->bar[SOF_FW_BLK_TYPE_IRAM]) {
322 dev_err(sdev->dev, "failed to ioremap base %pa size %#x\n",
328 priv->adsp->va_sram = sdev->bar[SOF_FW_BLK_TYPE_IRAM];
330 sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap(sdev->dev,
333 if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) {
334 dev_err(sdev->dev, "failed to ioremap base %pa size %#x\n",
339 priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM];
343 dev_err(sdev->dev, "adsp_shared_base_ioremap fail!\n");
347 sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg;
349 sdev->mmio_bar = SOF_FW_BLK_TYPE_SRAM;
350 sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM;
353 sdev->dsp_box.offset = mt8195_get_mailbox_offset(sdev);
360 dev_err(sdev->dev, "failed to register mtk-adsp-ipc device\n");
367 dev_err(sdev->dev, "failed to get drvdata\n");
381 adsp_clock_off(sdev);
386 static int mt8195_dsp_shutdown(struct snd_sof_dev *sdev)
388 return snd_sof_suspend(sdev->dev);
391 static int mt8195_dsp_remove(struct snd_sof_dev *sdev)
393 struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev);
394 struct adsp_priv *priv = sdev->pdata->hw_pdata;
398 adsp_clock_off(sdev);
403 static int mt8195_dsp_suspend(struct snd_sof_dev *sdev, u32 target_state)
405 struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev);
410 ret = snd_sof_dsp_read_poll_timeout(sdev, DSP_REG_BAR,
416 dbg_pc = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGPC);
417 dev_warn(sdev->dev, "dsp not idle, powering off anyway : swrest %#x, pc %#x, ret %d\n",
422 sof_hifixdsp_shutdown(sdev);
427 dev_err(sdev->dev, "adsp_sram_power_off fail!\n");
432 return adsp_clock_off(sdev);
435 static int mt8195_dsp_resume(struct snd_sof_dev *sdev)
440 ret = adsp_clock_on(sdev);
442 dev_err(sdev->dev, "adsp_clock_on fail!\n");
447 ret = adsp_sram_power_on(sdev->dev, true);
449 dev_err(sdev->dev, "adsp_sram_power_on fail!\n");
455 static int mt8195_get_bar_index(struct snd_sof_dev *sdev, u32 type)
460 static int mt8195_pcm_hw_params(struct snd_sof_dev *sdev,
470 static snd_pcm_uframes_t mt8195_pcm_pointer(struct snd_sof_dev *sdev,
478 struct snd_soc_component *scomp = sdev->component;
483 dev_warn_ratelimited(sdev->dev, "warn: can't find PCM with DAI ID %d\n",
489 ret = snd_sof_ipc_msg_data(sdev, stream, &posn, sizeof(posn));
491 dev_warn(sdev->dev, "failed to read stream position: %d\n", ret);
502 static void mt8195_adsp_dump(struct snd_sof_dev *sdev, u32 flags)
508 dbg_pc = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGPC);
509 dbg_data = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGDATA);
510 dbg_bus0 = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGBUS0);
511 dbg_bus1 = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGBUS1);
512 dbg_inst = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGINST);
513 dbg_ls0stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS0STAT);
514 dbg_ls1stat = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PDEBUGLS1STAT);
515 faultbus = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTBUS);
516 faultinfo = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_PFAULTINFO);
517 swrest = snd_sof_dsp_read(sdev, DSP_REG_BAR, DSP_RESET_SW);
519 dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, bus0 %#x, bus1 %#x, swrest %#x",
521 dev_info(sdev->dev, "dbg_inst %#x, ls0stat %#x, ls1stat %#x, faultbus %#x, faultinfo %#x",
524 mtk_adsp_dump(sdev, flags);