Lines Matching refs:component

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