Lines Matching refs:twl4030
64 static void tw4030_init_ctl_cache(struct twl4030_priv *twl4030) in tw4030_init_ctl_cache() argument
71 twl4030->ctl_cache[i - TWL4030_REG_EAR_CTL] = byte; in tw4030_init_ctl_cache()
77 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_read() local
90 value = twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL]; in twl4030_read()
100 static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030, in twl4030_can_write_to_chip() argument
108 if (twl4030->earpiece_enabled) in twl4030_can_write_to_chip()
112 if (twl4030->predrivel_enabled) in twl4030_can_write_to_chip()
116 if (twl4030->predriver_enabled) in twl4030_can_write_to_chip()
120 if (twl4030->carkitl_enabled) in twl4030_can_write_to_chip()
124 if (twl4030->carkitr_enabled) in twl4030_can_write_to_chip()
128 if (twl4030->hsl_enabled || twl4030->hsr_enabled) in twl4030_can_write_to_chip()
143 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_write() local
153 twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL] = value; in twl4030_write()
159 if (twl4030_can_write_to_chip(twl4030, reg)) in twl4030_write()
177 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_codec_enable() local
180 if (enable == twl4030->codec_powered) in twl4030_codec_enable()
189 twl4030->codec_powered = enable; in twl4030_codec_enable()
242 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_init_chip() local
278 tw4030_init_ctl_cache(twl4030); in twl4030_init_chip()
296 twl4030->pdata = pdata; in twl4030_init_chip()
333 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_apll_enable() local
336 twl4030->apll_enabled++; in twl4030_apll_enable()
337 if (twl4030->apll_enabled == 1) in twl4030_apll_enable()
341 twl4030->apll_enabled--; in twl4030_apll_enable()
342 if (!twl4030->apll_enabled) in twl4030_apll_enable()
557 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
561 twl4030->pin_name##_enabled = 1; \
565 twl4030->pin_name##_enabled = 0; \
694 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headset_ramp() local
695 struct twl4030_codec_data *pdata = twl4030->pdata; in headset_ramp()
704 twl4030->sysclk) + 1; in headset_ramp()
758 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event() local
763 if (!twl4030->hsr_enabled) in headsetlpga_event()
766 twl4030->hsl_enabled = 1; in headsetlpga_event()
770 if (!twl4030->hsr_enabled) in headsetlpga_event()
773 twl4030->hsl_enabled = 0; in headsetlpga_event()
783 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event() local
788 if (!twl4030->hsl_enabled) in headsetrpga_event()
791 twl4030->hsr_enabled = 1; in headsetrpga_event()
795 if (!twl4030->hsl_enabled) in headsetrpga_event()
798 twl4030->hsr_enabled = 0; in headsetrpga_event()
808 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event() local
809 struct twl4030_codec_data *pdata = twl4030->pdata; in digimic_event()
958 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double() local
960 if (twl4030->configured) { in snd_soc_put_twl4030_opmode_enum_double()
1588 static void twl4030_constraints(struct twl4030_priv *twl4030, in twl4030_constraints() argument
1594 if (mst_substream == twl4030->master_substream) in twl4030_constraints()
1595 slv_substream = twl4030->slave_substream; in twl4030_constraints()
1596 else if (mst_substream == twl4030->slave_substream) in twl4030_constraints()
1597 slv_substream = twl4030->master_substream; in twl4030_constraints()
1604 twl4030->rate); in twl4030_constraints()
1608 twl4030->sample_bits); in twl4030_constraints()
1612 twl4030->channels); in twl4030_constraints()
1641 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup() local
1643 if (twl4030->master_substream) { in twl4030_startup()
1644 twl4030->slave_substream = substream; in twl4030_startup()
1648 if (twl4030->configured) in twl4030_startup()
1649 twl4030_constraints(twl4030, twl4030->master_substream); in twl4030_startup()
1660 twl4030->master_substream = substream; in twl4030_startup()
1670 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown() local
1672 if (twl4030->master_substream == substream) in twl4030_shutdown()
1673 twl4030->master_substream = twl4030->slave_substream; in twl4030_shutdown()
1675 twl4030->slave_substream = NULL; in twl4030_shutdown()
1679 if (!twl4030->master_substream) in twl4030_shutdown()
1680 twl4030->configured = 0; in twl4030_shutdown()
1681 else if (!twl4030->master_substream->runtime->channels) in twl4030_shutdown()
1682 twl4030->configured = 0; in twl4030_shutdown()
1694 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params() local
1711 if (twl4030->configured) in twl4030_hw_params()
1775 if (twl4030->codec_powered) { in twl4030_hw_params()
1792 twl4030->configured = 1; in twl4030_hw_params()
1793 twl4030->rate = params_rate(params); in twl4030_hw_params()
1794 twl4030->sample_bits = hw_param_interval(params, in twl4030_hw_params()
1796 twl4030->channels = params_channels(params); in twl4030_hw_params()
1801 if (twl4030->slave_substream) in twl4030_hw_params()
1802 twl4030_constraints(twl4030, substream); in twl4030_hw_params()
1811 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk() local
1823 if ((freq / 1000) != twl4030->sysclk) { in twl4030_set_dai_sysclk()
1826 freq, twl4030->sysclk * 1000); in twl4030_set_dai_sysclk()
1836 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt() local
1871 if (twl4030->codec_powered) { in twl4030_set_dai_fmt()
1926 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup() local
1932 if (twl4030->sysclk != 26000) { in twl4030_voice_startup()
1935 __func__, twl4030->sysclk); in twl4030_voice_startup()
1968 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params() local
1993 if (twl4030->codec_powered) { in twl4030_voice_hw_params()
2013 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk() local
2021 if ((freq / 1000) != twl4030->sysclk) { in twl4030_voice_set_dai_sysclk()
2024 freq, twl4030->sysclk * 1000); in twl4030_voice_set_dai_sysclk()
2034 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt() local
2066 if (twl4030->codec_powered) { in twl4030_voice_set_dai_fmt()
2155 struct twl4030_priv *twl4030; in twl4030_soc_probe() local
2157 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2159 if (!twl4030) in twl4030_soc_probe()
2161 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2163 twl4030->sysclk = twl4030_audio_get_mclk() / 1000; in twl4030_soc_probe()
2172 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove() local
2173 struct twl4030_codec_data *pdata = twl4030->pdata; in twl4030_soc_remove()