#ifndef __SPRD_MCDT_H
#define __SPRD_MCDT_H
enum sprd_mcdt_channel_type { … };
enum sprd_mcdt_dma_chan { … };
struct sprd_mcdt_chan_callback { … };
struct sprd_mcdt_chan { … };
#if IS_ENABLED(CONFIG_SND_SOC_SPRD_MCDT)
struct sprd_mcdt_chan *sprd_mcdt_request_chan(u8 channel,
enum sprd_mcdt_channel_type type);
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan);
int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size);
int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size);
int sprd_mcdt_chan_int_enable(struct sprd_mcdt_chan *chan, u32 water_mark,
struct sprd_mcdt_chan_callback *cb);
void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan);
int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan,
enum sprd_mcdt_dma_chan dma_chan, u32 water_mark);
void sprd_mcdt_chan_dma_disable(struct sprd_mcdt_chan *chan);
#else
struct sprd_mcdt_chan *sprd_mcdt_request_chan(u8 channel,
enum sprd_mcdt_channel_type type)
{
return NULL;
}
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan)
{ }
int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size)
{
return -EINVAL;
}
int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size)
{
return 0;
}
int sprd_mcdt_chan_int_enable(struct sprd_mcdt_chan *chan, u32 water_mark,
struct sprd_mcdt_chan_callback *cb)
{
return -EINVAL;
}
void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan)
{ }
int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan,
enum sprd_mcdt_dma_chan dma_chan, u32 water_mark)
{
return -EINVAL;
}
void sprd_mcdt_chan_dma_disable(struct sprd_mcdt_chan *chan)
{ }
#endif
#endif