Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/sound/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct sof_dev_desc {
/* defaults for no codec mode */
const char *nocodec_fw_filename;
const char *nocodec_tplg_filename;

const struct snd_sof_dsp_ops *ops;
const struct sof_arch_ops *arch_ops;
};

int sof_nocodec_setup(struct device *dev,
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ static int sof_probe(struct platform_device *pdev)
sdev->parent = plat_data->dev;
if dev_is_pci(plat_data->dev)
sdev->pci = to_pci_dev(plat_data->dev);
sdev->ops = plat_data->machine->pdata;

sdev->pdata = plat_data;
sdev->first_boot = true;
Expand Down Expand Up @@ -326,9 +325,9 @@ static int sof_probe(struct platform_device *pdev)
sdev->first_boot = false;

/* now register audio DSP platform driver and dai */
ret = snd_soc_register_component(&pdev->dev, &sdev->plat_drv,
sdev->ops->drv,
sdev->ops->num_drv);
ret = snd_soc_register_component(&pdev->dev, &sdev->plat_drv,
sof_ops(sdev)->drv,
sof_ops(sdev)->num_drv);
if (ret < 0) {
dev_err(sdev->dev,
"error: failed to register DSP DAI driver %d\n", ret);
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/sof/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include "sof-priv.h"
#include "ops.h"

static ssize_t sof_dfsentry_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
Expand Down Expand Up @@ -139,7 +140,7 @@ EXPORT_SYMBOL(snd_sof_debugfs_buf_create_item);

int snd_sof_dbg_init(struct snd_sof_dev *sdev)
{
const struct snd_sof_dsp_ops *ops = sdev->ops;
const struct snd_sof_dsp_ops *ops = sof_ops(sdev);
const struct snd_sof_debugfs_map *map;
int err = 0, i;

Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/hw-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ EXPORT_SYMBOL(snd_sof_spi_ops);
const struct sof_intel_dsp_desc spi_chip_info = {
.cores_num = 2,
.cores_mask = 0x3,
.ops = &snd_sof_spi_ops,
};
EXPORT_SYMBOL(spi_chip_info);

Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/intel/apl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,5 @@ const struct sof_intel_dsp_desc apl_chip_info = {
.ipc_ack = HDA_DSP_REG_HIPCIE,
.ipc_ack_mask = HDA_DSP_REG_HIPCIE_DONE,
.ipc_ctl = HDA_DSP_REG_HIPCCTL,
.ops = &sof_apl_ops,
};
EXPORT_SYMBOL(apl_chip_info);
4 changes: 0 additions & 4 deletions sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,6 @@ static int bdw_probe(struct snd_sof_dev *sdev)
u32 base, size;
int ret = 0;

/* set DSP arch ops */
sdev->arch_ops = &sof_xtensa_arch_ops;

/* LPE base */
mmio = platform_get_resource(pdev, IORESOURCE_MEM,
desc->resindex_lpe_base);
Expand Down Expand Up @@ -700,7 +697,6 @@ EXPORT_SYMBOL(sof_bdw_ops);
const struct sof_intel_dsp_desc bdw_chip_info = {
.cores_num = 1,
.cores_mask = 1,
.ops = &sof_bdw_ops,
};
EXPORT_SYMBOL(bdw_chip_info);

Expand Down
6 changes: 0 additions & 6 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ EXPORT_SYMBOL(sof_tng_ops);
const struct sof_intel_dsp_desc tng_chip_info = {
.cores_num = 1,
.cores_mask = 1,
.ops = &sof_tng_ops,
};
EXPORT_SYMBOL(tng_chip_info);

Expand All @@ -657,9 +656,6 @@ static int byt_acpi_probe(struct snd_sof_dev *sdev)
u32 base, size;
int ret = 0;

/* set DSP arch ops */
sdev->arch_ops = &sof_xtensa_arch_ops;

/* DSP DMA can only access low 31 bits of host memory */
ret = dma_coerce_mask_and_coherent(sdev->dev, DMA_BIT_MASK(31));
if (ret < 0) {
Expand Down Expand Up @@ -808,7 +804,6 @@ EXPORT_SYMBOL(sof_byt_ops);
const struct sof_intel_dsp_desc byt_chip_info = {
.cores_num = 1,
.cores_mask = 1,
.ops = &sof_byt_ops,
};
EXPORT_SYMBOL(byt_chip_info);

Expand Down Expand Up @@ -867,7 +862,6 @@ EXPORT_SYMBOL(sof_cht_ops);
const struct sof_intel_dsp_desc cht_chip_info = {
.cores_num = 1,
.cores_mask = 1,
.ops = &sof_cht_ops,
};
EXPORT_SYMBOL(cht_chip_info);

Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,5 @@ const struct sof_intel_dsp_desc cnl_chip_info = {
.ipc_ack = CNL_DSP_REG_HIPCIDA,
.ipc_ack_mask = CNL_DSP_REG_HIPCIDA_DONE,
.ipc_ctl = CNL_DSP_REG_HIPCCTL,
.ops = &sof_cnl_ops,
};
EXPORT_SYMBOL(cnl_chip_info);
7 changes: 2 additions & 5 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
}
dev_info(sdev->dev, "DSP detected with PCI class/subclass/prog-if 0x%06x\n", pci->class);

/* set DSP arch ops */
sdev->arch_ops = &sof_xtensa_arch_ops;

chip = get_chip_info(sdev->pdata);
if (!chip) {
dev_err(sdev->dev, "error: no such device supported, chip id:%x\n",
Expand Down Expand Up @@ -364,7 +361,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_FORCE_IPC_POSITION)
hdev->no_ipc_position = 0;
#else
hdev->no_ipc_position = sdev->ops->pcm_pointer ? 1 : 0;
hdev->no_ipc_position = sof_ops(sdev)->pcm_pointer ? 1 : 0;
#endif

/* set up HDA base */
Expand Down Expand Up @@ -442,7 +439,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)

dev_dbg(sdev->dev, "using IPC IRQ %d\n", sdev->ipc_irq);
ret = request_threaded_irq(sdev->ipc_irq, hda_dsp_ipc_irq_handler,
chip->ops->irq_thread, IRQF_SHARED,
sof_ops(sdev)->irq_thread, IRQF_SHARED,
"AudioDSP", sdev);
if (ret < 0) {
dev_err(sdev->dev, "error: failed to register IPC IRQ %d\n",
Expand Down
4 changes: 0 additions & 4 deletions sound/soc/sof/intel/hsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,6 @@ static int hsw_probe(struct snd_sof_dev *sdev)
u32 base, size;
int ret = 0;

/* set DSP arch ops */
sdev->arch_ops = &sof_xtensa_arch_ops;

/* LPE base */
mmio = platform_get_resource(pdev, IORESOURCE_MEM,
desc->resindex_lpe_base);
Expand Down Expand Up @@ -701,7 +698,6 @@ EXPORT_SYMBOL(sof_hsw_ops);
const struct sof_intel_dsp_desc hsw_chip_info = {
.cores_num = 1,
.cores_mask = 1,
.ops = &sof_hsw_ops,
};
EXPORT_SYMBOL(hsw_chip_info);

Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/intel/shim.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ struct sof_intel_dsp_desc {
int ipc_ack;
int ipc_ack_mask;
int ipc_ctl;
const struct snd_sof_dsp_ops *ops;
};

extern const struct snd_sof_dsp_ops sof_tng_ops;
Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/intel/skl.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,5 @@ const struct sof_intel_dsp_desc skl_chip_info = {
.ipc_ack = HDA_DSP_REG_HIPCIE,
.ipc_ack_mask = HDA_DSP_REG_HIPCIE_DONE,
.ipc_ctl = HDA_DSP_REG_HIPCCTL,
.ops = &sof_skl_ops,
};
EXPORT_SYMBOL(skl_chip_info);
4 changes: 2 additions & 2 deletions sound/soc/sof/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ static void ipc_msgs_rx(struct work_struct *work)
case SOF_IPC_FW_READY:
/* check for FW boot completion */
if (!sdev->boot_complete) {
if (sdev->ops->fw_ready)
err = sdev->ops->fw_ready(sdev, cmd);
if (sof_ops(sdev)->fw_ready)
err = sof_ops(sdev)->fw_ready(sdev, cmd);
if (err < 0) {
dev_err(sdev->dev, "error: DSP firmware boot timeout %d\n",
err);
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/sof/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int load_modules(struct snd_sof_dev *sdev, const struct firmware *fw)
size_t remaining;

header = (struct snd_sof_fw_header *)fw->data;
load_module = sdev->ops->load_module;
load_module = sof_ops(sdev)->load_module;
if (!load_module)
return -EINVAL;

Expand Down Expand Up @@ -271,8 +271,8 @@ int snd_sof_load_firmware(struct snd_sof_dev *sdev)
{
dev_dbg(sdev->dev, "loading firmware\n");

if (sdev->ops->load_firmware)
return sdev->ops->load_firmware(sdev);
if (sof_ops(sdev)->load_firmware)
return sof_ops(sdev)->load_firmware(sdev);
return 0;
}
EXPORT_SYMBOL(snd_sof_load_firmware);
Expand Down
Loading