From c465f8293449c7919f23aed5979cc91e9c44e27c Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Mon, 23 Jul 2018 01:13:09 -0400 Subject: [PATCH] ASoC: SOF: use hdac_bus to manage streams This patch doesn't replace struct sof_intel_hda_dev with hda_bus, but embed hda_bus in sof_intel_hda_dev. It's becasue there are a few memebers of sof_intel_hda_dev are not in hda_bus. Host streams are managed by hdac_bus's stream_list now. Compiling okay. But not test yet. May have conflict with Keyon's PR today. I'll rebase and merge it to Keyon's PR later. Signed-off-by: Mengdong Lin --- sound/soc/sof/intel/hda-codec.c | 8 +- sound/soc/sof/intel/hda-ctrl.c | 2 +- sound/soc/sof/intel/hda-loader.c | 14 +- sound/soc/sof/intel/hda-stream.c | 228 +++++++++++++++++-------------- sound/soc/sof/intel/hda.c | 29 +--- sound/soc/sof/intel/hda.h | 17 ++- sound/soc/sof/sof-priv.h | 4 +- 7 files changed, 155 insertions(+), 147 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 83a544b974aa98..d35ca8a1085128 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -51,7 +51,7 @@ static void hda_codec_load_module(struct hda_codec *codec) {} /* probe individual codec */ static int hda_codec_probe(struct snd_sof_dev *sdev, int addr) { - struct hda_bus *hbus = sdev->hbus; + struct hda_bus *hbus = sof_to_hbus(sdev); unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) | (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; unsigned int res = -1; @@ -92,8 +92,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int addr) /* Codec initialization */ int hda_codec_probe_bus(struct snd_sof_dev *sdev) { - struct hda_bus *hbus = sdev->hbus; - struct hdac_bus *bus = &hbus->core; + struct hdac_bus *bus = sof_to_bus(sdev); int c, max_slots, ret = 0; max_slots = HDA_MAX_CODECS; @@ -116,8 +115,7 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev) int hda_codec_i915_init(struct snd_sof_dev *sdev) { - struct hda_bus *hbus = sdev->hbus; - struct hdac_bus *bus = &hbus->core; + struct hdac_bus *bus = sof_to_bus(sdev); int ret; /* i915 exposes a HDA codec for HDMI audio */ diff --git a/sound/soc/sof/intel/hda-ctrl.c b/sound/soc/sof/intel/hda-ctrl.c index eac0815de78734..a55801a3d93433 100644 --- a/sound/soc/sof/intel/hda-ctrl.c +++ b/sound/soc/sof/intel/hda-ctrl.c @@ -145,7 +145,7 @@ void hda_dsp_ctrl_enable_miscbdcge(struct snd_sof_dev *sdev, bool enable) */ int hda_dsp_ctrl_init_chip(struct snd_sof_dev *sdev, bool full_reset) { - struct hdac_bus *bus = &sdev->hbus->core; + struct hdac_bus *bus = sof_to_bus(sdev); int ret; hda_dsp_ctrl_enable_miscbdcge(sdev, false); diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 372ccfaac30647..fbb3943422380e 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -242,17 +242,19 @@ static int cl_cleanup(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab, static int cl_copy_fw(struct snd_sof_dev *sdev, int tag) { - struct sof_intel_hda_stream *stream = NULL; - struct sof_intel_hda_dev *hdev = sdev->hda; - int ret, status, i; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s, *stream = NULL; + int ret, status; /* get stream with tag */ - for (i = 0; i < hdev->num_playback; i++) { - if (hdev->pstream[i].tag == tag) { - stream = &hdev->pstream[i]; + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == SNDRV_PCM_STREAM_PLAYBACK + && s->tag == tag) { + stream = s; break; } } + if (!stream) { dev_err(sdev->dev, "error: could not get stream with stream tag%d\n", diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index d753a83c746b72..a61a3e20942d14 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -116,19 +116,44 @@ int hda_dsp_stream_spib_config(struct snd_sof_dev *sdev, return 0; } + +/* get next unused stream */ +struct sof_intel_hda_stream * +hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction) +{ + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s, *stream = NULL; + + /* get an unused playback stream */ + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == direction && !s->open) { + s->open = true; + stream = s; + break; + } + } + + /* stream found ? */ + if (!stream) + dev_err(sdev->dev, "error: no free %s streams\n", + direction ==SNDRV_PCM_STREAM_PLAYBACK ? "playback" : "capture" ); + + return stream; +} + /* get next unused playback stream */ struct sof_intel_hda_stream * hda_dsp_stream_get_pstream(struct snd_sof_dev *sdev) { - struct sof_intel_hda_dev *hdev = sdev->hda; - struct sof_intel_hda_stream *stream = NULL; - int i; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s, *stream = NULL; /* get an unused playback stream */ - for (i = 0; i < hdev->num_playback; i++) { - if (!hdev->pstream[i].open) { - hdev->pstream[i].open = true; - stream = &hdev->pstream[i]; + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == SNDRV_PCM_STREAM_PLAYBACK + && !s->open) { + s->open = true; + stream = s; break; } } @@ -144,15 +169,15 @@ hda_dsp_stream_get_pstream(struct snd_sof_dev *sdev) struct sof_intel_hda_stream * hda_dsp_stream_get_cstream(struct snd_sof_dev *sdev) { - struct sof_intel_hda_dev *hdev = sdev->hda; - struct sof_intel_hda_stream *stream = NULL; - int i; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s, *stream = NULL; /* get an unused capture stream */ - for (i = 0; i < hdev->num_capture; i++) { - if (!hdev->cstream[i].open) { - hdev->cstream[i].open = true; - stream = &hdev->cstream[i]; + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == SNDRV_PCM_STREAM_CAPTURE + && !s->open) { + s->open = true; + stream = s; break; } } @@ -164,17 +189,36 @@ hda_dsp_stream_get_cstream(struct snd_sof_dev *sdev) return stream; } +/* free a stream */ +int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int tag) +{ + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s; + + /* find used stream */ + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == direction + && s->open && s->tag == tag) { + s->open = false; + return 0; + } + } + + dev_dbg(sdev->dev, "tag %d not opened!\n", tag); + return -ENODEV; +} + /* free playback stream */ int hda_dsp_stream_put_pstream(struct snd_sof_dev *sdev, int tag) { - struct sof_intel_hda_dev *hdev = sdev->hda; - int i; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s; /* find used playback stream */ - for (i = 0; i < hdev->num_playback; i++) { - if (hdev->pstream[i].open && - hdev->pstream[i].tag == tag) { - hdev->pstream[i].open = false; + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == SNDRV_PCM_STREAM_PLAYBACK + && s->open && s->tag == tag) { + s->open = false; return 0; } } @@ -186,14 +230,14 @@ int hda_dsp_stream_put_pstream(struct snd_sof_dev *sdev, int tag) /* free capture stream */ int hda_dsp_stream_put_cstream(struct snd_sof_dev *sdev, int tag) { - struct sof_intel_hda_dev *hdev = sdev->hda; - int i; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s; /* find used capture stream */ - for (i = 0; i < hdev->num_capture; i++) { - if (hdev->cstream[i].open && - hdev->cstream[i].tag == tag) { - hdev->cstream[i].open = false; + list_for_each_entry(s, &bus->stream_list, list) { + if (s->direction == SNDRV_PCM_STREAM_CAPTURE + && s->open && s->tag == tag) { + s->open = false; return 0; } } @@ -256,7 +300,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab, struct snd_pcm_hw_params *params) { - struct sof_intel_hda_dev *hdev = sdev->hda; + struct hdac_bus *bus = sof_to_bus(sdev); struct sof_intel_dsp_bdl *bdl; int ret, timeout = HDA_DSP_STREAM_RESET_TIMEOUT; u32 val, mask; @@ -382,7 +426,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, if (!(snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE) & SOF_HDA_ADSP_DPLBASE_ENABLE)) snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE, - (u32)hdev->posbuffer.addr | + (u32)bus->posbuf.addr | SOF_HDA_ADSP_DPLBASE_ENABLE); /* set interrupt enable bits */ @@ -408,7 +452,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, irqreturn_t hda_dsp_stream_interrupt(int irq, void *context) { struct snd_sof_dev *sdev = (struct snd_sof_dev *)context; - struct hdac_bus *bus = &sdev->hbus->core; + struct hdac_bus *bus = sof_to_bus(sdev); u32 status; if (!pm_runtime_active(sdev->dev)) @@ -440,63 +484,40 @@ irqreturn_t hda_dsp_stream_interrupt(int irq, void *context) irqreturn_t hda_dsp_stream_threaded_handler(int irq, void *context) { struct snd_sof_dev *sdev = (struct snd_sof_dev *)context; - struct sof_intel_hda_dev *hdev = sdev->hda; + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s; + //struct sof_intel_hda_dev *hdev = sdev->hda; u32 status = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); u32 sd_status; - int i; - /* check playback streams */ - for (i = 0; i < hdev->num_playback; i++) { - /* is IRQ for this stream ? */ - if (status & (1 << hdev->pstream[i].index)) { + /* check streams */ + list_for_each_entry(s, &bus->stream_list, list) { + if (status & (1 << s->index) + && !s->open) { sd_status = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, - hdev->pstream[i].sd_offset + + s->sd_offset + SOF_HDA_ADSP_REG_CL_SD_STS) & 0xff; - dev_dbg(sdev->dev, "pstream %d status 0x%x\n", - i, sd_status); + dev_dbg(sdev->dev, "stream %d status 0x%x\n", + s->index, sd_status); snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, - hdev->pstream[i].sd_offset + + s->sd_offset + SOF_HDA_ADSP_REG_CL_SD_STS, SOF_HDA_CL_DMA_SD_INT_MASK, SOF_HDA_CL_DMA_SD_INT_MASK); - if (!hdev->pstream[i].substream || - !hdev->pstream[i].running || + if (!s->substream || + !s->running || (sd_status & SOF_HDA_CL_DMA_SD_INT_MASK) == 0) continue; - } - } - - /* check capture streams */ - for (i = 0; i < hdev->num_capture; i++) { - /* is IRQ for this stream ? */ - if (status & (1 << hdev->cstream[i].index)) { - sd_status = - snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, - hdev->cstream[i].sd_offset + - SOF_HDA_ADSP_REG_CL_SD_STS) & - 0xff; - - dev_dbg(sdev->dev, "cstream %d status 0x%x\n", - i, sd_status); - - snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, - hdev->cstream[i].sd_offset + - SOF_HDA_ADSP_REG_CL_SD_STS, - SOF_HDA_CL_DMA_SD_INT_MASK, - SOF_HDA_CL_DMA_SD_INT_MASK); - if (!hdev->cstream[i].substream || - !hdev->cstream[i].running || - (sd_status & SOF_HDA_CL_DMA_SD_INT_MASK) == 0) - continue; } } + // TODO: legacy code call snd_pcm_period_elapsed(hstr->substream); // we probably dont need this since we get updates via IPC/SRAM/ // TODO: evaluate. @@ -506,7 +527,7 @@ irqreturn_t hda_dsp_stream_threaded_handler(int irq, void *context) int hda_dsp_stream_init(struct snd_sof_dev *sdev) { - struct sof_intel_hda_dev *hdev = sdev->hda; + struct hdac_bus *bus = sof_to_bus(sdev); struct sof_intel_hda_stream *stream; struct pci_dev *pci = sdev->pci; int i, num_playback, num_capture, num_total, ret; @@ -520,9 +541,6 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) num_playback = (gcap >> 12) & 0x0f; num_total = num_playback + num_capture; - hdev->num_capture = num_capture; - hdev->num_playback = num_playback; - dev_dbg(sdev->dev, "detected %d playback and %d capture streams\n", num_playback, num_capture); @@ -539,26 +557,29 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) } /* mem alloc for the position buffer */ - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, 8, - &hdev->posbuffer); + /* TODO: check postion buffer update */ + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, 8 * num_total, + &bus->posbuf); if (ret < 0) { dev_err(sdev->dev, "error: posbuffer dma alloc failed\n"); return -ENOMEM; } - if (sdev->hbus) { - /* mem alloc for the CORB/RIRB ringbuffers */ - ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, - PAGE_SIZE, &sdev->hbus->core.rb); - if (ret < 0) { - dev_err(sdev->dev, "error: RB alloc failed\n"); - return -ENOMEM; - } + + /* mem alloc for the CORB/RIRB ringbuffers */ + ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev, + PAGE_SIZE, &bus->rb); + if (ret < 0) { + dev_err(sdev->dev, "error: RB alloc failed\n"); + return -ENOMEM; } /* create capture streams */ for (i = 0; i < num_capture; i++) { - stream = &hdev->cstream[i]; + + stream = kzalloc(sizeof(*stream), GFP_KERNEL); + if (!stream) + return -ENOMEM; stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + SOF_HDA_PPHC_BASE + SOF_HDA_PPHC_INTERVAL * i; @@ -598,15 +619,21 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) HDA_DSP_BDL_SIZE, &stream->bdl); if (ret < 0) { dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); + kfree(stream); return -ENOMEM; } - stream->posbuf = (__le32 *)(hdev->posbuffer.area + + stream->posbuf = (__le32 *)(bus->posbuf.area + (stream->index) * 8); + + list_add_tail(&stream->list, &bus->stream_list); } /* create playback streams */ for (i = num_capture; i < num_total; i++) { - stream = &hdev->pstream[i - num_capture]; + + stream = kzalloc(sizeof(*stream), GFP_KERNEL); + if (!stream) + return -ENOMEM; /* we always have DSP support */ stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + @@ -646,11 +673,14 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) HDA_DSP_BDL_SIZE, &stream->bdl); if (ret < 0) { dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); + kfree(stream); return -ENOMEM; } - stream->posbuf = (__le32 *)(hdev->posbuffer.area + + stream->posbuf = (__le32 *)(bus->posbuf.area + (stream->index) * 8); + + list_add_tail(&stream->list, &bus->stream_list); } return 0; @@ -658,30 +688,22 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev) void hda_dsp_stream_free(struct snd_sof_dev *sdev) { - struct sof_intel_hda_dev *hdev = sdev->hda; - struct sof_intel_hda_stream *stream; - int i; - - /* free position buffer */ - if (hdev->posbuffer.area) - snd_dma_free_pages(&hdev->posbuffer); + struct hdac_bus *bus = sof_to_bus(sdev); + struct sof_intel_hda_stream *s, *_s; - /* free capture streams */ - for (i = 0; i < hdev->num_capture; i++) { - stream = &hdev->cstream[i]; - /* free bdl buffer */ - if (stream->bdl.area) - snd_dma_free_pages(&stream->bdl); - } + /* free position buffer */ + if (bus->posbuf.area) + snd_dma_free_pages(&bus->posbuf); - /* free playback streams */ - for (i = 0; i < hdev->num_playback; i++) { - stream = &hdev->pstream[i]; + list_for_each_entry_safe(s, _s, &bus->stream_list, list) { + /* TODO: decouple */ /* free bdl buffer */ - if (stream->bdl.area) - snd_dma_free_pages(&stream->bdl); + if (s->bdl.area) + snd_dma_free_pages(&s->bdl); + list_del(&s->list); + kfree(s); } } diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index a65dca8c446326..1965967cc7f981 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -342,12 +342,8 @@ static int hda_init(struct snd_sof_dev *sdev) //int err; //unsigned short gcap; - hbus = devm_kzalloc(&pci->dev, sizeof(*hbus), GFP_KERNEL); - if (!hbus) - return -ENOMEM; - - sdev->hbus = hbus; - bus = &hbus->core; + hbus = sof_to_hbus(sdev); + bus = sof_to_bus(sdev); /* HDA bus init */ #if IS_ENABLED(CONFIG_SND_SOC_HDAC_HDA) @@ -389,7 +385,7 @@ static int hda_init(struct snd_sof_dev *sdev) static int hda_init_caps(struct snd_sof_dev *sdev) { - struct hdac_bus *bus = &sdev->hbus->core; + struct hdac_bus *bus = sof_to_bus(sdev); struct pci_dev *pci = sdev->pci; struct hdac_ext_link *hlink = NULL; int ret = 0; @@ -499,9 +495,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) { struct pci_dev *pci = sdev->pci; struct sof_intel_hda_dev *hdev; + struct hdac_bus *bus; struct sof_intel_hda_stream *stream; const struct sof_intel_dsp_desc *chip; - int i; int ret = 0; /* set DSP arch ops */ @@ -582,20 +578,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) } /* clear stream status */ - for (i = 0 ; i < hdev->num_capture ; i++) { - stream = &hdev->cstream[i]; - if (stream) - snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, - stream->sd_offset + - SOF_HDA_ADSP_REG_CL_SD_STS, - SOF_HDA_CL_DMA_SD_INT_MASK, - SOF_HDA_CL_DMA_SD_INT_MASK); - } - - for (i = 0 ; i < hdev->num_playback ; i++) { - stream = &hdev->pstream[i]; - if (stream) - snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, + bus = sof_to_bus(sdev); + list_for_each_entry(stream, &bus->stream_list, list) { + snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, stream->sd_offset + SOF_HDA_ADSP_REG_CL_SD_STS, SOF_HDA_CL_DMA_SD_INT_MASK, diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 6ff873f66be456..a9aa7f6cf98b3d 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -358,6 +358,8 @@ struct sof_intel_hda_stream { /* PCM */ struct snd_pcm_substream *substream; + + struct list_head list; /* list of streams on the bus */ }; #define SOF_HDA_PLAYBACK_STREAMS 16 @@ -368,18 +370,11 @@ struct sof_intel_hda_stream { /* represents DSP HDA controller frontend - i.e. host facing control */ struct sof_intel_hda_dev { + struct hda_bus hbus; + /* hw config */ const struct sof_intel_dsp_desc *desc; - /* streams */ - struct sof_intel_hda_stream pstream[SOF_HDA_PLAYBACK_STREAMS]; - struct sof_intel_hda_stream cstream[SOF_HDA_CAPTURE_STREAMS]; - int num_capture; - int num_playback; - - /* position buffers */ - struct snd_dma_buffer posbuffer; - /*trace */ struct sof_intel_hda_stream *dtrace_stream; @@ -453,10 +448,14 @@ int hda_dsp_stream_setup_bdl(struct snd_sof_dev *sdev, struct sof_intel_hda_stream *stream, struct sof_intel_dsp_bdl *bdl, int size, struct snd_pcm_hw_params *params); + +struct sof_intel_hda_stream * + hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction); struct sof_intel_hda_stream * hda_dsp_stream_get_cstream(struct snd_sof_dev *sdev); struct sof_intel_hda_stream * hda_dsp_stream_get_pstream(struct snd_sof_dev *sdev); +int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag); int hda_dsp_stream_put_pstream(struct snd_sof_dev *sdev, int stream_tag); int hda_dsp_stream_put_cstream(struct snd_sof_dev *sdev, int stream_tag); int hda_dsp_stream_spib_config(struct snd_sof_dev *sdev, diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index e1c2d1deb5f667..faa56f2e29bcd7 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -298,7 +298,6 @@ struct snd_sof_dev { struct snd_sof_pdata *pdata; const struct snd_sof_dsp_ops *ops; struct sof_intel_hda_dev *hda; /* for HDA based DSP HW FIXME: delete this and use hbus instead */ - struct hda_bus *hbus; const struct sof_arch_ops *arch_ops; /* IPC */ @@ -355,6 +354,9 @@ struct snd_sof_dev { void *private; /* core does not touch this */ }; +#define sof_to_bus(s) (&(s)->hda->hbus.core) +#define sof_to_hbus(s) (&(s)->hda->hbus) + /* * SOF platform private struct used as drvdata of * platform dev (e.g. pci/acpi/spi...) drvdata.