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()
709 hs_gain = twl4030_read(component, TWL4030_REG_HS_GAIN_SET); in headset_ramp()
710 hs_pop = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in headset_ramp()
721 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
728 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
733 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
740 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
748 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
757 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
765 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetlpga_event() local
766 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event()
772 headset_ramp(component, 1); in headsetlpga_event()
779 headset_ramp(component, 0); in headsetlpga_event()
790 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetrpga_event() local
791 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event()
797 headset_ramp(component, 1); in headsetrpga_event()
804 headset_ramp(component, 0); in headsetrpga_event()
815 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in digimic_event() local
816 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event()
839 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_twl4030() local
847 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_twl4030()
854 (twl4030_read(component, reg) >> rshift) & mask; in snd_soc_get_volsw_twl4030()
868 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_twl4030() local
889 return snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_twl4030()
897 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_r2_twl4030() local
905 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
907 (twl4030_read(component, reg2) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
924 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_r2_twl4030() local
945 err = snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_r2_twl4030()
949 err = snd_soc_component_update_bits(component, reg2, val_mask, val2); in snd_soc_put_volsw_r2_twl4030()
965 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_twl4030_opmode_enum_double() local
966 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double()
969 dev_err(component->dev, in snd_soc_put_twl4030_opmode_enum_double()
1576 static int twl4030_set_bias_level(struct snd_soc_component *component, in twl4030_set_bias_level() argument
1585 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) in twl4030_set_bias_level()
1586 twl4030_codec_enable(component, 1); in twl4030_set_bias_level()
1589 twl4030_codec_enable(component, 0); in twl4030_set_bias_level()
1625 static void twl4030_tdm_enable(struct snd_soc_component *component, int direction, in twl4030_tdm_enable() argument
1630 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_tdm_enable()
1642 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_tdm_enable()
1648 struct snd_soc_component *component = dai->component; in twl4030_startup() local
1649 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup()
1659 if (!(twl4030_read(component, TWL4030_REG_CODEC_MODE) & in twl4030_startup()
1677 struct snd_soc_component *component = dai->component; in twl4030_shutdown() local
1678 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown()
1694 twl4030_tdm_enable(component, substream->stream, 0); in twl4030_shutdown()
1701 struct snd_soc_component *component = dai->component; in twl4030_hw_params() local
1702 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params()
1707 format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1708 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE); in twl4030_hw_params()
1714 twl4030_tdm_enable(component, substream->stream, 1); in twl4030_hw_params()
1724 old_mode = twl4030_read(component, in twl4030_hw_params()
1760 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_hw_params()
1766 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1777 dev_err(component->dev, "%s: unsupported bits/sample %d\n", in twl4030_hw_params()
1788 twl4030_codec_enable(component, 0); in twl4030_hw_params()
1789 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1790 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1791 twl4030_codec_enable(component, 1); in twl4030_hw_params()
1793 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1794 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1818 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_sysclk() local
1819 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk()
1827 dev_err(component->dev, "Unsupported HFCLKIN: %u\n", freq); in twl4030_set_dai_sysclk()
1832 dev_err(component->dev, in twl4030_set_dai_sysclk()
1843 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_fmt() local
1844 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt()
1848 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_dai_fmt()
1883 twl4030_codec_enable(component, 0); in twl4030_set_dai_fmt()
1884 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1885 twl4030_codec_enable(component, 1); in twl4030_set_dai_fmt()
1887 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1896 struct snd_soc_component *component = dai->component; in twl4030_set_tristate() local
1897 u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_tristate()
1904 return twl4030_write(component, TWL4030_REG_AUDIO_IF, reg); in twl4030_set_tristate()
1909 static void twl4030_voice_enable(struct snd_soc_component *component, int direction, in twl4030_voice_enable() argument
1914 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_voice_enable()
1926 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_voice_enable()
1932 struct snd_soc_component *component = dai->component; in twl4030_voice_startup() local
1933 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup()
1940 dev_err(component->dev, in twl4030_voice_startup()
1949 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE) in twl4030_voice_startup()
1953 dev_err(component->dev, "%s: the codec mode is not option2\n", in twl4030_voice_startup()
1964 struct snd_soc_component *component = dai->component; in twl4030_voice_shutdown() local
1967 twl4030_voice_enable(component, substream->stream, 0); in twl4030_voice_shutdown()
1974 struct snd_soc_component *component = dai->component; in twl4030_voice_hw_params() local
1975 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params()
1979 twl4030_voice_enable(component, substream->stream, 1); in twl4030_voice_hw_params()
1982 old_mode = twl4030_read(component, in twl4030_voice_hw_params()
1994 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_voice_hw_params()
2005 twl4030_codec_enable(component, 0); in twl4030_voice_hw_params()
2006 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2007 twl4030_codec_enable(component, 1); in twl4030_voice_hw_params()
2009 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2019 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_sysclk() local
2020 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk()
2023 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2029 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2040 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_fmt() local
2041 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt()
2045 old_format = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_dai_fmt()
2077 twl4030_codec_enable(component, 0); in twl4030_voice_set_dai_fmt()
2078 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2079 twl4030_codec_enable(component, 1); in twl4030_voice_set_dai_fmt()
2081 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2090 struct snd_soc_component *component = dai->component; in twl4030_voice_set_tristate() local
2091 u8 reg = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_tristate()
2098 return twl4030_write(component, TWL4030_REG_VOICE_IF, reg); in twl4030_voice_set_tristate()
2159 static int twl4030_soc_probe(struct snd_soc_component *component) in twl4030_soc_probe() argument
2163 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2167 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2171 twl4030_init_chip(component); in twl4030_soc_probe()
2176 static void twl4030_soc_remove(struct snd_soc_component *component) in twl4030_soc_remove() argument
2178 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove()