• Home
  • Raw
  • Download

Lines Matching refs:component

75 static unsigned int twl4030_read(struct snd_soc_component *component, unsigned int reg)  in twl4030_read()  argument
77 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_read()
140 static int twl4030_write(struct snd_soc_component *component, unsigned int reg, in twl4030_write() argument
143 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_write()
175 static void twl4030_codec_enable(struct snd_soc_component *component, int enable) in twl4030_codec_enable() argument
177 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_codec_enable()
216 static struct twl4030_codec_data *twl4030_get_pdata(struct snd_soc_component *component) in twl4030_get_pdata() argument
218 struct twl4030_codec_data *pdata = dev_get_platdata(component->dev); in twl4030_get_pdata()
221 twl4030_codec_node = of_get_child_by_name(component->dev->parent->of_node, in twl4030_get_pdata()
225 pdata = devm_kzalloc(component->dev, in twl4030_get_pdata()
239 static void twl4030_init_chip(struct snd_soc_component *component) in twl4030_init_chip() argument
242 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_init_chip()
246 pdata = twl4030_get_pdata(component); in twl4030_init_chip()
253 dev_warn(component->dev, in twl4030_init_chip()
260 dev_err(component->dev, in twl4030_init_chip()
281 reg = twl4030_read(component, TWL4030_REG_MISC_SET_1); in twl4030_init_chip()
282 twl4030_write(component, TWL4030_REG_MISC_SET_1, in twl4030_init_chip()
285 twl4030_write(component, TWL4030_REG_OPTION, in twl4030_init_chip()
290 twl4030_write(component, TWL4030_REG_ARXR2_APGA_CTL, 0x32); in twl4030_init_chip()
298 reg = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in twl4030_init_chip()
301 twl4030_write(component, TWL4030_REG_HS_POPN_SET, reg); in twl4030_init_chip()
304 twl4030_codec_enable(component, 1); in twl4030_init_chip()
306 reg = twl4030_read(component, TWL4030_REG_ANAMICL); in twl4030_init_chip()
309 twl4030_write(component, TWL4030_REG_ANAMICL, in twl4030_init_chip()
328 twl4030_codec_enable(component, 0); in twl4030_init_chip()
331 static void twl4030_apll_enable(struct snd_soc_component *component, int enable) in twl4030_apll_enable() argument
333 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_apll_enable()
556 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); \
557 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); \
562 twl4030_write(component, reg, twl4030_read(component, reg)); \
578 static void handsfree_ramp(struct snd_soc_component *component, int reg, int ramp) in handsfree_ramp() argument
582 hs_ctl = twl4030_read(component, reg); in handsfree_ramp()
587 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
590 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
594 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
599 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
601 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
604 twl4030_write(component, reg, hs_ctl); in handsfree_ramp()
611 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreelpga_event() local
615 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 1); in handsfreelpga_event()
618 handsfree_ramp(component, TWL4030_REG_HFL_CTL, 0); in handsfreelpga_event()
627 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in handsfreerpga_event() local
631 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 1); in handsfreerpga_event()
634 handsfree_ramp(component, TWL4030_REG_HFR_CTL, 0); in handsfreerpga_event()
643 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vibramux_event() local
645 twl4030_write(component, TWL4030_REG_VIBRA_SET, 0xff); in vibramux_event()
652 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in apll_event() local
656 twl4030_apll_enable(component, 1); in apll_event()
659 twl4030_apll_enable(component, 0); in apll_event()
668 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif_event() local
671 audio_if = twl4030_read(component, TWL4030_REG_AUDIO_IF); in aif_event()
676 twl4030_apll_enable(component, 1); in aif_event()
678 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
683 twl4030_write(component, TWL4030_REG_AUDIO_IF, in aif_event()
685 twl4030_apll_enable(component, 0); in aif_event()
691 static void headset_ramp(struct snd_soc_component *component, int ramp) in headset_ramp() argument
694 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headset_ramp()
701 hs_gain = twl4030_read(component, TWL4030_REG_HS_GAIN_SET); in headset_ramp()
702 hs_pop = twl4030_read(component, TWL4030_REG_HS_POPN_SET); in headset_ramp()
713 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
720 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
725 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
732 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()
749 twl4030_write(component, TWL4030_REG_HS_POPN_SET, hs_pop); in headset_ramp()
757 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetlpga_event() local
758 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetlpga_event()
764 headset_ramp(component, 1); in headsetlpga_event()
771 headset_ramp(component, 0); in headsetlpga_event()
782 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in headsetrpga_event() local
783 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in headsetrpga_event()
789 headset_ramp(component, 1); in headsetrpga_event()
796 headset_ramp(component, 0); in headsetrpga_event()
807 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in digimic_event() local
808 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in digimic_event()
831 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_twl4030() local
839 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_twl4030()
846 (twl4030_read(component, reg) >> rshift) & mask; in snd_soc_get_volsw_twl4030()
860 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_twl4030() local
881 return snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_twl4030()
889 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_get_volsw_r2_twl4030() local
897 (twl4030_read(component, reg) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
899 (twl4030_read(component, reg2) >> shift) & mask; in snd_soc_get_volsw_r2_twl4030()
916 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_volsw_r2_twl4030() local
937 err = snd_soc_component_update_bits(component, reg, val_mask, val); in snd_soc_put_volsw_r2_twl4030()
941 err = snd_soc_component_update_bits(component, reg2, val_mask, val2); in snd_soc_put_volsw_r2_twl4030()
957 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in snd_soc_put_twl4030_opmode_enum_double() local
958 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in snd_soc_put_twl4030_opmode_enum_double()
961 dev_err(component->dev, in snd_soc_put_twl4030_opmode_enum_double()
1568 static int twl4030_set_bias_level(struct snd_soc_component *component, in twl4030_set_bias_level() argument
1577 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) in twl4030_set_bias_level()
1578 twl4030_codec_enable(component, 1); in twl4030_set_bias_level()
1581 twl4030_codec_enable(component, 0); in twl4030_set_bias_level()
1617 static void twl4030_tdm_enable(struct snd_soc_component *component, int direction, in twl4030_tdm_enable() argument
1622 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_tdm_enable()
1634 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_tdm_enable()
1640 struct snd_soc_component *component = dai->component; in twl4030_startup() local
1641 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_startup()
1651 if (!(twl4030_read(component, TWL4030_REG_CODEC_MODE) & in twl4030_startup()
1669 struct snd_soc_component *component = dai->component; in twl4030_shutdown() local
1670 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_shutdown()
1686 twl4030_tdm_enable(component, substream->stream, 0); in twl4030_shutdown()
1693 struct snd_soc_component *component = dai->component; in twl4030_hw_params() local
1694 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_hw_params()
1699 format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1700 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE); in twl4030_hw_params()
1706 twl4030_tdm_enable(component, substream->stream, 1); in twl4030_hw_params()
1716 old_mode = twl4030_read(component, in twl4030_hw_params()
1752 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_hw_params()
1758 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_hw_params()
1769 dev_err(component->dev, "%s: unsupported bits/sample %d\n", in twl4030_hw_params()
1780 twl4030_codec_enable(component, 0); in twl4030_hw_params()
1781 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1782 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1783 twl4030_codec_enable(component, 1); in twl4030_hw_params()
1785 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_hw_params()
1786 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_hw_params()
1810 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_sysclk() local
1811 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_sysclk()
1819 dev_err(component->dev, "Unsupported HFCLKIN: %u\n", freq); in twl4030_set_dai_sysclk()
1824 dev_err(component->dev, in twl4030_set_dai_sysclk()
1835 struct snd_soc_component *component = codec_dai->component; in twl4030_set_dai_fmt() local
1836 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_set_dai_fmt()
1840 old_format = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_dai_fmt()
1876 twl4030_codec_enable(component, 0); in twl4030_set_dai_fmt()
1877 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1878 twl4030_codec_enable(component, 1); in twl4030_set_dai_fmt()
1880 twl4030_write(component, TWL4030_REG_AUDIO_IF, format); in twl4030_set_dai_fmt()
1889 struct snd_soc_component *component = dai->component; in twl4030_set_tristate() local
1890 u8 reg = twl4030_read(component, TWL4030_REG_AUDIO_IF); in twl4030_set_tristate()
1897 return twl4030_write(component, TWL4030_REG_AUDIO_IF, reg); in twl4030_set_tristate()
1902 static void twl4030_voice_enable(struct snd_soc_component *component, int direction, in twl4030_voice_enable() argument
1907 reg = twl4030_read(component, TWL4030_REG_OPTION); in twl4030_voice_enable()
1919 twl4030_write(component, TWL4030_REG_OPTION, reg); in twl4030_voice_enable()
1925 struct snd_soc_component *component = dai->component; in twl4030_voice_startup() local
1926 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_startup()
1933 dev_err(component->dev, in twl4030_voice_startup()
1942 mode = twl4030_read(component, TWL4030_REG_CODEC_MODE) in twl4030_voice_startup()
1946 dev_err(component->dev, "%s: the codec mode is not option2\n", in twl4030_voice_startup()
1957 struct snd_soc_component *component = dai->component; in twl4030_voice_shutdown() local
1960 twl4030_voice_enable(component, substream->stream, 0); in twl4030_voice_shutdown()
1967 struct snd_soc_component *component = dai->component; in twl4030_voice_hw_params() local
1968 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_hw_params()
1972 twl4030_voice_enable(component, substream->stream, 1); in twl4030_voice_hw_params()
1975 old_mode = twl4030_read(component, in twl4030_voice_hw_params()
1987 dev_err(component->dev, "%s: unknown rate %d\n", __func__, in twl4030_voice_hw_params()
1998 twl4030_codec_enable(component, 0); in twl4030_voice_hw_params()
1999 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2000 twl4030_codec_enable(component, 1); in twl4030_voice_hw_params()
2002 twl4030_write(component, TWL4030_REG_CODEC_MODE, mode); in twl4030_voice_hw_params()
2012 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_sysclk() local
2013 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_sysclk()
2016 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2022 dev_err(component->dev, in twl4030_voice_set_dai_sysclk()
2033 struct snd_soc_component *component = codec_dai->component; in twl4030_voice_set_dai_fmt() local
2034 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_voice_set_dai_fmt()
2038 old_format = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_dai_fmt()
2071 twl4030_codec_enable(component, 0); in twl4030_voice_set_dai_fmt()
2072 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2073 twl4030_codec_enable(component, 1); in twl4030_voice_set_dai_fmt()
2075 twl4030_write(component, TWL4030_REG_VOICE_IF, format); in twl4030_voice_set_dai_fmt()
2084 struct snd_soc_component *component = dai->component; in twl4030_voice_set_tristate() local
2085 u8 reg = twl4030_read(component, TWL4030_REG_VOICE_IF); in twl4030_voice_set_tristate()
2092 return twl4030_write(component, TWL4030_REG_VOICE_IF, reg); in twl4030_voice_set_tristate()
2153 static int twl4030_soc_probe(struct snd_soc_component *component) in twl4030_soc_probe() argument
2157 twl4030 = devm_kzalloc(component->dev, sizeof(struct twl4030_priv), in twl4030_soc_probe()
2161 snd_soc_component_set_drvdata(component, twl4030); in twl4030_soc_probe()
2165 twl4030_init_chip(component); in twl4030_soc_probe()
2170 static void twl4030_soc_remove(struct snd_soc_component *component) in twl4030_soc_remove() argument
2172 struct twl4030_priv *twl4030 = snd_soc_component_get_drvdata(component); in twl4030_soc_remove()