wm8993 469 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 477 sound/soc/codecs/wm8993.c if (Fref == wm8993->fll_fref && Fout == wm8993->fll_fout) wm8993 483 sound/soc/codecs/wm8993.c wm8993->fll_fref = 0; wm8993 484 sound/soc/codecs/wm8993.c wm8993->fll_fout = 0; wm8993 552 sound/soc/codecs/wm8993.c try_wait_for_completion(&wm8993->fll_lock); wm8993 557 sound/soc/codecs/wm8993.c timeout = wait_for_completion_timeout(&wm8993->fll_lock, timeout); wm8993 563 sound/soc/codecs/wm8993.c wm8993->fll_fref = Fref; wm8993 564 sound/soc/codecs/wm8993.c wm8993->fll_fout = Fout; wm8993 565 sound/soc/codecs/wm8993.c wm8993->fll_src = source; wm8993 578 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 582 sound/soc/codecs/wm8993.c switch (wm8993->sysclk_source) { wm8993 584 sound/soc/codecs/wm8993.c dev_dbg(component->dev, "Using %dHz MCLK\n", wm8993->mclk_rate); wm8993 588 sound/soc/codecs/wm8993.c if (wm8993->mclk_rate > 13500000) { wm8993 590 sound/soc/codecs/wm8993.c wm8993->sysclk_rate = wm8993->mclk_rate / 2; wm8993 593 sound/soc/codecs/wm8993.c wm8993->sysclk_rate = wm8993->mclk_rate; wm8993 600 sound/soc/codecs/wm8993.c wm8993->fll_fout); wm8993 604 sound/soc/codecs/wm8993.c if (wm8993->fll_fout > 13500000) { wm8993 606 sound/soc/codecs/wm8993.c wm8993->sysclk_rate = wm8993->fll_fout / 2; wm8993 609 sound/soc/codecs/wm8993.c wm8993->sysclk_rate = wm8993->fll_fout; wm8993 619 sound/soc/codecs/wm8993.c dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8993->sysclk_rate); wm8993 975 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 992 sound/soc/codecs/wm8993.c ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), wm8993 993 sound/soc/codecs/wm8993.c wm8993->supplies); wm8993 997 sound/soc/codecs/wm8993.c regcache_cache_only(wm8993->regmap, false); wm8993 998 sound/soc/codecs/wm8993.c regcache_sync(wm8993->regmap); wm8993 1015 sound/soc/codecs/wm8993.c if (!wm8993->pdata.lineout1_diff || wm8993 1016 sound/soc/codecs/wm8993.c !wm8993->pdata.lineout2_diff) wm8993 1056 sound/soc/codecs/wm8993.c regcache_cache_only(wm8993->regmap, true); wm8993 1057 sound/soc/codecs/wm8993.c regcache_mark_dirty(wm8993->regmap); wm8993 1059 sound/soc/codecs/wm8993.c regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993 1060 sound/soc/codecs/wm8993.c wm8993->supplies); wm8993 1071 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1075 sound/soc/codecs/wm8993.c wm8993->mclk_rate = freq; wm8993 1078 sound/soc/codecs/wm8993.c wm8993->sysclk_source = clk_id; wm8993 1092 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1102 sound/soc/codecs/wm8993.c wm8993->master = 0; wm8993 1106 sound/soc/codecs/wm8993.c wm8993->master = 1; wm8993 1110 sound/soc/codecs/wm8993.c wm8993->master = 1; wm8993 1115 sound/soc/codecs/wm8993.c wm8993->master = 1; wm8993 1189 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1206 sound/soc/codecs/wm8993.c wm8993->fs = params_rate(params); wm8993 1207 sound/soc/codecs/wm8993.c wm8993->bclk = 2 * wm8993->fs; wm8993 1208 sound/soc/codecs/wm8993.c if (wm8993->tdm_slots) { wm8993 1210 sound/soc/codecs/wm8993.c wm8993->tdm_slots, wm8993->tdm_width); wm8993 1211 sound/soc/codecs/wm8993.c wm8993->bclk *= wm8993->tdm_width * wm8993->tdm_slots; wm8993 1215 sound/soc/codecs/wm8993.c wm8993->bclk *= 16; wm8993 1218 sound/soc/codecs/wm8993.c wm8993->bclk *= 20; wm8993 1222 sound/soc/codecs/wm8993.c wm8993->bclk *= 24; wm8993 1226 sound/soc/codecs/wm8993.c wm8993->bclk *= 32; wm8993 1234 sound/soc/codecs/wm8993.c dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8993->bclk); wm8993 1242 sound/soc/codecs/wm8993.c best_val = abs((wm8993->sysclk_rate / clk_sys_rates[0].ratio) wm8993 1243 sound/soc/codecs/wm8993.c - wm8993->fs); wm8993 1245 sound/soc/codecs/wm8993.c cur_val = abs((wm8993->sysclk_rate / wm8993 1246 sound/soc/codecs/wm8993.c clk_sys_rates[i].ratio) - wm8993->fs); wm8993 1259 sound/soc/codecs/wm8993.c best_val = abs(wm8993->fs - sample_rates[0].rate); wm8993 1262 sound/soc/codecs/wm8993.c cur_val = abs(wm8993->fs - sample_rates[i].rate); wm8993 1277 sound/soc/codecs/wm8993.c cur_val = ((wm8993->sysclk_rate * 10) / bclk_divs[i].div) wm8993 1278 sound/soc/codecs/wm8993.c - wm8993->bclk; wm8993 1286 sound/soc/codecs/wm8993.c wm8993->bclk = (wm8993->sysclk_rate * 10) / bclk_divs[best].div; wm8993 1288 sound/soc/codecs/wm8993.c bclk_divs[best].div, wm8993->bclk); wm8993 1292 sound/soc/codecs/wm8993.c dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8993->bclk / wm8993->fs); wm8993 1293 sound/soc/codecs/wm8993.c aif4 |= wm8993->bclk / wm8993->fs; wm8993 1301 sound/soc/codecs/wm8993.c if (wm8993->pdata.num_retune_configs) { wm8993 1306 sound/soc/codecs/wm8993.c best_val = abs(wm8993->pdata.retune_configs[0].rate wm8993 1307 sound/soc/codecs/wm8993.c - wm8993->fs); wm8993 1308 sound/soc/codecs/wm8993.c for (i = 0; i < wm8993->pdata.num_retune_configs; i++) { wm8993 1309 sound/soc/codecs/wm8993.c cur_val = abs(wm8993->pdata.retune_configs[i].rate wm8993 1310 sound/soc/codecs/wm8993.c - wm8993->fs); wm8993 1316 sound/soc/codecs/wm8993.c s = &wm8993->pdata.retune_configs[best]; wm8993 1354 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1360 sound/soc/codecs/wm8993.c wm8993->tdm_slots = 0; wm8993 1393 sound/soc/codecs/wm8993.c wm8993->tdm_width = slot_width; wm8993 1394 sound/soc/codecs/wm8993.c wm8993->tdm_slots = slots / 2; wm8993 1406 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = data; wm8993 1409 sound/soc/codecs/wm8993.c ret = regmap_read(wm8993->regmap, WM8993_GPIO_CTRL_1, &val); wm8993 1411 sound/soc/codecs/wm8993.c dev_err(wm8993->dev, "Failed to read interrupt status: %d\n", wm8993 1416 sound/soc/codecs/wm8993.c ret = regmap_read(wm8993->regmap, WM8993_GPIOCTRL_2, &mask); wm8993 1418 sound/soc/codecs/wm8993.c dev_err(wm8993->dev, "Failed to read interrupt mask: %d\n", wm8993 1429 sound/soc/codecs/wm8993.c dev_crit(wm8993->dev, "Thermal warning\n"); wm8993 1432 sound/soc/codecs/wm8993.c dev_dbg(wm8993->dev, "FLL locked\n"); wm8993 1433 sound/soc/codecs/wm8993.c complete(&wm8993->fll_lock); wm8993 1436 sound/soc/codecs/wm8993.c ret = regmap_write(wm8993->regmap, WM8993_GPIO_CTRL_1, val); wm8993 1438 sound/soc/codecs/wm8993.c dev_err(wm8993->dev, "Failed to ack interrupt: %d\n", ret); wm8993 1483 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1486 sound/soc/codecs/wm8993.c wm8993->hubs_data.hp_startup_mode = 1; wm8993 1487 sound/soc/codecs/wm8993.c wm8993->hubs_data.dcs_codes_l = -2; wm8993 1488 sound/soc/codecs/wm8993.c wm8993->hubs_data.dcs_codes_r = -2; wm8993 1489 sound/soc/codecs/wm8993.c wm8993->hubs_data.series_startup = 1; wm8993 1505 sound/soc/codecs/wm8993.c wm_hubs_handle_analogue_pdata(component, wm8993->pdata.lineout1_diff, wm8993 1506 sound/soc/codecs/wm8993.c wm8993->pdata.lineout2_diff, wm8993 1507 sound/soc/codecs/wm8993.c wm8993->pdata.lineout1fb, wm8993 1508 sound/soc/codecs/wm8993.c wm8993->pdata.lineout2fb, wm8993 1509 sound/soc/codecs/wm8993.c wm8993->pdata.jd_scthr, wm8993 1510 sound/soc/codecs/wm8993.c wm8993->pdata.jd_thr, wm8993 1511 sound/soc/codecs/wm8993.c wm8993->pdata.micbias1_delay, wm8993 1512 sound/soc/codecs/wm8993.c wm8993->pdata.micbias2_delay, wm8993 1513 sound/soc/codecs/wm8993.c wm8993->pdata.micbias1_lvl, wm8993 1514 sound/soc/codecs/wm8993.c wm8993->pdata.micbias2_lvl); wm8993 1518 sound/soc/codecs/wm8993.c if (wm8993->pdata.num_retune_configs != 0) { wm8993 1531 sound/soc/codecs/wm8993.c wm_hubs_add_analogue_routes(component, wm8993->pdata.lineout1_diff, wm8993 1532 sound/soc/codecs/wm8993.c wm8993->pdata.lineout2_diff); wm8993 1537 sound/soc/codecs/wm8993.c if (wm8993->pdata.lineout1_diff && wm8993->pdata.lineout2_diff) wm8993 1547 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1548 sound/soc/codecs/wm8993.c int fll_fout = wm8993->fll_fout; wm8993 1549 sound/soc/codecs/wm8993.c int fll_fref = wm8993->fll_fref; wm8993 1559 sound/soc/codecs/wm8993.c wm8993->fll_fout = fll_fout; wm8993 1560 sound/soc/codecs/wm8993.c wm8993->fll_fref = fll_fref; wm8993 1569 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = snd_soc_component_get_drvdata(component); wm8993 1575 sound/soc/codecs/wm8993.c if (wm8993->fll_fout) { wm8993 1576 sound/soc/codecs/wm8993.c int fll_fout = wm8993->fll_fout; wm8993 1577 sound/soc/codecs/wm8993.c int fll_fref = wm8993->fll_fref; wm8993 1579 sound/soc/codecs/wm8993.c wm8993->fll_fref = 0; wm8993 1580 sound/soc/codecs/wm8993.c wm8993->fll_fout = 0; wm8993 1582 sound/soc/codecs/wm8993.c ret = _wm8993_set_fll(component, 0, wm8993->fll_src, wm8993 1629 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993; wm8993 1633 sound/soc/codecs/wm8993.c wm8993 = devm_kzalloc(&i2c->dev, sizeof(struct wm8993_priv), wm8993 1635 sound/soc/codecs/wm8993.c if (wm8993 == NULL) wm8993 1638 sound/soc/codecs/wm8993.c wm8993->dev = &i2c->dev; wm8993 1639 sound/soc/codecs/wm8993.c init_completion(&wm8993->fll_lock); wm8993 1641 sound/soc/codecs/wm8993.c wm8993->regmap = devm_regmap_init_i2c(i2c, &wm8993_regmap); wm8993 1642 sound/soc/codecs/wm8993.c if (IS_ERR(wm8993->regmap)) { wm8993 1643 sound/soc/codecs/wm8993.c ret = PTR_ERR(wm8993->regmap); wm8993 1648 sound/soc/codecs/wm8993.c i2c_set_clientdata(i2c, wm8993); wm8993 1650 sound/soc/codecs/wm8993.c for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++) wm8993 1651 sound/soc/codecs/wm8993.c wm8993->supplies[i].supply = wm8993_supply_names[i]; wm8993 1653 sound/soc/codecs/wm8993.c ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies), wm8993 1654 sound/soc/codecs/wm8993.c wm8993->supplies); wm8993 1660 sound/soc/codecs/wm8993.c ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), wm8993 1661 sound/soc/codecs/wm8993.c wm8993->supplies); wm8993 1667 sound/soc/codecs/wm8993.c ret = regmap_read(wm8993->regmap, WM8993_SOFTWARE_RESET, ®); wm8993 1679 sound/soc/codecs/wm8993.c ret = regmap_write(wm8993->regmap, WM8993_SOFTWARE_RESET, 0xffff); wm8993 1683 sound/soc/codecs/wm8993.c ret = regmap_register_patch(wm8993->regmap, wm8993_regmap_patch, wm8993 1686 sound/soc/codecs/wm8993.c dev_warn(wm8993->dev, "Failed to apply regmap patch: %d\n", wm8993 1691 sound/soc/codecs/wm8993.c ret = regmap_update_bits(wm8993->regmap, WM8993_GPIO1, wm8993 1699 sound/soc/codecs/wm8993.c "wm8993", wm8993); wm8993 1705 sound/soc/codecs/wm8993.c regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); wm8993 1707 sound/soc/codecs/wm8993.c regcache_cache_only(wm8993->regmap, true); wm8993 1720 sound/soc/codecs/wm8993.c free_irq(i2c->irq, wm8993); wm8993 1722 sound/soc/codecs/wm8993.c regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); wm8993 1728 sound/soc/codecs/wm8993.c struct wm8993_priv *wm8993 = i2c_get_clientdata(i2c); wm8993 1731 sound/soc/codecs/wm8993.c free_irq(i2c->irq, wm8993); wm8993 1732 sound/soc/codecs/wm8993.c regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);