Lines Matching refs:tx

240 	struct tx_macro *tx;  member
246 struct tx_macro *tx; member
593 static int tx_macro_mclk_enable(struct tx_macro *tx, in tx_macro_mclk_enable() argument
596 struct regmap *regmap = tx->regmap; in tx_macro_mclk_enable()
599 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
611 tx->tx_mclk_users++; in tx_macro_mclk_enable()
613 if (tx->tx_mclk_users <= 0) { in tx_macro_mclk_enable()
614 dev_err(tx->dev, "clock already disabled\n"); in tx_macro_mclk_enable()
615 tx->tx_mclk_users = 0; in tx_macro_mclk_enable()
618 tx->tx_mclk_users--; in tx_macro_mclk_enable()
619 if (tx->tx_mclk_users == 0) { in tx_macro_mclk_enable()
651 struct tx_macro *tx; in tx_macro_tx_hpf_corner_freq_callback() local
658 tx = hpf_work->tx; in tx_macro_tx_hpf_corner_freq_callback()
659 component = tx->component; in tx_macro_tx_hpf_corner_freq_callback()
695 struct tx_macro *tx; in tx_macro_mute_update_callback() local
701 tx = tx_mute_dwork->tx; in tx_macro_mute_update_callback()
702 component = tx->component; in tx_macro_mute_update_callback()
713 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_mclk_event() local
717 tx_macro_mclk_enable(tx, true); in tx_macro_mclk_event()
720 tx_macro_mclk_enable(tx, false); in tx_macro_mclk_event()
738 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_put_dec_enum() local
780 tx->dmic_clk_div); in tx_macro_put_dec_enum()
795 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_get() local
797 if (test_bit(dec_id, &tx->active_ch_mask[dai_id])) in tx_macro_tx_mixer_get()
815 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_tx_mixer_put() local
818 set_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
819 tx->active_ch_cnt[dai_id]++; in tx_macro_tx_mixer_put()
820 tx->active_decimator[dai_id] = dec_id; in tx_macro_tx_mixer_put()
822 tx->active_ch_cnt[dai_id]--; in tx_macro_tx_mixer_put()
823 clear_bit(dec_id, &tx->active_ch_mask[dai_id]); in tx_macro_tx_mixer_put()
824 tx->active_decimator[dai_id] = -1; in tx_macro_tx_mixer_put()
842 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_enable_dec() local
863 tx->dmic_clk_div); in tx_macro_enable_dec()
868 tx->dec_mode[decimator]); in tx_macro_enable_dec()
884 tx->tx_hpf_work[decimator].hpf_cut_off_freq = in tx_macro_enable_dec()
898 &tx->tx_mute_dwork[decimator].dwork, in tx_macro_enable_dec()
900 if (tx->tx_hpf_work[decimator].hpf_cut_off_freq != CF_MIN_3DB_150HZ) { in tx_macro_enable_dec()
902 &tx->tx_hpf_work[decimator].dwork, in tx_macro_enable_dec()
927 if (tx->bcs_enable) { in tx_macro_enable_dec()
930 tx->bcs_clk_en = true; in tx_macro_enable_dec()
935 tx->tx_hpf_work[decimator].hpf_cut_off_freq; in tx_macro_enable_dec()
939 &tx->tx_hpf_work[decimator].dwork)) { in tx_macro_enable_dec()
969 cancel_delayed_work_sync(&tx->tx_mute_dwork[decimator].dwork); in tx_macro_enable_dec()
978 if (tx->bcs_enable) { in tx_macro_enable_dec()
985 tx->bcs_clk_en = false; in tx_macro_enable_dec()
996 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_get() local
1000 ucontrol->value.integer.value[0] = tx->dec_mode[path]; in tx_macro_dec_mode_get()
1012 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_dec_mode_put() local
1014 tx->dec_mode[path] = value; in tx_macro_dec_mode_put()
1023 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_bcs() local
1025 ucontrol->value.integer.value[0] = tx->bcs_enable; in tx_macro_get_bcs()
1035 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_set_bcs() local
1037 tx->bcs_enable = value; in tx_macro_set_bcs()
1049 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_hw_params() local
1080 for_each_set_bit(decimator, &tx->active_ch_mask[dai->id], TX_MACRO_DEC_MAX) in tx_macro_hw_params()
1092 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_get_channel_map() local
1098 *tx_slot = tx->active_ch_mask[dai->id]; in tx_macro_get_channel_map()
1099 *tx_num = tx->active_ch_cnt[dai->id]; in tx_macro_get_channel_map()
1110 struct tx_macro *tx = snd_soc_component_get_drvdata(component); in tx_macro_digital_mute() local
1113 decimator = tx->active_decimator[dai->id]; in tx_macro_digital_mute()
1655 struct tx_macro *tx = snd_soc_component_get_drvdata(comp); in tx_macro_component_probe() local
1658 snd_soc_component_init_regmap(comp, tx->regmap); in tx_macro_component_probe()
1661 tx->tx_hpf_work[i].tx = tx; in tx_macro_component_probe()
1662 tx->tx_hpf_work[i].decimator = i; in tx_macro_component_probe()
1663 INIT_DELAYED_WORK(&tx->tx_hpf_work[i].dwork, in tx_macro_component_probe()
1668 tx->tx_mute_dwork[i].tx = tx; in tx_macro_component_probe()
1669 tx->tx_mute_dwork[i].decimator = i; in tx_macro_component_probe()
1670 INIT_DELAYED_WORK(&tx->tx_mute_dwork[i].dwork, in tx_macro_component_probe()
1673 tx->component = comp; in tx_macro_component_probe()
1686 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_enable() local
1687 struct regmap *regmap = tx->regmap; in swclk_gate_enable()
1689 tx_macro_mclk_enable(tx, true); in swclk_gate_enable()
1690 if (tx->reset_swr) in swclk_gate_enable()
1698 if (tx->reset_swr) in swclk_gate_enable()
1701 tx->reset_swr = false; in swclk_gate_enable()
1708 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_disable() local
1709 struct regmap *regmap = tx->regmap; in swclk_gate_disable()
1714 tx_macro_mclk_enable(tx, false); in swclk_gate_disable()
1719 struct tx_macro *tx = to_tx_macro(hw); in swclk_gate_is_enabled() local
1722 regmap_read(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, &val); in swclk_gate_is_enabled()
1742 static struct clk *tx_macro_register_mclk_output(struct tx_macro *tx) in tx_macro_register_mclk_output() argument
1744 struct device *dev = tx->dev; in tx_macro_register_mclk_output()
1752 parent_clk_name = __clk_get_name(tx->clks[2].clk); in tx_macro_register_mclk_output()
1759 tx->hw.init = &init; in tx_macro_register_mclk_output()
1760 hw = &tx->hw; in tx_macro_register_mclk_output()
1761 ret = clk_hw_register(tx->dev, hw); in tx_macro_register_mclk_output()
1785 struct tx_macro *tx; in tx_macro_probe() local
1789 tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); in tx_macro_probe()
1790 if (!tx) in tx_macro_probe()
1793 tx->clks[0].id = "macro"; in tx_macro_probe()
1794 tx->clks[1].id = "dcodec"; in tx_macro_probe()
1795 tx->clks[2].id = "mclk"; in tx_macro_probe()
1796 tx->clks[3].id = "npl"; in tx_macro_probe()
1797 tx->clks[4].id = "fsgen"; in tx_macro_probe()
1799 ret = devm_clk_bulk_get_optional(dev, TX_NUM_CLKS_MAX, tx->clks); in tx_macro_probe()
1823 tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); in tx_macro_probe()
1825 dev_set_drvdata(dev, tx); in tx_macro_probe()
1827 tx->reset_swr = true; in tx_macro_probe()
1828 tx->dev = dev; in tx_macro_probe()
1831 clk_set_rate(tx->clks[2].clk, MCLK_FREQ); in tx_macro_probe()
1832 clk_set_rate(tx->clks[3].clk, 2 * MCLK_FREQ); in tx_macro_probe()
1834 ret = clk_bulk_prepare_enable(TX_NUM_CLKS_MAX, tx->clks); in tx_macro_probe()
1838 tx_macro_register_mclk_output(tx); in tx_macro_probe()
1847 clk_bulk_disable_unprepare(TX_NUM_CLKS_MAX, tx->clks); in tx_macro_probe()
1854 struct tx_macro *tx = dev_get_drvdata(&pdev->dev); in tx_macro_remove() local
1858 clk_bulk_disable_unprepare(TX_NUM_CLKS_MAX, tx->clks); in tx_macro_remove()