Lines Matching refs:twl4030

72 static void tw4030_init_ctl_cache(struct twl4030_priv *twl4030)  in tw4030_init_ctl_cache()  argument
79 twl4030->ctl_cache[i - TWL4030_REG_EAR_CTL] = byte; in tw4030_init_ctl_cache()
85 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_read() local
98 value = twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL]; in twl4030_read()
108 static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030, in twl4030_can_write_to_chip() argument
116 if (twl4030->earpiece_enabled) in twl4030_can_write_to_chip()
120 if (twl4030->predrivel_enabled) in twl4030_can_write_to_chip()
124 if (twl4030->predriver_enabled) in twl4030_can_write_to_chip()
128 if (twl4030->carkitl_enabled) in twl4030_can_write_to_chip()
132 if (twl4030->carkitr_enabled) in twl4030_can_write_to_chip()
136 if (twl4030->hsl_enabled || twl4030->hsr_enabled) in twl4030_can_write_to_chip()
151 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_write() local
161 twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL] = value; in twl4030_write()
167 if (twl4030_can_write_to_chip(twl4030, reg)) in twl4030_write()
185 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_codec_enable() local
188 if (enable == twl4030->codec_powered) in twl4030_codec_enable()
197 twl4030->codec_powered = enable; in twl4030_codec_enable()
248 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_init_chip() local
284 tw4030_init_ctl_cache(twl4030); in twl4030_init_chip()
302 twl4030->board_params = board_params; in twl4030_init_chip()
339 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_apll_enable() local
342 twl4030->apll_enabled++; in twl4030_apll_enable()
343 if (twl4030->apll_enabled == 1) in twl4030_apll_enable()
347 twl4030->apll_enabled--; in twl4030_apll_enable()
348 if (!twl4030->apll_enabled) in twl4030_apll_enable()
563 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
567 twl4030->pin_name##_enabled = 1; \
571 twl4030->pin_name##_enabled = 0; \
700 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headset_ramp() local
701 struct twl4030_board_params *board_params = twl4030->board_params; in headset_ramp()
712 twl4030->sysclk) + 1; in headset_ramp()
766 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event() local
771 if (!twl4030->hsr_enabled) in headsetlpga_event()
774 twl4030->hsl_enabled = 1; in headsetlpga_event()
778 if (!twl4030->hsr_enabled) in headsetlpga_event()
781 twl4030->hsl_enabled = 0; in headsetlpga_event()
791 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event() local
796 if (!twl4030->hsl_enabled) in headsetrpga_event()
799 twl4030->hsr_enabled = 1; in headsetrpga_event()
803 if (!twl4030->hsl_enabled) in headsetrpga_event()
806 twl4030->hsr_enabled = 0; in headsetrpga_event()
816 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event() local
817 struct twl4030_board_params *board_params = twl4030->board_params; in digimic_event()
966 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double() local
968 if (twl4030->configured) { in snd_soc_put_twl4030_opmode_enum_double()
1596 static void twl4030_constraints(struct twl4030_priv *twl4030, in twl4030_constraints() argument
1602 if (mst_substream == twl4030->master_substream) in twl4030_constraints()
1603 slv_substream = twl4030->slave_substream; in twl4030_constraints()
1604 else if (mst_substream == twl4030->slave_substream) in twl4030_constraints()
1605 slv_substream = twl4030->master_substream; in twl4030_constraints()
1612 twl4030->rate); in twl4030_constraints()
1616 twl4030->sample_bits); in twl4030_constraints()
1620 twl4030->channels); in twl4030_constraints()
1649 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup() local
1651 if (twl4030->master_substream) { in twl4030_startup()
1652 twl4030->slave_substream = substream; in twl4030_startup()
1656 if (twl4030->configured) in twl4030_startup()
1657 twl4030_constraints(twl4030, twl4030->master_substream); in twl4030_startup()
1668 twl4030->master_substream = substream; in twl4030_startup()
1678 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown() local
1680 if (twl4030->master_substream == substream) in twl4030_shutdown()
1681 twl4030->master_substream = twl4030->slave_substream; in twl4030_shutdown()
1683 twl4030->slave_substream = NULL; in twl4030_shutdown()
1687 if (!twl4030->master_substream) in twl4030_shutdown()
1688 twl4030->configured = 0; in twl4030_shutdown()
1689 else if (!twl4030->master_substream->runtime->channels) in twl4030_shutdown()
1690 twl4030->configured = 0; in twl4030_shutdown()
1702 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params() local
1719 if (twl4030->configured) in twl4030_hw_params()
1783 if (twl4030->codec_powered) { in twl4030_hw_params()
1800 twl4030->configured = 1; in twl4030_hw_params()
1801 twl4030->rate = params_rate(params); in twl4030_hw_params()
1802 twl4030->sample_bits = hw_param_interval(params, in twl4030_hw_params()
1804 twl4030->channels = params_channels(params); in twl4030_hw_params()
1809 if (twl4030->slave_substream) in twl4030_hw_params()
1810 twl4030_constraints(twl4030, substream); in twl4030_hw_params()
1819 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk() local
1831 if ((freq / 1000) != twl4030->sysclk) { in twl4030_set_dai_sysclk()
1834 freq, twl4030->sysclk * 1000); in twl4030_set_dai_sysclk()
1844 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt() local
1878 if (twl4030->codec_powered) { in twl4030_set_dai_fmt()
1933 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup() local
1939 if (twl4030->sysclk != 26000) { in twl4030_voice_startup()
1942 __func__, twl4030->sysclk); in twl4030_voice_startup()
1975 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params() local
2000 if (twl4030->codec_powered) { in twl4030_voice_hw_params()
2020 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk() local
2028 if ((freq / 1000) != twl4030->sysclk) { in twl4030_voice_set_dai_sysclk()
2031 freq, twl4030->sysclk * 1000); in twl4030_voice_set_dai_sysclk()
2041 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt() local
2072 if (twl4030->codec_powered) { in twl4030_voice_set_dai_fmt()
2161 struct twl4030_priv *twl4030; in twl4030_soc_probe() local
2163 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2165 if (!twl4030) in twl4030_soc_probe()
2167 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2169 twl4030->sysclk = twl4030_audio_get_mclk() / 1000; in twl4030_soc_probe()
2178 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove() local
2179 struct twl4030_board_params *board_params = twl4030->board_params; in twl4030_soc_remove()