aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/qcom/lpass.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/qcom/lpass.h')
-rw-r--r--sound/soc/qcom/lpass.h51
1 files changed, 49 insertions, 2 deletions
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 5c99b3dace86..d6e86c119e74 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -22,6 +22,8 @@
22#include <linux/regmap.h> 22#include <linux/regmap.h>
23 23
24#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 24#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
25#define LPASS_MAX_MI2S_PORTS (8)
26#define LPASS_MAX_DMA_CHANNELS (8)
25 27
26/* Both the CPU DAI and platform drivers will access this data */ 28/* Both the CPU DAI and platform drivers will access this data */
27struct lpass_data { 29struct lpass_data {
@@ -30,10 +32,10 @@ struct lpass_data {
30 struct clk *ahbix_clk; 32 struct clk *ahbix_clk;
31 33
32 /* MI2S system clock */ 34 /* MI2S system clock */
33 struct clk *mi2s_osr_clk; 35 struct clk *mi2s_osr_clk[LPASS_MAX_MI2S_PORTS];
34 36
35 /* MI2S bit clock (derived from system clock by a divider */ 37 /* MI2S bit clock (derived from system clock by a divider */
36 struct clk *mi2s_bit_clk; 38 struct clk *mi2s_bit_clk[LPASS_MAX_MI2S_PORTS];
37 39
38 /* low-power audio interface (LPAIF) registers */ 40 /* low-power audio interface (LPAIF) registers */
39 void __iomem *lpaif; 41 void __iomem *lpaif;
@@ -43,9 +45,54 @@ struct lpass_data {
43 45
44 /* interrupts from the low-power audio interface (LPAIF) */ 46 /* interrupts from the low-power audio interface (LPAIF) */
45 int lpaif_irq; 47 int lpaif_irq;
48
49 /* SOC specific variations in the LPASS IP integration */
50 struct lpass_variant *variant;
51
52 /* bit map to keep track of static channel allocations */
53 unsigned long rdma_ch_bit_map;
54
55 /* used it for handling interrupt per dma channel */
56 struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS];
57
58 /* 8016 specific */
59 struct clk *pcnoc_mport_clk;
60 struct clk *pcnoc_sway_clk;
61};
62
63/* Vairant data per each SOC */
64struct lpass_variant {
65 u32 i2sctrl_reg_base;
66 u32 i2sctrl_reg_stride;
67 u32 i2s_ports;
68 u32 irq_reg_base;
69 u32 irq_reg_stride;
70 u32 irq_ports;
71 u32 rdma_reg_base;
72 u32 rdma_reg_stride;
73 u32 rdma_channels;
74
75 /**
76 * on SOCs like APQ8016 the channel control bits start
77 * at different offset to ipq806x
78 **/
79 u32 rdmactl_audif_start;
80 /* SOC specific intialization like clocks */
81 int (*init)(struct platform_device *pdev);
82 int (*exit)(struct platform_device *pdev);
83 int (*alloc_dma_channel)(struct lpass_data *data);
84 int (*free_dma_channel)(struct lpass_data *data, int ch);
85
86 /* SOC specific dais */
87 struct snd_soc_dai_driver *dai_driver;
88 int num_dai;
46}; 89};
47 90
48/* register the platform driver from the CPU DAI driver */ 91/* register the platform driver from the CPU DAI driver */
49int asoc_qcom_lpass_platform_register(struct platform_device *); 92int asoc_qcom_lpass_platform_register(struct platform_device *);
93int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev);
94int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev);
95int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai);
96extern struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops;
50 97
51#endif /* __LPASS_H__ */ 98#endif /* __LPASS_H__ */