Lines Matching defs:twl4030
39 #include "twl4030.h"
42 * twl4030 register cache & default register settings
152 * read twl4030 register cache
166 * write twl4030 register cache
179 * write to the twl4030 register space
184 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
192 if (twl4030->earpiece_enabled)
196 if (twl4030->predrivel_enabled)
200 if (twl4030->predriver_enabled)
204 if (twl4030->carkitl_enabled)
208 if (twl4030->carkitr_enabled)
212 if (twl4030->hsl_enabled || twl4030->hsr_enabled)
229 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
232 if (enable == twl4030->codec_powered)
242 twl4030->codec_powered = enable;
285 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
318 twl4030->digimic_delay = setup->digimic_delay;
321 if (setup->sysclk != twl4030->sysclk)
324 setup->sysclk, twl4030->sysclk);
358 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
362 twl4030->apll_enabled++;
363 if (twl4030->apll_enabled == 1)
367 twl4030->apll_enabled--;
368 if (!twl4030->apll_enabled)
592 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); \
596 twl4030->pin_name##_enabled = 1; \
601 twl4030->pin_name##_enabled = 0; \
725 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
756 twl4030->sysclk) + 1);
764 twl4030->sysclk) + 1);
788 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
793 if (!twl4030->hsr_enabled)
796 twl4030->hsl_enabled = 1;
800 if (!twl4030->hsr_enabled)
803 twl4030->hsl_enabled = 0;
812 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
817 if (!twl4030->hsl_enabled)
820 twl4030->hsr_enabled = 1;
824 if (!twl4030->hsl_enabled)
827 twl4030->hsr_enabled = 0;
836 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec);
838 if (twl4030->digimic_delay)
839 mdelay(twl4030->digimic_delay);
1014 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1019 if (twl4030->configured) {
1020 printk(KERN_ERR "twl4030 operation mode cannot be "
1654 static void twl4030_constraints(struct twl4030_priv *twl4030,
1660 if (mst_substream == twl4030->master_substream)
1661 slv_substream = twl4030->slave_substream;
1662 else if (mst_substream == twl4030->slave_substream)
1663 slv_substream = twl4030->master_substream;
1670 twl4030->rate,
1671 twl4030->rate);
1675 twl4030->sample_bits,
1676 twl4030->sample_bits);
1680 twl4030->channels,
1681 twl4030->channels);
1712 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1714 if (twl4030->master_substream) {
1715 twl4030->slave_substream = substream;
1719 if (twl4030->configured)
1720 twl4030_constraints(twl4030, twl4030->master_substream);
1731 twl4030->master_substream = substream;
1743 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1745 if (twl4030->master_substream == substream)
1746 twl4030->master_substream = twl4030->slave_substream;
1748 twl4030->slave_substream = NULL;
1752 if (!twl4030->master_substream)
1753 twl4030->configured = 0;
1754 else if (!twl4030->master_substream->runtime->channels)
1755 twl4030->configured = 0;
1769 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1786 if (twl4030->configured)
1850 if (twl4030->codec_powered) {
1867 twl4030->configured = 1;
1868 twl4030->rate = params_rate(params);
1869 twl4030->sample_bits = hw_param_interval(params,
1871 twl4030->channels = params_channels(params);
1876 if (twl4030->slave_substream)
1877 twl4030_constraints(twl4030, substream);
1886 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1898 if ((freq / 1000) != twl4030->sysclk) {
1901 freq, twl4030->sysclk * 1000);
1912 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
1947 if (twl4030->codec_powered) {
2004 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2010 if (twl4030->sysclk != 26000) {
2013 twl4030->sysclk * 1000);
2049 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2074 if (twl4030->codec_powered) {
2094 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2101 if ((freq / 1000) != twl4030->sysclk) {
2104 freq, twl4030->sysclk * 1000);
2114 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
2146 if (twl4030->codec_powered) {
2198 .name = "twl4030",
2214 .name = "twl4030 Voice",
2298 struct twl4030_priv *twl4030;
2306 twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL);
2307 if (twl4030 == NULL) {
2312 codec = &twl4030->codec;
2313 snd_soc_codec_set_drvdata(codec, twl4030);
2322 codec->name = "twl4030";
2338 platform_set_drvdata(pdev, twl4030);
2342 twl4030->sysclk = twl4030_codec_get_mclk() / 1000;
2364 kfree(twl4030);
2370 struct twl4030_priv *twl4030 = platform_get_drvdata(pdev);
2373 snd_soc_unregister_codec(&twl4030->codec);
2374 kfree(twl4030->codec.reg_cache);
2375 kfree(twl4030);