.. | .. |
---|
9 | 9 | |
---|
10 | 10 | struct clk; |
---|
11 | 11 | struct platform_device; |
---|
| 12 | +struct reg_field; |
---|
12 | 13 | struct regmap; |
---|
| 14 | +struct regmap_field; |
---|
13 | 15 | struct reset_control; |
---|
14 | 16 | |
---|
15 | 17 | struct snd_soc_component_driver; |
---|
16 | 18 | struct snd_soc_dai; |
---|
17 | 19 | struct snd_soc_dai_driver; |
---|
18 | | -struct snd_pcm_ops; |
---|
| 20 | + |
---|
19 | 21 | struct snd_soc_pcm_runtime; |
---|
20 | 22 | |
---|
21 | 23 | #define AXG_FIFO_CH_MAX 128 |
---|
.. | .. |
---|
25 | 27 | SNDRV_PCM_FMTBIT_S16_LE | \ |
---|
26 | 28 | SNDRV_PCM_FMTBIT_S20_LE | \ |
---|
27 | 29 | SNDRV_PCM_FMTBIT_S24_LE | \ |
---|
28 | | - SNDRV_PCM_FMTBIT_S32_LE) |
---|
| 30 | + SNDRV_PCM_FMTBIT_S32_LE | \ |
---|
| 31 | + SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE) |
---|
29 | 32 | |
---|
30 | 33 | #define AXG_FIFO_BURST 8 |
---|
31 | | -#define AXG_FIFO_MIN_CNT 64 |
---|
32 | | -#define AXG_FIFO_MIN_DEPTH (AXG_FIFO_BURST * AXG_FIFO_MIN_CNT) |
---|
33 | 34 | |
---|
34 | 35 | #define FIFO_INT_ADDR_FINISH BIT(0) |
---|
35 | 36 | #define FIFO_INT_ADDR_INT BIT(1) |
---|
.. | .. |
---|
49 | 50 | #define CTRL1_STATUS2_SEL_MASK GENMASK(11, 8) |
---|
50 | 51 | #define CTRL1_STATUS2_SEL(x) ((x) << 8) |
---|
51 | 52 | #define STATUS2_SEL_DDR_READ 0 |
---|
52 | | -#define CTRL1_THRESHOLD_MASK GENMASK(23, 16) |
---|
53 | | -#define CTRL1_THRESHOLD(x) ((x) << 16) |
---|
54 | 53 | #define CTRL1_FRDDR_DEPTH_MASK GENMASK(31, 24) |
---|
55 | 54 | #define CTRL1_FRDDR_DEPTH(x) ((x) << 24) |
---|
56 | 55 | #define FIFO_START_ADDR 0x08 |
---|
.. | .. |
---|
59 | 58 | #define FIFO_STATUS1 0x14 |
---|
60 | 59 | #define STATUS1_INT_STS(x) ((x) << 0) |
---|
61 | 60 | #define FIFO_STATUS2 0x18 |
---|
| 61 | +#define FIFO_INIT_ADDR 0x24 |
---|
| 62 | +#define FIFO_CTRL2 0x28 |
---|
62 | 63 | |
---|
63 | 64 | struct axg_fifo { |
---|
64 | 65 | struct regmap *map; |
---|
65 | 66 | struct clk *pclk; |
---|
66 | 67 | struct reset_control *arb; |
---|
| 68 | + struct regmap_field *field_threshold; |
---|
| 69 | + unsigned int depth; |
---|
67 | 70 | int irq; |
---|
68 | 71 | }; |
---|
69 | 72 | |
---|
70 | 73 | struct axg_fifo_match_data { |
---|
71 | 74 | const struct snd_soc_component_driver *component_drv; |
---|
72 | 75 | struct snd_soc_dai_driver *dai_drv; |
---|
| 76 | + struct reg_field field_threshold; |
---|
73 | 77 | }; |
---|
74 | 78 | |
---|
75 | | -extern const struct snd_pcm_ops axg_fifo_pcm_ops; |
---|
| 79 | +int axg_fifo_pcm_open(struct snd_soc_component *component, |
---|
| 80 | + struct snd_pcm_substream *ss); |
---|
| 81 | +int axg_fifo_pcm_close(struct snd_soc_component *component, |
---|
| 82 | + struct snd_pcm_substream *ss); |
---|
| 83 | +int axg_fifo_pcm_hw_params(struct snd_soc_component *component, |
---|
| 84 | + struct snd_pcm_substream *ss, |
---|
| 85 | + struct snd_pcm_hw_params *params); |
---|
| 86 | +int g12a_fifo_pcm_hw_params(struct snd_soc_component *component, |
---|
| 87 | + struct snd_pcm_substream *ss, |
---|
| 88 | + struct snd_pcm_hw_params *params); |
---|
| 89 | +int axg_fifo_pcm_hw_free(struct snd_soc_component *component, |
---|
| 90 | + struct snd_pcm_substream *ss); |
---|
| 91 | +snd_pcm_uframes_t axg_fifo_pcm_pointer(struct snd_soc_component *component, |
---|
| 92 | + struct snd_pcm_substream *ss); |
---|
| 93 | +int axg_fifo_pcm_trigger(struct snd_soc_component *component, |
---|
| 94 | + struct snd_pcm_substream *ss, int cmd); |
---|
76 | 95 | |
---|
77 | 96 | int axg_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd, unsigned int type); |
---|
78 | 97 | int axg_fifo_probe(struct platform_device *pdev); |
---|