Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: qcom: lpass: Add dma fields for codec dma lpass interface

Add lpass interface memebers to support audio path over codec dma.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Co-developed-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Signed-off-by: Venkata Prasad Potturu <quic_potturu@quicinc.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1645716828-15305-3-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Srinivasa Rao Mandadapu and committed by
Mark Brown
ddd60045 74190d7c

+114
+114
sound/soc/qcom/lpass.h
··· 20 20 #define LPASS_MAX_MI2S_PORTS (8) 21 21 #define LPASS_MAX_DMA_CHANNELS (8) 22 22 #define LPASS_MAX_HDMI_DMA_CHANNELS (4) 23 + #define LPASS_MAX_CDC_DMA_CHANNELS (8) 24 + #define LPASS_MAX_VA_CDC_DMA_CHANNELS (8) 25 + #define LPASS_CDC_DMA_INTF_ONE_CHANNEL (0x01) 26 + #define LPASS_CDC_DMA_INTF_TWO_CHANNEL (0x03) 27 + #define LPASS_CDC_DMA_INTF_FOUR_CHANNEL (0x0F) 28 + #define LPASS_CDC_DMA_INTF_SIX_CHANNEL (0x3F) 29 + #define LPASS_CDC_DMA_INTF_EIGHT_CHANNEL (0xFF) 30 + 31 + #define LPASS_ACTIVE_PDS (4) 32 + #define LPASS_PROXY_PDS (8) 23 33 24 34 #define QCOM_REGMAP_FIELD_ALLOC(d, m, f, mf) \ 25 35 do { \ ··· 61 51 struct regmap_field *burst8; 62 52 struct regmap_field *burst16; 63 53 struct regmap_field *dynburst; 54 + struct regmap_field *codec_enable; 55 + struct regmap_field *codec_pack; 56 + struct regmap_field *codec_intf; 57 + struct regmap_field *codec_fs_sel; 58 + struct regmap_field *codec_channel; 59 + struct regmap_field *codec_fs_delay; 64 60 }; 65 61 66 62 /* Both the CPU DAI and platform drivers will access this data */ ··· 81 65 /* MI2S bit clock (derived from system clock by a divider */ 82 66 struct clk *mi2s_bit_clk[LPASS_MAX_MI2S_PORTS]; 83 67 68 + struct clk *codec_mem0; 69 + struct clk *codec_mem1; 70 + struct clk *codec_mem2; 71 + struct clk *va_mem0; 72 + 84 73 /* MI2S SD lines to use for playback/capture */ 85 74 unsigned int mi2s_playback_sd_mode[LPASS_MAX_MI2S_PORTS]; 86 75 unsigned int mi2s_capture_sd_mode[LPASS_MAX_MI2S_PORTS]; ··· 94 73 bool mi2s_was_prepared[LPASS_MAX_MI2S_PORTS]; 95 74 96 75 int hdmi_port_enable; 76 + int codec_dma_enable; 97 77 98 78 /* low-power audio interface (LPAIF) registers */ 99 79 void __iomem *lpaif; 100 80 void __iomem *hdmiif; 81 + void __iomem *rxtx_lpaif; 82 + void __iomem *va_lpaif; 83 + 84 + u32 rxtx_cdc_dma_lpm_buf; 85 + u32 va_cdc_dma_lpm_buf; 101 86 102 87 /* regmap backed by the low-power audio interface (LPAIF) registers */ 103 88 struct regmap *lpaif_map; 104 89 struct regmap *hdmiif_map; 90 + struct regmap *rxtx_lpaif_map; 91 + struct regmap *va_lpaif_map; 105 92 106 93 /* interrupts from the low-power audio interface (LPAIF) */ 107 94 int lpaif_irq; 108 95 int hdmiif_irq; 96 + int rxtxif_irq; 97 + int vaif_irq; 98 + 109 99 /* SOC specific variations in the LPASS IP integration */ 110 100 struct lpass_variant *variant; 111 101 112 102 /* bit map to keep track of static channel allocations */ 113 103 unsigned long dma_ch_bit_map; 114 104 unsigned long hdmi_dma_ch_bit_map; 105 + unsigned long rxtx_dma_ch_bit_map; 106 + unsigned long va_dma_ch_bit_map; 115 107 116 108 /* used it for handling interrupt per dma channel */ 117 109 struct snd_pcm_substream *substream[LPASS_MAX_DMA_CHANNELS]; 118 110 struct snd_pcm_substream *hdmi_substream[LPASS_MAX_HDMI_DMA_CHANNELS]; 111 + struct snd_pcm_substream *rxtx_substream[LPASS_MAX_CDC_DMA_CHANNELS]; 112 + struct snd_pcm_substream *va_substream[LPASS_MAX_CDC_DMA_CHANNELS]; 119 113 120 114 /* SOC specific clock list */ 121 115 struct clk_bulk_data *clks; ··· 141 105 struct lpaif_dmactl *rd_dmactl; 142 106 struct lpaif_dmactl *wr_dmactl; 143 107 struct lpaif_dmactl *hdmi_rd_dmactl; 108 + 109 + /* Regmap fields of CODEC DMA CTRL registers */ 110 + struct lpaif_dmactl *rxtx_rd_dmactl; 111 + struct lpaif_dmactl *rxtx_wr_dmactl; 112 + struct lpaif_dmactl *va_wr_dmactl; 113 + 144 114 /* Regmap fields of HDMI_CTRL registers*/ 145 115 struct regmap_field *hdmitx_legacy_en; 146 116 struct regmap_field *hdmitx_parity_calc_en; ··· 173 131 u32 wrdma_reg_base; 174 132 u32 wrdma_reg_stride; 175 133 u32 wrdma_channels; 134 + u32 rxtx_irq_reg_base; 135 + u32 rxtx_irq_reg_stride; 136 + u32 rxtx_irq_ports; 137 + u32 rxtx_rdma_reg_base; 138 + u32 rxtx_rdma_reg_stride; 139 + u32 rxtx_rdma_channels; 140 + u32 rxtx_wrdma_reg_base; 141 + u32 rxtx_wrdma_reg_stride; 142 + u32 rxtx_wrdma_channels; 143 + u32 va_irq_reg_base; 144 + u32 va_irq_reg_stride; 145 + u32 va_irq_ports; 146 + u32 va_rdma_reg_base; 147 + u32 va_rdma_reg_stride; 148 + u32 va_rdma_channels; 149 + u32 va_wrdma_reg_base; 150 + u32 va_wrdma_reg_stride; 151 + u32 va_wrdma_channels; 176 152 u32 i2sctrl_reg_base; 177 153 u32 i2sctrl_reg_stride; 178 154 u32 i2s_ports; ··· 294 234 struct reg_field wrdma_enable; 295 235 struct reg_field wrdma_dyncclk; 296 236 237 + /* CDC RXTX RD_DMA */ 238 + struct reg_field rxtx_rdma_intf; 239 + struct reg_field rxtx_rdma_bursten; 240 + struct reg_field rxtx_rdma_wpscnt; 241 + struct reg_field rxtx_rdma_fifowm; 242 + struct reg_field rxtx_rdma_enable; 243 + struct reg_field rxtx_rdma_dyncclk; 244 + struct reg_field rxtx_rdma_burst8; 245 + struct reg_field rxtx_rdma_burst16; 246 + struct reg_field rxtx_rdma_dynburst; 247 + struct reg_field rxtx_rdma_codec_enable; 248 + struct reg_field rxtx_rdma_codec_pack; 249 + struct reg_field rxtx_rdma_codec_intf; 250 + struct reg_field rxtx_rdma_codec_fs_sel; 251 + struct reg_field rxtx_rdma_codec_ch; 252 + struct reg_field rxtx_rdma_codec_fs_delay; 253 + 254 + /* CDC RXTX WR_DMA */ 255 + struct reg_field rxtx_wrdma_intf; 256 + struct reg_field rxtx_wrdma_bursten; 257 + struct reg_field rxtx_wrdma_wpscnt; 258 + struct reg_field rxtx_wrdma_fifowm; 259 + struct reg_field rxtx_wrdma_enable; 260 + struct reg_field rxtx_wrdma_dyncclk; 261 + struct reg_field rxtx_wrdma_burst8; 262 + struct reg_field rxtx_wrdma_burst16; 263 + struct reg_field rxtx_wrdma_dynburst; 264 + struct reg_field rxtx_wrdma_codec_enable; 265 + struct reg_field rxtx_wrdma_codec_pack; 266 + struct reg_field rxtx_wrdma_codec_intf; 267 + struct reg_field rxtx_wrdma_codec_fs_sel; 268 + struct reg_field rxtx_wrdma_codec_ch; 269 + struct reg_field rxtx_wrdma_codec_fs_delay; 270 + 271 + /* CDC VA WR_DMA */ 272 + struct reg_field va_wrdma_intf; 273 + struct reg_field va_wrdma_bursten; 274 + struct reg_field va_wrdma_wpscnt; 275 + struct reg_field va_wrdma_fifowm; 276 + struct reg_field va_wrdma_enable; 277 + struct reg_field va_wrdma_dyncclk; 278 + struct reg_field va_wrdma_burst8; 279 + struct reg_field va_wrdma_burst16; 280 + struct reg_field va_wrdma_dynburst; 281 + struct reg_field va_wrdma_codec_enable; 282 + struct reg_field va_wrdma_codec_pack; 283 + struct reg_field va_wrdma_codec_intf; 284 + struct reg_field va_wrdma_codec_fs_sel; 285 + struct reg_field va_wrdma_codec_ch; 286 + struct reg_field va_wrdma_codec_fs_delay; 287 + 297 288 /** 298 289 * on SOCs like APQ8016 the channel control bits start 299 290 * at different offset to ipq806x 300 291 **/ 301 292 u32 dmactl_audif_start; 302 293 u32 wrdma_channel_start; 294 + u32 rxtx_wrdma_channel_start; 295 + u32 va_wrdma_channel_start; 296 + 303 297 /* SOC specific initialization like clocks */ 304 298 int (*init)(struct platform_device *pdev); 305 299 int (*exit)(struct platform_device *pdev);