Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'topic/rt5640' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel

+33 -19
+30 -19
sound/soc/codecs/rt5640.c
··· 1906 1906 return 0; 1907 1907 } 1908 1908 1909 + int rt5640_dmic_enable(struct snd_soc_codec *codec, 1910 + bool dmic1_data_pin, bool dmic2_data_pin) 1911 + { 1912 + struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); 1913 + 1914 + regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 1915 + RT5640_GP2_PIN_MASK, RT5640_GP2_PIN_DMIC1_SCL); 1916 + 1917 + if (dmic1_data_pin) { 1918 + regmap_update_bits(rt5640->regmap, RT5640_DMIC, 1919 + RT5640_DMIC_1_DP_MASK, RT5640_DMIC_1_DP_GPIO3); 1920 + regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 1921 + RT5640_GP3_PIN_MASK, RT5640_GP3_PIN_DMIC1_SDA); 1922 + } 1923 + 1924 + if (dmic2_data_pin) { 1925 + regmap_update_bits(rt5640->regmap, RT5640_DMIC, 1926 + RT5640_DMIC_2_DP_MASK, RT5640_DMIC_2_DP_GPIO4); 1927 + regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 1928 + RT5640_GP4_PIN_MASK, RT5640_GP4_PIN_DMIC2_SDA); 1929 + } 1930 + 1931 + return 0; 1932 + } 1933 + EXPORT_SYMBOL_GPL(rt5640_dmic_enable); 1934 + 1909 1935 static int rt5640_probe(struct snd_soc_codec *codec) 1910 1936 { 1911 1937 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); ··· 1970 1944 "The driver is for RT5639 RT5640 or RT5642 only\n"); 1971 1945 return -ENODEV; 1972 1946 } 1947 + 1948 + if (rt5640->pdata.dmic_en) 1949 + rt5640_dmic_enable(codec, rt5640->pdata.dmic1_data_pin, 1950 + rt5640->pdata.dmic2_data_pin); 1973 1951 1974 1952 return 0; 1975 1953 } ··· 2223 2193 if (rt5640->pdata.in2_diff) 2224 2194 regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4, 2225 2195 RT5640_IN_DF2, RT5640_IN_DF2); 2226 - 2227 - if (rt5640->pdata.dmic_en) { 2228 - regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 2229 - RT5640_GP2_PIN_MASK, RT5640_GP2_PIN_DMIC1_SCL); 2230 - 2231 - if (rt5640->pdata.dmic1_data_pin) { 2232 - regmap_update_bits(rt5640->regmap, RT5640_DMIC, 2233 - RT5640_DMIC_1_DP_MASK, RT5640_DMIC_1_DP_GPIO3); 2234 - regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 2235 - RT5640_GP3_PIN_MASK, RT5640_GP3_PIN_DMIC1_SDA); 2236 - } 2237 - 2238 - if (rt5640->pdata.dmic2_data_pin) { 2239 - regmap_update_bits(rt5640->regmap, RT5640_DMIC, 2240 - RT5640_DMIC_2_DP_MASK, RT5640_DMIC_2_DP_GPIO4); 2241 - regmap_update_bits(rt5640->regmap, RT5640_GPIO_CTRL1, 2242 - RT5640_GP4_PIN_MASK, RT5640_GP4_PIN_DMIC2_SDA); 2243 - } 2244 - } 2245 2196 2246 2197 rt5640->hp_mute = 1; 2247 2198
+3
sound/soc/codecs/rt5640.h
··· 2097 2097 bool hp_mute; 2098 2098 }; 2099 2099 2100 + int rt5640_dmic_enable(struct snd_soc_codec *codec, 2101 + bool dmic1_data_pin, bool dmic2_data_pin); 2102 + 2100 2103 #endif