• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Unionman Technology Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef A311D_DMA_OPS_H
10 #define A311D_DMA_OPS_H
11 
12 #include <linux/dmaengine.h>
13 #include "audio_core.h"
14 
15 #ifdef __cplusplus
16 #if __cplusplus
17 extern "C" {
18 #endif
19 #endif /* __cplusplus */
20 
21 #define SUNXI_CODEC_ADDR_BASE       0x05096000
22 #define SUNXI_DAC_TXDATA            0X20
23 
24 #define SUNXI_AHUB_ADDR_BASE        0x05097000
25 #define SUNXI_AHUB_APBIF_RXFIFO(n)  (0x120 + ((n) * 0x30))
26 
27 #define AHUB_APBIF_0    0
28 #define AHUB_APBIF_1    1
29 #define AHUB_APBIF_2    2
30 #define AHUB_I2S_0      0
31 #define AHUB_I2S_1      1
32 #define AHUB_I2S_2      2
33 #define AHUB_I2S_3      3
34 #define AHUB_APBIF_USE  AHUB_APBIF_0
35 #define AHUB_I2S_USE    AHUB_I2S_0
36 
37 int32_t A311DAudioDmaDeviceInit(const struct AudioCard *card, const struct PlatformDevice *platform);
38 int32_t A311DAudioDmaBufAlloc(struct PlatformData *data, const enum AudioStreamType streamType);
39 int32_t A311DAudioDmaBufFree(struct PlatformData *data, const enum AudioStreamType streamType);
40 int32_t A311DAudioDmaRequestChannel(const struct PlatformData *data, const enum AudioStreamType streamType);
41 int32_t A311DAudioDmaConfigChannel(const struct PlatformData *data, const enum AudioStreamType streamType);
42 int32_t A311DAudioDmaPrep(const struct PlatformData *data, const enum AudioStreamType streamType);
43 int32_t A311DAudioDmaSubmit(const struct PlatformData *data, const enum AudioStreamType streamType);
44 int32_t A311DAudioDmaPending(struct PlatformData *data, const enum AudioStreamType streamType);
45 int32_t A311DAudioDmaPause(struct PlatformData *data, const enum AudioStreamType streamType);
46 int32_t A311DAudioDmaResume(const struct PlatformData *data, const enum AudioStreamType streamType);
47 int32_t A311DAudioDmaPointer(struct PlatformData *data, const enum AudioStreamType streamType, uint32_t *pointer);
48 
49 #ifdef __cplusplus
50 #if __cplusplus
51 }
52 #endif
53 #endif /* __cplusplus */
54 
55 #endif /* A311D_DMA_OPS_H */
56