Lines Matching defs:twl4030
28 #include <linux/mfd/twl4030-audio.h>
72 static void tw4030_init_ctl_cache(struct twl4030_priv *twl4030)
79 twl4030->ctl_cache[i - TWL4030_REG_EAR_CTL] = byte;
85 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
98 value = twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL];
108 static bool twl4030_can_write_to_chip(struct twl4030_priv *twl4030,
116 if (twl4030->earpiece_enabled)
120 if (twl4030->predrivel_enabled)
124 if (twl4030->predriver_enabled)
128 if (twl4030->carkitl_enabled)
132 if (twl4030->carkitr_enabled)
136 if (twl4030->hsl_enabled || twl4030->hsr_enabled)
151 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
161 twl4030->ctl_cache[reg - TWL4030_REG_EAR_CTL] = value;
167 if (twl4030_can_write_to_chip(twl4030, reg))
185 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
188 if (enable == twl4030->codec_powered)
197 twl4030->codec_powered = enable;
248 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
284 tw4030_init_ctl_cache(twl4030);
302 twl4030->board_params = board_params;
339 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
342 twl4030->apll_enabled++;
343 if (twl4030->apll_enabled == 1)
347 twl4030->apll_enabled--;
348 if (!twl4030->apll_enabled)
563 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
567 twl4030->pin_name##_enabled = 1; \
571 twl4030->pin_name##_enabled = 0; \
700 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
701 struct twl4030_board_params *board_params = twl4030->board_params;
712 twl4030->sysclk) + 1;
766 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
771 if (!twl4030->hsr_enabled)
774 twl4030->hsl_enabled = 1;
778 if (!twl4030->hsr_enabled)
781 twl4030->hsl_enabled = 0;
791 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
796 if (!twl4030->hsl_enabled)
799 twl4030->hsr_enabled = 1;
803 if (!twl4030->hsl_enabled)
806 twl4030->hsr_enabled = 0;
816 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
817 struct twl4030_board_params *board_params = twl4030->board_params;
966 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
968 if (twl4030->configured) {
1596 static void twl4030_constraints(struct twl4030_priv *twl4030,
1602 if (mst_substream == twl4030->master_substream)
1603 slv_substream = twl4030->slave_substream;
1604 else if (mst_substream == twl4030->slave_substream)
1605 slv_substream = twl4030->master_substream;
1612 twl4030->rate);
1616 twl4030->sample_bits);
1620 twl4030->channels);
1649 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1651 if (twl4030->master_substream) {
1652 twl4030->slave_substream = substream;
1656 if (twl4030->configured)
1657 twl4030_constraints(twl4030, twl4030->master_substream);
1668 twl4030->master_substream = substream;
1678 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1680 if (twl4030->master_substream == substream)
1681 twl4030->master_substream = twl4030->slave_substream;
1683 twl4030->slave_substream = NULL;
1687 if (!twl4030->master_substream)
1688 twl4030->configured = 0;
1689 else if (!twl4030->master_substream->runtime->channels)
1690 twl4030->configured = 0;
1702 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1719 if (twl4030->configured)
1783 if (twl4030->codec_powered) {
1800 twl4030->configured = 1;
1801 twl4030->rate = params_rate(params);
1802 twl4030->sample_bits = hw_param_interval(params,
1804 twl4030->channels = params_channels(params);
1809 if (twl4030->slave_substream)
1810 twl4030_constraints(twl4030, substream);
1819 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1831 if ((freq / 1000) != twl4030->sysclk) {
1834 freq, twl4030->sysclk * 1000);
1844 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1878 if (twl4030->codec_powered) {
1933 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
1939 if (twl4030->sysclk != 26000) {
1942 __func__, twl4030->sysclk);
1975 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2000 if (twl4030->codec_powered) {
2020 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2028 if ((freq / 1000) != twl4030->sysclk) {
2031 freq, twl4030->sysclk * 1000);
2041 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2072 if (twl4030->codec_powered) {
2124 .name = "twl4030-hifi",
2142 .name = "twl4030-voice",
2161 struct twl4030_priv *twl4030;
2163 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv),
2165 if (!twl4030)
2167 snd_soc_component_set_drvdata(component, twl4030);
2169 twl4030->sysclk = twl4030_audio_get_mclk() / 1000;
2178 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component);
2179 struct twl4030_board_params *board_params = twl4030->board_params;
2209 MODULE_ALIAS("platform:twl4030-codec");
2214 .name = "twl4030-codec",