Lines Matching refs:wm8960

186 	struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);  in wm8960_set_deemph()  local
192 if (wm8960->deemph) { in wm8960_set_deemph()
195 if (abs(deemph_settings[i] - wm8960->lrclk) < in wm8960_set_deemph()
196 abs(deemph_settings[best] - wm8960->lrclk)) in wm8960_set_deemph()
215 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_get_deemph() local
217 ucontrol->value.integer.value[0] = wm8960->deemph; in wm8960_get_deemph()
225 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_put_deemph() local
231 wm8960->deemph = deemph; in wm8960_put_deemph()
489 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_add_widgets() local
490 struct wm8960_data *pdata = &wm8960->pdata; in wm8960_add_widgets()
525 wm8960->lout1 = w; in wm8960_add_widgets()
527 wm8960->rout1 = w; in wm8960_add_widgets()
529 wm8960->out3 = w; in wm8960_add_widgets()
640 int wm8960_configure_sysclk(struct wm8960_priv *wm8960, int mclk, in wm8960_configure_sysclk() argument
650 bclk = wm8960->bclk; in wm8960_configure_sysclk()
651 lrclk = wm8960->lrclk; in wm8960_configure_sysclk()
705 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_configure_pll() local
710 bclk = wm8960->bclk; in wm8960_configure_pll()
711 lrclk = wm8960->lrclk; in wm8960_configure_pll()
756 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_configure_clocking() local
769 if (!(iface1 & (1 << 6)) && !wm8960->sysclk) { in wm8960_configure_clocking()
775 if (wm8960->clk_id != WM8960_SYSCLK_MCLK && !wm8960->freq_in) { in wm8960_configure_clocking()
780 freq_in = wm8960->freq_in; in wm8960_configure_clocking()
787 if (wm8960->clk_id == WM8960_SYSCLK_AUTO) { in wm8960_configure_clocking()
791 } else if (wm8960->sysclk) { in wm8960_configure_clocking()
792 freq_out = wm8960->sysclk; in wm8960_configure_clocking()
798 if (wm8960->clk_id != WM8960_SYSCLK_PLL) { in wm8960_configure_clocking()
799 ret = wm8960_configure_sysclk(wm8960, freq_out, &i, &j, &k); in wm8960_configure_clocking()
802 } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) { in wm8960_configure_clocking()
834 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_hw_params() local
839 wm8960->bclk = snd_soc_params_to_bclk(params); in wm8960_hw_params()
841 wm8960->bclk *= 2; in wm8960_hw_params()
866 wm8960->lrclk = params_rate(params); in wm8960_hw_params()
881 wm8960->is_stream_in_use[tx] = true; in wm8960_hw_params()
883 if (!wm8960->is_stream_in_use[!tx]) in wm8960_hw_params()
893 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_hw_free() local
896 wm8960->is_stream_in_use[tx] = false; in wm8960_hw_free()
915 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level_out3() local
927 if (!IS_ERR(wm8960->mclk)) { in wm8960_set_bias_level_out3()
928 ret = clk_prepare_enable(wm8960->mclk); in wm8960_set_bias_level_out3()
950 if (wm8960->clk_id == WM8960_SYSCLK_AUTO && (pm2 & 0x1)) in wm8960_set_bias_level_out3()
953 if (!IS_ERR(wm8960->mclk)) in wm8960_set_bias_level_out3()
954 clk_disable_unprepare(wm8960->mclk); in wm8960_set_bias_level_out3()
966 tout = WM8960_DSCH_TOUT - ktime_ms_delta(ktime_get(), wm8960->dsch_start); in wm8960_set_bias_level_out3()
970 regcache_sync(wm8960->regmap); in wm8960_set_bias_level_out3()
1001 wm8960->dsch_start = ktime_get(); in wm8960_set_bias_level_out3()
1011 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level_capless() local
1031 if (wm8960->lout1 && wm8960->lout1->power) in wm8960_set_bias_level_capless()
1033 if (wm8960->rout1 && wm8960->rout1->power) in wm8960_set_bias_level_capless()
1035 if (wm8960->out3 && wm8960->out3->power) in wm8960_set_bias_level_capless()
1055 if (!IS_ERR(wm8960->mclk)) { in wm8960_set_bias_level_capless()
1056 ret = clk_prepare_enable(wm8960->mclk); in wm8960_set_bias_level_capless()
1076 if (wm8960->clk_id == WM8960_SYSCLK_AUTO && (pm2 & 0x1)) in wm8960_set_bias_level_capless()
1079 if (!IS_ERR(wm8960->mclk)) in wm8960_set_bias_level_capless()
1080 clk_disable_unprepare(wm8960->mclk); in wm8960_set_bias_level_capless()
1095 regcache_sync(wm8960->regmap); in wm8960_set_bias_level_capless()
1256 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_dai_pll() local
1258 wm8960->freq_in = freq_in; in wm8960_set_dai_pll()
1303 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_bias_level() local
1305 return wm8960->set_bias_level(component, level); in wm8960_set_bias_level()
1312 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_set_dai_sysclk() local
1329 wm8960->sysclk = freq; in wm8960_set_dai_sysclk()
1330 wm8960->clk_id = clk_id; in wm8960_set_dai_sysclk()
1372 struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); in wm8960_probe() local
1373 struct wm8960_data *pdata = &wm8960->pdata; in wm8960_probe()
1376 wm8960->set_bias_level = wm8960_set_bias_level_capless; in wm8960_probe()
1378 wm8960->set_bias_level = wm8960_set_bias_level_out3; in wm8960_probe()
1429 struct wm8960_priv *wm8960; in wm8960_i2c_probe() local
1434 wm8960 = devm_kzalloc(&i2c->dev, sizeof(struct wm8960_priv), in wm8960_i2c_probe()
1436 if (wm8960 == NULL) in wm8960_i2c_probe()
1439 wm8960->mclk = devm_clk_get(&i2c->dev, "mclk"); in wm8960_i2c_probe()
1440 if (IS_ERR(wm8960->mclk)) { in wm8960_i2c_probe()
1441 if (PTR_ERR(wm8960->mclk) == -EPROBE_DEFER) in wm8960_i2c_probe()
1444 ret = clk_get_rate(wm8960->mclk); in wm8960_i2c_probe()
1446 wm8960->freq_in = ret; in wm8960_i2c_probe()
1453 for (i = 0; i < ARRAY_SIZE(wm8960->supplies); i++) in wm8960_i2c_probe()
1454 wm8960->supplies[i].supply = wm8960_supply_names[i]; in wm8960_i2c_probe()
1456 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8960->supplies), in wm8960_i2c_probe()
1457 wm8960->supplies); in wm8960_i2c_probe()
1463 ret = regulator_bulk_enable(ARRAY_SIZE(wm8960->supplies), in wm8960_i2c_probe()
1464 wm8960->supplies); in wm8960_i2c_probe()
1470 wm8960->regmap = devm_regmap_init_i2c(i2c, &wm8960_regmap); in wm8960_i2c_probe()
1471 if (IS_ERR(wm8960->regmap)) { in wm8960_i2c_probe()
1472 ret = PTR_ERR(wm8960->regmap); in wm8960_i2c_probe()
1477 memcpy(&wm8960->pdata, pdata, sizeof(struct wm8960_data)); in wm8960_i2c_probe()
1479 wm8960_set_pdata_from_of(i2c, &wm8960->pdata); in wm8960_i2c_probe()
1488 ret = wm8960_reset(wm8960->regmap); in wm8960_i2c_probe()
1494 if (wm8960->pdata.shared_lrclk) { in wm8960_i2c_probe()
1495 ret = regmap_update_bits(wm8960->regmap, WM8960_ADDCTL2, in wm8960_i2c_probe()
1505 regmap_update_bits(wm8960->regmap, WM8960_LINVOL, 0x100, 0x100); in wm8960_i2c_probe()
1506 regmap_update_bits(wm8960->regmap, WM8960_RINVOL, 0x100, 0x100); in wm8960_i2c_probe()
1507 regmap_update_bits(wm8960->regmap, WM8960_LADC, 0x100, 0x100); in wm8960_i2c_probe()
1508 regmap_update_bits(wm8960->regmap, WM8960_RADC, 0x100, 0x100); in wm8960_i2c_probe()
1509 regmap_update_bits(wm8960->regmap, WM8960_LDAC, 0x100, 0x100); in wm8960_i2c_probe()
1510 regmap_update_bits(wm8960->regmap, WM8960_RDAC, 0x100, 0x100); in wm8960_i2c_probe()
1511 regmap_update_bits(wm8960->regmap, WM8960_LOUT1, 0x100, 0x100); in wm8960_i2c_probe()
1512 regmap_update_bits(wm8960->regmap, WM8960_ROUT1, 0x100, 0x100); in wm8960_i2c_probe()
1513 regmap_update_bits(wm8960->regmap, WM8960_LOUT2, 0x100, 0x100); in wm8960_i2c_probe()
1514 regmap_update_bits(wm8960->regmap, WM8960_ROUT2, 0x100, 0x100); in wm8960_i2c_probe()
1517 regmap_update_bits(wm8960->regmap, WM8960_IFACE2, 1 << 6, in wm8960_i2c_probe()
1518 wm8960->pdata.gpio_cfg[0] << 6); in wm8960_i2c_probe()
1519 regmap_update_bits(wm8960->regmap, WM8960_ADDCTL4, 0xF << 4, in wm8960_i2c_probe()
1520 wm8960->pdata.gpio_cfg[1] << 4); in wm8960_i2c_probe()
1523 regmap_update_bits(wm8960->regmap, WM8960_ADDCTL4, 3 << 2, in wm8960_i2c_probe()
1524 wm8960->pdata.hp_cfg[0] << 2); in wm8960_i2c_probe()
1525 regmap_update_bits(wm8960->regmap, WM8960_ADDCTL2, 3 << 5, in wm8960_i2c_probe()
1526 wm8960->pdata.hp_cfg[1] << 5); in wm8960_i2c_probe()
1527 regmap_update_bits(wm8960->regmap, WM8960_ADDCTL1, 3, in wm8960_i2c_probe()
1528 wm8960->pdata.hp_cfg[2]); in wm8960_i2c_probe()
1530 i2c_set_clientdata(i2c, wm8960); in wm8960_i2c_probe()
1540 regulator_bulk_disable(ARRAY_SIZE(wm8960->supplies), wm8960->supplies); in wm8960_i2c_probe()
1546 struct wm8960_priv *wm8960 = i2c_get_clientdata(client); in wm8960_i2c_remove() local
1548 regulator_bulk_disable(ARRAY_SIZE(wm8960->supplies), wm8960->supplies); in wm8960_i2c_remove()