Lines Matching refs:tx
243 struct tx_macro *tx; member
249 struct tx_macro *tx; member
600 static int tx_macro_mclk_enable(struct tx_macro *tx, in tx_macro_mclk_enable() argument
603 struct regmap *regmap = tx->regmap; in tx_macro_mclk_enable()
606 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
618 tx->tx_mclk_users++; in tx_macro_mclk_enable()
620 if (tx->tx_mclk_users <= 0) { in tx_macro_mclk_enable()
621 dev_err(tx->dev, "clock already disabled\n"); in tx_macro_mclk_enable()
622 tx->tx_mclk_users = 0; in tx_macro_mclk_enable()
625 tx->tx_mclk_users--; in tx_macro_mclk_enable()
626 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
658 struct tx_macro *tx; in tx_macro_tx_hpf_corner_freq_callback() local
665 tx = hpf_work->tx; in tx_macro_tx_hpf_corner_freq_callback()
666 component = tx->component; in tx_macro_tx_hpf_corner_freq_callback()
702 struct tx_macro *tx; in tx_macro_mute_update_callback() local
708 tx = tx_mute_dwork->tx; in tx_macro_mute_update_callback()
709 component = tx->component; in tx_macro_mute_update_callback()
720 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_mclk_event() local
724 tx_macro_mclk_enable(tx, true); in tx_macro_mclk_event()
727 tx_macro_mclk_enable(tx, false); in tx_macro_mclk_event()
745 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_put_dec_enum() local
787 tx->dmic_clk_div); in tx_macro_put_dec_enum()
802 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_get() local
804 if (test_bit(dec_id, &tx->active_ch_mask[dai_id])) in tx_macro_tx_mixer_get()
822 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_put() local
825 if (tx->active_decimator[dai_id] == dec_id) in tx_macro_tx_mixer_put()
828 set_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
829 tx->active_ch_cnt[dai_id]++; in tx_macro_tx_mixer_put()
830 tx->active_decimator[dai_id] = dec_id; in tx_macro_tx_mixer_put()
832 if (tx->active_decimator[dai_id] == -1) in tx_macro_tx_mixer_put()
835 tx->active_ch_cnt[dai_id]--; in tx_macro_tx_mixer_put()
836 clear_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
837 tx->active_decimator[dai_id] = -1; in tx_macro_tx_mixer_put()
855 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_enable_dec() local
876 tx->dmic_clk_div); in tx_macro_enable_dec()
881 tx->dec_mode[decimator]); in tx_macro_enable_dec()
897 tx->tx_hpf_work[decimator].hpf_cut_off_freq = in tx_macro_enable_dec()
911 &tx->tx_mute_dwork[decimator].dwork, in tx_macro_enable_dec()
913 if (tx->tx_hpf_work[decimator].hpf_cut_off_freq != CF_MIN_3DB_150HZ) { in tx_macro_enable_dec()
915 &tx->tx_hpf_work[decimator].dwork, in tx_macro_enable_dec()
940 if (tx->bcs_enable) { in tx_macro_enable_dec()
943 tx->bcs_clk_en = true; in tx_macro_enable_dec()
948 tx->tx_hpf_work[decimator].hpf_cut_off_freq; in tx_macro_enable_dec()
952 &tx->tx_hpf_work[decimator].dwork)) { in tx_macro_enable_dec()
982 cancel_delayed_work_sync(&tx->tx_mute_dwork[decimator].dwork); in tx_macro_enable_dec()
991 if (tx->bcs_enable) { in tx_macro_enable_dec()
998 tx->bcs_clk_en = false; in tx_macro_enable_dec()
1009 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_get() local
1013 ucontrol->value.integer.value[0] = tx->dec_mode[path]; in tx_macro_dec_mode_get()
1025 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_put() local
1027 if (tx->dec_mode[path] == value) in tx_macro_dec_mode_put()
1030 tx->dec_mode[path] = value; in tx_macro_dec_mode_put()
1039 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_bcs() local
1041 ucontrol->value.integer.value[0] = tx->bcs_enable; in tx_macro_get_bcs()
1051 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_set_bcs() local
1053 tx->bcs_enable = value; in tx_macro_set_bcs()
1065 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_hw_params() local
1096 for_each_set_bit(decimator, &tx->active_ch_mask[dai->id], TX_MACRO_DEC_MAX) in tx_macro_hw_params()
1108 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_channel_map() local
1114 *tx_slot = tx->active_ch_mask[dai->id]; in tx_macro_get_channel_map()
1115 *tx_num = tx->active_ch_cnt[dai->id]; in tx_macro_get_channel_map()
1126 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_digital_mute() local
1130 if (tx->active_decimator[dai->id] == -1) in tx_macro_digital_mute()
1133 decimator = tx->active_decimator[dai->id]; in tx_macro_digital_mute()
1675 struct tx_macro *tx = snd_soc_component_get_drvdata(comp); in tx_macro_component_probe() local
1678 snd_soc_component_init_regmap(comp, tx->regmap); in tx_macro_component_probe()
1681 tx->tx_hpf_work[i].tx = tx; in tx_macro_component_probe()
1682 tx->tx_hpf_work[i].decimator = i; in tx_macro_component_probe()
1683 INIT_DELAYED_WORK(&tx->tx_hpf_work[i].dwork, in tx_macro_component_probe()
1688 tx->tx_mute_dwork[i].tx = tx; in tx_macro_component_probe()
1689 tx->tx_mute_dwork[i].decimator = i; in tx_macro_component_probe()
1690 INIT_DELAYED_WORK(&tx->tx_mute_dwork[i].dwork, in tx_macro_component_probe()
1693 tx->component = comp; in tx_macro_component_probe()
1706 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_enable() local
1707 struct regmap *regmap = tx->regmap; in swclk_gate_enable()
1710 ret = clk_prepare_enable(tx->mclk); in swclk_gate_enable()
1712 dev_err(tx->dev, "failed to enable mclk\n"); in swclk_gate_enable()
1716 tx_macro_mclk_enable(tx, true); in swclk_gate_enable()
1731 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_disable() local
1732 struct regmap *regmap = tx->regmap; in swclk_gate_disable()
1737 tx_macro_mclk_enable(tx, false); in swclk_gate_disable()
1738 clk_disable_unprepare(tx->mclk); in swclk_gate_disable()
1743 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_is_enabled() local
1746 regmap_read(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, &val); in swclk_gate_is_enabled()
1766 static int tx_macro_register_mclk_output(struct tx_macro *tx) in tx_macro_register_mclk_output() argument
1768 struct device *dev = tx->dev; in tx_macro_register_mclk_output()
1775 parent_clk_name = __clk_get_name(tx->npl); in tx_macro_register_mclk_output()
1782 tx->hw.init = &init; in tx_macro_register_mclk_output()
1783 hw = &tx->hw; in tx_macro_register_mclk_output()
1806 struct tx_macro *tx; in tx_macro_probe() local
1810 tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); in tx_macro_probe()
1811 if (!tx) in tx_macro_probe()
1814 tx->macro = devm_clk_get_optional(dev, "macro"); in tx_macro_probe()
1815 if (IS_ERR(tx->macro)) in tx_macro_probe()
1816 return PTR_ERR(tx->macro); in tx_macro_probe()
1818 tx->dcodec = devm_clk_get_optional(dev, "dcodec"); in tx_macro_probe()
1819 if (IS_ERR(tx->dcodec)) in tx_macro_probe()
1820 return PTR_ERR(tx->dcodec); in tx_macro_probe()
1822 tx->mclk = devm_clk_get(dev, "mclk"); in tx_macro_probe()
1823 if (IS_ERR(tx->mclk)) in tx_macro_probe()
1824 return PTR_ERR(tx->mclk); in tx_macro_probe()
1826 tx->npl = devm_clk_get(dev, "npl"); in tx_macro_probe()
1827 if (IS_ERR(tx->npl)) in tx_macro_probe()
1828 return PTR_ERR(tx->npl); in tx_macro_probe()
1830 tx->fsgen = devm_clk_get(dev, "fsgen"); in tx_macro_probe()
1831 if (IS_ERR(tx->fsgen)) in tx_macro_probe()
1832 return PTR_ERR(tx->fsgen); in tx_macro_probe()
1834 tx->pds = lpass_macro_pds_init(dev); in tx_macro_probe()
1835 if (IS_ERR(tx->pds)) in tx_macro_probe()
1836 return PTR_ERR(tx->pds); in tx_macro_probe()
1858 tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); in tx_macro_probe()
1859 if (IS_ERR(tx->regmap)) { in tx_macro_probe()
1860 ret = PTR_ERR(tx->regmap); in tx_macro_probe()
1864 dev_set_drvdata(dev, tx); in tx_macro_probe()
1866 tx->dev = dev; in tx_macro_probe()
1869 clk_set_rate(tx->mclk, MCLK_FREQ); in tx_macro_probe()
1870 clk_set_rate(tx->npl, 2 * MCLK_FREQ); in tx_macro_probe()
1872 ret = clk_prepare_enable(tx->macro); in tx_macro_probe()
1876 ret = clk_prepare_enable(tx->dcodec); in tx_macro_probe()
1880 ret = clk_prepare_enable(tx->mclk); in tx_macro_probe()
1884 ret = clk_prepare_enable(tx->npl); in tx_macro_probe()
1888 ret = clk_prepare_enable(tx->fsgen); in tx_macro_probe()
1892 ret = tx_macro_register_mclk_output(tx); in tx_macro_probe()
1911 clk_disable_unprepare(tx->fsgen); in tx_macro_probe()
1913 clk_disable_unprepare(tx->npl); in tx_macro_probe()
1915 clk_disable_unprepare(tx->mclk); in tx_macro_probe()
1917 clk_disable_unprepare(tx->dcodec); in tx_macro_probe()
1919 clk_disable_unprepare(tx->macro); in tx_macro_probe()
1921 lpass_macro_pds_exit(tx->pds); in tx_macro_probe()
1928 struct tx_macro *tx = dev_get_drvdata(&pdev->dev); in tx_macro_remove() local
1930 clk_disable_unprepare(tx->macro); in tx_macro_remove()
1931 clk_disable_unprepare(tx->dcodec); in tx_macro_remove()
1932 clk_disable_unprepare(tx->mclk); in tx_macro_remove()
1933 clk_disable_unprepare(tx->npl); in tx_macro_remove()
1934 clk_disable_unprepare(tx->fsgen); in tx_macro_remove()
1936 lpass_macro_pds_exit(tx->pds); in tx_macro_remove()
1943 struct tx_macro *tx = dev_get_drvdata(dev); in tx_macro_runtime_suspend() local
1945 regcache_cache_only(tx->regmap, true); in tx_macro_runtime_suspend()
1946 regcache_mark_dirty(tx->regmap); in tx_macro_runtime_suspend()
1948 clk_disable_unprepare(tx->mclk); in tx_macro_runtime_suspend()
1949 clk_disable_unprepare(tx->npl); in tx_macro_runtime_suspend()
1950 clk_disable_unprepare(tx->fsgen); in tx_macro_runtime_suspend()
1957 struct tx_macro *tx = dev_get_drvdata(dev); in tx_macro_runtime_resume() local
1960 ret = clk_prepare_enable(tx->mclk); in tx_macro_runtime_resume()
1966 ret = clk_prepare_enable(tx->npl); in tx_macro_runtime_resume()
1972 ret = clk_prepare_enable(tx->fsgen); in tx_macro_runtime_resume()
1978 regcache_cache_only(tx->regmap, false); in tx_macro_runtime_resume()
1979 regcache_sync(tx->regmap); in tx_macro_runtime_resume()
1983 clk_disable_unprepare(tx->npl); in tx_macro_runtime_resume()
1985 clk_disable_unprepare(tx->mclk); in tx_macro_runtime_resume()