Lines Matching refs:component

83 static unsigned int twl4030_read(struct snd_soc_component *component, unsigned int reg)  in twl4030_read()  argument
85 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_read()
148 static int twl4030_write(struct snd_soc_component *component, unsigned int reg, in twl4030_write() argument
151 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_write()
183 static void twl4030_codec_enable(struct snd_soc_component *component, int enable) in twl4030_codec_enable() argument
185 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_codec_enable()
222 twl4030_get_board_params(struct snd_soc_component *component) in twl4030_get_board_params() argument
227 twl4030_codec_node = of_get_child_by_name(component->dev->parent->of_node, in twl4030_get_board_params()
231 board_params = devm_kzalloc(component->dev, in twl4030_get_board_params()
245 static void twl4030_init_chip(struct snd_soc_component *component) in twl4030_init_chip() argument
248 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_init_chip()
252 board_params = twl4030_get_board_params(component); in twl4030_init_chip()
259 dev_warn(component->dev, in twl4030_init_chip()
266 dev_err(component->dev, in twl4030_init_chip()
287 reg = twl4030_read(component, TWL4030_REG_MISC_SET_1); in twl4030_init_chip()
288 twl4030_write(component, TWL4030_REG_MISC_SET_1, in twl4030_init_chip()
291 twl4030_write(component, TWL4030_REG_OPTION, in twl4030_init_chip()
296 twl4030_write(component, TWL4030_REG_ARXR2_APGA_CTL, 0x32); in twl4030_init_chip()
304 reg = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in twl4030_init_chip()
307 twl4030_write(component, TWL4030_REG_HS_POPN_SET, reg); in twl4030_init_chip()
310 twl4030_codec_enable(component, 1); in twl4030_init_chip()
312 reg = twl4030_read(component, TWL4030_REG_ANAMICL); in twl4030_init_chip()
315 twl4030_write(component, TWL4030_REG_ANAMICL, in twl4030_init_chip()
334 twl4030_codec_enable(component, 0); in twl4030_init_chip()
337 static void twl4030_apll_enable(struct snd_soc_component *component, int enable) in twl4030_apll_enable() argument
339 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_apll_enable()
562 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); \
563 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
568 twl4030_write(component, reg, twl4030_read(component, reg)); \
584 static void handsfree_ramp(struct snd_soc_component *component, int reg, int ramp) in handsfree_ramp() argument
588 hs_ctl = twl4030_read(component, reg); in handsfree_ramp()
593 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
596 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
600 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
605 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
607 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
610 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
617 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreelpga_event() local
621 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 1); in handsfreelpga_event()
624 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 0); in handsfreelpga_event()
633 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreerpga_event() local
637 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 1); in handsfreerpga_event()
640 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 0); in handsfreerpga_event()
649 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vibramux_event() local
651 twl4030_write(component, TWL4030_REG_VIBRA_SET, 0xff); in vibramux_event()
658 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in apll_event() local
662 twl4030_apll_enable(component, 1); in apll_event()
665 twl4030_apll_enable(component, 0); in apll_event()
674 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif_event() local
677 audio_if = twl4030_read(component, TWL4030_REG_AUDIO_IF); in aif_event()
682 twl4030_apll_enable(component, 1); in aif_event()
684 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
689 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
691 twl4030_apll_enable(component, 0); in aif_event()
697 static void headset_ramp(struct snd_soc_component *component, int ramp) in headset_ramp() argument
700 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headset_ramp()
707 hs_gain = twl4030_read(component, TWL4030_REG_HS_GAIN_SET); in headset_ramp()
708 hs_pop = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in headset_ramp()
719 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
726 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
731 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
738 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()
755 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
763 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetlpga_event() local
764 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event()
770 headset_ramp(component, 1); in headsetlpga_event()
777 headset_ramp(component, 0); in headsetlpga_event()
788 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetrpga_event() local
789 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event()
795 headset_ramp(component, 1); in headsetrpga_event()
802 headset_ramp(component, 0); in headsetrpga_event()
813 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in digimic_event() local
814 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event()
837 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_twl4030() local
845 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_twl4030()
852 (twl4030_read(component, reg) >> rshift) & mask; in snd_soc_get_volsw_twl4030()
866 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_twl4030() local
887 return snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_twl4030()
895 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_r2_twl4030() local
903 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
905 (twl4030_read(component, reg2) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
922 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_r2_twl4030() local
943 err = snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_r2_twl4030()
947 err = snd_soc_component_update_bits(component, reg2, val_mask, val2); in snd_soc_put_volsw_r2_twl4030()
963 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_twl4030_opmode_enum_double() local
964 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double()
967 dev_err(component->dev, in snd_soc_put_twl4030_opmode_enum_double()
1574 static int twl4030_set_bias_level(struct snd_soc_component *component, in twl4030_set_bias_level() argument
1583 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) in twl4030_set_bias_level()
1584 twl4030_codec_enable(component, 1); in twl4030_set_bias_level()
1587 twl4030_codec_enable(component, 0); in twl4030_set_bias_level()
1623 static void twl4030_tdm_enable(struct snd_soc_component *component, int direction, in twl4030_tdm_enable() argument
1628 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_tdm_enable()
1640 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_tdm_enable()
1646 struct snd_soc_component *component = dai->component; in twl4030_startup() local
1647 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup()
1657 if (!(twl4030_read(component, TWL4030_REG_CODEC_MODE) & in twl4030_startup()
1675 struct snd_soc_component *component = dai->component; in twl4030_shutdown() local
1676 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown()
1692 twl4030_tdm_enable(component, substream->stream, 0); in twl4030_shutdown()
1699 struct snd_soc_component *component = dai->component; in twl4030_hw_params() local
1700 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params()
1705 format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1706 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE); in twl4030_hw_params()
1712 twl4030_tdm_enable(component, substream->stream, 1); in twl4030_hw_params()
1722 old_mode = twl4030_read(component, in twl4030_hw_params()
1758 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_hw_params()
1764 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1775 dev_err(component->dev, "%s: unsupported bits/sample %d\n", in twl4030_hw_params()
1786 twl4030_codec_enable(component, 0); in twl4030_hw_params()
1787 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1788 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1789 twl4030_codec_enable(component, 1); in twl4030_hw_params()
1791 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1792 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1816 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_sysclk() local
1817 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk()
1825 dev_err(component->dev, "Unsupported HFCLKIN: %u\n", freq); in twl4030_set_dai_sysclk()
1830 dev_err(component->dev, in twl4030_set_dai_sysclk()
1841 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_fmt() local
1842 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt()
1846 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_dai_fmt()
1881 twl4030_codec_enable(component, 0); in twl4030_set_dai_fmt()
1882 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1883 twl4030_codec_enable(component, 1); in twl4030_set_dai_fmt()
1885 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1894 struct snd_soc_component *component = dai->component; in twl4030_set_tristate() local
1895 u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_tristate()
1902 return twl4030_write(component, TWL4030_REG_AUDIO_IF, reg); in twl4030_set_tristate()
1907 static void twl4030_voice_enable(struct snd_soc_component *component, int direction, in twl4030_voice_enable() argument
1912 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_voice_enable()
1924 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_voice_enable()
1930 struct snd_soc_component *component = dai->component; in twl4030_voice_startup() local
1931 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup()
1938 dev_err(component->dev, in twl4030_voice_startup()
1947 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE) in twl4030_voice_startup()
1951 dev_err(component->dev, "%s: the codec mode is not option2\n", in twl4030_voice_startup()
1962 struct snd_soc_component *component = dai->component; in twl4030_voice_shutdown() local
1965 twl4030_voice_enable(component, substream->stream, 0); in twl4030_voice_shutdown()
1972 struct snd_soc_component *component = dai->component; in twl4030_voice_hw_params() local
1973 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params()
1977 twl4030_voice_enable(component, substream->stream, 1); in twl4030_voice_hw_params()
1980 old_mode = twl4030_read(component, in twl4030_voice_hw_params()
1992 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_voice_hw_params()
2003 twl4030_codec_enable(component, 0); in twl4030_voice_hw_params()
2004 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2005 twl4030_codec_enable(component, 1); in twl4030_voice_hw_params()
2007 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2017 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_sysclk() local
2018 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk()
2021 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2027 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2038 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_fmt() local
2039 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt()
2043 old_format = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_dai_fmt()
2075 twl4030_codec_enable(component, 0); in twl4030_voice_set_dai_fmt()
2076 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2077 twl4030_codec_enable(component, 1); in twl4030_voice_set_dai_fmt()
2079 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2088 struct snd_soc_component *component = dai->component; in twl4030_voice_set_tristate() local
2089 u8 reg = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_tristate()
2096 return twl4030_write(component, TWL4030_REG_VOICE_IF, reg); in twl4030_voice_set_tristate()
2157 static int twl4030_soc_probe(struct snd_soc_component *component) in twl4030_soc_probe() argument
2161 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2165 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2169 twl4030_init_chip(component); in twl4030_soc_probe()
2174 static void twl4030_soc_remove(struct snd_soc_component *component) in twl4030_soc_remove() argument
2176 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove()