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()
571 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); \
575 twl4030->pin_name##_enabled = 1; \
579 twl4030->pin_name##_enabled = 0; \
708 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headset_ramp() local
709 struct twl4030_codec_data *pdata = twl4030->pdata; in headset_ramp()
718 twl4030->sysclk) + 1; in headset_ramp()
772 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headsetlpga_event() local
777 if (!twl4030->hsr_enabled) in headsetlpga_event()
780 twl4030->hsl_enabled = 1; in headsetlpga_event()
784 if (!twl4030->hsr_enabled) in headsetlpga_event()
787 twl4030->hsl_enabled = 0; in headsetlpga_event()
797 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in headsetrpga_event() local
802 if (!twl4030->hsl_enabled) in headsetrpga_event()
805 twl4030->hsr_enabled = 1; in headsetrpga_event()
809 if (!twl4030->hsl_enabled) in headsetrpga_event()
812 twl4030->hsr_enabled = 0; in headsetrpga_event()
822 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in digimic_event() local
823 struct twl4030_codec_data *pdata = twl4030->pdata; in digimic_event()
972 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in snd_soc_put_twl4030_opmode_enum_double() local
974 if (twl4030->configured) { in snd_soc_put_twl4030_opmode_enum_double()
1603 static void twl4030_constraints(struct twl4030_priv *twl4030, in twl4030_constraints() argument
1609 if (mst_substream == twl4030->master_substream) in twl4030_constraints()
1610 slv_substream = twl4030->slave_substream; in twl4030_constraints()
1611 else if (mst_substream == twl4030->slave_substream) in twl4030_constraints()
1612 slv_substream = twl4030->master_substream; in twl4030_constraints()
1619 twl4030->rate, in twl4030_constraints()
1620 twl4030->rate); in twl4030_constraints()
1624 twl4030->sample_bits, in twl4030_constraints()
1625 twl4030->sample_bits); in twl4030_constraints()
1629 twl4030->channels, in twl4030_constraints()
1630 twl4030->channels); in twl4030_constraints()
1659 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_startup() local
1661 if (twl4030->master_substream) { in twl4030_startup()
1662 twl4030->slave_substream = substream; in twl4030_startup()
1666 if (twl4030->configured) in twl4030_startup()
1667 twl4030_constraints(twl4030, twl4030->master_substream); in twl4030_startup()
1678 twl4030->master_substream = substream; in twl4030_startup()
1688 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_shutdown() local
1690 if (twl4030->master_substream == substream) in twl4030_shutdown()
1691 twl4030->master_substream = twl4030->slave_substream; in twl4030_shutdown()
1693 twl4030->slave_substream = NULL; in twl4030_shutdown()
1697 if (!twl4030->master_substream) in twl4030_shutdown()
1698 twl4030->configured = 0; in twl4030_shutdown()
1699 else if (!twl4030->master_substream->runtime->channels) in twl4030_shutdown()
1700 twl4030->configured = 0; in twl4030_shutdown()
1712 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_hw_params() local
1729 if (twl4030->configured) in twl4030_hw_params()
1793 if (twl4030->codec_powered) { in twl4030_hw_params()
1810 twl4030->configured = 1; in twl4030_hw_params()
1811 twl4030->rate = params_rate(params); in twl4030_hw_params()
1812 twl4030->sample_bits = hw_param_interval(params, in twl4030_hw_params()
1814 twl4030->channels = params_channels(params); in twl4030_hw_params()
1819 if (twl4030->slave_substream) in twl4030_hw_params()
1820 twl4030_constraints(twl4030, substream); in twl4030_hw_params()
1829 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_set_dai_sysclk() local
1841 if ((freq / 1000) != twl4030->sysclk) { in twl4030_set_dai_sysclk()
1844 freq, twl4030->sysclk * 1000); in twl4030_set_dai_sysclk()
1854 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_set_dai_fmt() local
1889 if (twl4030->codec_powered) { in twl4030_set_dai_fmt()
1944 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_startup() local
1950 if (twl4030->sysclk != 26000) { in twl4030_voice_startup()
1953 __func__, twl4030->sysclk); in twl4030_voice_startup()
1986 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_hw_params() local
2011 if (twl4030->codec_powered) { in twl4030_voice_hw_params()
2031 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_set_dai_sysclk() local
2039 if ((freq / 1000) != twl4030->sysclk) { in twl4030_voice_set_dai_sysclk()
2042 freq, twl4030->sysclk * 1000); in twl4030_voice_set_dai_sysclk()
2052 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_voice_set_dai_fmt() local
2084 if (twl4030->codec_powered) { in twl4030_voice_set_dai_fmt()
2173 struct twl4030_priv *twl4030; in twl4030_soc_probe() local
2175 twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2177 if (!twl4030) in twl4030_soc_probe()
2179 snd_soc_codec_set_drvdata(codec, twl4030); in twl4030_soc_probe()
2181 twl4030->sysclk = twl4030_audio_get_mclk() / 1000; in twl4030_soc_probe()
2190 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); in twl4030_soc_remove() local
2191 struct twl4030_codec_data *pdata = twl4030->pdata; in twl4030_soc_remove()