abox_restore_data(dev);
abox_request_cpu_gear(dev, data, (void *)DEFAULT_CPU_GEAR_ID,
ABOX_CPU_GEAR_MIN);
- abox_request_dram_on(pdev, dev, false);
}
static void abox_boot_done(struct device *dev, unsigned int version)
static int abox_disable(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct abox_data *data = dev_get_drvdata(dev);
enum calliope_state state = data->calliope_state;
abox_cpu_pm_ipc(dev, false);
data->calliope_state = CALLIOPE_DISABLED;
abox_log_drain_all(dev);
-
+ abox_request_dram_on(pdev, dev, false);
abox_save_register(data);
abox_cfg_gpio(dev, "idle");
abox_pad_retention(true);
struct platform_device *pdev_abox;
pdev_abox = to_platform_device(abox_dump_dev_abox);
- if (enable) {
- abox_request_dram_on(pdev_abox, dev, true);
+ if (enable)
pm_runtime_get(dev);
- } else {
+ else
pm_runtime_put(dev);
- abox_request_dram_on(pdev_abox, dev, false);
- }
}
info->auto_started = enable;
return ret;
}
+ ret = enable_irq_wake(data->irq);
+ if (ret < 0)
+ dev_err(dev, "Failed to enable irq wake\n");
+
#ifndef CONFIG_PM
abox_gic_resume(dev);
#endif
if (ret < 0)
dev_err(dev, "%s: pause cmd failed(%d)\n", __func__,
ret);
-
- abox_request_dram_on(platform_data->pdev_abox, dev, false);
break;
case SNDRV_PCM_TRIGGER_STOP:
dev_info(dev, "SNDRV_PCM_TRIGGER_STOP\n");
data->byte_offset = 0;
data->copied_total = 0;
data->received_total = 0;
-
- abox_request_dram_on(platform_data->pdev_abox, dev, false);
break;
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
"SNDRV_PCM_TRIGGER_START" :
"SNDRV_PCM_TRIGGER_PAUSE_RELEASE");
- abox_request_dram_on(platform_data->pdev_abox, dev, true);
-
data->start = 1;
ret = abox_rdma_mailbox_send_cmd(dev, CMD_COMPR_START);
if (ret < 0)
struct snd_soc_platform *platform = rtd->platform;
struct device *dev = platform->dev;
struct abox_platform_data *data = dev_get_drvdata(dev);
- struct snd_pcm_runtime *runtime = substream->runtime;
int id = data->id;
int ret;
ABOX_IPC_MSG msg;
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (memblock_is_memory(runtime->dma_addr))
- abox_request_dram_on(data->pdev_abox, dev, true);
-
pcmtask_msg->param.trigger = 1;
ret = abox_rdma_request_ipc(data, &msg, 1, 0);
break;
default:
break;
}
-
- if (memblock_is_memory(runtime->dma_addr))
- abox_request_dram_on(data->pdev_abox, dev, false);
-
break;
default:
ret = -EINVAL;
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (memblock_is_memory(substream->runtime->dma_addr))
- abox_request_dram_on(pdev_abox, dev, true);
pcmtask_msg->param.trigger = 1;
ret = abox_vdma_request_ipc(&msg, 1, 0);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
pcmtask_msg->param.trigger = 0;
ret = abox_vdma_request_ipc(&msg, 1, 0);
- if (memblock_is_memory(substream->runtime->dma_addr))
- abox_request_dram_on(pdev_abox, dev, false);
break;
default:
dev_err(dev, "invalid command: %d\n", cmd);
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (memblock_is_memory(substream->runtime->dma_addr))
- abox_request_dram_on(data->pdev_abox, dev, true);
-
pcmtask_msg->param.trigger = 1;
ret = abox_wdma_request_ipc(data, &msg, 1, 0);
switch (data->type) {
default:
break;
}
-
- if (memblock_is_memory(substream->runtime->dma_addr))
- abox_request_dram_on(data->pdev_abox, dev, false);
break;
default:
ret = -EINVAL;