Lines Matching refs:component

65 	struct snd_soc_component *component;  member
95 #define to_twl6040(component) dev_get_drvdata((component)->dev->parent) argument
97 static unsigned int twl6040_read(struct snd_soc_component *component, unsigned int reg) in twl6040_read() argument
99 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_read()
100 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_read()
122 static bool twl6040_can_write_to_chip(struct snd_soc_component *component, in twl6040_can_write_to_chip() argument
125 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_can_write_to_chip()
141 static inline void twl6040_update_dl12_cache(struct snd_soc_component *component, in twl6040_update_dl12_cache() argument
144 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_update_dl12_cache()
159 static int twl6040_write(struct snd_soc_component *component, in twl6040_write() argument
162 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_write()
167 twl6040_update_dl12_cache(component, reg, value); in twl6040_write()
168 if (twl6040_can_write_to_chip(component, reg)) in twl6040_write()
174 static void twl6040_init_chip(struct snd_soc_component *component) in twl6040_init_chip() argument
176 twl6040_read(component, TWL6040_REG_TRIM1); in twl6040_init_chip()
177 twl6040_read(component, TWL6040_REG_TRIM2); in twl6040_init_chip()
178 twl6040_read(component, TWL6040_REG_TRIM3); in twl6040_init_chip()
179 twl6040_read(component, TWL6040_REG_HSOTRIM); in twl6040_init_chip()
180 twl6040_read(component, TWL6040_REG_HFOTRIM); in twl6040_init_chip()
184 twl6040_write(component, TWL6040_REG_MICLCTL, 0x18); in twl6040_init_chip()
185 twl6040_write(component, TWL6040_REG_MICRCTL, 0x18); in twl6040_init_chip()
192 twl6040_write(component, TWL6040_REG_HSGAIN, 0xff); in twl6040_init_chip()
193 twl6040_write(component, TWL6040_REG_EARCTL, 0x1e); in twl6040_init_chip()
194 twl6040_write(component, TWL6040_REG_HFLGAIN, 0x1d); in twl6040_init_chip()
195 twl6040_write(component, TWL6040_REG_HFRGAIN, 0x1d); in twl6040_init_chip()
196 twl6040_write(component, TWL6040_REG_LINEGAIN, 0); in twl6040_init_chip()
200 static int headset_power_mode(struct snd_soc_component *component, int high_perf) in headset_power_mode() argument
205 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in headset_power_mode()
206 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in headset_power_mode()
216 twl6040_write(component, TWL6040_REG_HSLCTL, hslctl); in headset_power_mode()
217 twl6040_write(component, TWL6040_REG_HSRCTL, hsrctl); in headset_power_mode()
225 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_hs_dac_event() local
233 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_hs_dac_event()
234 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in twl6040_hs_dac_event()
242 twl6040_write(component, TWL6040_REG_HSLCTL, hslctl); in twl6040_hs_dac_event()
243 twl6040_write(component, TWL6040_REG_HSRCTL, hsrctl); in twl6040_hs_dac_event()
252 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_ep_drv_event() local
253 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_ep_drv_event()
259 ret = headset_power_mode(component, 1); in twl6040_ep_drv_event()
262 ret = headset_power_mode(component, priv->hs_power_mode); in twl6040_ep_drv_event()
270 static void twl6040_hs_jack_report(struct snd_soc_component *component, in twl6040_hs_jack_report() argument
273 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hs_jack_report()
279 status = twl6040_read(component, TWL6040_REG_STATUS); in twl6040_hs_jack_report()
288 void twl6040_hs_jack_detect(struct snd_soc_component *component, in twl6040_hs_jack_detect() argument
291 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hs_jack_detect()
297 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_hs_jack_detect()
305 struct snd_soc_component *component = priv->component; in twl6040_accessory_work() local
308 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_accessory_work()
314 struct snd_soc_component *component = data; in twl6040_audio_handler() local
315 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_audio_handler()
326 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in twl6040_soc_dapm_put_vibra_enum() local
331 val = twl6040_read(component, e->reg); in twl6040_soc_dapm_put_vibra_enum()
475 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_headset_power_get_enum() local
476 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_headset_power_get_enum()
486 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_headset_power_put_enum() local
487 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_headset_power_put_enum()
492 ret = headset_power_mode(component, high_perf); in twl6040_headset_power_put_enum()
503 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_pll_get_enum() local
504 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_pll_get_enum()
514 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in twl6040_pll_put_enum() local
515 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_pll_put_enum()
522 int twl6040_get_dl1_gain(struct snd_soc_component *component) in twl6040_get_dl1_gain() argument
524 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in twl6040_get_dl1_gain()
532 u8 val = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_get_dl1_gain()
544 int twl6040_get_clk_id(struct snd_soc_component *component) in twl6040_get_clk_id() argument
546 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_get_clk_id()
552 int twl6040_get_trim_value(struct snd_soc_component *component, enum twl6040_trim trim) in twl6040_get_trim_value() argument
557 return twl6040_read(component, TWL6040_REG_TRIM1 + trim); in twl6040_get_trim_value()
561 int twl6040_get_hs_step_size(struct snd_soc_component *component) in twl6040_get_hs_step_size() argument
563 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_get_hs_step_size()
818 static int twl6040_set_bias_level(struct snd_soc_component *component, in twl6040_set_bias_level() argument
821 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_set_bias_level()
822 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_set_bias_level()
845 twl6040_write(component, TWL6040_REG_GPOCTL, 0x02); in twl6040_set_bias_level()
862 struct snd_soc_component *component = dai->component; in twl6040_startup() local
863 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_startup()
876 struct snd_soc_component *component = dai->component; in twl6040_hw_params() local
877 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_hw_params()
888 dev_err(component->dev, "HPPLL does not support rate %d\n", in twl6040_hw_params()
902 dev_err(component->dev, "unsupported rate %d\n", rate); in twl6040_hw_params()
912 struct snd_soc_component *component = dai->component; in twl6040_prepare() local
913 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_prepare()
914 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_prepare()
918 dev_err(component->dev, in twl6040_prepare()
925 dev_err(component->dev, "Can not set PLL (%d)\n", ret); in twl6040_prepare()
935 struct snd_soc_component *component = codec_dai->component; in twl6040_set_dai_sysclk() local
936 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_set_dai_sysclk()
945 dev_err(component->dev, "unknown clk_id %d\n", clk_id); in twl6040_set_dai_sysclk()
952 static void twl6040_mute_path(struct snd_soc_component *component, enum twl6040_dai_id id, in twl6040_mute_path() argument
955 struct twl6040 *twl6040 = to_twl6040(component); in twl6040_mute_path()
956 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_mute_path()
962 hslctl = twl6040_read(component, TWL6040_REG_HSLCTL); in twl6040_mute_path()
963 hsrctl = twl6040_read(component, TWL6040_REG_HSRCTL); in twl6040_mute_path()
964 earctl = twl6040_read(component, TWL6040_REG_EARCTL); in twl6040_mute_path()
980 hflctl = twl6040_read(component, TWL6040_REG_HFLCTL); in twl6040_mute_path()
981 hfrctl = twl6040_read(component, TWL6040_REG_HFRCTL); in twl6040_mute_path()
1004 twl6040_mute_path(dai->component, TWL6040_DAI_DL1, mute); in twl6040_mute_stream()
1005 twl6040_mute_path(dai->component, TWL6040_DAI_DL2, mute); in twl6040_mute_stream()
1009 twl6040_mute_path(dai->component, dai->id, mute); in twl6040_mute_stream()
1097 static int twl6040_probe(struct snd_soc_component *component) in twl6040_probe() argument
1100 struct platform_device *pdev = to_platform_device(component->dev); in twl6040_probe()
1103 priv = devm_kzalloc(component->dev, sizeof(*priv), GFP_KERNEL); in twl6040_probe()
1107 snd_soc_component_set_drvdata(component, priv); in twl6040_probe()
1109 priv->component = component; in twl6040_probe()
1122 "twl6040_irq_plug", component); in twl6040_probe()
1124 dev_err(component->dev, "PLUG IRQ request failed: %d\n", ret); in twl6040_probe()
1128 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY); in twl6040_probe()
1129 twl6040_init_chip(component); in twl6040_probe()
1134 static void twl6040_remove(struct snd_soc_component *component) in twl6040_remove() argument
1136 struct twl6040_data *priv = snd_soc_component_get_drvdata(component); in twl6040_remove()
1138 free_irq(priv->plug_irq, component); in twl6040_remove()