wm8904 316 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 325 sound/soc/codecs/wm8904.c switch (wm8904->sysclk_src) { wm8904 327 sound/soc/codecs/wm8904.c dev_dbg(component->dev, "Using %dHz MCLK\n", wm8904->mclk_rate); wm8904 330 sound/soc/codecs/wm8904.c rate = wm8904->mclk_rate; wm8904 339 sound/soc/codecs/wm8904.c wm8904->fll_fout); wm8904 342 sound/soc/codecs/wm8904.c rate = wm8904->fll_fout; wm8904 353 sound/soc/codecs/wm8904.c wm8904->sysclk_rate = rate / 2; wm8904 356 sound/soc/codecs/wm8904.c wm8904->sysclk_rate = rate; wm8904 365 sound/soc/codecs/wm8904.c dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8904->sysclk_rate); wm8904 372 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 373 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 381 sound/soc/codecs/wm8904.c pdata->drc_cfgs[wm8904->drc_cfg].regs[i]); wm8904 392 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 393 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 399 sound/soc/codecs/wm8904.c wm8904->drc_cfg = value; wm8904 410 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 412 sound/soc/codecs/wm8904.c ucontrol->value.enumerated.item[0] = wm8904->drc_cfg; wm8904 419 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 420 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 423 sound/soc/codecs/wm8904.c if (!pdata || !wm8904->num_retune_mobile_texts) wm8904 428 sound/soc/codecs/wm8904.c cfg = wm8904->retune_mobile_cfg; wm8904 433 sound/soc/codecs/wm8904.c wm8904->retune_mobile_texts[cfg]) == 0 && wm8904 435 sound/soc/codecs/wm8904.c - wm8904->fs) < best_val) { wm8904 438 sound/soc/codecs/wm8904.c - wm8904->fs); wm8904 445 sound/soc/codecs/wm8904.c wm8904->fs); wm8904 463 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 464 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 470 sound/soc/codecs/wm8904.c wm8904->retune_mobile_cfg = value; wm8904 481 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 483 sound/soc/codecs/wm8904.c ucontrol->value.enumerated.item[0] = wm8904->retune_mobile_cfg; wm8904 492 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 498 sound/soc/codecs/wm8904.c if (wm8904->deemph) { wm8904 501 sound/soc/codecs/wm8904.c if (abs(deemph_settings[i] - wm8904->fs) < wm8904 502 sound/soc/codecs/wm8904.c abs(deemph_settings[best] - wm8904->fs)) wm8904 521 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 523 sound/soc/codecs/wm8904.c ucontrol->value.integer.value[0] = wm8904->deemph; wm8904 531 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 537 sound/soc/codecs/wm8904.c wm8904->deemph = deemph; wm8904 657 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 666 sound/soc/codecs/wm8904.c switch (wm8904->sysclk_src) { wm8904 695 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 756 sound/soc/codecs/wm8904.c if (wm8904->dcs_state[dcs_l] || wm8904->dcs_state[dcs_r]) { wm8904 760 sound/soc/codecs/wm8904.c wm8904->dcs_state[dcs_l]); wm8904 762 sound/soc/codecs/wm8904.c wm8904->dcs_state[dcs_r]); wm8904 817 sound/soc/codecs/wm8904.c wm8904->dcs_state[dcs_l] = snd_soc_component_read32(component, dcs_l_reg); wm8904 818 sound/soc/codecs/wm8904.c wm8904->dcs_state[dcs_r] = snd_soc_component_read32(component, dcs_r_reg); wm8904 1179 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1187 sound/soc/codecs/wm8904.c switch (wm8904->devtype) { wm8904 1291 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1300 sound/soc/codecs/wm8904.c wm8904->fs = params_rate(params); wm8904 1301 sound/soc/codecs/wm8904.c if (wm8904->tdm_slots) { wm8904 1303 sound/soc/codecs/wm8904.c wm8904->tdm_slots, wm8904->tdm_width); wm8904 1304 sound/soc/codecs/wm8904.c wm8904->bclk = snd_soc_calc_bclk(wm8904->fs, wm8904 1305 sound/soc/codecs/wm8904.c wm8904->tdm_width, 2, wm8904 1306 sound/soc/codecs/wm8904.c wm8904->tdm_slots); wm8904 1308 sound/soc/codecs/wm8904.c wm8904->bclk = snd_soc_params_to_bclk(params); wm8904 1328 sound/soc/codecs/wm8904.c dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8904->bclk); wm8904 1336 sound/soc/codecs/wm8904.c best_val = abs((wm8904->sysclk_rate / clk_sys_rates[0].ratio) wm8904 1337 sound/soc/codecs/wm8904.c - wm8904->fs); wm8904 1339 sound/soc/codecs/wm8904.c cur_val = abs((wm8904->sysclk_rate / wm8904 1340 sound/soc/codecs/wm8904.c clk_sys_rates[i].ratio) - wm8904->fs); wm8904 1353 sound/soc/codecs/wm8904.c best_val = abs(wm8904->fs - sample_rates[0].rate); wm8904 1356 sound/soc/codecs/wm8904.c cur_val = abs(wm8904->fs - sample_rates[i].rate); wm8904 1368 sound/soc/codecs/wm8904.c if (wm8904->fs <= 24000) wm8904 1375 sound/soc/codecs/wm8904.c cur_val = ((wm8904->sysclk_rate * 10) / bclk_divs[i].div) wm8904 1376 sound/soc/codecs/wm8904.c - wm8904->bclk; wm8904 1384 sound/soc/codecs/wm8904.c wm8904->bclk = (wm8904->sysclk_rate * 10) / bclk_divs[best].div; wm8904 1386 sound/soc/codecs/wm8904.c bclk_divs[best].div, wm8904->bclk); wm8904 1390 sound/soc/codecs/wm8904.c dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8904->bclk / wm8904->fs); wm8904 1391 sound/soc/codecs/wm8904.c aif3 |= wm8904->bclk / wm8904->fs; wm8904 1535 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1570 sound/soc/codecs/wm8904.c wm8904->tdm_width = slot_width; wm8904 1571 sound/soc/codecs/wm8904.c wm8904->tdm_slots = slots / 2; wm8904 1692 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1698 sound/soc/codecs/wm8904.c if (source == wm8904->fll_src && Fref == wm8904->fll_fref && wm8904 1699 sound/soc/codecs/wm8904.c Fout == wm8904->fll_fout) wm8904 1707 sound/soc/codecs/wm8904.c wm8904->fll_fref = 0; wm8904 1708 sound/soc/codecs/wm8904.c wm8904->fll_fout = 0; wm8904 1809 sound/soc/codecs/wm8904.c wm8904->fll_fref = Fref; wm8904 1810 sound/soc/codecs/wm8904.c wm8904->fll_fout = Fout; wm8904 1811 sound/soc/codecs/wm8904.c wm8904->fll_src = source; wm8904 1845 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1865 sound/soc/codecs/wm8904.c ret = regulator_bulk_enable(ARRAY_SIZE(wm8904->supplies), wm8904 1866 sound/soc/codecs/wm8904.c wm8904->supplies); wm8904 1874 sound/soc/codecs/wm8904.c ret = clk_prepare_enable(wm8904->mclk); wm8904 1878 sound/soc/codecs/wm8904.c regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904 1879 sound/soc/codecs/wm8904.c wm8904->supplies); wm8904 1883 sound/soc/codecs/wm8904.c regcache_cache_only(wm8904->regmap, false); wm8904 1884 sound/soc/codecs/wm8904.c regcache_sync(wm8904->regmap); wm8904 1921 sound/soc/codecs/wm8904.c regcache_cache_only(wm8904->regmap, true); wm8904 1922 sound/soc/codecs/wm8904.c regcache_mark_dirty(wm8904->regmap); wm8904 1924 sound/soc/codecs/wm8904.c regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904 1925 sound/soc/codecs/wm8904.c wm8904->supplies); wm8904 1926 sound/soc/codecs/wm8904.c clk_disable_unprepare(wm8904->mclk); wm8904 1968 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 1969 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 1972 sound/soc/codecs/wm8904.c wm8904->retune_mobile_enum, wm8904 1982 sound/soc/codecs/wm8904.c wm8904->num_retune_mobile_texts = 0; wm8904 1983 sound/soc/codecs/wm8904.c wm8904->retune_mobile_texts = NULL; wm8904 1985 sound/soc/codecs/wm8904.c for (j = 0; j < wm8904->num_retune_mobile_texts; j++) { wm8904 1987 sound/soc/codecs/wm8904.c wm8904->retune_mobile_texts[j]) == 0) wm8904 1991 sound/soc/codecs/wm8904.c if (j != wm8904->num_retune_mobile_texts) wm8904 1995 sound/soc/codecs/wm8904.c t = krealloc(wm8904->retune_mobile_texts, wm8904 1997 sound/soc/codecs/wm8904.c (wm8904->num_retune_mobile_texts + 1), wm8904 2003 sound/soc/codecs/wm8904.c t[wm8904->num_retune_mobile_texts] = wm8904 2007 sound/soc/codecs/wm8904.c wm8904->num_retune_mobile_texts++; wm8904 2008 sound/soc/codecs/wm8904.c wm8904->retune_mobile_texts = t; wm8904 2012 sound/soc/codecs/wm8904.c wm8904->num_retune_mobile_texts); wm8904 2014 sound/soc/codecs/wm8904.c wm8904->retune_mobile_enum.items = wm8904->num_retune_mobile_texts; wm8904 2015 sound/soc/codecs/wm8904.c wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts; wm8904 2025 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 2026 sound/soc/codecs/wm8904.c struct wm8904_pdata *pdata = wm8904->pdata; wm8904 2039 sound/soc/codecs/wm8904.c SOC_ENUM_EXT("DRC Mode", wm8904->drc_enum, wm8904 2043 sound/soc/codecs/wm8904.c wm8904->drc_texts = kmalloc_array(pdata->num_drc_cfgs, wm8904 2046 sound/soc/codecs/wm8904.c if (!wm8904->drc_texts) wm8904 2050 sound/soc/codecs/wm8904.c wm8904->drc_texts[i] = pdata->drc_cfgs[i].name; wm8904 2052 sound/soc/codecs/wm8904.c wm8904->drc_enum.items = pdata->num_drc_cfgs; wm8904 2053 sound/soc/codecs/wm8904.c wm8904->drc_enum.texts = wm8904->drc_texts; wm8904 2076 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 2078 sound/soc/codecs/wm8904.c switch (wm8904->devtype) { wm8904 2086 sound/soc/codecs/wm8904.c wm8904->devtype); wm8904 2099 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); wm8904 2101 sound/soc/codecs/wm8904.c kfree(wm8904->retune_mobile_texts); wm8904 2102 sound/soc/codecs/wm8904.c kfree(wm8904->drc_texts); wm8904 2145 sound/soc/codecs/wm8904.c struct wm8904_priv *wm8904; wm8904 2149 sound/soc/codecs/wm8904.c wm8904 = devm_kzalloc(&i2c->dev, sizeof(struct wm8904_priv), wm8904 2151 sound/soc/codecs/wm8904.c if (wm8904 == NULL) wm8904 2154 sound/soc/codecs/wm8904.c wm8904->mclk = devm_clk_get(&i2c->dev, "mclk"); wm8904 2155 sound/soc/codecs/wm8904.c if (IS_ERR(wm8904->mclk)) { wm8904 2156 sound/soc/codecs/wm8904.c ret = PTR_ERR(wm8904->mclk); wm8904 2161 sound/soc/codecs/wm8904.c wm8904->regmap = devm_regmap_init_i2c(i2c, &wm8904_regmap); wm8904 2162 sound/soc/codecs/wm8904.c if (IS_ERR(wm8904->regmap)) { wm8904 2163 sound/soc/codecs/wm8904.c ret = PTR_ERR(wm8904->regmap); wm8904 2175 sound/soc/codecs/wm8904.c wm8904->devtype = (enum wm8904_type)match->data; wm8904 2177 sound/soc/codecs/wm8904.c wm8904->devtype = id->driver_data; wm8904 2180 sound/soc/codecs/wm8904.c i2c_set_clientdata(i2c, wm8904); wm8904 2181 sound/soc/codecs/wm8904.c wm8904->pdata = i2c->dev.platform_data; wm8904 2183 sound/soc/codecs/wm8904.c for (i = 0; i < ARRAY_SIZE(wm8904->supplies); i++) wm8904 2184 sound/soc/codecs/wm8904.c wm8904->supplies[i].supply = wm8904_supply_names[i]; wm8904 2186 sound/soc/codecs/wm8904.c ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8904->supplies), wm8904 2187 sound/soc/codecs/wm8904.c wm8904->supplies); wm8904 2193 sound/soc/codecs/wm8904.c ret = regulator_bulk_enable(ARRAY_SIZE(wm8904->supplies), wm8904 2194 sound/soc/codecs/wm8904.c wm8904->supplies); wm8904 2200 sound/soc/codecs/wm8904.c ret = regmap_read(wm8904->regmap, WM8904_SW_RESET_AND_ID, &val); wm8904 2211 sound/soc/codecs/wm8904.c ret = regmap_read(wm8904->regmap, WM8904_REVISION, &val); wm8904 2219 sound/soc/codecs/wm8904.c ret = regmap_write(wm8904->regmap, WM8904_SW_RESET_AND_ID, 0); wm8904 2226 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ADC_DIGITAL_VOLUME_LEFT, wm8904 2228 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ADC_DIGITAL_VOLUME_RIGHT, wm8904 2230 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_DAC_DIGITAL_VOLUME_LEFT, wm8904 2232 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_DAC_DIGITAL_VOLUME_RIGHT, wm8904 2234 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ANALOGUE_OUT1_LEFT, wm8904 2237 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ANALOGUE_OUT1_RIGHT, wm8904 2240 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ANALOGUE_OUT2_LEFT, wm8904 2243 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_ANALOGUE_OUT2_RIGHT, wm8904 2246 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_CLOCK_RATES_0, wm8904 2250 sound/soc/codecs/wm8904.c if (wm8904->pdata) { wm8904 2252 sound/soc/codecs/wm8904.c if (!wm8904->pdata->gpio_cfg[i]) wm8904 2255 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, wm8904 2258 sound/soc/codecs/wm8904.c wm8904->pdata->gpio_cfg[i]); wm8904 2263 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, wm8904 2266 sound/soc/codecs/wm8904.c wm8904->pdata->mic_cfg[i]); wm8904 2272 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_CLASS_W_0, wm8904 2276 sound/soc/codecs/wm8904.c regmap_update_bits(wm8904->regmap, WM8904_BIAS_CONTROL_0, wm8904 2280 sound/soc/codecs/wm8904.c regcache_cache_only(wm8904->regmap, true); wm8904 2281 sound/soc/codecs/wm8904.c regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); wm8904 2291 sound/soc/codecs/wm8904.c regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);