Пример #1
0
int skl_resume_dsp(struct skl *skl)
{
	struct skl_sst *ctx = skl->skl_sst;
	int ret;

	/* if ppcap is not supported return 0 */
	if (!skl->ebus.bus.ppcap)
		return 0;

	/* enable ppcap interrupt */
	snd_hdac_ext_bus_ppcap_enable(&skl->ebus, true);
	snd_hdac_ext_bus_ppcap_int_enable(&skl->ebus, true);

	/* check if DSP 1st boot is done */
	if (skl->skl_sst->is_first_boot == true)
		return 0;

	/* disable dynamic clock gating during fw and lib download */
	ctx->enable_miscbdcge(ctx->dev, false);

	ret = skl_dsp_wake(ctx->dsp);
	ctx->enable_miscbdcge(ctx->dev, true);
	if (ret < 0)
		return ret;

	skl_dsp_enable_notification(skl->skl_sst, false);

	if (skl->cfg.astate_cfg != NULL) {
		skl_dsp_set_astate_cfg(skl->skl_sst, skl->cfg.astate_cfg->count,
					skl->cfg.astate_cfg);
	}
	return ret;
}
Пример #2
0
int skl_init_dsp(struct skl *skl)
{
	void __iomem *mmio_base;
	struct hdac_ext_bus *ebus = &skl->ebus;
	struct hdac_bus *bus = ebus_to_hbus(ebus);
	int irq = bus->irq;
	struct skl_dsp_loader_ops loader_ops;
	int ret;

	loader_ops.alloc_dma_buf = skl_alloc_dma_buf;
	loader_ops.free_dma_buf = skl_free_dma_buf;

	/* enable ppcap interrupt */
	snd_hdac_ext_bus_ppcap_enable(&skl->ebus, true);
	snd_hdac_ext_bus_ppcap_int_enable(&skl->ebus, true);

	/* read the BAR of the ADSP MMIO */
	mmio_base = pci_ioremap_bar(skl->pci, 4);
	if (mmio_base == NULL) {
		dev_err(bus->dev, "ioremap error\n");
		return -ENXIO;
	}

	ret = skl_sst_dsp_init(bus->dev, mmio_base, irq,
			skl->fw_name, loader_ops, &skl->skl_sst);
	if (ret < 0)
		return ret;

	skl_dsp_enable_notification(skl->skl_sst, false);
	dev_dbg(bus->dev, "dsp registration status=%d\n", ret);

	return ret;
}
Пример #3
0
int skl_resume_dsp(struct skl *skl)
{
	struct skl_sst *ctx = skl->skl_sst;
	int ret;

	/* if ppcap is not supported return 0 */
	if (!skl->ebus.ppcap)
		return 0;

	/* enable ppcap interrupt */
	snd_hdac_ext_bus_ppcap_enable(&skl->ebus, true);
	snd_hdac_ext_bus_ppcap_int_enable(&skl->ebus, true);

	ret = skl_dsp_wake(ctx->dsp);
	if (ret < 0)
		return ret;

	skl_dsp_enable_notification(skl->skl_sst, false);
	return ret;
}
Пример #4
0
int skl_resume_dsp(struct skl *skl)
{
	struct skl_sst *ctx = skl->skl_sst;
	struct hdac_bus *bus = skl_to_bus(skl);
	int ret;

	/* if ppcap is not supported return 0 */
	if (!bus->ppcap)
		return 0;

	/* enable ppcap interrupt */
	snd_hdac_ext_bus_ppcap_enable(bus, true);
	snd_hdac_ext_bus_ppcap_int_enable(bus, true);

	/* check if DSP 1st boot is done */
	if (skl->skl_sst->is_first_boot)
		return 0;

	/*
	 * Disable dynamic clock and power gating during firmware
	 * and library download
	 */
	ctx->enable_miscbdcge(ctx->dev, false);
	ctx->clock_power_gating(ctx->dev, false);

	ret = skl_dsp_wake(ctx->dsp);
	ctx->enable_miscbdcge(ctx->dev, true);
	ctx->clock_power_gating(ctx->dev, true);
	if (ret < 0)
		return ret;

	skl_dsp_enable_notification(skl->skl_sst, false);

	if (skl->cfg.astate_cfg != NULL) {
		skl_dsp_set_astate_cfg(skl->skl_sst, skl->cfg.astate_cfg->count,
					skl->cfg.astate_cfg);
	}
	return ret;
}