diff options
Diffstat (limited to 'sound/soc/codecs/rt5670.h')
-rw-r--r-- | sound/soc/codecs/rt5670.h | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/sound/soc/codecs/rt5670.h b/sound/soc/codecs/rt5670.h index d11b9c207e26..21f8e18c13c4 100644 --- a/sound/soc/codecs/rt5670.h +++ b/sound/soc/codecs/rt5670.h | |||
@@ -1023,50 +1023,33 @@ | |||
1023 | #define RT5670_DMIC_2_M_NOR (0x0 << 8) | 1023 | #define RT5670_DMIC_2_M_NOR (0x0 << 8) |
1024 | #define RT5670_DMIC_2_M_ASYN (0x1 << 8) | 1024 | #define RT5670_DMIC_2_M_ASYN (0x1 << 8) |
1025 | 1025 | ||
1026 | /* ASRC clock source selection (0x84, 0x85) */ | ||
1027 | #define RT5670_CLK_SEL_SYS (0x0) | ||
1028 | #define RT5670_CLK_SEL_I2S1_ASRC (0x1) | ||
1029 | #define RT5670_CLK_SEL_I2S2_ASRC (0x2) | ||
1030 | #define RT5670_CLK_SEL_I2S3_ASRC (0x3) | ||
1031 | #define RT5670_CLK_SEL_SYS2 (0x5) | ||
1032 | #define RT5670_CLK_SEL_SYS3 (0x6) | ||
1033 | |||
1026 | /* ASRC Control 2 (0x84) */ | 1034 | /* ASRC Control 2 (0x84) */ |
1027 | #define RT5670_MDA_L_M_MASK (0x1 << 15) | 1035 | #define RT5670_DA_STO_CLK_SEL_MASK (0xf << 12) |
1028 | #define RT5670_MDA_L_M_SFT 15 | 1036 | #define RT5670_DA_STO_CLK_SEL_SFT 12 |
1029 | #define RT5670_MDA_L_M_NOR (0x0 << 15) | 1037 | #define RT5670_DA_MONOL_CLK_SEL_MASK (0xf << 8) |
1030 | #define RT5670_MDA_L_M_ASYN (0x1 << 15) | 1038 | #define RT5670_DA_MONOL_CLK_SEL_SFT 8 |
1031 | #define RT5670_MDA_R_M_MASK (0x1 << 14) | 1039 | #define RT5670_DA_MONOR_CLK_SEL_MASK (0xf << 4) |
1032 | #define RT5670_MDA_R_M_SFT 14 | 1040 | #define RT5670_DA_MONOR_CLK_SEL_SFT 4 |
1033 | #define RT5670_MDA_R_M_NOR (0x0 << 14) | 1041 | #define RT5670_AD_STO1_CLK_SEL_MASK (0xf << 0) |
1034 | #define RT5670_MDA_R_M_ASYN (0x1 << 14) | 1042 | #define RT5670_AD_STO1_CLK_SEL_SFT 0 |
1035 | #define RT5670_MAD_L_M_MASK (0x1 << 13) | ||
1036 | #define RT5670_MAD_L_M_SFT 13 | ||
1037 | #define RT5670_MAD_L_M_NOR (0x0 << 13) | ||
1038 | #define RT5670_MAD_L_M_ASYN (0x1 << 13) | ||
1039 | #define RT5670_MAD_R_M_MASK (0x1 << 12) | ||
1040 | #define RT5670_MAD_R_M_SFT 12 | ||
1041 | #define RT5670_MAD_R_M_NOR (0x0 << 12) | ||
1042 | #define RT5670_MAD_R_M_ASYN (0x1 << 12) | ||
1043 | #define RT5670_ADC_M_MASK (0x1 << 11) | ||
1044 | #define RT5670_ADC_M_SFT 11 | ||
1045 | #define RT5670_ADC_M_NOR (0x0 << 11) | ||
1046 | #define RT5670_ADC_M_ASYN (0x1 << 11) | ||
1047 | #define RT5670_STO_DAC_M_MASK (0x1 << 5) | ||
1048 | #define RT5670_STO_DAC_M_SFT 5 | ||
1049 | #define RT5670_STO_DAC_M_NOR (0x0 << 5) | ||
1050 | #define RT5670_STO_DAC_M_ASYN (0x1 << 5) | ||
1051 | #define RT5670_I2S1_R_D_MASK (0x1 << 4) | ||
1052 | #define RT5670_I2S1_R_D_SFT 4 | ||
1053 | #define RT5670_I2S1_R_D_DIS (0x0 << 4) | ||
1054 | #define RT5670_I2S1_R_D_EN (0x1 << 4) | ||
1055 | #define RT5670_I2S2_R_D_MASK (0x1 << 3) | ||
1056 | #define RT5670_I2S2_R_D_SFT 3 | ||
1057 | #define RT5670_I2S2_R_D_DIS (0x0 << 3) | ||
1058 | #define RT5670_I2S2_R_D_EN (0x1 << 3) | ||
1059 | #define RT5670_PRE_SCLK_MASK (0x3) | ||
1060 | #define RT5670_PRE_SCLK_SFT 0 | ||
1061 | #define RT5670_PRE_SCLK_512 (0x0) | ||
1062 | #define RT5670_PRE_SCLK_1024 (0x1) | ||
1063 | #define RT5670_PRE_SCLK_2048 (0x2) | ||
1064 | 1043 | ||
1065 | /* ASRC Control 3 (0x85) */ | 1044 | /* ASRC Control 3 (0x85) */ |
1066 | #define RT5670_I2S1_RATE_MASK (0xf << 12) | 1045 | #define RT5670_UP_CLK_SEL_MASK (0xf << 12) |
1067 | #define RT5670_I2S1_RATE_SFT 12 | 1046 | #define RT5670_UP_CLK_SEL_SFT 12 |
1068 | #define RT5670_I2S2_RATE_MASK (0xf << 8) | 1047 | #define RT5670_DOWN_CLK_SEL_MASK (0xf << 8) |
1069 | #define RT5670_I2S2_RATE_SFT 8 | 1048 | #define RT5670_DOWN_CLK_SEL_SFT 8 |
1049 | #define RT5670_AD_MONOL_CLK_SEL_MASK (0xf << 4) | ||
1050 | #define RT5670_AD_MONOL_CLK_SEL_SFT 4 | ||
1051 | #define RT5670_AD_MONOR_CLK_SEL_MASK (0xf << 0) | ||
1052 | #define RT5670_AD_MONOR_CLK_SEL_SFT 0 | ||
1070 | 1053 | ||
1071 | /* ASRC Control 4 (0x89) */ | 1054 | /* ASRC Control 4 (0x89) */ |
1072 | #define RT5670_I2S1_PD_MASK (0x7 << 12) | 1055 | #define RT5670_I2S1_PD_MASK (0x7 << 12) |
@@ -1983,6 +1966,21 @@ enum { | |||
1983 | RT5670_DMIC_DATA_GPIO5, | 1966 | RT5670_DMIC_DATA_GPIO5, |
1984 | }; | 1967 | }; |
1985 | 1968 | ||
1969 | /* filter mask */ | ||
1970 | enum { | ||
1971 | RT5670_DA_STEREO_FILTER = 0x1, | ||
1972 | RT5670_DA_MONO_L_FILTER = (0x1 << 1), | ||
1973 | RT5670_DA_MONO_R_FILTER = (0x1 << 2), | ||
1974 | RT5670_AD_STEREO_FILTER = (0x1 << 3), | ||
1975 | RT5670_AD_MONO_L_FILTER = (0x1 << 4), | ||
1976 | RT5670_AD_MONO_R_FILTER = (0x1 << 5), | ||
1977 | RT5670_UP_RATE_FILTER = (0x1 << 6), | ||
1978 | RT5670_DOWN_RATE_FILTER = (0x1 << 7), | ||
1979 | }; | ||
1980 | |||
1981 | int rt5670_sel_asrc_clk_src(struct snd_soc_codec *codec, | ||
1982 | unsigned int filter_mask, unsigned int clk_src); | ||
1983 | |||
1986 | struct rt5670_priv { | 1984 | struct rt5670_priv { |
1987 | struct snd_soc_codec *codec; | 1985 | struct snd_soc_codec *codec; |
1988 | struct rt5670_platform_data pdata; | 1986 | struct rt5670_platform_data pdata; |