Lines Matching +full:active +full:- +full:low

1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
15 #include "acp-dsp-offset.h"
29 const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); in acp_dsp_stream_config()
31 int stream_tag = stream->stream_tag; in acp_dsp_stream_config()
32 u32 low, high, offset, reg_val; in acp_dsp_stream_config() local
41 stream->reg_offset = PTE_GRP1_OFFSET; in acp_dsp_stream_config()
47 stream->reg_offset = PTE_GRP2_OFFSET; in acp_dsp_stream_config()
53 stream->reg_offset = PTE_GRP3_OFFSET; in acp_dsp_stream_config()
59 stream->reg_offset = PTE_GRP4_OFFSET; in acp_dsp_stream_config()
65 stream->reg_offset = PTE_GRP5_OFFSET; in acp_dsp_stream_config()
71 stream->reg_offset = PTE_GRP6_OFFSET; in acp_dsp_stream_config()
77 stream->reg_offset = PTE_GRP7_OFFSET; in acp_dsp_stream_config()
83 stream->reg_offset = PTE_GRP8_OFFSET; in acp_dsp_stream_config()
86 dev_err(sdev->dev, "Invalid stream tag %d\n", stream_tag); in acp_dsp_stream_config()
87 return -EINVAL; in acp_dsp_stream_config()
92 phy_addr_offset = sdev->debug_box.offset + in acp_dsp_stream_config()
94 index = stream_tag - 1; in acp_dsp_stream_config()
98 phy_addr_offset, stream->reg_offset); in acp_dsp_stream_config()
101 offset = offset + sdev->debug_box.offset; in acp_dsp_stream_config()
102 reg_val = desc->sram_pte_offset + offset; in acp_dsp_stream_config()
106 for (page_idx = 0; page_idx < stream->num_pages; page_idx++) { in acp_dsp_stream_config()
107 addr = snd_sgbuf_get_addr(stream->dmab, page_idx * PAGE_SIZE); in acp_dsp_stream_config()
109 /* Load the low address of page int ACP SRAM through SRBM */ in acp_dsp_stream_config()
110 low = lower_32_bits(addr); in acp_dsp_stream_config()
113 snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_SCRATCH_REG_0 + offset, low); in acp_dsp_stream_config()
129 struct acp_dev_data *adata = sdev->pdata->hw_pdata; in acp_dsp_stream_get()
130 struct acp_dsp_stream *stream = adata->stream_buf; in acp_dsp_stream_get()
134 if (stream->active) in acp_dsp_stream_get()
139 stream->active = 1; in acp_dsp_stream_get()
144 if (stream->stream_tag == tag) { in acp_dsp_stream_get()
145 stream->active = 1; in acp_dsp_stream_get()
150 dev_err(sdev->dev, "stream %d active or no inactive stream\n", tag); in acp_dsp_stream_get()
158 struct acp_dev_data *adata = sdev->pdata->hw_pdata; in acp_dsp_stream_put()
159 struct acp_dsp_stream *stream = adata->stream_buf; in acp_dsp_stream_put()
162 /* Free an active stream */ in acp_dsp_stream_put()
165 stream->active = 0; in acp_dsp_stream_put()
170 dev_err(sdev->dev, "Cannot find active stream tag %d\n", acp_stream->stream_tag); in acp_dsp_stream_put()
171 return -EINVAL; in acp_dsp_stream_put()
177 struct acp_dev_data *adata = sdev->pdata->hw_pdata; in acp_dsp_stream_init()
181 adata->stream_buf[i].sdev = sdev; in acp_dsp_stream_init()
182 adata->stream_buf[i].active = 0; in acp_dsp_stream_init()
183 adata->stream_buf[i].stream_tag = i + 1; in acp_dsp_stream_init()