Lines Matching full:component
79 struct snd_soc_component *component; member
109 #define to_twl6040(component) dev_get_drvdata((component)->dev->parent) argument
111 static unsigned int twl6040_read(struct snd_soc_component *component, unsigned int reg) in twl6040_read() argument
113 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_read()
114 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_read()
136 static bool twl6040_can_write_to_chip(struct snd_soc_component *component, in twl6040_can_write_to_chip() argument
139 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_can_write_to_chip()
155 static inline void twl6040_update_dl12_cache(struct snd_soc_component *component, in twl6040_update_dl12_cache() argument
158 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_update_dl12_cache()
173 static int twl6040_write(struct snd_soc_component *component, in twl6040_write() argument
176 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_write()
181 twl6040_update_dl12_cache(component, reg, value); in twl6040_write()
182 if (twl6040_can_write_to_chip(component, reg)) in twl6040_write()
188 static void twl6040_init_chip(struct snd_soc_component *component) in twl6040_init_chip() argument
190 twl6040_read(component, TWL6040_REG_TRIM1); in twl6040_init_chip()
191 twl6040_read(component, TWL6040_REG_TRIM2); in twl6040_init_chip()
192 twl6040_read(component, TWL6040_REG_TRIM3); in twl6040_init_chip()
193 twl6040_read(component, TWL6040_REG_HSOTRIM); in twl6040_init_chip()
194 twl6040_read(component, TWL6040_REG_HFOTRIM); in twl6040_init_chip()
198 twl6040_write(component, TWL6040_REG_MICLCTL, 0x18); in twl6040_init_chip()
199 twl6040_write(component, TWL6040_REG_MICRCTL, 0x18); in twl6040_init_chip()
206 twl6040_write(component, TWL6040_REG_HSGAIN, 0xff); in twl6040_init_chip()
207 twl6040_write(component, TWL6040_REG_EARCTL, 0x1e); in twl6040_init_chip()
208 twl6040_write(component, TWL6040_REG_HFLGAIN, 0x1d); in twl6040_init_chip()
209 twl6040_write(component, TWL6040_REG_HFRGAIN, 0x1d); in twl6040_init_chip()
210 twl6040_write(component, TWL6040_REG_LINEGAIN, 0); in twl6040_init_chip()
214 static int headset_power_mode(struct snd_soc_component *component, int high_perf) in headset_power_mode() argument
219 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in headset_power_mode()
220 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in headset_power_mode()
230 twl6040_write(component, TWL6040_REG_HSLCTL, hslctl); in headset_power_mode()
231 twl6040_write(component, TWL6040_REG_HSRCTL, hsrctl); in headset_power_mode()
239 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_hs_dac_event() local
247 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_hs_dac_event()
248 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in twl6040_hs_dac_event()
256 twl6040_write(component, TWL6040_REG_HSLCTL, hslctl); in twl6040_hs_dac_event()
257 twl6040_write(component, TWL6040_REG_HSRCTL, hsrctl); in twl6040_hs_dac_event()
266 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_ep_drv_event() local
267 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_ep_drv_event()
273 ret = headset_power_mode(component, 1); in twl6040_ep_drv_event()
276 ret = headset_power_mode(component, priv->hs_power_mode); in twl6040_ep_drv_event()
284 static void twl6040_hs_jack_report(struct snd_soc_component *component, in twl6040_hs_jack_report() argument
287 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hs_jack_report()
293 status = twl6040_read(component, TWL6040_REG_STATUS); in twl6040_hs_jack_report()
302 void twl6040_hs_jack_detect(struct snd_soc_component *component, in twl6040_hs_jack_detect() argument
305 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hs_jack_detect()
311 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_hs_jack_detect()
319 struct snd_soc_component *component = priv->component; in twl6040_accessory_work() local
322 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_accessory_work()
328 struct snd_soc_component *component = data; in twl6040_audio_handler() local
329 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_audio_handler()
340 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in twl6040_soc_dapm_put_vibra_enum() local
345 val = twl6040_read(component, e->reg); in twl6040_soc_dapm_put_vibra_enum()
489 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_headset_power_get_enum() local
490 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_headset_power_get_enum()
500 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_headset_power_put_enum() local
501 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_headset_power_put_enum()
506 ret = headset_power_mode(component, high_perf); in twl6040_headset_power_put_enum()
517 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_pll_get_enum() local
518 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_pll_get_enum()
528 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_pll_put_enum() local
529 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_pll_put_enum()
536 int twl6040_get_dl1_gain(struct snd_soc_component *component) in twl6040_get_dl1_gain() argument
538 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in twl6040_get_dl1_gain()
546 u8 val = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_get_dl1_gain()
558 int twl6040_get_clk_id(struct snd_soc_component *component) in twl6040_get_clk_id() argument
560 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_get_clk_id()
566 int twl6040_get_trim_value(struct snd_soc_component *component, enum twl6040_trim trim) in twl6040_get_trim_value() argument
571 return twl6040_read(component, TWL6040_REG_TRIM1 + trim); in twl6040_get_trim_value()
575 int twl6040_get_hs_step_size(struct snd_soc_component *component) in twl6040_get_hs_step_size() argument
577 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_get_hs_step_size()
832 static int twl6040_set_bias_level(struct snd_soc_component *component, in twl6040_set_bias_level() argument
835 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_set_bias_level()
836 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_set_bias_level()
859 twl6040_write(component, TWL6040_REG_GPOCTL, 0x02); in twl6040_set_bias_level()
876 struct snd_soc_component *component = dai->component; in twl6040_startup() local
877 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_startup()
890 struct snd_soc_component *component = dai->component; in twl6040_hw_params() local
891 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hw_params()
902 dev_err(component->dev, "HPPLL does not support rate %d\n", in twl6040_hw_params()
916 dev_err(component->dev, "unsupported rate %d\n", rate); in twl6040_hw_params()
926 struct snd_soc_component *component = dai->component; in twl6040_prepare() local
927 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_prepare()
928 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_prepare()
932 dev_err(component->dev, in twl6040_prepare()
939 dev_err(component->dev, "Can not set PLL (%d)\n", ret); in twl6040_prepare()
949 struct snd_soc_component *component = codec_dai->component; in twl6040_set_dai_sysclk() local
950 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_set_dai_sysclk()
959 dev_err(component->dev, "unknown clk_id %d\n", clk_id); in twl6040_set_dai_sysclk()
966 static void twl6040_mute_path(struct snd_soc_component *component, enum twl6040_dai_id id, in twl6040_mute_path() argument
969 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_mute_path()
970 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_mute_path()
976 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_mute_path()
977 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in twl6040_mute_path()
978 earctl = twl6040_read(component, TWL6040_REG_EARCTL); in twl6040_mute_path()
994 hflctl = twl6040_read(component, TWL6040_REG_HFLCTL); in twl6040_mute_path()
995 hfrctl = twl6040_read(component, TWL6040_REG_HFRCTL); in twl6040_mute_path()
1018 twl6040_mute_path(dai->component, TWL6040_DAI_DL1, mute); in twl6040_digital_mute()
1019 twl6040_mute_path(dai->component, TWL6040_DAI_DL2, mute); in twl6040_digital_mute()
1023 twl6040_mute_path(dai->component, dai->id, mute); in twl6040_digital_mute()
1110 static int twl6040_probe(struct snd_soc_component *component) in twl6040_probe() argument
1113 struct platform_device *pdev = to_platform_device(component->dev); in twl6040_probe()
1116 priv = devm_kzalloc(component->dev, sizeof(*priv), GFP_KERNEL); in twl6040_probe()
1120 snd_soc_component_set_drvdata(component, priv); in twl6040_probe()
1122 priv->component = component; in twl6040_probe()
1126 dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq); in twl6040_probe()
1137 "twl6040_irq_plug", component); in twl6040_probe()
1139 dev_err(component->dev, "PLUG IRQ request failed: %d\n", ret); in twl6040_probe()
1143 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); in twl6040_probe()
1144 twl6040_init_chip(component); in twl6040_probe()
1149 static void twl6040_remove(struct snd_soc_component *component) in twl6040_remove() argument
1151 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_remove()
1153 free_irq(priv->plug_irq, component); in twl6040_remove()