Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright(c) 2021 Intel Corporation. All rights reserved.
0004  *
0005  * Authors: Cezary Rojewski <cezary.rojewski@intel.com>
0006  *          Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
0007  */
0008 
0009 #ifndef __SOUND_SOC_INTEL_AVS_PATH_H
0010 #define __SOUND_SOC_INTEL_AVS_PATH_H
0011 
0012 #include <linux/list.h>
0013 #include "avs.h"
0014 #include "topology.h"
0015 
0016 struct avs_path {
0017     u32 dma_id;
0018     struct list_head ppl_list;
0019     u32 state;
0020 
0021     struct avs_tplg_path *template;
0022     struct avs_dev *owner;
0023     /* device path management */
0024     struct list_head node;
0025 };
0026 
0027 struct avs_path_pipeline {
0028     u8 instance_id;
0029     struct list_head mod_list;
0030     struct list_head binding_list;
0031 
0032     struct avs_tplg_pipeline *template;
0033     struct avs_path *owner;
0034     /* path pipelines management */
0035     struct list_head node;
0036 };
0037 
0038 struct avs_path_module {
0039     u16 module_id;
0040     u16 instance_id;
0041     union avs_gtw_attributes gtw_attrs;
0042 
0043     struct avs_tplg_module *template;
0044     struct avs_path_pipeline *owner;
0045     /* pipeline modules management */
0046     struct list_head node;
0047 };
0048 
0049 struct avs_path_binding {
0050     struct avs_path_module *source;
0051     u8 source_pin;
0052     struct avs_path_module *sink;
0053     u8 sink_pin;
0054 
0055     struct avs_tplg_binding *template;
0056     struct avs_path_pipeline *owner;
0057     /* pipeline bindings management */
0058     struct list_head node;
0059 };
0060 
0061 void avs_path_free(struct avs_path *path);
0062 struct avs_path *avs_path_create(struct avs_dev *adev, u32 dma_id,
0063                  struct avs_tplg_path_template *template,
0064                  struct snd_pcm_hw_params *fe_params,
0065                  struct snd_pcm_hw_params *be_params);
0066 int avs_path_bind(struct avs_path *path);
0067 int avs_path_unbind(struct avs_path *path);
0068 int avs_path_reset(struct avs_path *path);
0069 int avs_path_pause(struct avs_path *path);
0070 int avs_path_run(struct avs_path *path, int trigger);
0071 
0072 #endif