16d817c0eSAdam Thomson /* 26d817c0eSAdam Thomson * da7219.h - DA7219 ALSA SoC Codec Driver 36d817c0eSAdam Thomson * 46d817c0eSAdam Thomson * Copyright (c) 2015 Dialog Semiconductor 56d817c0eSAdam Thomson * 66d817c0eSAdam Thomson * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> 76d817c0eSAdam Thomson * 86d817c0eSAdam Thomson * This program is free software; you can redistribute it and/or modify it 96d817c0eSAdam Thomson * under the terms of the GNU General Public License as published by the 106d817c0eSAdam Thomson * Free Software Foundation; either version 2 of the License, or (at your 116d817c0eSAdam Thomson * option) any later version. 126d817c0eSAdam Thomson */ 136d817c0eSAdam Thomson 146d817c0eSAdam Thomson #ifndef __DA7219_H 156d817c0eSAdam Thomson #define __DA7219_H 166d817c0eSAdam Thomson 176d817c0eSAdam Thomson #include <linux/regmap.h> 186d817c0eSAdam Thomson #include <linux/regulator/consumer.h> 196d817c0eSAdam Thomson #include <sound/da7219.h> 206d817c0eSAdam Thomson 216d817c0eSAdam Thomson /* 226d817c0eSAdam Thomson * Registers 236d817c0eSAdam Thomson */ 246d817c0eSAdam Thomson 256d817c0eSAdam Thomson #define DA7219_MIC_1_GAIN_STATUS 0x6 266d817c0eSAdam Thomson #define DA7219_MIXIN_L_GAIN_STATUS 0x8 276d817c0eSAdam Thomson #define DA7219_ADC_L_GAIN_STATUS 0xA 286d817c0eSAdam Thomson #define DA7219_DAC_L_GAIN_STATUS 0xC 296d817c0eSAdam Thomson #define DA7219_DAC_R_GAIN_STATUS 0xD 306d817c0eSAdam Thomson #define DA7219_HP_L_GAIN_STATUS 0xE 316d817c0eSAdam Thomson #define DA7219_HP_R_GAIN_STATUS 0xF 326d817c0eSAdam Thomson #define DA7219_MIC_1_SELECT 0x10 336d817c0eSAdam Thomson #define DA7219_CIF_TIMEOUT_CTRL 0x12 346d817c0eSAdam Thomson #define DA7219_CIF_CTRL 0x13 356d817c0eSAdam Thomson #define DA7219_SR_24_48 0x16 366d817c0eSAdam Thomson #define DA7219_SR 0x17 376d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG 0x1B 386d817c0eSAdam Thomson #define DA7219_PLL_CTRL 0x20 396d817c0eSAdam Thomson #define DA7219_PLL_FRAC_TOP 0x22 406d817c0eSAdam Thomson #define DA7219_PLL_FRAC_BOT 0x23 416d817c0eSAdam Thomson #define DA7219_PLL_INTEGER 0x24 426d817c0eSAdam Thomson #define DA7219_PLL_SRM_STS 0x25 436d817c0eSAdam Thomson #define DA7219_DIG_ROUTING_DAI 0x2A 446d817c0eSAdam Thomson #define DA7219_DAI_CLK_MODE 0x2B 456d817c0eSAdam Thomson #define DA7219_DAI_CTRL 0x2C 466d817c0eSAdam Thomson #define DA7219_DAI_TDM_CTRL 0x2D 476d817c0eSAdam Thomson #define DA7219_DIG_ROUTING_DAC 0x2E 486d817c0eSAdam Thomson #define DA7219_ALC_CTRL1 0x2F 496d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER 0x30 506d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER 0x31 516d817c0eSAdam Thomson #define DA7219_REFERENCES 0x32 526d817c0eSAdam Thomson #define DA7219_MIXIN_L_SELECT 0x33 536d817c0eSAdam Thomson #define DA7219_MIXIN_L_GAIN 0x34 546d817c0eSAdam Thomson #define DA7219_ADC_L_GAIN 0x36 556d817c0eSAdam Thomson #define DA7219_ADC_FILTERS1 0x38 566d817c0eSAdam Thomson #define DA7219_MIC_1_GAIN 0x39 576d817c0eSAdam Thomson #define DA7219_SIDETONE_CTRL 0x3A 586d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN 0x3B 596d817c0eSAdam Thomson #define DA7219_DROUTING_ST_OUTFILT_1L 0x3C 606d817c0eSAdam Thomson #define DA7219_DROUTING_ST_OUTFILT_1R 0x3D 616d817c0eSAdam Thomson #define DA7219_DAC_FILTERS5 0x40 626d817c0eSAdam Thomson #define DA7219_DAC_FILTERS2 0x41 636d817c0eSAdam Thomson #define DA7219_DAC_FILTERS3 0x42 646d817c0eSAdam Thomson #define DA7219_DAC_FILTERS4 0x43 656d817c0eSAdam Thomson #define DA7219_DAC_FILTERS1 0x44 666d817c0eSAdam Thomson #define DA7219_DAC_L_GAIN 0x45 676d817c0eSAdam Thomson #define DA7219_DAC_R_GAIN 0x46 686d817c0eSAdam Thomson #define DA7219_CP_CTRL 0x47 696d817c0eSAdam Thomson #define DA7219_HP_L_GAIN 0x48 706d817c0eSAdam Thomson #define DA7219_HP_R_GAIN 0x49 716d817c0eSAdam Thomson #define DA7219_MIXOUT_L_SELECT 0x4B 726d817c0eSAdam Thomson #define DA7219_MIXOUT_R_SELECT 0x4C 736d817c0eSAdam Thomson #define DA7219_SYSTEM_MODES_INPUT 0x50 746d817c0eSAdam Thomson #define DA7219_SYSTEM_MODES_OUTPUT 0x51 756d817c0eSAdam Thomson #define DA7219_MICBIAS_CTRL 0x62 766d817c0eSAdam Thomson #define DA7219_MIC_1_CTRL 0x63 776d817c0eSAdam Thomson #define DA7219_MIXIN_L_CTRL 0x65 786d817c0eSAdam Thomson #define DA7219_ADC_L_CTRL 0x67 796d817c0eSAdam Thomson #define DA7219_DAC_L_CTRL 0x69 806d817c0eSAdam Thomson #define DA7219_DAC_R_CTRL 0x6A 816d817c0eSAdam Thomson #define DA7219_HP_L_CTRL 0x6B 826d817c0eSAdam Thomson #define DA7219_HP_R_CTRL 0x6C 836d817c0eSAdam Thomson #define DA7219_MIXOUT_L_CTRL 0x6E 846d817c0eSAdam Thomson #define DA7219_MIXOUT_R_CTRL 0x6F 856d817c0eSAdam Thomson #define DA7219_CHIP_ID1 0x81 866d817c0eSAdam Thomson #define DA7219_CHIP_ID2 0x82 876d817c0eSAdam Thomson #define DA7219_CHIP_REVISION 0x83 886d817c0eSAdam Thomson #define DA7219_IO_CTRL 0x91 896d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_CTRL 0x92 906d817c0eSAdam Thomson #define DA7219_PC_COUNT 0x94 916d817c0eSAdam Thomson #define DA7219_CP_VOL_THRESHOLD1 0x95 926d817c0eSAdam Thomson #define DA7219_CP_DELAY 0x96 936d817c0eSAdam Thomson #define DA7219_DIG_CTRL 0x99 946d817c0eSAdam Thomson #define DA7219_ALC_CTRL2 0x9A 956d817c0eSAdam Thomson #define DA7219_ALC_CTRL3 0x9B 966d817c0eSAdam Thomson #define DA7219_ALC_NOISE 0x9C 976d817c0eSAdam Thomson #define DA7219_ALC_TARGET_MIN 0x9D 986d817c0eSAdam Thomson #define DA7219_ALC_TARGET_MAX 0x9E 996d817c0eSAdam Thomson #define DA7219_ALC_GAIN_LIMITS 0x9F 1006d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_LIMITS 0xA0 1016d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_CTRL 0xA1 1026d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL 0xA2 1036d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L 0xA3 1046d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L 0xA4 1056d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME 0xAF 1066d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESH 0xB0 1076d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESH 0xB1 1086d817c0eSAdam Thomson #define DA7219_DAC_NG_CTRL 0xB2 1096d817c0eSAdam Thomson #define DA7219_TONE_GEN_CFG1 0xB4 1106d817c0eSAdam Thomson #define DA7219_TONE_GEN_CFG2 0xB5 1116d817c0eSAdam Thomson #define DA7219_TONE_GEN_CYCLES 0xB6 1126d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ1_L 0xB7 1136d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ1_U 0xB8 1146d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ2_L 0xB9 1156d817c0eSAdam Thomson #define DA7219_TONE_GEN_FREQ2_U 0xBA 1166d817c0eSAdam Thomson #define DA7219_TONE_GEN_ON_PER 0xBB 1176d817c0eSAdam Thomson #define DA7219_TONE_GEN_OFF_PER 0xBC 1186d817c0eSAdam Thomson #define DA7219_SYSTEM_STATUS 0xE0 1196d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE 0xFD 1206d817c0eSAdam Thomson 1216d817c0eSAdam Thomson 1226d817c0eSAdam Thomson /* 1236d817c0eSAdam Thomson * Bit Fields 1246d817c0eSAdam Thomson */ 1256d817c0eSAdam Thomson 1266d817c0eSAdam Thomson #define DA7219_SWITCH_EN_MAX 0x1 1276d817c0eSAdam Thomson 1286d817c0eSAdam Thomson /* DA7219_MIC_1_GAIN_STATUS = 0x6 */ 1296d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_STATUS_SHIFT 0 1306d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_STATUS_MASK (0x7 << 0) 1316d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_MAX 0x7 1326d817c0eSAdam Thomson 1336d817c0eSAdam Thomson /* DA7219_MIXIN_L_GAIN_STATUS = 0x8 */ 1346d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_STATUS_SHIFT 0 1356d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_STATUS_MASK (0xF << 0) 1366d817c0eSAdam Thomson 1376d817c0eSAdam Thomson /* DA7219_ADC_L_GAIN_STATUS = 0xA */ 1386d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_STATUS_SHIFT 0 1396d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_STATUS_MASK (0x7F << 0) 1406d817c0eSAdam Thomson 1416d817c0eSAdam Thomson /* DA7219_DAC_L_GAIN_STATUS = 0xC */ 1426d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_STATUS_SHIFT 0 1436d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_STATUS_MASK (0x7F << 0) 1446d817c0eSAdam Thomson 1456d817c0eSAdam Thomson /* DA7219_DAC_R_GAIN_STATUS = 0xD */ 1466d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_STATUS_SHIFT 0 1476d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_STATUS_MASK (0x7F << 0) 1486d817c0eSAdam Thomson 1496d817c0eSAdam Thomson /* DA7219_HP_L_GAIN_STATUS = 0xE */ 1506d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_STATUS_SHIFT 0 1516d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_STATUS_MASK (0x3F << 0) 1526d817c0eSAdam Thomson 1536d817c0eSAdam Thomson /* DA7219_HP_R_GAIN_STATUS = 0xF */ 1546d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_STATUS_SHIFT 0 1556d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_STATUS_MASK (0x3F << 0) 1566d817c0eSAdam Thomson 1576d817c0eSAdam Thomson /* DA7219_MIC_1_SELECT = 0x10 */ 1586d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_IN_SEL_SHIFT 0 1596d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_IN_SEL_MASK (0x3 << 0) 1606d817c0eSAdam Thomson 1616d817c0eSAdam Thomson /* DA7219_CIF_TIMEOUT_CTRL = 0x12 */ 1626d817c0eSAdam Thomson #define DA7219_I2C_TIMEOUT_EN_SHIFT 0 1636d817c0eSAdam Thomson #define DA7219_I2C_TIMEOUT_EN_MASK (0x1 << 0) 1646d817c0eSAdam Thomson 1656d817c0eSAdam Thomson /* DA7219_CIF_CTRL = 0x13 */ 1666d817c0eSAdam Thomson #define DA7219_CIF_I2C_WRITE_MODE_SHIFT 0 1676d817c0eSAdam Thomson #define DA7219_CIF_I2C_WRITE_MODE_MASK (0x1 << 0) 1686d817c0eSAdam Thomson #define DA7219_CIF_REG_SOFT_RESET_SHIFT 7 1696d817c0eSAdam Thomson #define DA7219_CIF_REG_SOFT_RESET_MASK (0x1 << 7) 1706d817c0eSAdam Thomson 1716d817c0eSAdam Thomson /* DA7219_SR_24_48 = 0x16 */ 1726d817c0eSAdam Thomson #define DA7219_SR_24_48_SHIFT 0 1736d817c0eSAdam Thomson #define DA7219_SR_24_48_MASK (0x1 << 0) 1746d817c0eSAdam Thomson 1756d817c0eSAdam Thomson /* DA7219_SR = 0x17 */ 1766d817c0eSAdam Thomson #define DA7219_SR_SHIFT 0 1776d817c0eSAdam Thomson #define DA7219_SR_MASK (0xF << 0) 1786d817c0eSAdam Thomson #define DA7219_SR_8000 (0x01 << 0) 1796d817c0eSAdam Thomson #define DA7219_SR_11025 (0x02 << 0) 1806d817c0eSAdam Thomson #define DA7219_SR_12000 (0x03 << 0) 1816d817c0eSAdam Thomson #define DA7219_SR_16000 (0x05 << 0) 1826d817c0eSAdam Thomson #define DA7219_SR_22050 (0x06 << 0) 1836d817c0eSAdam Thomson #define DA7219_SR_24000 (0x07 << 0) 1846d817c0eSAdam Thomson #define DA7219_SR_32000 (0x09 << 0) 1856d817c0eSAdam Thomson #define DA7219_SR_44100 (0x0A << 0) 1866d817c0eSAdam Thomson #define DA7219_SR_48000 (0x0B << 0) 1876d817c0eSAdam Thomson #define DA7219_SR_88200 (0x0E << 0) 1886d817c0eSAdam Thomson #define DA7219_SR_96000 (0x0F << 0) 1896d817c0eSAdam Thomson 1906d817c0eSAdam Thomson /* DA7219_CIF_I2C_ADDR_CFG = 0x1B */ 1916d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG_SHIFT 0 1926d817c0eSAdam Thomson #define DA7219_CIF_I2C_ADDR_CFG_MASK (0x3 << 0) 1936d817c0eSAdam Thomson 1946d817c0eSAdam Thomson /* DA7219_PLL_CTRL = 0x20 */ 1956d817c0eSAdam Thomson #define DA7219_PLL_INDIV_SHIFT 2 1966d817c0eSAdam Thomson #define DA7219_PLL_INDIV_MASK (0x7 << 2) 19763a450aaSAdam Thomson #define DA7219_PLL_INDIV_2_TO_4_5_MHZ (0x0 << 2) 19863a450aaSAdam Thomson #define DA7219_PLL_INDIV_4_5_TO_9_MHZ (0x1 << 2) 19963a450aaSAdam Thomson #define DA7219_PLL_INDIV_9_TO_18_MHZ (0x2 << 2) 20063a450aaSAdam Thomson #define DA7219_PLL_INDIV_18_TO_36_MHZ (0x3 << 2) 20163a450aaSAdam Thomson #define DA7219_PLL_INDIV_36_TO_54_MHZ (0x4 << 2) 2026d817c0eSAdam Thomson #define DA7219_PLL_MCLK_SQR_EN_SHIFT 5 2036d817c0eSAdam Thomson #define DA7219_PLL_MCLK_SQR_EN_MASK (0x1 << 5) 2046d817c0eSAdam Thomson #define DA7219_PLL_MODE_SHIFT 6 2056d817c0eSAdam Thomson #define DA7219_PLL_MODE_MASK (0x3 << 6) 2066d817c0eSAdam Thomson #define DA7219_PLL_MODE_BYPASS (0x0 << 6) 2076d817c0eSAdam Thomson #define DA7219_PLL_MODE_NORMAL (0x1 << 6) 2086d817c0eSAdam Thomson #define DA7219_PLL_MODE_SRM (0x2 << 6) 2096d817c0eSAdam Thomson 2106d817c0eSAdam Thomson /* DA7219_PLL_FRAC_TOP = 0x22 */ 2116d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT 0 2126d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_TOP_MASK (0x1F << 0) 2136d817c0eSAdam Thomson 2146d817c0eSAdam Thomson /* DA7219_PLL_FRAC_BOT = 0x23 */ 2156d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_BOT_SHIFT 0 2166d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_FRAC_BOT_MASK (0xFF << 0) 2176d817c0eSAdam Thomson 2186d817c0eSAdam Thomson /* DA7219_PLL_INTEGER = 0x24 */ 2196d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_INTEGER_SHIFT 0 2206d817c0eSAdam Thomson #define DA7219_PLL_FBDIV_INTEGER_MASK (0x7F << 0) 2216d817c0eSAdam Thomson 2226d817c0eSAdam Thomson /* DA7219_PLL_SRM_STS = 0x25 */ 2236d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATE_SHIFT 0 2246d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATE_MASK (0xF << 0) 2256d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATUS_SHIFT 4 2266d817c0eSAdam Thomson #define DA7219_PLL_SRM_STATUS_MASK (0xF << 4) 2276a0b87c6SAdam Thomson #define DA7219_PLL_SRM_STS_MCLK (0x1 << 4) 2286d817c0eSAdam Thomson #define DA7219_PLL_SRM_STS_SRM_LOCK (0x1 << 7) 2296d817c0eSAdam Thomson 2306d817c0eSAdam Thomson /* DA7219_DIG_ROUTING_DAI = 0x2A */ 2316d817c0eSAdam Thomson #define DA7219_DAI_L_SRC_SHIFT 0 2326d817c0eSAdam Thomson #define DA7219_DAI_L_SRC_MASK (0x3 << 0) 2336d817c0eSAdam Thomson #define DA7219_DAI_R_SRC_SHIFT 4 2346d817c0eSAdam Thomson #define DA7219_DAI_R_SRC_MASK (0x3 << 4) 2356d817c0eSAdam Thomson #define DA7219_OUT_SRC_MAX 4 2366d817c0eSAdam Thomson 2376d817c0eSAdam Thomson /* DA7219_DAI_CLK_MODE = 0x2B */ 2386d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_SHIFT 0 2396d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_MASK (0x3 << 0) 2406d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_32 (0x0 << 0) 2416d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_64 (0x1 << 0) 2426d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_128 (0x2 << 0) 2436d817c0eSAdam Thomson #define DA7219_DAI_BCLKS_PER_WCLK_256 (0x3 << 0) 2446d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_SHIFT 2 2456d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_MASK (0x1 << 2) 2466d817c0eSAdam Thomson #define DA7219_DAI_CLK_POL_INV (0x1 << 2) 2476d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_SHIFT 3 2486d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_MASK (0x1 << 3) 2496d817c0eSAdam Thomson #define DA7219_DAI_WCLK_POL_INV (0x1 << 3) 2506d817c0eSAdam Thomson #define DA7219_DAI_WCLK_TRI_STATE_SHIFT 4 2516d817c0eSAdam Thomson #define DA7219_DAI_WCLK_TRI_STATE_MASK (0x1 << 4) 2526d817c0eSAdam Thomson #define DA7219_DAI_CLK_EN_SHIFT 7 2536d817c0eSAdam Thomson #define DA7219_DAI_CLK_EN_MASK (0x1 << 7) 2546d817c0eSAdam Thomson 2556d817c0eSAdam Thomson /* DA7219_DAI_CTRL = 0x2C */ 2566d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_SHIFT 0 2576d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_MASK (0x3 << 0) 2586d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_I2S (0x0 << 0) 2596d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_LEFT_J (0x1 << 0) 2606d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_RIGHT_J (0x2 << 0) 2616d817c0eSAdam Thomson #define DA7219_DAI_FORMAT_DSP (0x3 << 0) 2626d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_SHIFT 2 2636d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_MASK (0x3 << 2) 2646d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S16_LE (0x0 << 2) 2656d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S20_LE (0x1 << 2) 2666d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S24_LE (0x2 << 2) 2676d817c0eSAdam Thomson #define DA7219_DAI_WORD_LENGTH_S32_LE (0x3 << 2) 2686d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_SHIFT 4 2696d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_MASK (0x3 << 4) 2706d817c0eSAdam Thomson #define DA7219_DAI_CH_NUM_MAX 2 2716d817c0eSAdam Thomson #define DA7219_DAI_EN_SHIFT 7 2726d817c0eSAdam Thomson #define DA7219_DAI_EN_MASK (0x1 << 7) 2736d817c0eSAdam Thomson 2746d817c0eSAdam Thomson /* DA7219_DAI_TDM_CTRL = 0x2D */ 2756d817c0eSAdam Thomson #define DA7219_DAI_TDM_CH_EN_SHIFT 0 2766d817c0eSAdam Thomson #define DA7219_DAI_TDM_CH_EN_MASK (0x3 << 0) 2776d817c0eSAdam Thomson #define DA7219_DAI_OE_SHIFT 6 2786d817c0eSAdam Thomson #define DA7219_DAI_OE_MASK (0x1 << 6) 2796d817c0eSAdam Thomson #define DA7219_DAI_TDM_MODE_EN_SHIFT 7 2806d817c0eSAdam Thomson #define DA7219_DAI_TDM_MODE_EN_MASK (0x1 << 7) 2816d817c0eSAdam Thomson #define DA7219_DAI_TDM_MAX_SLOTS 2 2826d817c0eSAdam Thomson 2836d817c0eSAdam Thomson /* DA7219_DIG_ROUTING_DAC = 0x2E */ 2846d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_SHIFT 0 2856d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_MASK (0x3 << 0) 2866d817c0eSAdam Thomson #define DA7219_DAC_L_SRC_TONEGEN (0x1 << 0) 2876d817c0eSAdam Thomson #define DA7219_DAC_L_MONO_SHIFT 3 2886d817c0eSAdam Thomson #define DA7219_DAC_L_MONO_MASK (0x1 << 3) 2896d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_SHIFT 4 2906d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_MASK (0x3 << 4) 2916d817c0eSAdam Thomson #define DA7219_DAC_R_SRC_TONEGEN (0x1 << 4) 2926d817c0eSAdam Thomson #define DA7219_DAC_R_MONO_SHIFT 7 2936d817c0eSAdam Thomson #define DA7219_DAC_R_MONO_MASK (0x1 << 7) 2946d817c0eSAdam Thomson 2956d817c0eSAdam Thomson /* DA7219_ALC_CTRL1 = 0x2F */ 2966d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_EN_SHIFT 0 2976d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_EN_MASK (0x1 << 0) 2986d817c0eSAdam Thomson #define DA7219_ALC_SYNC_MODE_SHIFT 1 2996d817c0eSAdam Thomson #define DA7219_ALC_SYNC_MODE_MASK (0x1 << 1) 3006d817c0eSAdam Thomson #define DA7219_ALC_EN_SHIFT 3 3016d817c0eSAdam Thomson #define DA7219_ALC_EN_MASK (0x1 << 3) 3026d817c0eSAdam Thomson #define DA7219_ALC_AUTO_CALIB_EN_SHIFT 4 3036d817c0eSAdam Thomson #define DA7219_ALC_AUTO_CALIB_EN_MASK (0x1 << 4) 3046d817c0eSAdam Thomson #define DA7219_ALC_CALIB_OVERFLOW_SHIFT 5 3056d817c0eSAdam Thomson #define DA7219_ALC_CALIB_OVERFLOW_MASK (0x1 << 5) 3066d817c0eSAdam Thomson 3076d817c0eSAdam Thomson /* DA7219_DAI_OFFSET_LOWER = 0x30 */ 3086d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER_SHIFT 0 3096d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_LOWER_MASK (0xFF << 0) 3106d817c0eSAdam Thomson 3116d817c0eSAdam Thomson /* DA7219_DAI_OFFSET_UPPER = 0x31 */ 3126d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER_SHIFT 0 3136d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_UPPER_MASK (0x7 << 0) 3146d817c0eSAdam Thomson #define DA7219_DAI_OFFSET_MAX 0x2FF 3156d817c0eSAdam Thomson 3166d817c0eSAdam Thomson /* DA7219_REFERENCES = 0x32 */ 3176d817c0eSAdam Thomson #define DA7219_BIAS_EN_SHIFT 3 3186d817c0eSAdam Thomson #define DA7219_BIAS_EN_MASK (0x1 << 3) 3196d817c0eSAdam Thomson #define DA7219_VMID_FAST_CHARGE_SHIFT 4 3206d817c0eSAdam Thomson #define DA7219_VMID_FAST_CHARGE_MASK (0x1 << 4) 3216d817c0eSAdam Thomson 3226d817c0eSAdam Thomson /* DA7219_MIXIN_L_SELECT = 0x33 */ 3236d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_SELECT_SHIFT 0 3246d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_SELECT_MASK (0x1 << 0) 3256d817c0eSAdam Thomson 3266d817c0eSAdam Thomson /* DA7219_MIXIN_L_GAIN = 0x34 */ 3276d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_SHIFT 0 3286d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_MASK (0xF << 0) 3296d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_GAIN_MAX 0xF 3306d817c0eSAdam Thomson 3316d817c0eSAdam Thomson /* DA7219_ADC_L_GAIN = 0x36 */ 3326d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_SHIFT 0 3336d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_MASK (0x7F << 0) 3346d817c0eSAdam Thomson #define DA7219_ADC_L_DIGITAL_GAIN_MAX 0x7F 3356d817c0eSAdam Thomson 3366d817c0eSAdam Thomson /* DA7219_ADC_FILTERS1 = 0x38 */ 3376d817c0eSAdam Thomson #define DA7219_ADC_VOICE_HPF_CORNER_SHIFT 0 3386d817c0eSAdam Thomson #define DA7219_ADC_VOICE_HPF_CORNER_MASK (0x7 << 0) 3396d817c0eSAdam Thomson #define DA7219_VOICE_HPF_CORNER_MAX 8 3406d817c0eSAdam Thomson #define DA7219_ADC_VOICE_EN_SHIFT 3 3416d817c0eSAdam Thomson #define DA7219_ADC_VOICE_EN_MASK (0x1 << 3) 3426d817c0eSAdam Thomson #define DA7219_ADC_AUDIO_HPF_CORNER_SHIFT 4 3436d817c0eSAdam Thomson #define DA7219_ADC_AUDIO_HPF_CORNER_MASK (0x3 << 4) 3446d817c0eSAdam Thomson #define DA7219_AUDIO_HPF_CORNER_MAX 4 3456d817c0eSAdam Thomson #define DA7219_ADC_HPF_EN_SHIFT 7 3466d817c0eSAdam Thomson #define DA7219_ADC_HPF_EN_MASK (0x1 << 7) 3476d817c0eSAdam Thomson #define DA7219_HPF_MODE_SHIFT 0 3486d817c0eSAdam Thomson #define DA7219_HPF_DISABLED ((0x0 << 3) | (0x0 << 7)) 3496d817c0eSAdam Thomson #define DA7219_HPF_AUDIO_EN ((0x0 << 3) | (0x1 << 7)) 3506d817c0eSAdam Thomson #define DA7219_HPF_VOICE_EN ((0x1 << 3) | (0x1 << 7)) 3516d817c0eSAdam Thomson #define DA7219_HPF_MODE_MASK ((0x1 << 3) | (0x1 << 7)) 3526d817c0eSAdam Thomson #define DA7219_HPF_MODE_MAX 3 3536d817c0eSAdam Thomson 3546d817c0eSAdam Thomson /* DA7219_MIC_1_GAIN = 0x39 */ 3556d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_SHIFT 0 3566d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_GAIN_MASK (0x7 << 0) 3576d817c0eSAdam Thomson 3586d817c0eSAdam Thomson /* DA7219_SIDETONE_CTRL = 0x3A */ 3596d817c0eSAdam Thomson #define DA7219_SIDETONE_MUTE_EN_SHIFT 6 3606d817c0eSAdam Thomson #define DA7219_SIDETONE_MUTE_EN_MASK (0x1 << 6) 3616d817c0eSAdam Thomson #define DA7219_SIDETONE_EN_SHIFT 7 3626d817c0eSAdam Thomson #define DA7219_SIDETONE_EN_MASK (0x1 << 7) 3636d817c0eSAdam Thomson 3646d817c0eSAdam Thomson /* DA7219_SIDETONE_GAIN = 0x3B */ 3656d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_SHIFT 0 3666d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_MASK (0xF << 0) 3676d817c0eSAdam Thomson #define DA7219_SIDETONE_GAIN_MAX 0xE 3686d817c0eSAdam Thomson 3696d817c0eSAdam Thomson /* DA7219_DROUTING_ST_OUTFILT_1L = 0x3C */ 3706d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1L_SRC_SHIFT 0 3716d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1L_SRC_MASK (0x7 << 0) 3726d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1L_SHIFT 0 3736d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1R_SHIFT 1 3746d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_SIDETONE_SHIFT 2 3756d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1L (0x1 << 0) 3766d817c0eSAdam Thomson #define DA7219_DMIX_ST_SRC_OUTFILT1R (0x1 << 1) 3776d817c0eSAdam Thomson 3786d817c0eSAdam Thomson /* DA7219_DROUTING_ST_OUTFILT_1R = 0x3D */ 3796d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1R_SRC_SHIFT 0 3806d817c0eSAdam Thomson #define DA7219_OUTFILT_ST_1R_SRC_MASK (0x7 << 0) 3816d817c0eSAdam Thomson 3826d817c0eSAdam Thomson /* DA7219_DAC_FILTERS5 = 0x40 */ 3836d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_SHIFT 4 3846d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_MASK (0x7 << 4) 3856d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_RATE_MAX 7 3866d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_EN_SHIFT 7 3876d817c0eSAdam Thomson #define DA7219_DAC_SOFTMUTE_EN_MASK (0x1 << 7) 3886d817c0eSAdam Thomson 3896d817c0eSAdam Thomson /* DA7219_DAC_FILTERS2 = 0x41 */ 3906d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND1_SHIFT 0 3916d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND1_MASK (0xF << 0) 3926d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND2_SHIFT 4 3936d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND2_MASK (0xF << 4) 3946d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND_MAX 0xF 3956d817c0eSAdam Thomson 3966d817c0eSAdam Thomson /* DA7219_DAC_FILTERS3 = 0x42 */ 3976d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND3_SHIFT 0 3986d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND3_MASK (0xF << 0) 3996d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND4_SHIFT 4 4006d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND4_MASK (0xF << 4) 4016d817c0eSAdam Thomson 4026d817c0eSAdam Thomson /* DA7219_DAC_FILTERS4 = 0x43 */ 4036d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND5_SHIFT 0 4046d817c0eSAdam Thomson #define DA7219_DAC_EQ_BAND5_MASK (0xF << 0) 4056d817c0eSAdam Thomson #define DA7219_DAC_EQ_EN_SHIFT 7 4066d817c0eSAdam Thomson #define DA7219_DAC_EQ_EN_MASK (0x1 << 7) 4076d817c0eSAdam Thomson 4086d817c0eSAdam Thomson /* DA7219_DAC_FILTERS1 = 0x44 */ 4096d817c0eSAdam Thomson #define DA7219_DAC_VOICE_HPF_CORNER_SHIFT 0 4106d817c0eSAdam Thomson #define DA7219_DAC_VOICE_HPF_CORNER_MASK (0x7 << 0) 4116d817c0eSAdam Thomson #define DA7219_DAC_VOICE_EN_SHIFT 3 4126d817c0eSAdam Thomson #define DA7219_DAC_VOICE_EN_MASK (0x1 << 3) 4136d817c0eSAdam Thomson #define DA7219_DAC_AUDIO_HPF_CORNER_SHIFT 4 4146d817c0eSAdam Thomson #define DA7219_DAC_AUDIO_HPF_CORNER_MASK (0x3 << 4) 4156d817c0eSAdam Thomson #define DA7219_DAC_HPF_EN_SHIFT 7 4166d817c0eSAdam Thomson #define DA7219_DAC_HPF_EN_MASK (0x1 << 7) 4176d817c0eSAdam Thomson 4186d817c0eSAdam Thomson /* DA7219_DAC_L_GAIN = 0x45 */ 4196d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_SHIFT 0 4206d817c0eSAdam Thomson #define DA7219_DAC_L_DIGITAL_GAIN_MASK (0x7F << 0) 4216d817c0eSAdam Thomson #define DA7219_DAC_DIGITAL_GAIN_MAX 0x7F 4226d817c0eSAdam Thomson #define DA7219_DAC_DIGITAL_GAIN_0DB (0x6F << 0) 4236d817c0eSAdam Thomson 4246d817c0eSAdam Thomson /* DA7219_DAC_R_GAIN = 0x46 */ 4256d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_SHIFT 0 4266d817c0eSAdam Thomson #define DA7219_DAC_R_DIGITAL_GAIN_MASK (0x7F << 0) 4276d817c0eSAdam Thomson 4286d817c0eSAdam Thomson /* DA7219_CP_CTRL = 0x47 */ 4296d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_SHIFT 4 4306d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_MASK (0x3 << 4) 4316d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_REL_MASK 0x3 4326d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_MAX 3 4336d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_LARGEST_VOL 0x1 4346d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_DAC_VOL 0x2 4356d817c0eSAdam Thomson #define DA7219_CP_MCHANGE_SIG_MAG 0x3 4366d817c0eSAdam Thomson #define DA7219_CP_EN_SHIFT 7 4376d817c0eSAdam Thomson #define DA7219_CP_EN_MASK (0x1 << 7) 4386d817c0eSAdam Thomson 4396d817c0eSAdam Thomson /* DA7219_HP_L_GAIN = 0x48 */ 4406d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_SHIFT 0 4416d817c0eSAdam Thomson #define DA7219_HP_L_AMP_GAIN_MASK (0x3F << 0) 4426d817c0eSAdam Thomson #define DA7219_HP_AMP_GAIN_MAX 0x3F 4436d817c0eSAdam Thomson #define DA7219_HP_AMP_GAIN_0DB (0x39 << 0) 4446d817c0eSAdam Thomson 4456d817c0eSAdam Thomson /* DA7219_HP_R_GAIN = 0x49 */ 4466d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_SHIFT 0 4476d817c0eSAdam Thomson #define DA7219_HP_R_AMP_GAIN_MASK (0x3F << 0) 4486d817c0eSAdam Thomson 4496d817c0eSAdam Thomson /* DA7219_MIXOUT_L_SELECT = 0x4B */ 4506d817c0eSAdam Thomson #define DA7219_MIXOUT_L_MIX_SELECT_SHIFT 0 4516d817c0eSAdam Thomson #define DA7219_MIXOUT_L_MIX_SELECT_MASK (0x1 << 0) 4526d817c0eSAdam Thomson 4536d817c0eSAdam Thomson /* DA7219_MIXOUT_R_SELECT = 0x4C */ 4546d817c0eSAdam Thomson #define DA7219_MIXOUT_R_MIX_SELECT_SHIFT 0 4556d817c0eSAdam Thomson #define DA7219_MIXOUT_R_MIX_SELECT_MASK (0x1 << 0) 4566d817c0eSAdam Thomson 4576d817c0eSAdam Thomson /* DA7219_SYSTEM_MODES_INPUT = 0x50 */ 4586d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_SHIFT 0 4596d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_MASK (0x1 << 0) 4606d817c0eSAdam Thomson #define DA7219_ADC_MODE_SHIFT 1 4616d817c0eSAdam Thomson #define DA7219_ADC_MODE_MASK (0x7F << 1) 4626d817c0eSAdam Thomson 4636d817c0eSAdam Thomson /* DA7219_SYSTEM_MODES_OUTPUT = 0x51 */ 4646d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_SHIFT 0 4656d817c0eSAdam Thomson #define DA7219_MODE_SUBMIT_MASK (0x1 << 0) 4666d817c0eSAdam Thomson #define DA7219_DAC_MODE_SHIFT 1 4676d817c0eSAdam Thomson #define DA7219_DAC_MODE_MASK (0x7F << 1) 4686d817c0eSAdam Thomson 4696d817c0eSAdam Thomson /* DA7219_MICBIAS_CTRL = 0x62 */ 4706d817c0eSAdam Thomson #define DA7219_MICBIAS1_LEVEL_SHIFT 0 4716d817c0eSAdam Thomson #define DA7219_MICBIAS1_LEVEL_MASK (0x7 << 0) 4726d817c0eSAdam Thomson #define DA7219_MICBIAS1_EN_SHIFT 3 4736d817c0eSAdam Thomson #define DA7219_MICBIAS1_EN_MASK (0x1 << 3) 4746d817c0eSAdam Thomson 4756d817c0eSAdam Thomson /* DA7219_MIC_1_CTRL = 0x63 */ 4766d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_RAMP_EN_SHIFT 5 4776d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_RAMP_EN_MASK (0x1 << 5) 4786d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_MUTE_EN_SHIFT 6 4796d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_MUTE_EN_MASK (0x1 << 6) 4806d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_EN_SHIFT 7 4816d817c0eSAdam Thomson #define DA7219_MIC_1_AMP_EN_MASK (0x1 << 7) 4826d817c0eSAdam Thomson 4836d817c0eSAdam Thomson /* DA7219_MIXIN_L_CTRL = 0x65 */ 4846d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_EN_SHIFT 3 4856d817c0eSAdam Thomson #define DA7219_MIXIN_L_MIX_EN_MASK (0x1 << 3) 4866d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_ZC_EN_SHIFT 4 4876d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_ZC_EN_MASK (0x1 << 4) 4886d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_RAMP_EN_SHIFT 5 4896d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_RAMP_EN_MASK (0x1 << 5) 4906d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_MUTE_EN_SHIFT 6 4916d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_MUTE_EN_MASK (0x1 << 6) 4926d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_EN_SHIFT 7 4936d817c0eSAdam Thomson #define DA7219_MIXIN_L_AMP_EN_MASK (0x1 << 7) 4946d817c0eSAdam Thomson 4956d817c0eSAdam Thomson /* DA7219_ADC_L_CTRL = 0x67 */ 4966d817c0eSAdam Thomson #define DA7219_ADC_L_BIAS_SHIFT 0 4976d817c0eSAdam Thomson #define DA7219_ADC_L_BIAS_MASK (0x3 << 0) 4986d817c0eSAdam Thomson #define DA7219_ADC_L_RAMP_EN_SHIFT 5 4996d817c0eSAdam Thomson #define DA7219_ADC_L_RAMP_EN_MASK (0x1 << 5) 5006d817c0eSAdam Thomson #define DA7219_ADC_L_MUTE_EN_SHIFT 6 5016d817c0eSAdam Thomson #define DA7219_ADC_L_MUTE_EN_MASK (0x1 << 6) 5026d817c0eSAdam Thomson #define DA7219_ADC_L_EN_SHIFT 7 5036d817c0eSAdam Thomson #define DA7219_ADC_L_EN_MASK (0x1 << 7) 5046d817c0eSAdam Thomson 5056d817c0eSAdam Thomson /* DA7219_DAC_L_CTRL = 0x69 */ 5066d817c0eSAdam Thomson #define DA7219_DAC_L_RAMP_EN_SHIFT 5 5076d817c0eSAdam Thomson #define DA7219_DAC_L_RAMP_EN_MASK (0x1 << 5) 5086d817c0eSAdam Thomson #define DA7219_DAC_L_MUTE_EN_SHIFT 6 5096d817c0eSAdam Thomson #define DA7219_DAC_L_MUTE_EN_MASK (0x1 << 6) 5106d817c0eSAdam Thomson #define DA7219_DAC_L_EN_SHIFT 7 5116d817c0eSAdam Thomson #define DA7219_DAC_L_EN_MASK (0x1 << 7) 5126d817c0eSAdam Thomson 5136d817c0eSAdam Thomson /* DA7219_DAC_R_CTRL = 0x6A */ 5146d817c0eSAdam Thomson #define DA7219_DAC_R_RAMP_EN_SHIFT 5 5156d817c0eSAdam Thomson #define DA7219_DAC_R_RAMP_EN_MASK (0x1 << 5) 5166d817c0eSAdam Thomson #define DA7219_DAC_R_MUTE_EN_SHIFT 6 5176d817c0eSAdam Thomson #define DA7219_DAC_R_MUTE_EN_MASK (0x1 << 6) 5186d817c0eSAdam Thomson #define DA7219_DAC_R_EN_SHIFT 7 5196d817c0eSAdam Thomson #define DA7219_DAC_R_EN_MASK (0x1 << 7) 5206d817c0eSAdam Thomson 5216d817c0eSAdam Thomson /* DA7219_HP_L_CTRL = 0x6B */ 5226d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MIN_GAIN_EN_SHIFT 2 5236d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MIN_GAIN_EN_MASK (0x1 << 2) 5246d817c0eSAdam Thomson #define DA7219_HP_L_AMP_OE_SHIFT 3 5256d817c0eSAdam Thomson #define DA7219_HP_L_AMP_OE_MASK (0x1 << 3) 5266d817c0eSAdam Thomson #define DA7219_HP_L_AMP_ZC_EN_SHIFT 4 5276d817c0eSAdam Thomson #define DA7219_HP_L_AMP_ZC_EN_MASK (0x1 << 4) 5286d817c0eSAdam Thomson #define DA7219_HP_L_AMP_RAMP_EN_SHIFT 5 5296d817c0eSAdam Thomson #define DA7219_HP_L_AMP_RAMP_EN_MASK (0x1 << 5) 5306d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MUTE_EN_SHIFT 6 5316d817c0eSAdam Thomson #define DA7219_HP_L_AMP_MUTE_EN_MASK (0x1 << 6) 5326d817c0eSAdam Thomson #define DA7219_HP_L_AMP_EN_SHIFT 7 5336d817c0eSAdam Thomson #define DA7219_HP_L_AMP_EN_MASK (0x1 << 7) 5346d817c0eSAdam Thomson 5356d817c0eSAdam Thomson /* DA7219_HP_R_CTRL = 0x6C */ 5366d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MIN_GAIN_EN_SHIFT 2 5376d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MIN_GAIN_EN_MASK (0x1 << 2) 5386d817c0eSAdam Thomson #define DA7219_HP_R_AMP_OE_SHIFT 3 5396d817c0eSAdam Thomson #define DA7219_HP_R_AMP_OE_MASK (0x1 << 3) 5406d817c0eSAdam Thomson #define DA7219_HP_R_AMP_ZC_EN_SHIFT 4 5416d817c0eSAdam Thomson #define DA7219_HP_R_AMP_ZC_EN_MASK (0x1 << 4) 5426d817c0eSAdam Thomson #define DA7219_HP_R_AMP_RAMP_EN_SHIFT 5 5436d817c0eSAdam Thomson #define DA7219_HP_R_AMP_RAMP_EN_MASK (0x1 << 5) 5446d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MUTE_EN_SHIFT 6 5456d817c0eSAdam Thomson #define DA7219_HP_R_AMP_MUTE_EN_MASK (0x1 << 6) 5466d817c0eSAdam Thomson #define DA7219_HP_R_AMP_EN_SHIFT 7 5476d817c0eSAdam Thomson #define DA7219_HP_R_AMP_EN_MASK (0x1 << 7) 5486d817c0eSAdam Thomson 5496d817c0eSAdam Thomson /* DA7219_MIXOUT_L_CTRL = 0x6E */ 5506d817c0eSAdam Thomson #define DA7219_MIXOUT_L_AMP_EN_SHIFT 7 5516d817c0eSAdam Thomson #define DA7219_MIXOUT_L_AMP_EN_MASK (0x1 << 7) 5526d817c0eSAdam Thomson 5536d817c0eSAdam Thomson /* DA7219_MIXOUT_R_CTRL = 0x6F */ 5546d817c0eSAdam Thomson #define DA7219_MIXOUT_R_AMP_EN_SHIFT 7 5556d817c0eSAdam Thomson #define DA7219_MIXOUT_R_AMP_EN_MASK (0x1 << 7) 5566d817c0eSAdam Thomson 5576d817c0eSAdam Thomson /* DA7219_CHIP_ID1 = 0x81 */ 5586d817c0eSAdam Thomson #define DA7219_CHIP_ID1_SHIFT 0 5596d817c0eSAdam Thomson #define DA7219_CHIP_ID1_MASK (0xFF << 0) 5606d817c0eSAdam Thomson 5616d817c0eSAdam Thomson /* DA7219_CHIP_ID2 = 0x82 */ 5626d817c0eSAdam Thomson #define DA7219_CHIP_ID2_SHIFT 0 5636d817c0eSAdam Thomson #define DA7219_CHIP_ID2_MASK (0xFF << 0) 5646d817c0eSAdam Thomson 5656d817c0eSAdam Thomson /* DA7219_CHIP_REVISION = 0x83 */ 5666d817c0eSAdam Thomson #define DA7219_CHIP_MINOR_SHIFT 0 5676d817c0eSAdam Thomson #define DA7219_CHIP_MINOR_MASK (0xF << 0) 5686d817c0eSAdam Thomson #define DA7219_CHIP_MAJOR_SHIFT 4 5696d817c0eSAdam Thomson #define DA7219_CHIP_MAJOR_MASK (0xF << 4) 5706d817c0eSAdam Thomson 5716d817c0eSAdam Thomson /* DA7219_IO_CTRL = 0x91 */ 5726d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0 5736d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0) 5746d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_2_5V_3_6V 0 5756d817c0eSAdam Thomson #define DA7219_IO_VOLTAGE_LEVEL_1_2V_2_8V 1 5766d817c0eSAdam Thomson 5776d817c0eSAdam Thomson /* DA7219_GAIN_RAMP_CTRL = 0x92 */ 5786d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_SHIFT 0 5796d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_MASK (0x3 << 0) 5806a0b87c6SAdam Thomson #define DA7219_GAIN_RAMP_RATE_X8 (0x0 << 0) 581a7f16ea9SAdam Thomson #define DA7219_GAIN_RAMP_RATE_NOMINAL (0x1 << 0) 5826d817c0eSAdam Thomson #define DA7219_GAIN_RAMP_RATE_MAX 4 5836d817c0eSAdam Thomson 5846d817c0eSAdam Thomson /* DA7219_PC_COUNT = 0x94 */ 5856d817c0eSAdam Thomson #define DA7219_PC_FREERUN_SHIFT 0 5866d817c0eSAdam Thomson #define DA7219_PC_FREERUN_MASK (0x1 << 0) 5876d817c0eSAdam Thomson #define DA7219_PC_RESYNC_AUTO_SHIFT 1 5886d817c0eSAdam Thomson #define DA7219_PC_RESYNC_AUTO_MASK (0x1 << 1) 5896d817c0eSAdam Thomson 5906d817c0eSAdam Thomson /* DA7219_CP_VOL_THRESHOLD1 = 0x95 */ 5916d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_SHIFT 0 5926d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_MASK (0x3F << 0) 5936d817c0eSAdam Thomson #define DA7219_CP_THRESH_VDD2_MAX 0x3F 5946d817c0eSAdam Thomson 5956d817c0eSAdam Thomson /* DA7219_DIG_CTRL = 0x99 */ 5966d817c0eSAdam Thomson #define DA7219_DAC_L_INV_SHIFT 3 5976d817c0eSAdam Thomson #define DA7219_DAC_L_INV_MASK (0x1 << 3) 5986d817c0eSAdam Thomson #define DA7219_DAC_R_INV_SHIFT 7 5996d817c0eSAdam Thomson #define DA7219_DAC_R_INV_MASK (0x1 << 7) 6006d817c0eSAdam Thomson 6016d817c0eSAdam Thomson /* DA7219_ALC_CTRL2 = 0x9A */ 6026d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_SHIFT 0 6036d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_MASK (0xF << 0) 6046d817c0eSAdam Thomson #define DA7219_ALC_ATTACK_MAX 13 6056d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_SHIFT 4 6066d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_MASK (0xF << 4) 6076d817c0eSAdam Thomson #define DA7219_ALC_RELEASE_MAX 11 6086d817c0eSAdam Thomson 6096d817c0eSAdam Thomson /* DA7219_ALC_CTRL3 = 0x9B */ 6106d817c0eSAdam Thomson #define DA7219_ALC_HOLD_SHIFT 0 6116d817c0eSAdam Thomson #define DA7219_ALC_HOLD_MASK (0xF << 0) 6126d817c0eSAdam Thomson #define DA7219_ALC_HOLD_MAX 16 6136d817c0eSAdam Thomson #define DA7219_ALC_INTEG_ATTACK_SHIFT 4 6146d817c0eSAdam Thomson #define DA7219_ALC_INTEG_ATTACK_MASK (0x3 << 4) 6156d817c0eSAdam Thomson #define DA7219_ALC_INTEG_RELEASE_SHIFT 6 6166d817c0eSAdam Thomson #define DA7219_ALC_INTEG_RELEASE_MASK (0x3 << 6) 6176d817c0eSAdam Thomson #define DA7219_ALC_INTEG_MAX 4 6186d817c0eSAdam Thomson 6196d817c0eSAdam Thomson /* DA7219_ALC_NOISE = 0x9C */ 6206d817c0eSAdam Thomson #define DA7219_ALC_NOISE_SHIFT 0 6216d817c0eSAdam Thomson #define DA7219_ALC_NOISE_MASK (0x3F << 0) 6226d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX 0x3F 6236d817c0eSAdam Thomson 6246d817c0eSAdam Thomson /* DA7219_ALC_TARGET_MIN = 0x9D */ 6256d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MIN_SHIFT 0 6266d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MIN_MASK (0x3F << 0) 6276d817c0eSAdam Thomson 6286d817c0eSAdam Thomson /* DA7219_ALC_TARGET_MAX = 0x9E */ 6296d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX_SHIFT 0 6306d817c0eSAdam Thomson #define DA7219_ALC_THRESHOLD_MAX_MASK (0x3F << 0) 6316d817c0eSAdam Thomson 6326d817c0eSAdam Thomson /* DA7219_ALC_GAIN_LIMITS = 0x9F */ 6336d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_MAX_SHIFT 0 6346d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_MAX_MASK (0xF << 0) 6356d817c0eSAdam Thomson #define DA7219_ALC_GAIN_MAX_SHIFT 4 6366d817c0eSAdam Thomson #define DA7219_ALC_GAIN_MAX_MASK (0xF << 4) 6376d817c0eSAdam Thomson #define DA7219_ALC_ATTEN_GAIN_MAX 0xF 6386d817c0eSAdam Thomson 6396d817c0eSAdam Thomson /* DA7219_ALC_ANA_GAIN_LIMITS = 0xA0 */ 6406d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN_SHIFT 0 6416d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN_MASK (0x7 << 0) 6426d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MIN 0x1 6436d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX_SHIFT 4 6446d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX_MASK (0x7 << 4) 6456d817c0eSAdam Thomson #define DA7219_ALC_ANA_GAIN_MAX 0x7 6466d817c0eSAdam Thomson 6476d817c0eSAdam Thomson /* DA7219_ALC_ANTICLIP_CTRL = 0xA1 */ 6486d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_SHIFT 0 6496d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_MASK (0x3 << 0) 6506d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_STEP_MAX 4 6516d817c0eSAdam Thomson #define DA7219_ALC_ANTIPCLIP_EN_SHIFT 7 6526d817c0eSAdam Thomson #define DA7219_ALC_ANTIPCLIP_EN_MASK (0x1 << 7) 6536d817c0eSAdam Thomson 6546d817c0eSAdam Thomson /* DA7219_ALC_ANTICLIP_LEVEL = 0xA2 */ 6556d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL_SHIFT 0 6566d817c0eSAdam Thomson #define DA7219_ALC_ANTICLIP_LEVEL_MASK (0x7F << 0) 6576d817c0eSAdam Thomson 6586d817c0eSAdam Thomson /* DA7219_ALC_OFFSET_AUTO_M_L = 0xA3 */ 6596d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L_SHIFT 0 6606d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_M_L_MASK (0xFF << 0) 6616d817c0eSAdam Thomson 6626d817c0eSAdam Thomson /* DA7219_ALC_OFFSET_AUTO_U_L = 0xA4 */ 6636d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L_SHIFT 0 6646d817c0eSAdam Thomson #define DA7219_ALC_OFFSET_AUTO_U_L_MASK (0xF << 0) 6656d817c0eSAdam Thomson 6666d817c0eSAdam Thomson /* DA7219_DAC_NG_SETUP_TIME = 0xAF */ 6676d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_SHIFT 0 6686d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_MASK (0x3 << 0) 6696d817c0eSAdam Thomson #define DA7219_DAC_NG_SETUP_TIME_MAX 4 6706d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPUP_RATE_SHIFT 2 6716d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPUP_RATE_MASK (0x1 << 2) 6726d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPDN_RATE_SHIFT 3 6736d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMPDN_RATE_MASK (0x1 << 3) 6746d817c0eSAdam Thomson #define DA7219_DAC_NG_RAMP_RATE_MAX 2 6756d817c0eSAdam Thomson 6766d817c0eSAdam Thomson /* DA7219_DAC_NG_OFF_THRESH = 0xB0 */ 6776d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESHOLD_SHIFT 0 6786d817c0eSAdam Thomson #define DA7219_DAC_NG_OFF_THRESHOLD_MASK (0x7 << 0) 6796d817c0eSAdam Thomson #define DA7219_DAC_NG_THRESHOLD_MAX 0x7 6806d817c0eSAdam Thomson 6816d817c0eSAdam Thomson /* DA7219_DAC_NG_ON_THRESH = 0xB1 */ 6826d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESHOLD_SHIFT 0 6836d817c0eSAdam Thomson #define DA7219_DAC_NG_ON_THRESHOLD_MASK (0x7 << 0) 6846d817c0eSAdam Thomson 6856d817c0eSAdam Thomson /* DA7219_DAC_NG_CTRL = 0xB2 */ 6866d817c0eSAdam Thomson #define DA7219_DAC_NG_EN_SHIFT 7 6876d817c0eSAdam Thomson #define DA7219_DAC_NG_EN_MASK (0x1 << 7) 6886d817c0eSAdam Thomson 6896d817c0eSAdam Thomson /* DA7219_TONE_GEN_CFG1 = 0xB4 */ 6906d817c0eSAdam Thomson #define DA7219_DTMF_REG_SHIFT 0 6916d817c0eSAdam Thomson #define DA7219_DTMF_REG_MASK (0xF << 0) 6926d817c0eSAdam Thomson #define DA7219_DTMF_REG_MAX 16 6936d817c0eSAdam Thomson #define DA7219_DTMF_EN_SHIFT 4 6946d817c0eSAdam Thomson #define DA7219_DTMF_EN_MASK (0x1 << 4) 6956d817c0eSAdam Thomson #define DA7219_START_STOPN_SHIFT 7 6966d817c0eSAdam Thomson #define DA7219_START_STOPN_MASK (0x1 << 7) 6976d817c0eSAdam Thomson 6986d817c0eSAdam Thomson /* DA7219_TONE_GEN_CFG2 = 0xB5 */ 6996d817c0eSAdam Thomson #define DA7219_SWG_SEL_SHIFT 0 7006d817c0eSAdam Thomson #define DA7219_SWG_SEL_MASK (0x3 << 0) 7016d817c0eSAdam Thomson #define DA7219_SWG_SEL_MAX 4 7026d817c0eSAdam Thomson #define DA7219_SWG_SEL_SRAMP (0x3 << 0) 7036d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_SHIFT 4 7046d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MASK (0xF << 4) 7056d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MAX 0xF 7066d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MINUS_9DB (0x3 << 4) 7076d817c0eSAdam Thomson #define DA7219_TONE_GEN_GAIN_MINUS_15DB (0x5 << 4) 7086d817c0eSAdam Thomson 7096d817c0eSAdam Thomson /* DA7219_TONE_GEN_CYCLES = 0xB6 */ 7106d817c0eSAdam Thomson #define DA7219_BEEP_CYCLES_SHIFT 0 7116d817c0eSAdam Thomson #define DA7219_BEEP_CYCLES_MASK (0x7 << 0) 7126d817c0eSAdam Thomson 7136d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ1_L = 0xB7 */ 7146d817c0eSAdam Thomson #define DA7219_FREQ1_L_SHIFT 0 7156d817c0eSAdam Thomson #define DA7219_FREQ1_L_MASK (0xFF << 0) 7166d817c0eSAdam Thomson #define DA7219_FREQ_MAX 0xFFFF 7176d817c0eSAdam Thomson 7186d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ1_U = 0xB8 */ 7196d817c0eSAdam Thomson #define DA7219_FREQ1_U_SHIFT 0 7206d817c0eSAdam Thomson #define DA7219_FREQ1_U_MASK (0xFF << 0) 7216d817c0eSAdam Thomson 7226d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ2_L = 0xB9 */ 7236d817c0eSAdam Thomson #define DA7219_FREQ2_L_SHIFT 0 7246d817c0eSAdam Thomson #define DA7219_FREQ2_L_MASK (0xFF << 0) 7256d817c0eSAdam Thomson 7266d817c0eSAdam Thomson /* DA7219_TONE_GEN_FREQ2_U = 0xBA */ 7276d817c0eSAdam Thomson #define DA7219_FREQ2_U_SHIFT 0 7286d817c0eSAdam Thomson #define DA7219_FREQ2_U_MASK (0xFF << 0) 7296d817c0eSAdam Thomson 7306d817c0eSAdam Thomson /* DA7219_TONE_GEN_ON_PER = 0xBB */ 7316d817c0eSAdam Thomson #define DA7219_BEEP_ON_PER_SHIFT 0 7326d817c0eSAdam Thomson #define DA7219_BEEP_ON_PER_MASK (0x3F << 0) 7336d817c0eSAdam Thomson #define DA7219_BEEP_ON_OFF_MAX 0x3F 7346d817c0eSAdam Thomson 7356d817c0eSAdam Thomson /* DA7219_TONE_GEN_OFF_PER = 0xBC */ 7366d817c0eSAdam Thomson #define DA7219_BEEP_OFF_PER_SHIFT 0 7376d817c0eSAdam Thomson #define DA7219_BEEP_OFF_PER_MASK (0x3F << 0) 7386d817c0eSAdam Thomson 7396d817c0eSAdam Thomson /* DA7219_SYSTEM_STATUS = 0xE0 */ 7406d817c0eSAdam Thomson #define DA7219_SC1_BUSY_SHIFT 0 7416d817c0eSAdam Thomson #define DA7219_SC1_BUSY_MASK (0x1 << 0) 7426d817c0eSAdam Thomson #define DA7219_SC2_BUSY_SHIFT 1 7436d817c0eSAdam Thomson #define DA7219_SC2_BUSY_MASK (0x1 << 1) 7446d817c0eSAdam Thomson 7456d817c0eSAdam Thomson /* DA7219_SYSTEM_ACTIVE = 0xFD */ 7466d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE_SHIFT 0 7476d817c0eSAdam Thomson #define DA7219_SYSTEM_ACTIVE_MASK (0x1 << 0) 7486d817c0eSAdam Thomson 7496d817c0eSAdam Thomson 7506d817c0eSAdam Thomson /* 7516d817c0eSAdam Thomson * General defines & data 7526d817c0eSAdam Thomson */ 7536d817c0eSAdam Thomson 7546d817c0eSAdam Thomson /* Register inversion */ 7556d817c0eSAdam Thomson #define DA7219_NO_INVERT 0 7566d817c0eSAdam Thomson #define DA7219_INVERT 1 7576d817c0eSAdam Thomson 7586d817c0eSAdam Thomson /* Byte related defines */ 7596d817c0eSAdam Thomson #define DA7219_BYTE_SHIFT 8 7606d817c0eSAdam Thomson #define DA7219_BYTE_MASK 0xFF 7616d817c0eSAdam Thomson 7626d817c0eSAdam Thomson /* PLL Output Frequencies */ 7636d817c0eSAdam Thomson #define DA7219_PLL_FREQ_OUT_90316 90316800 7646d817c0eSAdam Thomson #define DA7219_PLL_FREQ_OUT_98304 98304000 7656d817c0eSAdam Thomson 7666d817c0eSAdam Thomson /* PLL Frequency Dividers */ 76763a450aaSAdam Thomson #define DA7219_PLL_INDIV_2_TO_4_5_MHZ_VAL 1 76863a450aaSAdam Thomson #define DA7219_PLL_INDIV_4_5_TO_9_MHZ_VAL 2 76963a450aaSAdam Thomson #define DA7219_PLL_INDIV_9_TO_18_MHZ_VAL 4 77063a450aaSAdam Thomson #define DA7219_PLL_INDIV_18_TO_36_MHZ_VAL 8 77163a450aaSAdam Thomson #define DA7219_PLL_INDIV_36_TO_54_MHZ_VAL 16 7726d817c0eSAdam Thomson 7736d817c0eSAdam Thomson /* SRM */ 7746d817c0eSAdam Thomson #define DA7219_SRM_CHECK_RETRIES 8 7756d817c0eSAdam Thomson 776a7f16ea9SAdam Thomson /* System Controller */ 777a7f16ea9SAdam Thomson #define DA7219_SYS_STAT_CHECK_RETRIES 6 778a7f16ea9SAdam Thomson #define DA7219_SYS_STAT_CHECK_DELAY 50 779a7f16ea9SAdam Thomson 780*86834511SAdam Thomson /* Power up/down Delays */ 781*86834511SAdam Thomson #define DA7219_SETTLING_DELAY 40 782*86834511SAdam Thomson #define DA7219_MIN_GAIN_DELAY 30 783*86834511SAdam Thomson 7846d817c0eSAdam Thomson enum da7219_clk_src { 7856d817c0eSAdam Thomson DA7219_CLKSRC_MCLK = 0, 7866d817c0eSAdam Thomson DA7219_CLKSRC_MCLK_SQR, 7876d817c0eSAdam Thomson }; 7886d817c0eSAdam Thomson 7896d817c0eSAdam Thomson enum da7219_sys_clk { 7906d817c0eSAdam Thomson DA7219_SYSCLK_MCLK = 0, 7916d817c0eSAdam Thomson DA7219_SYSCLK_PLL, 7926d817c0eSAdam Thomson DA7219_SYSCLK_PLL_SRM, 7936d817c0eSAdam Thomson }; 7946d817c0eSAdam Thomson 7956d817c0eSAdam Thomson /* Regulators */ 7966d817c0eSAdam Thomson enum da7219_supplies { 7976d817c0eSAdam Thomson DA7219_SUPPLY_VDD = 0, 7986d817c0eSAdam Thomson DA7219_SUPPLY_VDDMIC, 7996d817c0eSAdam Thomson DA7219_SUPPLY_VDDIO, 8006d817c0eSAdam Thomson DA7219_NUM_SUPPLIES, 8016d817c0eSAdam Thomson }; 8026d817c0eSAdam Thomson 8036d817c0eSAdam Thomson struct da7219_aad_priv; 8046d817c0eSAdam Thomson 8056d817c0eSAdam Thomson /* Private data */ 8066d817c0eSAdam Thomson struct da7219_priv { 8076d817c0eSAdam Thomson struct da7219_aad_priv *aad; 8086d817c0eSAdam Thomson struct da7219_pdata *pdata; 8096d817c0eSAdam Thomson 810bb0c35fcSAdam Thomson bool wakeup_source; 8116d817c0eSAdam Thomson struct regulator_bulk_data supplies[DA7219_NUM_SUPPLIES]; 8126d817c0eSAdam Thomson struct regmap *regmap; 8136d817c0eSAdam Thomson struct mutex lock; 8146d817c0eSAdam Thomson 8156d817c0eSAdam Thomson struct clk *mclk; 8166d817c0eSAdam Thomson unsigned int mclk_rate; 8176d817c0eSAdam Thomson int clk_src; 8186d817c0eSAdam Thomson 8196d817c0eSAdam Thomson bool master; 8206d817c0eSAdam Thomson bool alc_en; 821*86834511SAdam Thomson u8 gain_ramp_ctrl; 8226d817c0eSAdam Thomson }; 8236d817c0eSAdam Thomson 8246d817c0eSAdam Thomson #endif /* __DA7219_H */ 825