Lines Matching refs:twl4030

78 static void tw4030_init_ctl_cache(struct twl4030_priv *twl4030)  in tw4030_init_ctl_cache()  argument
85 twl4030->ctl_cache[i - TWL4030_REG_EAR_CTL] = byte; in tw4030_init_ctl_cache()
91 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_read() local
104 value = twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL]; in twl4030_read()
114 static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030, in twl4030_can_write_to_chip() argument
122 if (twl4030->earpiece_enabled) in twl4030_can_write_to_chip()
126 if (twl4030->predrivel_enabled) in twl4030_can_write_to_chip()
130 if (twl4030->predriver_enabled) in twl4030_can_write_to_chip()
134 if (twl4030->carkitl_enabled) in twl4030_can_write_to_chip()
138 if (twl4030->carkitr_enabled) in twl4030_can_write_to_chip()
142 if (twl4030->hsl_enabled || twl4030->hsr_enabled) in twl4030_can_write_to_chip()
157 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_write() local
167 twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL] = value; in twl4030_write()
173 if (twl4030_can_write_to_chip(twl4030, reg)) in twl4030_write()
191 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_codec_enable() local
194 if (enable == twl4030->codec_powered) in twl4030_codec_enable()
203 twl4030->codec_powered = enable; in twl4030_codec_enable()
255 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_init_chip() local
291 tw4030_init_ctl_cache(twl4030); in twl4030_init_chip()
309 twl4030->pdata = pdata; in twl4030_init_chip()
346 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_apll_enable() local
349 twl4030->apll_enabled++; in twl4030_apll_enable()
350 if (twl4030->apll_enabled == 1) in twl4030_apll_enable()
354 twl4030->apll_enabled--; in twl4030_apll_enable()
355 if (!twl4030->apll_enabled) in twl4030_apll_enable()
570 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); \
574 twl4030->pin_name##_enabled = 1; \
578 twl4030->pin_name##_enabled = 0; \
707 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headset_ramp() local
708 struct twl4030_codec_data *pdata = twl4030->pdata; in headset_ramp()
717 twl4030->sysclk) + 1; in headset_ramp()
771 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headsetlpga_event() local
776 if (!twl4030->hsr_enabled) in headsetlpga_event()
779 twl4030->hsl_enabled = 1; in headsetlpga_event()
783 if (!twl4030->hsr_enabled) in headsetlpga_event()
786 twl4030->hsl_enabled = 0; in headsetlpga_event()
796 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headsetrpga_event() local
801 if (!twl4030->hsl_enabled) in headsetrpga_event()
804 twl4030->hsr_enabled = 1; in headsetrpga_event()
808 if (!twl4030->hsl_enabled) in headsetrpga_event()
811 twl4030->hsr_enabled = 0; in headsetrpga_event()
821 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in digimic_event() local
822 struct twl4030_codec_data *pdata = twl4030->pdata; in digimic_event()
971 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in snd_soc_put_twl4030_opmode_enum_double() local
973 if (twl4030->configured) { in snd_soc_put_twl4030_opmode_enum_double()
1601 static void twl4030_constraints(struct twl4030_priv *twl4030, in twl4030_constraints() argument
1607 if (mst_substream == twl4030->master_substream) in twl4030_constraints()
1608 slv_substream = twl4030->slave_substream; in twl4030_constraints()
1609 else if (mst_substream == twl4030->slave_substream) in twl4030_constraints()
1610 slv_substream = twl4030->master_substream; in twl4030_constraints()
1617 twl4030->rate); in twl4030_constraints()
1621 twl4030->sample_bits); in twl4030_constraints()
1625 twl4030->channels); in twl4030_constraints()
1654 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_startup() local
1656 if (twl4030->master_substream) { in twl4030_startup()
1657 twl4030->slave_substream = substream; in twl4030_startup()
1661 if (twl4030->configured) in twl4030_startup()
1662 twl4030_constraints(twl4030, twl4030->master_substream); in twl4030_startup()
1673 twl4030->master_substream = substream; in twl4030_startup()
1683 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_shutdown() local
1685 if (twl4030->master_substream == substream) in twl4030_shutdown()
1686 twl4030->master_substream = twl4030->slave_substream; in twl4030_shutdown()
1688 twl4030->slave_substream = NULL; in twl4030_shutdown()
1692 if (!twl4030->master_substream) in twl4030_shutdown()
1693 twl4030->configured = 0; in twl4030_shutdown()
1694 else if (!twl4030->master_substream->runtime->channels) in twl4030_shutdown()
1695 twl4030->configured = 0; in twl4030_shutdown()
1707 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_hw_params() local
1724 if (twl4030->configured) in twl4030_hw_params()
1788 if (twl4030->codec_powered) { in twl4030_hw_params()
1805 twl4030->configured = 1; in twl4030_hw_params()
1806 twl4030->rate = params_rate(params); in twl4030_hw_params()
1807 twl4030->sample_bits = hw_param_interval(params, in twl4030_hw_params()
1809 twl4030->channels = params_channels(params); in twl4030_hw_params()
1814 if (twl4030->slave_substream) in twl4030_hw_params()
1815 twl4030_constraints(twl4030, substream); in twl4030_hw_params()
1824 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_set_dai_sysclk() local
1836 if ((freq / 1000) != twl4030->sysclk) { in twl4030_set_dai_sysclk()
1839 freq, twl4030->sysclk * 1000); in twl4030_set_dai_sysclk()
1849 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_set_dai_fmt() local
1884 if (twl4030->codec_powered) { in twl4030_set_dai_fmt()
1939 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_startup() local
1945 if (twl4030->sysclk != 26000) { in twl4030_voice_startup()
1948 __func__, twl4030->sysclk); in twl4030_voice_startup()
1981 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_hw_params() local
2006 if (twl4030->codec_powered) { in twl4030_voice_hw_params()
2026 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_set_dai_sysclk() local
2034 if ((freq / 1000) != twl4030->sysclk) { in twl4030_voice_set_dai_sysclk()
2037 freq, twl4030->sysclk * 1000); in twl4030_voice_set_dai_sysclk()
2047 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_set_dai_fmt() local
2079 if (twl4030->codec_powered) { in twl4030_voice_set_dai_fmt()
2168 struct twl4030_priv *twl4030; in twl4030_soc_probe() local
2170 twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2172 if (!twl4030) in twl4030_soc_probe()
2174 snd_soc_codec_set_drvdata(codec, twl4030); in twl4030_soc_probe()
2176 twl4030->sysclk = twl4030_audio_get_mclk() / 1000; in twl4030_soc_probe()
2185 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_soc_remove() local
2186 struct twl4030_codec_data *pdata = twl4030->pdata; in twl4030_soc_remove()