Lines Matching refs:da7219

258 	struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);  in da7219_volsw_locked_get()  local
261 mutex_lock(&da7219->ctrl_lock); in da7219_volsw_locked_get()
263 mutex_unlock(&da7219->ctrl_lock); in da7219_volsw_locked_get()
272 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_volsw_locked_put() local
275 mutex_lock(&da7219->ctrl_lock); in da7219_volsw_locked_put()
277 mutex_unlock(&da7219->ctrl_lock); in da7219_volsw_locked_put()
286 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_enum_locked_get() local
289 mutex_lock(&da7219->ctrl_lock); in da7219_enum_locked_get()
291 mutex_unlock(&da7219->ctrl_lock); in da7219_enum_locked_get()
300 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_enum_locked_put() local
303 mutex_lock(&da7219->ctrl_lock); in da7219_enum_locked_put()
305 mutex_unlock(&da7219->ctrl_lock); in da7219_enum_locked_put()
380 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_mixin_gain_put() local
389 if ((ret == 1) && (da7219->alc_en)) in da7219_mixin_gain_put()
399 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_alc_sw_put() local
403 if ((ucontrol->value.integer.value[0]) && (!da7219->alc_en)) { in da7219_alc_sw_put()
405 da7219->alc_en = true; in da7219_alc_sw_put()
407 da7219->alc_en = false; in da7219_alc_sw_put()
418 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_tonegen_freq_get() local
425 mutex_lock(&da7219->ctrl_lock); in da7219_tonegen_freq_get()
426 ret = regmap_raw_read(da7219->regmap, reg, &val, sizeof(val)); in da7219_tonegen_freq_get()
427 mutex_unlock(&da7219->ctrl_lock); in da7219_tonegen_freq_get()
445 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_tonegen_freq_put() local
459 mutex_lock(&da7219->ctrl_lock); in da7219_tonegen_freq_put()
460 ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old)); in da7219_tonegen_freq_put()
462 ret = regmap_raw_write(da7219->regmap, reg, in da7219_tonegen_freq_put()
464 mutex_unlock(&da7219->ctrl_lock); in da7219_tonegen_freq_put()
777 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_mic_pga_event() local
781 if (da7219->micbias_on_event) { in da7219_mic_pga_event()
786 da7219->micbias_on_event = false; in da7219_mic_pga_event()
787 msleep(da7219->mic_pga_delay); in da7219_mic_pga_event()
801 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_dai_event() local
802 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_dai_event()
809 if (da7219->master) { in da7219_dai_event()
857 if (da7219->master) { in da7219_dai_event()
930 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_gain_ramp_event() local
936 da7219->gain_ramp_ctrl = in da7219_gain_ramp_event()
945 da7219->gain_ramp_ctrl); in da7219_gain_ramp_event()
1167 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_dai_sysclk() local
1170 if ((da7219->clk_src == clk_id) && (da7219->mclk_rate == freq)) in da7219_set_dai_sysclk()
1179 mutex_lock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1193 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1197 da7219->clk_src = clk_id; in da7219_set_dai_sysclk()
1199 if (da7219->mclk) { in da7219_set_dai_sysclk()
1200 freq = clk_round_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1201 ret = clk_set_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1205 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1210 da7219->mclk_rate = freq; in da7219_set_dai_sysclk()
1212 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1219 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_pll() local
1227 if (da7219->mclk_rate < 2000000) { in da7219_set_pll()
1229 da7219->mclk_rate); in da7219_set_pll()
1231 } else if (da7219->mclk_rate <= 4500000) { in da7219_set_pll()
1234 } else if (da7219->mclk_rate <= 9000000) { in da7219_set_pll()
1237 } else if (da7219->mclk_rate <= 18000000) { in da7219_set_pll()
1240 } else if (da7219->mclk_rate <= 36000000) { in da7219_set_pll()
1243 } else if (da7219->mclk_rate <= 54000000) { in da7219_set_pll()
1248 da7219->mclk_rate); in da7219_set_pll()
1251 freq_ref = (da7219->mclk_rate / indiv); in da7219_set_pll()
1295 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_dai_pll() local
1298 mutex_lock(&da7219->pll_lock); in da7219_set_dai_pll()
1300 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_pll()
1308 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_dai_fmt() local
1313 da7219->master = true; in da7219_set_dai_fmt()
1316 da7219->master = false; in da7219_set_dai_fmt()
1425 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_dai_tdm_slot() local
1426 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_set_dai_tdm_slot()
1427 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_set_dai_tdm_slot()
1441 da7219->tdm_en = false; in da7219_set_dai_tdm_slot()
1469 if (da7219->master) { in da7219_set_dai_tdm_slot()
1494 regmap_bulk_write(da7219->regmap, DA7219_DAI_OFFSET_LOWER, in da7219_set_dai_tdm_slot()
1503 da7219->tdm_en = true; in da7219_set_dai_tdm_slot()
1561 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_hw_params() local
1562 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_hw_params()
1563 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_hw_params()
1597 if (da7219->master && wclk) { in da7219_hw_params()
1618 if (da7219->master && !da7219->tdm_en) { in da7219_hw_params()
1806 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_set_bias_level() local
1815 if (da7219->mclk) { in da7219_set_bias_level()
1816 ret = clk_prepare_enable(da7219->mclk); in da7219_set_bias_level()
1835 if (da7219->mclk) in da7219_set_bias_level()
1836 clk_disable_unprepare(da7219->mclk); in da7219_set_bias_level()
1841 if (!da7219->wakeup_source) in da7219_set_bias_level()
1860 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_handle_supplies() local
1866 da7219->supplies[i].supply = da7219_supply_names[i]; in da7219_handle_supplies()
1869 da7219->supplies); in da7219_handle_supplies()
1879 vddio = da7219->supplies[DA7219_SUPPLY_VDDIO].consumer; in da7219_handle_supplies()
1887 ret = regulator_bulk_enable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1890 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1900 struct da7219_priv *da7219 = in da7219_wclk_prepare() local
1903 struct snd_soc_component *component = da7219->component; in da7219_wclk_prepare()
1905 if (!da7219->master) in da7219_wclk_prepare()
1917 struct da7219_priv *da7219 = in da7219_wclk_unprepare() local
1920 struct snd_soc_component *component = da7219->component; in da7219_wclk_unprepare()
1922 if (!da7219->master) in da7219_wclk_unprepare()
1931 struct da7219_priv *da7219 = in da7219_wclk_is_prepared() local
1934 struct snd_soc_component *component = da7219->component; in da7219_wclk_is_prepared()
1937 if (!da7219->master) in da7219_wclk_is_prepared()
1948 struct da7219_priv *da7219 = in da7219_wclk_recalc_rate() local
1951 struct snd_soc_component *component = da7219->component; in da7219_wclk_recalc_rate()
1985 struct da7219_priv *da7219 = in da7219_wclk_round_rate() local
1989 if (!da7219->master) in da7219_wclk_round_rate()
2019 struct da7219_priv *da7219 = in da7219_wclk_set_rate() local
2022 struct snd_soc_component *component = da7219->component; in da7219_wclk_set_rate()
2024 if (!da7219->master) in da7219_wclk_set_rate()
2033 struct da7219_priv *da7219 = in da7219_bclk_recalc_rate() local
2036 struct snd_soc_component *component = da7219->component; in da7219_bclk_recalc_rate()
2073 struct da7219_priv *da7219 = in da7219_bclk_round_rate() local
2078 if (!*parent_rate || !da7219->master) in da7219_bclk_round_rate()
2096 struct da7219_priv *da7219 = in da7219_bclk_set_rate() local
2099 struct snd_soc_component *component = da7219->component; in da7219_bclk_set_rate()
2102 if (!da7219->master) in da7219_bclk_set_rate()
2130 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_register_dai_clks() local
2131 struct da7219_pdata *pdata = da7219->pdata; in da7219_register_dai_clks()
2144 da7219->clk_hw_data = clk_data; in da7219_register_dai_clks()
2150 struct clk_hw *dai_clk_hw = &da7219->dai_clks_hw[i]; in da7219_register_dai_clks()
2158 if (da7219->mclk) { in da7219_register_dai_clks()
2159 parent_name = __clk_get_name(da7219->mclk); in da7219_register_dai_clks()
2169 parent_name = __clk_get_name(da7219->dai_clks[DA7219_DAI_WCLK_IDX]); in da7219_register_dai_clks()
2190 da7219->dai_clks[i] = dai_clk_hw->clk; in da7219_register_dai_clks()
2194 da7219->clk_hw_data->hws[i] = dai_clk_hw; in da7219_register_dai_clks()
2203 da7219->dai_clks_lookup[i] = dai_clk_lookup; in da7219_register_dai_clks()
2211 da7219->clk_hw_data); in da7219_register_dai_clks()
2222 if (da7219->dai_clks_lookup[i]) in da7219_register_dai_clks()
2223 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_register_dai_clks()
2225 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_register_dai_clks()
2229 kfree(da7219->clk_hw_data); in da7219_register_dai_clks()
2236 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_free_dai_clks() local
2244 if (da7219->dai_clks_lookup[i]) in da7219_free_dai_clks()
2245 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_free_dai_clks()
2247 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_free_dai_clks()
2251 kfree(da7219->clk_hw_data); in da7219_free_dai_clks()
2264 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_handle_pdata() local
2265 struct da7219_pdata *pdata = da7219->pdata; in da7219_handle_pdata()
2270 da7219->wakeup_source = pdata->wakeup_source; in da7219_handle_pdata()
2291 da7219->mic_pga_delay = DA7219_MIC_PGA_BASE_DELAY + in da7219_handle_pdata()
2449 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_probe() local
2454 da7219->component = component; in da7219_probe()
2455 mutex_init(&da7219->ctrl_lock); in da7219_probe()
2456 mutex_init(&da7219->pll_lock); in da7219_probe()
2463 regcache_cache_bypass(da7219->regmap, true); in da7219_probe()
2466 regmap_read(da7219->regmap, DA7219_SYSTEM_ACTIVE, &system_active); in da7219_probe()
2468 regmap_write(da7219->regmap, DA7219_GAIN_RAMP_CTRL, in da7219_probe()
2470 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_INPUT, 0x00); in da7219_probe()
2471 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_OUTPUT, 0x01); in da7219_probe()
2474 regmap_read(da7219->regmap, DA7219_SYSTEM_STATUS, in da7219_probe()
2484 regmap_write_bits(da7219->regmap, DA7219_ACCDET_CONFIG_1, in da7219_probe()
2486 regmap_write_bits(da7219->regmap, DA7219_CIF_CTRL, in da7219_probe()
2489 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2491 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2494 regcache_cache_bypass(da7219->regmap, false); in da7219_probe()
2495 regmap_reinit_cache(da7219->regmap, &da7219_regmap_config); in da7219_probe()
2500 ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev); in da7219_probe()
2508 ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch, in da7219_probe()
2524 da7219->mclk = clk_get(component->dev, "mclk"); in da7219_probe()
2525 if (IS_ERR(da7219->mclk)) { in da7219_probe()
2526 if (PTR_ERR(da7219->mclk) != -ENOENT) { in da7219_probe()
2527 ret = PTR_ERR(da7219->mclk); in da7219_probe()
2530 da7219->mclk = NULL; in da7219_probe()
2582 clk_put(da7219->mclk); in da7219_probe()
2585 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2586 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2593 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_remove() local
2598 clk_put(da7219->mclk); in da7219_remove()
2601 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2602 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2608 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_suspend() local
2611 if (!da7219->wakeup_source) in da7219_suspend()
2621 struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); in da7219_resume() local
2626 if (!da7219->wakeup_source) in da7219_resume()
2670 struct da7219_priv *da7219; in da7219_i2c_probe() local
2673 da7219 = devm_kzalloc(dev, sizeof(struct da7219_priv), in da7219_i2c_probe()
2675 if (!da7219) in da7219_i2c_probe()
2678 i2c_set_clientdata(i2c, da7219); in da7219_i2c_probe()
2680 da7219->regmap = devm_regmap_init_i2c(i2c, &da7219_regmap_config); in da7219_i2c_probe()
2681 if (IS_ERR(da7219->regmap)) { in da7219_i2c_probe()
2682 ret = PTR_ERR(da7219->regmap); in da7219_i2c_probe()
2688 da7219->pdata = dev_get_platdata(dev); in da7219_i2c_probe()
2689 if (!da7219->pdata) in da7219_i2c_probe()
2690 da7219->pdata = da7219_fw_to_pdata(dev); in da7219_i2c_probe()