Lines Matching refs:rt5660
353 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_set_dmic_clk() local
356 rate = rt5660->sysclk / rl6231_get_pre_div(rt5660->regmap, in rt5660_set_dmic_clk()
837 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_hw_params() local
841 rt5660->lrck[dai->id] = params_rate(params); in rt5660_hw_params()
842 pre_div = rl6231_get_clk_info(rt5660->sysclk, rt5660->lrck[dai->id]); in rt5660_hw_params()
845 rt5660->lrck[dai->id], dai->id); in rt5660_hw_params()
860 rt5660->bclk[dai->id] = rt5660->lrck[dai->id] * (32 << bclk_ms); in rt5660_hw_params()
863 rt5660->bclk[dai->id], rt5660->lrck[dai->id]); in rt5660_hw_params()
904 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_set_dai_fmt() local
909 rt5660->master[dai->id] = 1; in rt5660_set_dai_fmt()
914 rt5660->master[dai->id] = 0; in rt5660_set_dai_fmt()
972 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_set_dai_sysclk() local
975 if (freq == rt5660->sysclk && clk_id == rt5660->sysclk_src) in rt5660_set_dai_sysclk()
999 rt5660->sysclk = freq; in rt5660_set_dai_sysclk()
1000 rt5660->sysclk_src = clk_id; in rt5660_set_dai_sysclk()
1011 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_set_dai_pll() local
1015 if (source == rt5660->pll_src && freq_in == rt5660->pll_in && in rt5660_set_dai_pll()
1016 freq_out == rt5660->pll_out) in rt5660_set_dai_pll()
1022 rt5660->pll_in = 0; in rt5660_set_dai_pll()
1023 rt5660->pll_out = 0; in rt5660_set_dai_pll()
1061 rt5660->pll_in = freq_in; in rt5660_set_dai_pll()
1062 rt5660->pll_out = freq_out; in rt5660_set_dai_pll()
1063 rt5660->pll_src = source; in rt5660_set_dai_pll()
1071 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_set_bias_level() local
1083 clk_disable_unprepare(rt5660->mclk); in rt5660_set_bias_level()
1085 ret = clk_prepare_enable(rt5660->mclk); in rt5660_set_bias_level()
1119 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_probe() local
1121 rt5660->component = component; in rt5660_probe()
1134 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_suspend() local
1136 regcache_cache_only(rt5660->regmap, true); in rt5660_suspend()
1137 regcache_mark_dirty(rt5660->regmap); in rt5660_suspend()
1144 struct rt5660_priv *rt5660 = snd_soc_component_get_drvdata(component); in rt5660_resume() local
1146 if (rt5660->pdata.poweroff_codec_in_suspend) in rt5660_resume()
1149 regcache_cache_only(rt5660->regmap, false); in rt5660_resume()
1150 regcache_sync(rt5660->regmap); in rt5660_resume()
1249 static int rt5660_parse_dt(struct rt5660_priv *rt5660, struct device *dev) in rt5660_parse_dt() argument
1251 rt5660->pdata.in1_diff = device_property_read_bool(dev, in rt5660_parse_dt()
1253 rt5660->pdata.in3_diff = device_property_read_bool(dev, in rt5660_parse_dt()
1255 rt5660->pdata.poweroff_codec_in_suspend = device_property_read_bool(dev, in rt5660_parse_dt()
1258 &rt5660->pdata.dmic1_data_pin); in rt5660_parse_dt()
1266 struct rt5660_priv *rt5660; in rt5660_i2c_probe() local
1270 rt5660 = devm_kzalloc(&i2c->dev, sizeof(struct rt5660_priv), in rt5660_i2c_probe()
1273 if (rt5660 == NULL) in rt5660_i2c_probe()
1277 rt5660->mclk = devm_clk_get_optional(&i2c->dev, "mclk"); in rt5660_i2c_probe()
1278 if (IS_ERR(rt5660->mclk)) in rt5660_i2c_probe()
1279 return PTR_ERR(rt5660->mclk); in rt5660_i2c_probe()
1281 i2c_set_clientdata(i2c, rt5660); in rt5660_i2c_probe()
1284 rt5660->pdata = *pdata; in rt5660_i2c_probe()
1286 rt5660_parse_dt(rt5660, &i2c->dev); in rt5660_i2c_probe()
1288 rt5660->regmap = devm_regmap_init_i2c(i2c, &rt5660_regmap); in rt5660_i2c_probe()
1289 if (IS_ERR(rt5660->regmap)) { in rt5660_i2c_probe()
1290 ret = PTR_ERR(rt5660->regmap); in rt5660_i2c_probe()
1296 regmap_read(rt5660->regmap, RT5660_VENDOR_ID2, &val); in rt5660_i2c_probe()
1303 regmap_write(rt5660->regmap, RT5660_RESET, 0); in rt5660_i2c_probe()
1305 ret = regmap_register_patch(rt5660->regmap, rt5660_patch, in rt5660_i2c_probe()
1310 regmap_update_bits(rt5660->regmap, RT5660_GEN_CTRL1, in rt5660_i2c_probe()
1314 if (rt5660->pdata.dmic1_data_pin) { in rt5660_i2c_probe()
1315 regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1, in rt5660_i2c_probe()
1318 if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_GPIO2) in rt5660_i2c_probe()
1319 regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1, in rt5660_i2c_probe()
1322 else if (rt5660->pdata.dmic1_data_pin == RT5660_DMIC1_DATA_IN1P) in rt5660_i2c_probe()
1323 regmap_update_bits(rt5660->regmap, RT5660_DMIC_CTRL1, in rt5660_i2c_probe()