/* * sound/soc/sprd/dai/vbc/r2p0/vbc-comm.h * * SPRD SoC VBC -- SpreadTrum SOC DAI for VBC Common function. * * Copyright (C) 2013 SpreadTrum Ltd. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY ork FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __VBC_COMM_H #define __VBC_COMM_H #include #define VBC_VERSION "vbc.r2p0" /* VBADBUFFDTA */ enum { VBISADCK_INV = 9, VBISDACK_INV, VBISAD23CK_INV, VBIIS_DLOOP = 13, }; /* VBDABUFFDTA */ enum { RAMSW_NUMB = 9, RAMSW_EN, VBAD0DMA_EN, VBAD1DMA_EN, VBDA0DMA_EN, VBDA1DMA_EN, VBENABLE, }; /* VBDAPATH FM MIXER*/ enum { DAPATH_NO_MIX = 0, DAPATH_ADD_FM, DAPATH_SUB_FM, }; /* VBADPATH ST INMUX*/ enum { ST_INPUT_NORMAL = 0, ST_INPUT_INVERSE, ST_INPUT_ZERO, }; /* AD DGMUX NUM*/ enum { ADC0_DGMUX = 0, ADC1_DGMUX, ADC2_DGMUX, ADC3_DGMUX, ADC_DGMUX_MAX }; /* -------------------------- */ #define PHYS_VBDA0 (VBC_PHY_BASE + 0x0000) /* 0x0000 Voice band DAC0 data buffer */ #define PHYS_VBDA1 (VBC_PHY_BASE + 0x0004) /* 0x0004 Voice band DAC1 data buffer */ #define PHYS_VBAD0 (VBC_PHY_BASE + 0x0008) /* 0x0008 Voice band ADC0 data buffer */ #define PHYS_VBAD1 (VBC_PHY_BASE + 0x000C) /* 0x000C Voice band ADC1 data buffer */ #define PHYS_VBAD2 (VBC_PHY_BASE + 0x00C0) /* 0x00C0 Voice band ADC2 data buffer */ #define PHYS_VBAD3 (VBC_PHY_BASE + 0x00C4) /* 0x00C4 Voice band ADC3 data buffer */ #define ARM_VB_BASE VBC_BASE #define VBDA0 (ARM_VB_BASE + 0x0000) /* Voice band DAC0 data buffer */ #define VBDA1 (ARM_VB_BASE + 0x0004) /* Voice band DAC1 data buffer */ #define VBAD0 (ARM_VB_BASE + 0x0008) /* Voice band ADC0 data buffer */ #define VBAD1 (ARM_VB_BASE + 0x000C) /* Voice band ADC1 data buffer */ #define VBBUFFSIZE (ARM_VB_BASE + 0x0010) /* Voice band buffer size */ #define VBADBUFFDTA (ARM_VB_BASE + 0x0014) /* Voice band AD buffer control */ #define VBDABUFFDTA (ARM_VB_BASE + 0x0018) /* Voice band DA buffer control */ #define VBADCNT (ARM_VB_BASE + 0x001C) /* Voice band AD buffer counter */ #define VBDACNT (ARM_VB_BASE + 0x0020) /* Voice band DA buffer counter */ #define VBAD23CNT (ARM_VB_BASE + 0x0024) /* Voice band AD23 buffer counter */ #define VBADDMA (ARM_VB_BASE + 0x0028) /* Voice band AD23 DMA control */ #define VBBUFFAD23 (ARM_VB_BASE + 0x002C) /* Voice band AD23 buffer size */ #define VBINTTYPE (ARM_VB_BASE + 0x0034) #define VBDATASWT (ARM_VB_BASE + 0x0038) #define VBIISSEL (ARM_VB_BASE + 0x003C) #define DAPATCHCTL (ARM_VB_BASE + 0x0040) #define DADGCTL (ARM_VB_BASE + 0x0044) #define DAHPCTL (ARM_VB_BASE + 0x0048) #define DAALCCTL0 (ARM_VB_BASE + 0x004C) #define DAALCCTL1 (ARM_VB_BASE + 0x0050) #define DAALCCTL2 (ARM_VB_BASE + 0x0054) #define DAALCCTL3 (ARM_VB_BASE + 0x0058) #define DAALCCTL4 (ARM_VB_BASE + 0x005C) #define DAALCCTL5 (ARM_VB_BASE + 0x0060) #define DAALCCTL6 (ARM_VB_BASE + 0x0064) #define DAALCCTL7 (ARM_VB_BASE + 0x0068) #define DAALCCTL8 (ARM_VB_BASE + 0x006C) #define DAALCCTL9 (ARM_VB_BASE + 0x0070) #define DAALCCTL10 (ARM_VB_BASE + 0x0074) #define STCTL0 (ARM_VB_BASE + 0x0078) #define STCTL1 (ARM_VB_BASE + 0x007C) #define ADPATCHCTL (ARM_VB_BASE + 0x0080) #define ADDG01CTL (ARM_VB_BASE + 0x0084) #define ADDG23CTL (ARM_VB_BASE + 0x0088) #define ADHPCTL (ARM_VB_BASE + 0x008C) #define ADCSRCCTL (ARM_VB_BASE + 0x0090) #define DACSRCCTL (ARM_VB_BASE + 0x0094) #define MIXERCTL (ARM_VB_BASE + 0x0098) #define STFIFOLVL (ARM_VB_BASE + 0x009C) #define VBIRQEN (ARM_VB_BASE + 0x00A0) #define VBIRQCLR (ARM_VB_BASE + 0x00A4) #define VBIRQRAW (ARM_VB_BASE + 0x00A8) #define VBIRQSTS (ARM_VB_BASE + 0x00AC) #define VBNGCVTHD (ARM_VB_BASE + 0x00B0) #define VBNGCTTHD (ARM_VB_BASE + 0x00B4) #define VBNGCTL (ARM_VB_BASE + 0x00B8) /* DA HPF EQ6 start, end */ #define HPCOEF0_H (ARM_VB_BASE + 0x0100) #define HPCOEF0_L (ARM_VB_BASE + 0x0104) #define HPCOEF35_H (ARM_VB_BASE + 0x0218) #define HPCOEF35_L (ARM_VB_BASE + 0x021c) #define HPCOEF42_H (ARM_VB_BASE + 0x0250) #define HPCOEF42_L (ARM_VB_BASE + 0x0254) /* DA HPF EQ4 start, end*/ #define HPCOEF43_H (ARM_VB_BASE + 0x0258) #define HPCOEF43_L (ARM_VB_BASE + 0x025C) #define HPCOEF64_H (ARM_VB_BASE + 0x0300) #define HPCOEF64_L (ARM_VB_BASE + 0x0304) #define HPCOEF71_H (ARM_VB_BASE + 0x0338) #define HPCOEF71_L (ARM_VB_BASE + 0x033C) /* AD01 HPF EQ6 start, end */ #define AD01_HPCOEF0_H (ARM_VB_BASE + 0x0400) #define AD01_HPCOEF0_L (ARM_VB_BASE + 0x0404) #define AD01_HPCOEF35_H (ARM_VB_BASE + 0x0418) #define AD01_HPCOEF35_L (ARM_VB_BASE + 0x041c) #define AD01_HPCOEF42_H (ARM_VB_BASE + 0x0550) #define AD01_HPCOEF42_L (ARM_VB_BASE + 0x0554) /* AD23 HPF EQ6 start, end */ #define AD23_HPCOEF0_H (ARM_VB_BASE + 0x0600) #define AD23_HPCOEF0_L (ARM_VB_BASE + 0x0604) #define AD23_HPCOEF35_H (ARM_VB_BASE + 0x0618) #define AD23_HPCOEF35_L (ARM_VB_BASE + 0x061c) #define AD23_HPCOEF42_H (ARM_VB_BASE + 0x0750) #define AD23_HPCOEF42_L (ARM_VB_BASE + 0x0754) #define ARM_VB_END (ARM_VB_BASE + 0x0758) #define IS_SPRD_VBC_RANG(reg) (((reg) >= ARM_VB_BASE) && ((reg) < ARM_VB_END)) #define SPRD_VBC_BASE_HI (ARM_VB_BASE & 0xFFFF0000) #define VBADBUFFERSIZE_SHIFT (0) #define VBADBUFFERSIZE_MASK (0xFF<