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
{
21 int total_data_length
;
22 int current_data_offset
;
25 struct sprd_compr_params
{
37 struct sprd_compr_callback
{
38 void (*drain_notify
)(void *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 */