Lines Matching refs:component

89 static unsigned int twl4030_read(struct snd_soc_component *component, unsigned int reg)  in twl4030_read()  argument
91 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_read()
154 static int twl4030_write(struct snd_soc_component *component, unsigned int reg, in twl4030_write() argument
157 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_write()
189 static void twl4030_codec_enable(struct snd_soc_component *component, int enable) in twl4030_codec_enable() argument
191 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_codec_enable()
230 static struct twl4030_codec_data *twl4030_get_pdata(struct snd_soc_component *component) in twl4030_get_pdata() argument
232 struct twl4030_codec_data *pdata = dev_get_platdata(component->dev); in twl4030_get_pdata()
235 twl4030_codec_node = of_get_child_by_name(component->dev->parent->of_node, in twl4030_get_pdata()
239 pdata = devm_kzalloc(component->dev, in twl4030_get_pdata()
253 static void twl4030_init_chip(struct snd_soc_component *component) in twl4030_init_chip() argument
256 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_init_chip()
260 pdata = twl4030_get_pdata(component); in twl4030_init_chip()
267 dev_warn(component->dev, in twl4030_init_chip()
274 dev_err(component->dev, in twl4030_init_chip()
295 reg = twl4030_read(component, TWL4030_REG_MISC_SET_1); in twl4030_init_chip()
296 twl4030_write(component, TWL4030_REG_MISC_SET_1, in twl4030_init_chip()
299 twl4030_write(component, TWL4030_REG_OPTION, in twl4030_init_chip()
304 twl4030_write(component, TWL4030_REG_ARXR2_APGA_CTL, 0x32); in twl4030_init_chip()
312 reg = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in twl4030_init_chip()
315 twl4030_write(component, TWL4030_REG_HS_POPN_SET, reg); in twl4030_init_chip()
318 twl4030_codec_enable(component, 1); in twl4030_init_chip()
320 reg = twl4030_read(component, TWL4030_REG_ANAMICL); in twl4030_init_chip()
323 twl4030_write(component, TWL4030_REG_ANAMICL, in twl4030_init_chip()
342 twl4030_codec_enable(component, 0); in twl4030_init_chip()
345 static void twl4030_apll_enable(struct snd_soc_component *component, int enable) in twl4030_apll_enable() argument
347 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_apll_enable()
570 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); \
571 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
576 twl4030_write(component, reg, twl4030_read(component, reg)); \
592 static void handsfree_ramp(struct snd_soc_component *component, int reg, int ramp) in handsfree_ramp() argument
596 hs_ctl = twl4030_read(component, reg); in handsfree_ramp()
601 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
604 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
608 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
613 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
615 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
618 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
625 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreelpga_event() local
629 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 1); in handsfreelpga_event()
632 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 0); in handsfreelpga_event()
641 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreerpga_event() local
645 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 1); in handsfreerpga_event()
648 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 0); in handsfreerpga_event()
657 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vibramux_event() local
659 twl4030_write(component, TWL4030_REG_VIBRA_SET, 0xff); in vibramux_event()
666 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in apll_event() local
670 twl4030_apll_enable(component, 1); in apll_event()
673 twl4030_apll_enable(component, 0); in apll_event()
682 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif_event() local
685 audio_if = twl4030_read(component, TWL4030_REG_AUDIO_IF); in aif_event()
690 twl4030_apll_enable(component, 1); in aif_event()
692 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
697 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
699 twl4030_apll_enable(component, 0); in aif_event()
705 static void headset_ramp(struct snd_soc_component *component, int ramp) in headset_ramp() argument
708 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headset_ramp()
715 hs_gain = twl4030_read(component, TWL4030_REG_HS_GAIN_SET); in headset_ramp()
716 hs_pop = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in headset_ramp()
727 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
734 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
739 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
746 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
754 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
763 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
771 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetlpga_event() local
772 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event()
778 headset_ramp(component, 1); in headsetlpga_event()
785 headset_ramp(component, 0); in headsetlpga_event()
796 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetrpga_event() local
797 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event()
803 headset_ramp(component, 1); in headsetrpga_event()
810 headset_ramp(component, 0); in headsetrpga_event()
821 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in digimic_event() local
822 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event()
845 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_twl4030() local
853 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_twl4030()
860 (twl4030_read(component, reg) >> rshift) & mask; in snd_soc_get_volsw_twl4030()
874 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_twl4030() local
895 return snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_twl4030()
903 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_r2_twl4030() local
911 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
913 (twl4030_read(component, reg2) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
930 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_r2_twl4030() local
951 err = snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_r2_twl4030()
955 err = snd_soc_component_update_bits(component, reg2, val_mask, val2); in snd_soc_put_volsw_r2_twl4030()
971 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_twl4030_opmode_enum_double() local
972 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double()
975 dev_err(component->dev, in snd_soc_put_twl4030_opmode_enum_double()
1582 static int twl4030_set_bias_level(struct snd_soc_component *component, in twl4030_set_bias_level() argument
1591 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) in twl4030_set_bias_level()
1592 twl4030_codec_enable(component, 1); in twl4030_set_bias_level()
1595 twl4030_codec_enable(component, 0); in twl4030_set_bias_level()
1631 static void twl4030_tdm_enable(struct snd_soc_component *component, int direction, in twl4030_tdm_enable() argument
1636 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_tdm_enable()
1648 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_tdm_enable()
1654 struct snd_soc_component *component = dai->component; in twl4030_startup() local
1655 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup()
1665 if (!(twl4030_read(component, TWL4030_REG_CODEC_MODE) & in twl4030_startup()
1683 struct snd_soc_component *component = dai->component; in twl4030_shutdown() local
1684 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown()
1700 twl4030_tdm_enable(component, substream->stream, 0); in twl4030_shutdown()
1707 struct snd_soc_component *component = dai->component; in twl4030_hw_params() local
1708 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params()
1713 format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1714 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE); in twl4030_hw_params()
1720 twl4030_tdm_enable(component, substream->stream, 1); in twl4030_hw_params()
1730 old_mode = twl4030_read(component, in twl4030_hw_params()
1766 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_hw_params()
1772 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1783 dev_err(component->dev, "%s: unsupported bits/sample %d\n", in twl4030_hw_params()
1794 twl4030_codec_enable(component, 0); in twl4030_hw_params()
1795 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1796 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1797 twl4030_codec_enable(component, 1); in twl4030_hw_params()
1799 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1800 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1824 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_sysclk() local
1825 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk()
1833 dev_err(component->dev, "Unsupported HFCLKIN: %u\n", freq); in twl4030_set_dai_sysclk()
1838 dev_err(component->dev, in twl4030_set_dai_sysclk()
1849 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_fmt() local
1850 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt()
1854 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_dai_fmt()
1890 twl4030_codec_enable(component, 0); in twl4030_set_dai_fmt()
1891 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1892 twl4030_codec_enable(component, 1); in twl4030_set_dai_fmt()
1894 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1903 struct snd_soc_component *component = dai->component; in twl4030_set_tristate() local
1904 u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_tristate()
1911 return twl4030_write(component, TWL4030_REG_AUDIO_IF, reg); in twl4030_set_tristate()
1916 static void twl4030_voice_enable(struct snd_soc_component *component, int direction, in twl4030_voice_enable() argument
1921 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_voice_enable()
1933 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_voice_enable()
1939 struct snd_soc_component *component = dai->component; in twl4030_voice_startup() local
1940 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup()
1947 dev_err(component->dev, in twl4030_voice_startup()
1956 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE) in twl4030_voice_startup()
1960 dev_err(component->dev, "%s: the codec mode is not option2\n", in twl4030_voice_startup()
1971 struct snd_soc_component *component = dai->component; in twl4030_voice_shutdown() local
1974 twl4030_voice_enable(component, substream->stream, 0); in twl4030_voice_shutdown()
1981 struct snd_soc_component *component = dai->component; in twl4030_voice_hw_params() local
1982 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params()
1986 twl4030_voice_enable(component, substream->stream, 1); in twl4030_voice_hw_params()
1989 old_mode = twl4030_read(component, in twl4030_voice_hw_params()
2001 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_voice_hw_params()
2012 twl4030_codec_enable(component, 0); in twl4030_voice_hw_params()
2013 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2014 twl4030_codec_enable(component, 1); in twl4030_voice_hw_params()
2016 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2026 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_sysclk() local
2027 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk()
2030 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2036 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2047 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_fmt() local
2048 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt()
2052 old_format = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_dai_fmt()
2085 twl4030_codec_enable(component, 0); in twl4030_voice_set_dai_fmt()
2086 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2087 twl4030_codec_enable(component, 1); in twl4030_voice_set_dai_fmt()
2089 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2098 struct snd_soc_component *component = dai->component; in twl4030_voice_set_tristate() local
2099 u8 reg = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_tristate()
2106 return twl4030_write(component, TWL4030_REG_VOICE_IF, reg); in twl4030_voice_set_tristate()
2167 static int twl4030_soc_probe(struct snd_soc_component *component) in twl4030_soc_probe() argument
2171 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2175 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2179 twl4030_init_chip(component); in twl4030_soc_probe()
2184 static void twl4030_soc_remove(struct snd_soc_component *component) in twl4030_soc_remove() argument
2186 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove()