sdk-hwV1.3/lichee/linux-4.9/sound/soc/sunxi/sun8iw19-pcm.h

62 lines
1.8 KiB
C

/* sound\soc\sunxi\sun8iw19-pcm.h
* (C) Copyright 2014-2019
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
* Wolfgang Huang <huangjinhui@allwinnertech.com>
*
* some simple description for this code
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
*/
#ifndef __SUN8IW19_PCM_H_
#define __SUN8IW19_PCM_H_
struct sunxi_dma_params {
char *name;
dma_addr_t dma_addr;
u8 src_maxburst;
u8 dst_maxburst;
u8 dma_drq_type_num;
};
#ifdef CONFIG_SUNXI_ADC_DAUDIO_SYNC
enum sunxi_pcm_adc_i2s_mode {
ADC_CODEC_SYNC = 0,
ADC_I2S_SYNC = 1,
ADC_I2S_RUNNING = 2,
};
struct sunxi_pcm_trigger_spinlock {
unsigned long ref_count;
spinlock_t spinlock;
unsigned long spinlock_flags;
};
long long sunxi_codec_get_pcm_trigger_playback_tv(void);
long long sunxi_codec_get_pcm_trigger_capture_tv(void);
void sunxi_codec_set_pcm_trigger_playback_tv(void);
void sunxi_codec_set_pcm_trigger_capture_tv(void);
int sunxi_codec_get_pcm_trigger_substream_mode(void);
void sunxi_codec_set_pcm_trigger_substream_mode(int value);
void sunxi_codec_set_pcm_adc_sync_flag(int value);
int sunxi_codec_get_pcm_adc_sync_flag(void);
void sunxi_codec_set_pcm_adc_daudio0(void *sunxi_daudio);
void *sunxi_codec_get_pcm_adc_daudio0(void);
/* for adc and i2s rx sync */
void sunxi_codec_set_regmap(struct regmap *codec_regmap);
void sunxi_cpudai_adc_drq_enable(bool enable);
void audio_trigger_lock_spinlock(void);
void audio_trigger_unlock_spinlock(void);
#endif
int asoc_dma_platform_register(struct device *dev, unsigned int flags);
void asoc_dma_platform_unregister(struct device *dev);
#endif /* __SUN8IW19_PCM_H_ */