treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / sprd / sprd-pcm-dma.h
blob08e9fdba82f13c111171130dfe401ea0998c839f
1 // SPDX-License-Identifier: GPL-2.0
3 #ifndef __SPRD_PCM_DMA_H
4 #define __SPRD_PCM_DMA_H
6 #define DRV_NAME "sprd_pcm_dma"
7 #define SPRD_PCM_CHANNEL_MAX 2
9 extern const struct snd_compr_ops sprd_platform_compr_ops;
11 struct sprd_pcm_dma_params {
12 dma_addr_t dev_phys[SPRD_PCM_CHANNEL_MAX];
13 u32 datawidth[SPRD_PCM_CHANNEL_MAX];
14 u32 fragment_len[SPRD_PCM_CHANNEL_MAX];
15 const char *chan_name[SPRD_PCM_CHANNEL_MAX];
18 struct sprd_compr_playinfo {
19 int total_time;
20 int current_time;
21 int total_data_length;
22 int current_data_offset;
25 struct sprd_compr_params {
26 u32 direction;
27 u32 rate;
28 u32 sample_rate;
29 u32 channels;
30 u32 format;
31 u32 period;
32 u32 periods;
33 u32 info_phys;
34 u32 info_size;
37 struct sprd_compr_callback {
38 void (*drain_notify)(void *data);
39 void *drain_data;
42 struct sprd_compr_ops {
43 int (*open)(int str_id, struct sprd_compr_callback *cb);
44 int (*close)(int str_id);
45 int (*start)(int str_id);
46 int (*stop)(int str_id);
47 int (*pause)(int str_id);
48 int (*pause_release)(int str_id);
49 int (*drain)(int received_total);
50 int (*set_params)(int str_id, struct sprd_compr_params *params);
53 struct sprd_compr_data {
54 struct sprd_compr_ops *ops;
55 struct sprd_pcm_dma_params *dma_params;
58 #endif /* __SPRD_PCM_DMA_H */