dma/cavs_hda: Support channel filtering
Support channel filtering to find the requested channel if filter_param provided Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
This commit is contained in:
parent
ba84364196
commit
cd11910201
4 changed files with 22 additions and 0 deletions
|
@ -130,6 +130,23 @@ int cavs_hda_dma_status(const struct device *dev, uint32_t channel,
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool cavs_hda_dma_chan_filter(const struct device *dev, int channel, void *filter_param)
|
||||
{
|
||||
uint32_t requested_channel;
|
||||
|
||||
if (!filter_param) {
|
||||
return true;
|
||||
}
|
||||
|
||||
requested_channel = *(uint32_t *)filter_param;
|
||||
|
||||
if (channel == requested_channel) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int cavs_hda_dma_start(const struct device *dev, uint32_t channel)
|
||||
{
|
||||
const struct cavs_hda_dma_cfg *const cfg = dev->config;
|
||||
|
|
|
@ -37,6 +37,9 @@ int cavs_hda_dma_host_reload(const struct device *dev, uint32_t channel,
|
|||
int cavs_hda_dma_status(const struct device *dev, uint32_t channel,
|
||||
struct dma_status *stat);
|
||||
|
||||
bool cavs_hda_dma_chan_filter(const struct device *dev, int channel,
|
||||
void *filter_param);
|
||||
|
||||
int cavs_hda_dma_start(const struct device *dev, uint32_t channel);
|
||||
|
||||
int cavs_hda_dma_stop(const struct device *dev, uint32_t channel);
|
||||
|
|
|
@ -19,6 +19,7 @@ static const struct dma_driver_api cavs_hda_dma_host_in_api = {
|
|||
.start = cavs_hda_dma_start,
|
||||
.stop = cavs_hda_dma_stop,
|
||||
.get_status = cavs_hda_dma_status,
|
||||
.chan_filter = cavs_hda_dma_chan_filter,
|
||||
};
|
||||
|
||||
#define CAVS_HDA_DMA_HOST_IN_INIT(inst) \
|
||||
|
|
|
@ -19,6 +19,7 @@ static const struct dma_driver_api cavs_hda_dma_host_out_api = {
|
|||
.start = cavs_hda_dma_start,
|
||||
.stop = cavs_hda_dma_stop,
|
||||
.get_status = cavs_hda_dma_status,
|
||||
.chan_filter = cavs_hda_dma_chan_filter,
|
||||
};
|
||||
|
||||
#define CAVS_HDA_DMA_HOST_OUT_INIT(inst) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue