Lines Matching defs:component

157 static inline int hp_sel_input(struct snd_soc_component *component)
159 return (snd_soc_component_read(component, SGTL5000_CHIP_ANA_CTRL) &
163 static inline u16 mute_output(struct snd_soc_component *component,
166 u16 mute_reg = snd_soc_component_read(component,
169 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL,
174 static inline void restore_output(struct snd_soc_component *component,
177 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL,
181 static void vag_power_on(struct snd_soc_component *component, u32 source)
183 if (snd_soc_component_read(component, SGTL5000_CHIP_ANA_POWER) &
187 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
193 if (hp_sel_input(component) == SGTL5000_HP_SEL_LINE_IN &&
198 static int vag_power_consumers(struct snd_soc_component *component,
216 if (hp_sel_input(component) == SGTL5000_HP_SEL_LINE_IN)
226 static void vag_power_off(struct snd_soc_component *component, u32 source)
228 u16 ana_pwr = snd_soc_component_read(component,
245 if (vag_power_consumers(component, ana_pwr, source) >= 2)
248 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
269 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
270 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
275 snd_soc_component_update_bits(component, SGTL5000_CHIP_MIC_CTRL,
281 snd_soc_component_update_bits(component, SGTL5000_CHIP_MIC_CTRL,
288 static int vag_and_mute_control(struct snd_soc_component *component,
308 snd_soc_component_get_drvdata(component);
313 mute_output(component, mute_mask[event_source]);
316 vag_power_on(component, event_source);
317 restore_output(component, mute_mask[event_source],
322 mute_output(component, mute_mask[event_source]);
323 vag_power_off(component, event_source);
326 restore_output(component, mute_mask[event_source],
343 struct snd_soc_component *component =
346 return vag_and_mute_control(component, event, HP_POWER_EVENT);
356 struct snd_soc_component *component =
359 return vag_and_mute_control(component, event, ADC_POWER_EVENT);
365 struct snd_soc_component *component =
368 return vag_and_mute_control(component, event, DAC_POWER_EVENT);
543 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
548 reg = snd_soc_component_read(component, SGTL5000_CHIP_DAC_VOL);
596 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
616 snd_soc_component_write(component, SGTL5000_CHIP_DAC_VOL, reg);
634 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
636 u16 reg = snd_soc_component_read(component, SGTL5000_DAP_AVC_THRESHOLD);
667 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
675 snd_soc_component_write(component, SGTL5000_DAP_AVC_THRESHOLD, reg);
780 struct snd_soc_component *component = codec_dai->component;
788 snd_soc_component_update_bits(component, SGTL5000_CHIP_DIG_POWER,
797 struct snd_soc_component *component = codec_dai->component;
798 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
856 snd_soc_component_write(component, SGTL5000_CHIP_I2S_CTRL, i2sctl);
865 struct snd_soc_component *component = codec_dai->component;
866 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
892 static int sgtl5000_set_clock(struct snd_soc_component *component, int frame_rate)
894 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
947 dev_err(component->dev, "frame rate %d not supported\n",
976 dev_err(component->dev,
978 dev_err(component->dev, "%d ratio is not supported. "
1011 snd_soc_component_write(component, SGTL5000_CHIP_PLL_CTRL, pll_ctl);
1013 snd_soc_component_update_bits(component,
1018 snd_soc_component_update_bits(component,
1024 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
1029 snd_soc_component_write(component, SGTL5000_CHIP_CLK_CTRL, clk_ctl);
1032 snd_soc_component_write(component, SGTL5000_CHIP_CLK_CTRL, clk_ctl);
1035 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
1051 struct snd_soc_component *component = dai->component;
1052 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
1060 dev_err(component->dev, "%s: set sysclk first!\n", __func__);
1070 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, stereo,
1074 ret = sgtl5000_set_clock(component, params_rate(params));
1108 snd_soc_component_update_bits(component, SGTL5000_CHIP_I2S_CTRL,
1125 static int sgtl5000_set_bias_level(struct snd_soc_component *component,
1128 struct sgtl5000_priv *sgtl = snd_soc_component_get_drvdata(component);
1142 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
1148 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER,
1289 static int sgtl5000_set_power_regs(struct snd_soc_component *component)
1301 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
1314 dev_err(component->dev, "regulator voltage not set correctly\n");
1321 dev_err(component->dev,
1329 ana_pwr = snd_soc_component_read(component, SGTL5000_CHIP_ANA_POWER);
1333 lreg_ctrl = snd_soc_component_read(component, SGTL5000_CHIP_LINREG_CTRL);
1337 snd_soc_component_update_bits(component, SGTL5000_CHIP_CLK_TOP_CTRL,
1356 snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl);
1358 snd_soc_component_write(component, SGTL5000_CHIP_ANA_POWER, ana_pwr);
1373 snd_soc_component_update_bits(component, SGTL5000_CHIP_REF_CTRL,
1387 snd_soc_component_update_bits(component, SGTL5000_CHIP_LINE_OUT_CTRL,
1410 snd_soc_component_update_bits(component, SGTL5000_CHIP_LINE_OUT_VOL,
1458 static int sgtl5000_probe(struct snd_soc_component *component)
1462 struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component);
1466 ret = sgtl5000_set_power_regs(component);
1471 snd_soc_component_update_bits(component, SGTL5000_CHIP_REF_CTRL,
1475 snd_soc_component_write(component, SGTL5000_CHIP_SHORT_CTRL, 0);
1477 snd_soc_component_write(component, SGTL5000_CHIP_DIG_POWER,
1481 snd_soc_component_write(component, SGTL5000_CHIP_ADCDAC_CTRL,
1489 snd_soc_component_write(component, SGTL5000_CHIP_PAD_STRENGTH, reg);
1491 snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL,
1494 snd_soc_component_update_bits(component, SGTL5000_CHIP_MIC_CTRL,
1498 snd_soc_component_update_bits(component, SGTL5000_CHIP_MIC_CTRL,
1506 snd_soc_component_write(component, SGTL5000_DAP_AUDIO_EQ, SGTL5000_DAP_SEL_GEQ);
1509 snd_soc_component_update_bits(component, SGTL5000_CHIP_ADCDAC_CTRL,
1518 static int sgtl5000_of_xlate_dai_id(struct snd_soc_component *component,