Lines Matching refs:rt274
340 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_index_sync() local
344 snd_soc_component_write(component, rt274->index_cache[i].reg, in rt274_index_sync()
345 rt274->index_cache[i].def); in rt274_index_sync()
350 static int rt274_jack_detect(struct rt274_priv *rt274, bool *hp, bool *mic) in rt274_jack_detect() argument
358 if (!rt274->component) in rt274_jack_detect()
361 ret = regmap_read(rt274->regmap, RT274_GET_HP_SENSE, &buf); in rt274_jack_detect()
366 ret = regmap_read(rt274->regmap, RT274_GET_MIC_SENSE, &buf); in rt274_jack_detect()
379 struct rt274_priv *rt274 = in rt274_jack_detect_work() local
385 if (rt274_jack_detect(rt274, &hp, &mic) < 0) in rt274_jack_detect_work()
394 snd_soc_jack_report(rt274->jack, status, in rt274_jack_detect_work()
403 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_mic_detect() local
405 rt274->jack = jack; in rt274_mic_detect()
409 regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, in rt274_mic_detect()
415 regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, in rt274_mic_detect()
419 rt274_irq(0, rt274); in rt274_mic_detect()
618 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_hw_params() local
632 switch (rt274->sys_clk) { in rt274_hw_params()
637 params_rate(params), rt274->sys_clk); in rt274_hw_params()
645 params_rate(params), rt274->sys_clk); in rt274_hw_params()
690 if (rt274->master) in rt274_hw_params()
706 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_set_dai_fmt() local
712 rt274->master = true; in rt274_set_dai_fmt()
717 rt274->master = false; in rt274_set_dai_fmt()
754 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_set_dai_pll() local
773 switch (rt274->fs) { in rt274_set_dai_pll()
807 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_set_dai_sysclk() local
868 rt274->sys_clk = freq; in rt274_set_dai_sysclk()
869 rt274->clk_id = clk_id; in rt274_set_dai_sysclk()
877 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_set_bclk_ratio() local
880 rt274->fs = ratio; in rt274_set_bclk_ratio()
951 struct rt274_priv *rt274 = data; in rt274_irq() local
957 regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, in rt274_irq()
960 ret = rt274_jack_detect(rt274, &hp, &mic); in rt274_irq()
969 snd_soc_jack_report(rt274->jack, status, in rt274_irq()
972 pm_wakeup_event(&rt274->i2c->dev, 300); in rt274_irq()
980 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_probe() local
982 rt274->component = component; in rt274_probe()
983 INIT_DELAYED_WORK(&rt274->jack_detect_work, rt274_jack_detect_work); in rt274_probe()
985 if (rt274->i2c->irq) in rt274_probe()
986 schedule_delayed_work(&rt274->jack_detect_work, in rt274_probe()
993 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_remove() local
995 cancel_delayed_work_sync(&rt274->jack_detect_work); in rt274_remove()
996 rt274->component = NULL; in rt274_remove()
1002 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_suspend() local
1004 regcache_cache_only(rt274->regmap, true); in rt274_suspend()
1005 regcache_mark_dirty(rt274->regmap); in rt274_suspend()
1012 struct rt274_priv *rt274 = snd_soc_component_get_drvdata(component); in rt274_resume() local
1014 regcache_cache_only(rt274->regmap, false); in rt274_resume()
1016 regcache_sync(rt274->regmap); in rt274_resume()
1116 struct rt274_priv *rt274; in rt274_i2c_probe() local
1121 rt274 = devm_kzalloc(&i2c->dev, sizeof(*rt274), in rt274_i2c_probe()
1123 if (rt274 == NULL) in rt274_i2c_probe()
1126 rt274->regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &rt274_regmap); in rt274_i2c_probe()
1127 if (IS_ERR(rt274->regmap)) { in rt274_i2c_probe()
1128 ret = PTR_ERR(rt274->regmap); in rt274_i2c_probe()
1134 ret = regmap_read(rt274->regmap, in rt274_i2c_probe()
1145 rt274->index_cache = devm_kmemdup(&i2c->dev, rt274_index_def, in rt274_i2c_probe()
1147 if (!rt274->index_cache) in rt274_i2c_probe()
1150 rt274->index_cache_size = INDEX_CACHE_SIZE; in rt274_i2c_probe()
1151 rt274->i2c = i2c; in rt274_i2c_probe()
1152 i2c_set_clientdata(i2c, rt274); in rt274_i2c_probe()
1155 regmap_write(rt274->regmap, RT274_RESET, 0); in rt274_i2c_probe()
1156 regmap_update_bits(rt274->regmap, 0x1a, 0x4000, 0x4000); in rt274_i2c_probe()
1159 regmap_update_bits(rt274->regmap, RT274_PAD_CTRL12, 0x3, 0x0); in rt274_i2c_probe()
1160 regmap_write(rt274->regmap, RT274_COEF5b_INDEX, 0x01); in rt274_i2c_probe()
1161 regmap_write(rt274->regmap, RT274_COEF5b_COEF, 0x8540); in rt274_i2c_probe()
1162 regmap_update_bits(rt274->regmap, 0x6f, 0x0100, 0x0100); in rt274_i2c_probe()
1164 regmap_write(rt274->regmap, 0x4a, 0x201b); in rt274_i2c_probe()
1166 regmap_update_bits(rt274->regmap, 0x6f, 0x3000, 0x2000); in rt274_i2c_probe()
1168 regmap_update_bits(rt274->regmap, 0x6f, 0xf, 0x0); in rt274_i2c_probe()
1170 regmap_write(rt274->regmap, RT274_COEF58_INDEX, 0x00); in rt274_i2c_probe()
1171 regmap_write(rt274->regmap, RT274_COEF58_COEF, 0xb888); in rt274_i2c_probe()
1173 regmap_update_bits(rt274->regmap, 0x6f, 0xf, 0xb); in rt274_i2c_probe()
1174 regmap_write(rt274->regmap, RT274_COEF58_INDEX, 0x00); in rt274_i2c_probe()
1175 regmap_write(rt274->regmap, RT274_COEF58_COEF, 0x3888); in rt274_i2c_probe()
1177 regmap_write(rt274->regmap, RT274_SET_PIN_HPO, 0x40); in rt274_i2c_probe()
1178 regmap_write(rt274->regmap, RT274_SET_PIN_LOUT3, 0x40); in rt274_i2c_probe()
1179 regmap_write(rt274->regmap, RT274_SET_MIC, 0x20); in rt274_i2c_probe()
1180 regmap_write(rt274->regmap, RT274_SET_PIN_DMIC1, 0x20); in rt274_i2c_probe()
1182 regmap_update_bits(rt274->regmap, RT274_I2S_CTRL2, 0xc004, 0x4004); in rt274_i2c_probe()
1183 regmap_update_bits(rt274->regmap, RT274_EAPD_GPIO_IRQ_CTRL, in rt274_i2c_probe()
1187 regmap_write(rt274->regmap, RT274_UNSOLICITED_HP_OUT, 0x81); in rt274_i2c_probe()
1188 regmap_write(rt274->regmap, RT274_UNSOLICITED_MIC, 0x82); in rt274_i2c_probe()
1190 if (rt274->i2c->irq) { in rt274_i2c_probe()
1191 ret = request_threaded_irq(rt274->i2c->irq, NULL, rt274_irq, in rt274_i2c_probe()
1192 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt274", rt274); in rt274_i2c_probe()
1209 struct rt274_priv *rt274 = i2c_get_clientdata(i2c); in rt274_i2c_remove() local
1212 free_irq(i2c->irq, rt274); in rt274_i2c_remove()