Lines Matching refs:tx

244 	struct tx_macro *tx;  member
250 struct tx_macro *tx; member
601 static int tx_macro_mclk_enable(struct tx_macro *tx, in tx_macro_mclk_enable() argument
604 struct regmap *regmap = tx->regmap; in tx_macro_mclk_enable()
607 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
619 tx->tx_mclk_users++; in tx_macro_mclk_enable()
621 if (tx->tx_mclk_users <= 0) { in tx_macro_mclk_enable()
622 dev_err(tx->dev, "clock already disabled\n"); in tx_macro_mclk_enable()
623 tx->tx_mclk_users = 0; in tx_macro_mclk_enable()
626 tx->tx_mclk_users--; in tx_macro_mclk_enable()
627 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
659 struct tx_macro *tx; in tx_macro_tx_hpf_corner_freq_callback() local
666 tx = hpf_work->tx; in tx_macro_tx_hpf_corner_freq_callback()
667 component = tx->component; in tx_macro_tx_hpf_corner_freq_callback()
703 struct tx_macro *tx; in tx_macro_mute_update_callback() local
709 tx = tx_mute_dwork->tx; in tx_macro_mute_update_callback()
710 component = tx->component; in tx_macro_mute_update_callback()
721 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_mclk_event() local
725 tx_macro_mclk_enable(tx, true); in tx_macro_mclk_event()
728 tx_macro_mclk_enable(tx, false); in tx_macro_mclk_event()
746 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_put_dec_enum() local
791 tx->dmic_clk_div); in tx_macro_put_dec_enum()
806 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_get() local
808 if (test_bit(dec_id, &tx->active_ch_mask[dai_id])) in tx_macro_tx_mixer_get()
826 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_put() local
829 if (tx->active_decimator[dai_id] == dec_id) in tx_macro_tx_mixer_put()
832 set_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
833 tx->active_ch_cnt[dai_id]++; in tx_macro_tx_mixer_put()
834 tx->active_decimator[dai_id] = dec_id; in tx_macro_tx_mixer_put()
836 if (tx->active_decimator[dai_id] == -1) in tx_macro_tx_mixer_put()
839 tx->active_ch_cnt[dai_id]--; in tx_macro_tx_mixer_put()
840 clear_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
841 tx->active_decimator[dai_id] = -1; in tx_macro_tx_mixer_put()
859 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_enable_dec() local
880 tx->dmic_clk_div); in tx_macro_enable_dec()
885 tx->dec_mode[decimator]); in tx_macro_enable_dec()
901 tx->tx_hpf_work[decimator].hpf_cut_off_freq = in tx_macro_enable_dec()
915 &tx->tx_mute_dwork[decimator].dwork, in tx_macro_enable_dec()
917 if (tx->tx_hpf_work[decimator].hpf_cut_off_freq != CF_MIN_3DB_150HZ) { in tx_macro_enable_dec()
919 &tx->tx_hpf_work[decimator].dwork, in tx_macro_enable_dec()
944 if (tx->bcs_enable) { in tx_macro_enable_dec()
947 tx->bcs_clk_en = true; in tx_macro_enable_dec()
952 tx->tx_hpf_work[decimator].hpf_cut_off_freq; in tx_macro_enable_dec()
956 &tx->tx_hpf_work[decimator].dwork)) { in tx_macro_enable_dec()
986 cancel_delayed_work_sync(&tx->tx_mute_dwork[decimator].dwork); in tx_macro_enable_dec()
995 if (tx->bcs_enable) { in tx_macro_enable_dec()
1002 tx->bcs_clk_en = false; in tx_macro_enable_dec()
1013 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_get() local
1017 ucontrol->value.integer.value[0] = tx->dec_mode[path]; in tx_macro_dec_mode_get()
1029 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_put() local
1031 if (tx->dec_mode[path] == value) in tx_macro_dec_mode_put()
1034 tx->dec_mode[path] = value; in tx_macro_dec_mode_put()
1043 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_bcs() local
1045 ucontrol->value.integer.value[0] = tx->bcs_enable; in tx_macro_get_bcs()
1055 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_set_bcs() local
1057 tx->bcs_enable = value; in tx_macro_set_bcs()
1069 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_hw_params() local
1100 for_each_set_bit(decimator, &tx->active_ch_mask[dai->id], TX_MACRO_DEC_MAX) in tx_macro_hw_params()
1112 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_channel_map() local
1118 *tx_slot = tx->active_ch_mask[dai->id]; in tx_macro_get_channel_map()
1119 *tx_num = tx->active_ch_cnt[dai->id]; in tx_macro_get_channel_map()
1130 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_digital_mute() local
1134 if (tx->active_decimator[dai->id] == -1) in tx_macro_digital_mute()
1137 decimator = tx->active_decimator[dai->id]; in tx_macro_digital_mute()
1822 struct tx_macro *tx = snd_soc_component_get_drvdata(comp); in tx_macro_component_probe() local
1825 snd_soc_component_init_regmap(comp, tx->regmap); in tx_macro_component_probe()
1828 tx->tx_hpf_work[i].tx = tx; in tx_macro_component_probe()
1829 tx->tx_hpf_work[i].decimator = i; in tx_macro_component_probe()
1830 INIT_DELAYED_WORK(&tx->tx_hpf_work[i].dwork, in tx_macro_component_probe()
1835 tx->tx_mute_dwork[i].tx = tx; in tx_macro_component_probe()
1836 tx->tx_mute_dwork[i].decimator = i; in tx_macro_component_probe()
1837 INIT_DELAYED_WORK(&tx->tx_mute_dwork[i].dwork, in tx_macro_component_probe()
1840 tx->component = comp; in tx_macro_component_probe()
1853 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_enable() local
1854 struct regmap *regmap = tx->regmap; in swclk_gate_enable()
1857 ret = clk_prepare_enable(tx->mclk); in swclk_gate_enable()
1859 dev_err(tx->dev, "failed to enable mclk\n"); in swclk_gate_enable()
1863 tx_macro_mclk_enable(tx, true); in swclk_gate_enable()
1873 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_disable() local
1874 struct regmap *regmap = tx->regmap; in swclk_gate_disable()
1879 tx_macro_mclk_enable(tx, false); in swclk_gate_disable()
1880 clk_disable_unprepare(tx->mclk); in swclk_gate_disable()
1885 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_is_enabled() local
1888 regmap_read(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, &val); in swclk_gate_is_enabled()
1908 static int tx_macro_register_mclk_output(struct tx_macro *tx) in tx_macro_register_mclk_output() argument
1910 struct device *dev = tx->dev; in tx_macro_register_mclk_output()
1917 parent_clk_name = __clk_get_name(tx->npl); in tx_macro_register_mclk_output()
1924 tx->hw.init = &init; in tx_macro_register_mclk_output()
1925 hw = &tx->hw; in tx_macro_register_mclk_output()
1948 struct tx_macro *tx; in tx_macro_probe() local
1952 tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); in tx_macro_probe()
1953 if (!tx) in tx_macro_probe()
1956 tx->macro = devm_clk_get_optional(dev, "macro"); in tx_macro_probe()
1957 if (IS_ERR(tx->macro)) in tx_macro_probe()
1958 return PTR_ERR(tx->macro); in tx_macro_probe()
1960 tx->dcodec = devm_clk_get_optional(dev, "dcodec"); in tx_macro_probe()
1961 if (IS_ERR(tx->dcodec)) in tx_macro_probe()
1962 return PTR_ERR(tx->dcodec); in tx_macro_probe()
1964 tx->mclk = devm_clk_get(dev, "mclk"); in tx_macro_probe()
1965 if (IS_ERR(tx->mclk)) in tx_macro_probe()
1966 return PTR_ERR(tx->mclk); in tx_macro_probe()
1968 tx->npl = devm_clk_get(dev, "npl"); in tx_macro_probe()
1969 if (IS_ERR(tx->npl)) in tx_macro_probe()
1970 return PTR_ERR(tx->npl); in tx_macro_probe()
1972 tx->fsgen = devm_clk_get(dev, "fsgen"); in tx_macro_probe()
1973 if (IS_ERR(tx->fsgen)) in tx_macro_probe()
1974 return PTR_ERR(tx->fsgen); in tx_macro_probe()
1976 tx->pds = lpass_macro_pds_init(dev); in tx_macro_probe()
1977 if (IS_ERR(tx->pds)) in tx_macro_probe()
1978 return PTR_ERR(tx->pds); in tx_macro_probe()
2000 tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); in tx_macro_probe()
2001 if (IS_ERR(tx->regmap)) { in tx_macro_probe()
2002 ret = PTR_ERR(tx->regmap); in tx_macro_probe()
2006 dev_set_drvdata(dev, tx); in tx_macro_probe()
2008 tx->dev = dev; in tx_macro_probe()
2011 clk_set_rate(tx->mclk, MCLK_FREQ); in tx_macro_probe()
2012 clk_set_rate(tx->npl, MCLK_FREQ); in tx_macro_probe()
2014 ret = clk_prepare_enable(tx->macro); in tx_macro_probe()
2018 ret = clk_prepare_enable(tx->dcodec); in tx_macro_probe()
2022 ret = clk_prepare_enable(tx->mclk); in tx_macro_probe()
2026 ret = clk_prepare_enable(tx->npl); in tx_macro_probe()
2030 ret = clk_prepare_enable(tx->fsgen); in tx_macro_probe()
2035 regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, in tx_macro_probe()
2038 regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, in tx_macro_probe()
2041 regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, in tx_macro_probe()
2056 ret = tx_macro_register_mclk_output(tx); in tx_macro_probe()
2063 clk_disable_unprepare(tx->fsgen); in tx_macro_probe()
2065 clk_disable_unprepare(tx->npl); in tx_macro_probe()
2067 clk_disable_unprepare(tx->mclk); in tx_macro_probe()
2069 clk_disable_unprepare(tx->dcodec); in tx_macro_probe()
2071 clk_disable_unprepare(tx->macro); in tx_macro_probe()
2073 lpass_macro_pds_exit(tx->pds); in tx_macro_probe()
2080 struct tx_macro *tx = dev_get_drvdata(&pdev->dev); in tx_macro_remove() local
2082 clk_disable_unprepare(tx->macro); in tx_macro_remove()
2083 clk_disable_unprepare(tx->dcodec); in tx_macro_remove()
2084 clk_disable_unprepare(tx->mclk); in tx_macro_remove()
2085 clk_disable_unprepare(tx->npl); in tx_macro_remove()
2086 clk_disable_unprepare(tx->fsgen); in tx_macro_remove()
2088 lpass_macro_pds_exit(tx->pds); in tx_macro_remove()
2095 struct tx_macro *tx = dev_get_drvdata(dev); in tx_macro_runtime_suspend() local
2097 regcache_cache_only(tx->regmap, true); in tx_macro_runtime_suspend()
2098 regcache_mark_dirty(tx->regmap); in tx_macro_runtime_suspend()
2100 clk_disable_unprepare(tx->mclk); in tx_macro_runtime_suspend()
2101 clk_disable_unprepare(tx->npl); in tx_macro_runtime_suspend()
2102 clk_disable_unprepare(tx->fsgen); in tx_macro_runtime_suspend()
2109 struct tx_macro *tx = dev_get_drvdata(dev); in tx_macro_runtime_resume() local
2112 ret = clk_prepare_enable(tx->mclk); in tx_macro_runtime_resume()
2118 ret = clk_prepare_enable(tx->npl); in tx_macro_runtime_resume()
2124 ret = clk_prepare_enable(tx->fsgen); in tx_macro_runtime_resume()
2130 regcache_cache_only(tx->regmap, false); in tx_macro_runtime_resume()
2131 regcache_sync(tx->regmap); in tx_macro_runtime_resume()
2135 clk_disable_unprepare(tx->npl); in tx_macro_runtime_resume()
2137 clk_disable_unprepare(tx->mclk); in tx_macro_runtime_resume()