• Home
  • Raw
  • Download

Lines Matching refs:rt286

195 	struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec);  in rt286_index_sync()  local
199 snd_soc_write(codec, rt286->index_cache[i].reg, in rt286_index_sync()
200 rt286->index_cache[i].def); in rt286_index_sync()
218 static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) in rt286_jack_detect() argument
226 if (!rt286->codec) in rt286_jack_detect()
229 dapm = snd_soc_codec_get_dapm(rt286->codec); in rt286_jack_detect()
231 if (rt286->pdata.cbj_en) { in rt286_jack_detect()
232 regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf); in rt286_jack_detect()
236 regmap_update_bits(rt286->regmap, in rt286_jack_detect()
245 regmap_write(rt286->regmap, RT286_SET_MIC1, 0x24); in rt286_jack_detect()
248 regmap_update_bits(rt286->regmap, in rt286_jack_detect()
251 regmap_read(rt286->regmap, RT286_CBJ_CTRL2, &val); in rt286_jack_detect()
256 regmap_update_bits(rt286->regmap, in rt286_jack_detect()
259 regmap_read(rt286->regmap, in rt286_jack_detect()
266 regmap_update_bits(rt286->regmap, in rt286_jack_detect()
271 regmap_write(rt286->regmap, RT286_SET_MIC1, 0x20); in rt286_jack_detect()
274 regmap_read(rt286->regmap, RT286_GET_HP_SENSE, &buf); in rt286_jack_detect()
276 regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf); in rt286_jack_detect()
291 struct rt286_priv *rt286 = in rt286_jack_detect_work() local
297 rt286_jack_detect(rt286, &hp, &mic); in rt286_jack_detect_work()
305 snd_soc_jack_report(rt286->jack, status, in rt286_jack_detect_work()
312 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_mic_detect() local
314 rt286->jack = jack; in rt286_mic_detect()
318 if (rt286->jack->status & SND_JACK_HEADPHONE) in rt286_mic_detect()
320 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x2); in rt286_mic_detect()
322 snd_soc_jack_report(rt286->jack, rt286->jack->status, in rt286_mic_detect()
326 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x2, 0x0); in rt286_mic_detect()
339 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in is_mclk_mode() local
341 if (rt286->clk_id == RT286_SCLK_S_MCLK) in is_mclk_mode()
697 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_hw_params() local
713 switch (rt286->sys_clk) { in rt286_hw_params()
718 params_rate(params), rt286->sys_clk); in rt286_hw_params()
726 params_rate(params), rt286->sys_clk); in rt286_hw_params()
825 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_set_dai_sysclk() local
879 rt286->sys_clk = freq; in rt286_set_dai_sysclk()
880 rt286->clk_id = clk_id; in rt286_set_dai_sysclk()
939 struct rt286_priv *rt286 = data; in rt286_irq() local
944 rt286_jack_detect(rt286, &hp, &mic); in rt286_irq()
947 regmap_update_bits(rt286->regmap, RT286_IRQ_CTRL, 0x1, 0x1); in rt286_irq()
955 snd_soc_jack_report(rt286->jack, status, in rt286_irq()
958 pm_wakeup_event(&rt286->i2c->dev, 300); in rt286_irq()
965 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_probe() local
967 rt286->codec = codec; in rt286_probe()
969 if (rt286->i2c->irq) { in rt286_probe()
970 regmap_update_bits(rt286->regmap, in rt286_probe()
973 INIT_DELAYED_WORK(&rt286->jack_detect_work, in rt286_probe()
975 schedule_delayed_work(&rt286->jack_detect_work, in rt286_probe()
984 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_remove() local
986 cancel_delayed_work_sync(&rt286->jack_detect_work); in rt286_remove()
994 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_suspend() local
996 regcache_cache_only(rt286->regmap, true); in rt286_suspend()
997 regcache_mark_dirty(rt286->regmap); in rt286_suspend()
1004 struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); in rt286_resume() local
1006 regcache_cache_only(rt286->regmap, false); in rt286_resume()
1008 regcache_sync(rt286->regmap); in rt286_resume()
1137 struct rt286_priv *rt286; in rt286_i2c_probe() local
1140 rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), in rt286_i2c_probe()
1142 if (NULL == rt286) in rt286_i2c_probe()
1145 rt286->regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &rt286_regmap); in rt286_i2c_probe()
1146 if (IS_ERR(rt286->regmap)) { in rt286_i2c_probe()
1147 ret = PTR_ERR(rt286->regmap); in rt286_i2c_probe()
1153 ret = regmap_read(rt286->regmap, in rt286_i2c_probe()
1166 rt286->index_cache = devm_kmemdup(&i2c->dev, rt286_index_def, in rt286_i2c_probe()
1168 if (!rt286->index_cache) in rt286_i2c_probe()
1171 rt286->index_cache_size = INDEX_CACHE_SIZE; in rt286_i2c_probe()
1172 rt286->i2c = i2c; in rt286_i2c_probe()
1173 i2c_set_clientdata(i2c, rt286); in rt286_i2c_probe()
1177 regmap_write(rt286->regmap, rt286->index_cache[i].reg, in rt286_i2c_probe()
1178 rt286->index_cache[i].def); in rt286_i2c_probe()
1180 regmap_write(rt286->regmap, rt286_reg[i].reg, in rt286_i2c_probe()
1184 rt286->pdata = *pdata; in rt286_i2c_probe()
1188 rt286->pdata.cbj_en = true; in rt286_i2c_probe()
1190 regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); in rt286_i2c_probe()
1193 regmap_write(rt286->regmap, in rt286_i2c_probe()
1197 if (!rt286->pdata.cbj_en) { in rt286_i2c_probe()
1198 regmap_write(rt286->regmap, RT286_CBJ_CTRL2, 0x0000); in rt286_i2c_probe()
1199 regmap_write(rt286->regmap, RT286_MIC1_DET_CTRL, 0x0816); in rt286_i2c_probe()
1200 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1203 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1209 if (!rt286->pdata.gpio2_en) in rt286_i2c_probe()
1210 regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0x4000); in rt286_i2c_probe()
1212 regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0); in rt286_i2c_probe()
1216 regmap_write(rt286->regmap, RT286_MISC_CTRL1, 0x0000); in rt286_i2c_probe()
1218 regmap_update_bits(rt286->regmap, RT286_POWER_CTRL2, 0xc, 0x0); in rt286_i2c_probe()
1219 regmap_update_bits(rt286->regmap, RT286_POWER_CTRL1, 0x1001, 0x1001); in rt286_i2c_probe()
1222 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL2, 0x403a, 0x401a); in rt286_i2c_probe()
1223 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); in rt286_i2c_probe()
1224 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); in rt286_i2c_probe()
1227 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1229 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1231 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1233 regmap_update_bits(rt286->regmap, in rt286_i2c_probe()
1237 if (rt286->i2c->irq) { in rt286_i2c_probe()
1238 ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq, in rt286_i2c_probe()
1239 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286); in rt286_i2c_probe()
1255 struct rt286_priv *rt286 = i2c_get_clientdata(i2c); in rt286_i2c_remove() local
1258 free_irq(i2c->irq, rt286); in rt286_i2c_remove()