1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 /* 3 * Copyright (c) 2010-2011,2013-2015 The Linux 4 */ 5 6 #ifndef __LPASS_LPAIF_REG_H__ 7 #define __LPASS_LPAIF_REG_H__ 8 9 /* LPAIF I2S */ 10 11 #define LPAIF_I2SCTL_REG_ADDR(v, addr, port) \ 12 (v->i2sctrl_reg_base + (addr) + v->i2s 13 14 #define LPAIF_I2SCTL_REG(v, port) LPAIF_ 15 16 #define LPAIF_I2SCTL_LOOPBACK_DISABLE 0 17 #define LPAIF_I2SCTL_LOOPBACK_ENABLE 1 18 19 #define LPAIF_I2SCTL_SPKEN_DISABLE 0 20 #define LPAIF_I2SCTL_SPKEN_ENABLE 1 21 22 #define LPAIF_I2SCTL_MODE_NONE 0 23 #define LPAIF_I2SCTL_MODE_SD0 1 24 #define LPAIF_I2SCTL_MODE_SD1 2 25 #define LPAIF_I2SCTL_MODE_SD2 3 26 #define LPAIF_I2SCTL_MODE_SD3 4 27 #define LPAIF_I2SCTL_MODE_QUAD01 5 28 #define LPAIF_I2SCTL_MODE_QUAD23 6 29 #define LPAIF_I2SCTL_MODE_6CH 7 30 #define LPAIF_I2SCTL_MODE_8CH 8 31 #define LPAIF_I2SCTL_MODE_10CH 9 32 #define LPAIF_I2SCTL_MODE_12CH 10 33 #define LPAIF_I2SCTL_MODE_14CH 11 34 #define LPAIF_I2SCTL_MODE_16CH 12 35 #define LPAIF_I2SCTL_MODE_SD4 13 36 #define LPAIF_I2SCTL_MODE_SD5 14 37 #define LPAIF_I2SCTL_MODE_SD6 15 38 #define LPAIF_I2SCTL_MODE_SD7 16 39 #define LPAIF_I2SCTL_MODE_QUAD45 17 40 #define LPAIF_I2SCTL_MODE_QUAD47 18 41 #define LPAIF_I2SCTL_MODE_8CH_2 19 42 43 #define LPAIF_I2SCTL_SPKMODE(mode) mode 44 45 #define LPAIF_I2SCTL_SPKMONO_STEREO 0 46 #define LPAIF_I2SCTL_SPKMONO_MONO 1 47 48 #define LPAIF_I2SCTL_MICEN_DISABLE 0 49 #define LPAIF_I2SCTL_MICEN_ENABLE 1 50 51 #define LPAIF_I2SCTL_MICMODE(mode) mode 52 53 #define LPAIF_I2SCTL_MICMONO_STEREO 0 54 #define LPAIF_I2SCTL_MICMONO_MONO 1 55 56 #define LPAIF_I2SCTL_WSSRC_INTERNAL 0 57 #define LPAIF_I2SCTL_WSSRC_EXTERNAL 1 58 59 #define LPAIF_I2SCTL_BITWIDTH_16 0 60 #define LPAIF_I2SCTL_BITWIDTH_24 1 61 #define LPAIF_I2SCTL_BITWIDTH_32 2 62 63 #define LPAIF_I2SCTL_RESET_STATE 0x003C 64 #define LPAIF_DMACTL_RESET_STATE 0x0020 65 66 67 /* LPAIF IRQ */ 68 #define LPAIF_IRQ_REG_ADDR(v, addr, port) \ 69 (v->irq_reg_base + (addr) + v->irq_reg 70 71 #define LPAIF_IRQ_PORT_HOST 0 72 73 #define LPAIF_IRQEN_REG(v, port) LPAIF_ 74 #define LPAIF_IRQSTAT_REG(v, port) LPAIF_ 75 #define LPAIF_IRQCLEAR_REG(v, port) LPAIF_ 76 77 /* LPAIF RXTX IRQ */ 78 #define LPAIF_RXTX_IRQ_REG_ADDR(v, addr, port) 79 (v->rxtx_irq_reg_base + (addr) 80 81 #define LPAIF_RXTX_IRQEN_REG(v, port) LPAIF_RX 82 #define LPAIF_RXTX_IRQSTAT_REG(v, port) LPAIF_ 83 #define LPAIF_RXTX_IRQCLEAR_REG(v, port) LPAIF 84 85 /* LPAIF VA IRQ */ 86 #define LPAIF_VA_IRQ_REG_ADDR(v, addr, port) \ 87 (v->va_irq_reg_base + (addr) + 88 89 #define LPAIF_VA_IRQEN_REG(v, port) LPAIF_VA_I 90 #define LPAIF_VA_IRQSTAT_REG(v, port) LPAIF_VA 91 #define LPAIF_VA_IRQCLEAR_REG(v, port) LPAIF_V 92 93 #define LPASS_HDMITX_APP_IRQ_REG_ADDR(v, addr) 94 ((v->hdmi_irq_reg_base) + (addr)) 95 96 #define LPASS_HDMITX_APP_IRQEN_REG(v) 97 #define LPASS_HDMITX_APP_IRQSTAT_REG(v) 98 #define LPASS_HDMITX_APP_IRQCLEAR_REG(v) 99 100 #define LPAIF_IRQ_BITSTRIDE 3 101 102 #define LPAIF_IRQ_PER(chan) (1 << 103 #define LPAIF_IRQ_XRUN(chan) (2 << 104 #define LPAIF_IRQ_ERR(chan) (4 << 105 106 #define LPAIF_IRQ_ALL(chan) (7 << 107 #define LPAIF_IRQ_HDMI_REQ_ON_PRELOAD(chan) 108 #define LPAIF_IRQ_HDMI_SDEEP_AUD_DIS(chan) 109 #define LPAIF_IRQ_HDMI_METADONE BIT(23 110 111 /* LPAIF DMA */ 112 #define LPAIF_HDMI_RDMA_REG_ADDR(v, addr, chan 113 (v->hdmi_rdma_reg_base + (addr) + v->h 114 115 #define LPAIF_HDMI_RDMACTL_AUDINTF(id) (id << 116 117 #define LPAIF_HDMI_RDMACTL_REG(v, chan) 118 #define LPAIF_HDMI_RDMABASE_REG(v, chan) 119 #define LPAIF_HDMI_RDMABUFF_REG(v, chan) 120 #define LPAIF_HDMI_RDMACURR_REG(v, chan) 121 #define LPAIF_HDMI_RDMAPER_REG(v, chan) 122 #define LPAIF_HDMI_RDMAPERCNT_REG(v, chan) 123 124 #define LPAIF_RDMA_REG_ADDR(v, addr, chan) \ 125 (v->rdma_reg_base + (addr) + v->rdma_r 126 127 #define LPAIF_RDMACTL_AUDINTF(id) (id << 128 129 #define LPAIF_RDMACTL_REG(v, chan) LPAIF_ 130 #define LPAIF_RDMABASE_REG(v, chan) LPAIF_ 131 #define LPAIF_RDMABUFF_REG(v, chan) LPAIF_ 132 #define LPAIF_RDMACURR_REG(v, chan) LPAIF_ 133 #define LPAIF_RDMAPER_REG(v, chan) LPAIF_ 134 #define LPAIF_RDMAPERCNT_REG(v, chan) LPAIF_ 135 136 #define LPAIF_WRDMA_REG_ADDR(v, addr, chan) \ 137 (v->wrdma_reg_base + (addr) + \ 138 v->wrdma_reg_stride * (chan - v->wrdm 139 140 #define LPAIF_WRDMACTL_REG(v, chan) LPAIF_ 141 #define LPAIF_WRDMABASE_REG(v, chan) LPAIF_ 142 #define LPAIF_WRDMABUFF_REG(v, chan) LPAIF_ 143 #define LPAIF_WRDMACURR_REG(v, chan) LPAIF_ 144 #define LPAIF_WRDMAPER_REG(v, chan) LPAIF_ 145 #define LPAIF_WRDMAPERCNT_REG(v, chan) LPAIF_ 146 147 #define LPAIF_INTFDMA_REG(v, chan, reg, dai_id 148 ((dai_id == LPASS_DP_RX) ? \ 149 LPAIF_HDMI_RDMA##reg##_REG(v, 150 LPAIF_RDMA##reg##_REG(v, chan 151 152 #define __LPAIF_DMA_REG(v, chan, dir, reg, dai 153 ((dir == SNDRV_PCM_STREAM_PLAYBACK) ? 154 (LPAIF_INTFDMA_REG(v, chan, re 155 LPAIF_WRDMA##reg##_REG(v, chan 156 157 #define LPAIF_DMACTL_REG(v, chan, dir, dai_id) 158 (is_cdc_dma_port(dai_id) ? \ 159 __LPAIF_CDC_DMA_REG(v, chan, dir, CTL, 160 __LPAIF_DMA_REG(v, chan, dir, CTL, dai 161 #define LPAIF_DMABASE_REG(v, chan, dir, dai_id 162 (is_cdc_dma_port(dai_id) ? \ 163 __LPAIF_CDC_DMA_REG(v, chan, dir, BASE 164 __LPAIF_DMA_REG(v, chan, dir, BASE, da 165 #define LPAIF_DMABUFF_REG(v, chan, dir, dai_id 166 (is_cdc_dma_port(dai_id) ? \ 167 __LPAIF_CDC_DMA_REG(v, chan, dir, BUFF 168 __LPAIF_DMA_REG(v, chan, dir, BUFF, da 169 #define LPAIF_DMACURR_REG(v, chan, dir, dai_id 170 (is_cdc_dma_port(dai_id) ? \ 171 __LPAIF_CDC_DMA_REG(v, chan, dir, CURR 172 __LPAIF_DMA_REG(v, chan, dir, CURR, da 173 #define LPAIF_DMAPER_REG(v, chan, dir, dai_id) 174 (is_cdc_dma_port(dai_id) ? \ 175 __LPAIF_CDC_DMA_REG(v, chan, dir, PER, 176 __LPAIF_DMA_REG(v, chan, dir, PER, dai 177 #define LPAIF_DMAPERCNT_REG(v, chan, dir, dai_ 178 (is_cdc_dma_port(dai_id) ? \ 179 __LPAIF_CDC_DMA_REG(v, chan, dir, PERC 180 __LPAIF_DMA_REG(v, chan, dir, PERCNT, 181 182 #define LPAIF_CDC_RDMA_REG_ADDR(v, addr, chan, 183 (is_rxtx_cdc_dma_port(dai_id) ? \ 184 (v->rxtx_rdma_reg_base + (addr) + v->r 185 (v->va_rdma_reg_base + (addr) + v->va_ 186 187 #define LPAIF_CDC_RXTX_RDMACTL_REG(v, chan, da 188 LPAIF_CDC_RDMA_REG_ADDR(v, 0x0 189 #define LPAIF_CDC_RXTX_RDMABASE_REG(v, chan, d 190 LPAIF_CDC_RDMA_REG_ADDR(v, 0x0 191 #define LPAIF_CDC_RXTX_RDMABUFF_REG(v, chan, d 192 LPAIF_CDC_RDMA_REG_ADDR(v, 0x0 193 #define LPAIF_CDC_RXTX_RDMACURR_REG(v, chan, d 194 LPAIF_CDC_RDMA_REG_ADDR(v, 0x0 195 #define LPAIF_CDC_RXTX_RDMAPER_REG(v, chan, da 196 LPAIF_CDC_RDMA_REG_ADDR(v, 0x1 197 #define LPAIF_CDC_RXTX_RDMA_INTF_REG(v, chan, 198 LPAIF_CDC_RDMA_REG_ADDR(v, 0x50, (chan 199 200 #define LPAIF_CDC_VA_RDMACTL_REG(v, chan, dai_ 201 #define LPAIF_CDC_VA_RDMABASE_REG(v, chan, dai 202 #define LPAIF_CDC_VA_RDMABUFF_REG(v, chan, dai 203 #define LPAIF_CDC_VA_RDMACURR_REG(v, chan, dai 204 #define LPAIF_CDC_VA_RDMAPER_REG(v, chan, dai_ 205 #define LPAIF_CDC_VA_RDMA_INTF_REG(v, chan, da 206 LPAIF_CDC_RDMA_REG_ADDR(v, 0x50, (chan 207 208 #define LPAIF_CDC_WRDMA_REG_ADDR(v, addr, chan 209 (is_rxtx_cdc_dma_port(dai_id) ? \ 210 (v->rxtx_wrdma_reg_base + (addr) + \ 211 v->rxtx_wrdma_reg_stride * (ch 212 (v->va_wrdma_reg_base + (addr) + \ 213 v->va_wrdma_reg_stride * (chan 214 215 #define LPAIF_CDC_RXTX_WRDMACTL_REG(v, chan, d 216 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x00, (cha 217 #define LPAIF_CDC_RXTX_WRDMABASE_REG(v, chan, 218 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x04, (cha 219 #define LPAIF_CDC_RXTX_WRDMABUFF_REG(v, chan, 220 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x08, (cha 221 #define LPAIF_CDC_RXTX_WRDMACURR_REG(v, chan, 222 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x0C, (cha 223 #define LPAIF_CDC_RXTX_WRDMAPER_REG(v, chan, d 224 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x10, (cha 225 #define LPAIF_CDC_RXTX_WRDMA_INTF_REG(v, chan, 226 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x50, (cha 227 228 #define LPAIF_CDC_VA_WRDMACTL_REG(v, chan, dai 229 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x00, (cha 230 #define LPAIF_CDC_VA_WRDMABASE_REG(v, chan, da 231 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x04, (cha 232 #define LPAIF_CDC_VA_WRDMABUFF_REG(v, chan, da 233 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x08, (cha 234 #define LPAIF_CDC_VA_WRDMACURR_REG(v, chan, da 235 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x0C, (cha 236 #define LPAIF_CDC_VA_WRDMAPER_REG(v, chan, dai 237 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x10, (cha 238 #define LPAIF_CDC_VA_WRDMA_INTF_REG(v, chan, d 239 LPAIF_CDC_WRDMA_REG_ADDR(v, 0x50, (cha 240 241 #define __LPAIF_CDC_RDDMA_REG(v, chan, dir, re 242 (is_rxtx_cdc_dma_port(dai_id) 243 LPAIF_CDC_VA_RDMA##reg 244 245 #define __LPAIF_CDC_WRDMA_REG(v, chan, dir, re 246 (is_rxtx_cdc_dma_port(dai_id) 247 LPAIF_CDC_VA_WRDMA##re 248 249 #define __LPAIF_CDC_DMA_REG(v, chan, dir, reg, 250 ((dir == SNDRV_PCM_STREAM_PLA 251 __LPAIF_CDC_RDDMA_REG( 252 __LPAIF_CDC_WRDMA_REG( 253 254 #define LPAIF_CDC_INTF_REG(v, chan, dir, dai_i 255 ((dir == SNDRV_PCM_STREAM_PLA 256 LPAIF_CDC_RDMA_INTF_REG(v, cha 257 LPAIF_CDC_WRDMA_INTF_REG(v, ch 258 259 #define LPAIF_INTF_REG(v, chan, dir, dai_id) \ 260 (is_cdc_dma_port(dai_id) ? \ 261 LPAIF_CDC_INTF_REG(v, chan, di 262 LPAIF_DMACTL_REG(v, chan, dir, 263 264 #define LPAIF_DMACTL_BURSTEN_SINGLE 0 265 #define LPAIF_DMACTL_BURSTEN_INCR4 1 266 267 #define LPAIF_DMACTL_WPSCNT_ONE 0 268 #define LPAIF_DMACTL_WPSCNT_TWO 1 269 #define LPAIF_DMACTL_WPSCNT_THREE 2 270 #define LPAIF_DMACTL_WPSCNT_FOUR 3 271 #define LPAIF_DMACTL_WPSCNT_SIX 5 272 #define LPAIF_DMACTL_WPSCNT_EIGHT 7 273 #define LPAIF_DMACTL_WPSCNT_TEN 9 274 #define LPAIF_DMACTL_WPSCNT_TWELVE 11 275 #define LPAIF_DMACTL_WPSCNT_FOURTEEN 13 276 #define LPAIF_DMACTL_WPSCNT_SIXTEEN 15 277 278 #define LPAIF_DMACTL_AUDINTF(id) id 279 280 #define LPAIF_DMACTL_FIFOWM_1 0 281 #define LPAIF_DMACTL_FIFOWM_2 1 282 #define LPAIF_DMACTL_FIFOWM_3 2 283 #define LPAIF_DMACTL_FIFOWM_4 3 284 #define LPAIF_DMACTL_FIFOWM_5 4 285 #define LPAIF_DMACTL_FIFOWM_6 5 286 #define LPAIF_DMACTL_FIFOWM_7 6 287 #define LPAIF_DMACTL_FIFOWM_8 7 288 #define LPAIF_DMACTL_FIFOWM_9 8 289 #define LPAIF_DMACTL_FIFOWM_10 9 290 #define LPAIF_DMACTL_FIFOWM_11 10 291 #define LPAIF_DMACTL_FIFOWM_12 11 292 #define LPAIF_DMACTL_FIFOWM_13 12 293 #define LPAIF_DMACTL_FIFOWM_14 13 294 #define LPAIF_DMACTL_FIFOWM_15 14 295 #define LPAIF_DMACTL_FIFOWM_16 15 296 #define LPAIF_DMACTL_FIFOWM_17 16 297 #define LPAIF_DMACTL_FIFOWM_18 17 298 #define LPAIF_DMACTL_FIFOWM_19 18 299 #define LPAIF_DMACTL_FIFOWM_20 19 300 #define LPAIF_DMACTL_FIFOWM_21 20 301 #define LPAIF_DMACTL_FIFOWM_22 21 302 #define LPAIF_DMACTL_FIFOWM_23 22 303 #define LPAIF_DMACTL_FIFOWM_24 23 304 #define LPAIF_DMACTL_FIFOWM_25 24 305 #define LPAIF_DMACTL_FIFOWM_26 25 306 #define LPAIF_DMACTL_FIFOWM_27 26 307 #define LPAIF_DMACTL_FIFOWM_28 27 308 #define LPAIF_DMACTL_FIFOWM_29 28 309 #define LPAIF_DMACTL_FIFOWM_30 29 310 #define LPAIF_DMACTL_FIFOWM_31 30 311 #define LPAIF_DMACTL_FIFOWM_32 31 312 313 #define LPAIF_DMACTL_ENABLE_OFF 0 314 #define LPAIF_DMACTL_ENABLE_ON 1 315 316 #define LPAIF_DMACTL_DYNCLK_OFF 0 317 #define LPAIF_DMACTL_DYNCLK_ON 1 318 319 #endif /* __LPASS_LPAIF_REG_H__ */ 320
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.