/********************************************************************* * bcm63xx-i2s.h -- Broadcom I2S Controller driver header file * * Author: Kevin Li * * Copyright (c) 2018 Broadcom Corporation * All Rights Reserved * * <:label-BRCM:2018:DUAL/GPL:standard * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as published by * the Free Software Foundation (the "GPL"). * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * * A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by * writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * :> *********************************************************************/ #ifndef __BCM63XX_I2S_H #define __BCM63XX_I2S_H #define I2S_ENABLE (1 << 31) #define I2S_MCLK_RATE_SHIFT 20 #define I2S_OUT_R (1 << 19) #define I2S_OUT_L (1 << 18) #define I2S_CLKSEL_SHIFT 16 #define I2S_CLK_100MHZ 0 #define I2S_CLK_50MHZ 1 #define I2S_CLK_25MHZ 2 #define I2S_CLK_PLL 3 #define I2S_MCLK_CLKSEL_CLR_MASK 0x00F30000 #define I2S_SCLK_POLARITY (1 << 9) #define I2S_LRCK_POLARITY (1 << 8) #define I2S_SCLKS_PER_1FS_DIV32_SHIFT 4 #define I2S_DATA_JUSTIFICATION (1 << 3) #define I2S_DATA_ALIGNMENT (1 << 2) #define I2S_DATA_ENABLE (1 << 1) #define I2S_CLOCK_ENABLE (1 << 0) #define I2S_DESC_OFF_LEVEL_SHIFT 12 #define I2S_DESC_IFF_LEVEL_SHIFT 8 #define I2S_DESC_LEVEL_MASK 0x0F #define I2S_DESC_OFF_OVERRUN_INTR (1 << 3) #define I2S_DESC_IFF_UNDERRUN_INTR (1 << 2) #define I2S_DESC_OFF_INTR (1 << 1) #define I2S_DESC_IFF_INTR (1 << 0) #define I2S_INTR_MASK 0x0F #define I2S_DESC_INTR_TYPE_SEL (1 << 4) #define I2S_DESC_OFF_OVERRUN_INTR_EN (1 << 3) #define I2S_DESC_IFF_UNDERRUN_INTR_EN (1 << 2) #define I2S_DESC_OFF_INTR_EN (1 << 1) #define I2S_DESC_IFF_INTR_EN (1 << 0) #define I2S_DESC_IFF_INTR_THLD_MASK 0x07 #define I2S_DESC_EOP (1 << 31) #define I2S_DESC_FIFO_DEPTH 8 #define I2S_DMA_BUFF_MAX_LEN 0xFFFF #define I2S_DESC_LEN_MASK I2S_DMA_BUFF_MAX_LEN #if defined(CONFIG_BCM963148) || defined(CONFIG_BCM963138) #define ISR_TABLE_OFFSET 32 #define ISR_TABLE2_OFFSET ISR_TABLE_OFFSET + 32 #define ISR_TABLE3_OFFSET ISR_TABLE2_OFFSET + 32 #define INTERRUPT_ID_I2S (ISR_TABLE3_OFFSET + 20) #endif #define I2S_INTR_SHIFT_REGMAP 0x00 #define I2S_INTR_MASK_REGMAP ( 0x0F<= threshold. 1.other...*/ #define I2S_RX_DESC_INTR_TYPE_SEL_MASK (1 << 4) #define I2S_RX_DESC_OFF_OVERRUN_INTR_EN (1 << 3) #define I2S_RX_DESC_IFF_UNDERRUN_INTR_EN (1 << 2) #define I2S_RX_DESC_OFF_INTR_EN (1 << 1) #define I2S_RX_DESC_OFF_INTR_EN_MASK (1 << 1) #define I2S_RX_DESC_IFF_INTR_EN (1 << 0) #define I2S_RX_IRQ_IFF_THLD (0x004c + I2S_REG_PLATFORM_OFFSET) /* 20cc */ #define I2S_RX_DESC_IFF_INTR_THLD_MASK 0x07 #define I2S_RX_IRQ_OFF_THLD (0x0050 + I2S_REG_PLATFORM_OFFSET) /* 20d0 */ #define I2S_RX_DESC_OFF_INTR_THLD_MASK 0x07 #define I2S_RX_DESC_IFF_ADDR (0x0054 + I2S_REG_PLATFORM_OFFSET) /* 20d4 */ #define I2S_RX_DESC_IFF_LEN (0x0058 + I2S_REG_PLATFORM_OFFSET) /* 20d8 */ #define I2S_RX_DESC_OFF_ADDR (0x005c + I2S_REG_PLATFORM_OFFSET) /* 20dc */ #define I2S_RX_DESC_OFF_LEN (0x0060 + I2S_REG_PLATFORM_OFFSET) /* 20e0 */ #define I2S_RX_DESC_EOP (1 << 31) #define I2S_RX_DESC_FIFO_DEPTH 8 #define I2S_RX_DMA_BUFF_MAX_LEN 0xFFFF #define I2S_RX_DESC_LEN_MASK I2S_TX_DMA_BUFF_MAX_LEN #define I2S_RX_CFG_2 (0x0064 + I2S_REG_PLATFORM_OFFSET) /* 20e4 */ #define I2S_RX_SLAVE_MODE ( 1 << 13 ) #define I2S_RX_SLAVE_MODE_MASK ( 1 << 13 ) #define I2S_REG_MAX (0x007c+I2S_REG_PLATFORM_OFFSET) /* 20fc */ #endif