forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/meson/axg-fifo.h
....@@ -9,13 +9,15 @@
99
1010 struct clk;
1111 struct platform_device;
12
+struct reg_field;
1213 struct regmap;
14
+struct regmap_field;
1315 struct reset_control;
1416
1517 struct snd_soc_component_driver;
1618 struct snd_soc_dai;
1719 struct snd_soc_dai_driver;
18
-struct snd_pcm_ops;
20
+
1921 struct snd_soc_pcm_runtime;
2022
2123 #define AXG_FIFO_CH_MAX 128
....@@ -25,11 +27,10 @@
2527 SNDRV_PCM_FMTBIT_S16_LE | \
2628 SNDRV_PCM_FMTBIT_S20_LE | \
2729 SNDRV_PCM_FMTBIT_S24_LE | \
28
- SNDRV_PCM_FMTBIT_S32_LE)
30
+ SNDRV_PCM_FMTBIT_S32_LE | \
31
+ SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
2932
3033 #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)
3334
3435 #define FIFO_INT_ADDR_FINISH BIT(0)
3536 #define FIFO_INT_ADDR_INT BIT(1)
....@@ -49,8 +50,6 @@
4950 #define CTRL1_STATUS2_SEL_MASK GENMASK(11, 8)
5051 #define CTRL1_STATUS2_SEL(x) ((x) << 8)
5152 #define STATUS2_SEL_DDR_READ 0
52
-#define CTRL1_THRESHOLD_MASK GENMASK(23, 16)
53
-#define CTRL1_THRESHOLD(x) ((x) << 16)
5453 #define CTRL1_FRDDR_DEPTH_MASK GENMASK(31, 24)
5554 #define CTRL1_FRDDR_DEPTH(x) ((x) << 24)
5655 #define FIFO_START_ADDR 0x08
....@@ -59,20 +58,40 @@
5958 #define FIFO_STATUS1 0x14
6059 #define STATUS1_INT_STS(x) ((x) << 0)
6160 #define FIFO_STATUS2 0x18
61
+#define FIFO_INIT_ADDR 0x24
62
+#define FIFO_CTRL2 0x28
6263
6364 struct axg_fifo {
6465 struct regmap *map;
6566 struct clk *pclk;
6667 struct reset_control *arb;
68
+ struct regmap_field *field_threshold;
69
+ unsigned int depth;
6770 int irq;
6871 };
6972
7073 struct axg_fifo_match_data {
7174 const struct snd_soc_component_driver *component_drv;
7275 struct snd_soc_dai_driver *dai_drv;
76
+ struct reg_field field_threshold;
7377 };
7478
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);
7695
7796 int axg_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd, unsigned int type);
7897 int axg_fifo_probe(struct platform_device *pdev);