Lines Matching defs:twl4030

28 #include <linux/mfd/twl4030-audio.h>
64 static void tw4030_init_ctl_cache(struct twl4030_priv *twl4030)
71 twl4030->ctl_cache[i - TWL4030_REG_EAR_CTL] = byte;
77 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
90 value = twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL];
100 static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030,
108 if (twl4030->earpiece_enabled)
112 if (twl4030->predrivel_enabled)
116 if (twl4030->predriver_enabled)
120 if (twl4030->carkitl_enabled)
124 if (twl4030->carkitr_enabled)
128 if (twl4030->hsl_enabled || twl4030->hsr_enabled)
143 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
153 twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL] = value;
159 if (twl4030_can_write_to_chip(twl4030, reg))
177 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
180 if (enable == twl4030->codec_powered)
189 twl4030->codec_powered = enable;
242 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
278 tw4030_init_ctl_cache(twl4030);
296 twl4030->pdata = pdata;
333 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
336 twl4030->apll_enabled++;
337 if (twl4030->apll_enabled == 1)
341 twl4030->apll_enabled--;
342 if (!twl4030->apll_enabled)
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);
695 struct twl4030_codec_data *pdata = twl4030->pdata;
704 twl4030->sysclk) + 1;
758 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
763 if (!twl4030->hsr_enabled)
766 twl4030->hsl_enabled = 1;
770 if (!twl4030->hsr_enabled)
773 twl4030->hsl_enabled = 0;
783 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
788 if (!twl4030->hsl_enabled)
791 twl4030->hsr_enabled = 1;
795 if (!twl4030->hsl_enabled)
798 twl4030->hsr_enabled = 0;
808 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
809 struct twl4030_codec_data *pdata = twl4030->pdata;
958 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
960 if (twl4030->configured) {
1588 static void twl4030_constraints(struct twl4030_priv *twl4030,
1594 if (mst_substream == twl4030->master_substream)
1595 slv_substream = twl4030->slave_substream;
1596 else if (mst_substream == twl4030->slave_substream)
1597 slv_substream = twl4030->master_substream;
1604 twl4030->rate);
1608 twl4030->sample_bits);
1612 twl4030->channels);
1641 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1643 if (twl4030->master_substream) {
1644 twl4030->slave_substream = substream;
1648 if (twl4030->configured)
1649 twl4030_constraints(twl4030, twl4030->master_substream);
1660 twl4030->master_substream = substream;
1670 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1672 if (twl4030->master_substream == substream)
1673 twl4030->master_substream = twl4030->slave_substream;
1675 twl4030->slave_substream = NULL;
1679 if (!twl4030->master_substream)
1680 twl4030->configured = 0;
1681 else if (!twl4030->master_substream->runtime->channels)
1682 twl4030->configured = 0;
1694 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1711 if (twl4030->configured)
1775 if (twl4030->codec_powered) {
1792 twl4030->configured = 1;
1793 twl4030->rate = params_rate(params);
1794 twl4030->sample_bits = hw_param_interval(params,
1796 twl4030->channels = params_channels(params);
1801 if (twl4030->slave_substream)
1802 twl4030_constraints(twl4030, substream);
1811 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1823 if ((freq / 1000) != twl4030->sysclk) {
1826 freq, twl4030->sysclk * 1000);
1836 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1871 if (twl4030->codec_powered) {
1926 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1932 if (twl4030->sysclk != 26000) {
1935 __func__, twl4030->sysclk);
1968 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1993 if (twl4030->codec_powered) {
2013 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2021 if ((freq / 1000) != twl4030->sysclk) {
2024 freq, twl4030->sysclk * 1000);
2034 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2066 if (twl4030->codec_powered) {
2118 .name = "twl4030-hifi",
2136 .name = "twl4030-voice",
2155 struct twl4030_priv *twl4030;
2157 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv),
2159 if (!twl4030)
2161 snd_soc_component_set_drvdata(component, twl4030);
2163 twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
2172 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2173 struct twl4030_codec_data *pdata = twl4030->pdata;
2203 MODULE_ALIAS("platform:twl4030-codec");
2208 .name = "twl4030-codec",