Lines Matching defs:component
52 struct snd_soc_component *component);
54 struct snd_soc_component *component);
80 struct snd_soc_component *component;
160 static inline unsigned int dac33_read_reg_cache(struct snd_soc_component *component,
163 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
171 static inline void dac33_write_reg_cache(struct snd_soc_component *component,
174 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
182 static int dac33_read(struct snd_soc_component *component, unsigned int reg,
185 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
194 dev_err(component->dev, "Read failed (%d)\n", val);
195 value[0] = dac33_read_reg_cache(component, reg);
199 dac33_write_reg_cache(component, reg, val);
202 value[0] = dac33_read_reg_cache(component, reg);
208 static int dac33_write(struct snd_soc_component *component, unsigned int reg,
211 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
223 dac33_write_reg_cache(component, data[0], data[1]);
227 dev_err(component->dev, "Write failed (%d)\n", ret);
235 static int dac33_write_locked(struct snd_soc_component *component, unsigned int reg,
238 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
242 ret = dac33_write(component, reg, value);
249 static int dac33_write16(struct snd_soc_component *component, unsigned int reg,
252 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
266 dac33_write_reg_cache(component, data[0], data[1]);
267 dac33_write_reg_cache(component, data[0] + 1, data[2]);
274 dev_err(component->dev, "Write failed (%d)\n", ret);
282 static void dac33_init_chip(struct snd_soc_component *component)
284 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
290 dac33_write(component, DAC33_DAC_CTRL_A, DAC33_DACRATE(0));
292 dac33_write(component, DAC33_DAC_CTRL_B, DAC33_DACSRCR_RIGHT |
295 dac33_write(component, DAC33_DAC_CTRL_C, 0x00);
299 dac33_write(component, DAC33_ANA_VOL_SOFT_STEP_CTRL, DAC33_VOLCLKEN);
302 dac33_write(component, DAC33_LDAC_DIG_VOL_CTRL,
303 dac33_read_reg_cache(component, DAC33_LDAC_DIG_VOL_CTRL));
304 dac33_write(component, DAC33_RDAC_DIG_VOL_CTRL,
305 dac33_read_reg_cache(component, DAC33_RDAC_DIG_VOL_CTRL));
307 dac33_write(component, DAC33_LINEL_TO_LLO_VOL,
308 dac33_read_reg_cache(component, DAC33_LINEL_TO_LLO_VOL));
309 dac33_write(component, DAC33_LINER_TO_RLO_VOL,
310 dac33_read_reg_cache(component, DAC33_LINER_TO_RLO_VOL));
312 dac33_write(component, DAC33_OUT_AMP_CTRL,
313 dac33_read_reg_cache(component, DAC33_OUT_AMP_CTRL));
315 dac33_write(component, DAC33_LDAC_PWR_CTRL,
316 dac33_read_reg_cache(component, DAC33_LDAC_PWR_CTRL));
317 dac33_write(component, DAC33_RDAC_PWR_CTRL,
318 dac33_read_reg_cache(component, DAC33_RDAC_PWR_CTRL));
321 static inline int dac33_read_id(struct snd_soc_component *component)
327 ret = dac33_read(component, DAC33_DEVICE_ID_MSB + i, ®);
335 static inline void dac33_soft_power(struct snd_soc_component *component, int power)
339 reg = dac33_read_reg_cache(component, DAC33_PWR_CTRL);
345 dac33_write(component, DAC33_PWR_CTRL, reg);
348 static inline void dac33_disable_digital(struct snd_soc_component *component)
353 reg = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B);
355 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_B, reg);
358 reg = dac33_read_reg_cache(component, DAC33_PWR_CTRL);
360 dac33_write(component, DAC33_PWR_CTRL, reg);
363 static int dac33_hard_power(struct snd_soc_component *component, int power)
365 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
372 dev_dbg(component->dev, "Trying to set the same power state: %s\n",
381 dev_err(component->dev,
391 dac33_soft_power(component, 0);
398 dev_err(component->dev,
414 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
415 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
420 dac33_calculate_times(dac33->substream, component);
421 dac33_prepare_chip(dac33->substream, component);
425 dac33_disable_digital(component);
434 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
435 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
445 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
446 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
452 if (snd_soc_component_active(component))
612 static int dac33_set_bias_level(struct snd_soc_component *component,
623 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
624 /* Coming from OFF, switch on the component */
625 ret = dac33_hard_power(component, 1);
629 dac33_init_chip(component);
633 /* Do not power off, when the component is already off */
634 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF)
636 ret = dac33_hard_power(component, 0);
647 struct snd_soc_component *component = dac33->component;
653 dac33_write16(component, DAC33_NSAMPLE_MSB,
662 dac33_write16(component, DAC33_PREFILL_MSB,
668 dac33_write(component, DAC33_FIFO_IRQ_MASK, DAC33_MAT);
678 dac33_write16(component, DAC33_PREFILL_MSB,
682 dac33_write(component, DAC33_FIFO_IRQ_MASK, DAC33_MUT);
685 dev_warn(component->dev, "Unhandled FIFO mode: %d\n",
693 struct snd_soc_component *component = dac33->component;
703 dac33_write16(component, DAC33_NSAMPLE_MSB,
710 dev_warn(component->dev, "Unhandled FIFO mode: %d\n",
718 struct snd_soc_component *component;
723 component = dac33->component;
739 dac33_write(component, DAC33_FIFO_IRQ_MASK, 0);
742 reg = dac33_read_reg_cache(component, DAC33_FIFO_CTRL_A);
744 dac33_write(component, DAC33_FIFO_CTRL_A, reg);
752 struct snd_soc_component *component = dev;
753 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
767 static void dac33_oscwait(struct snd_soc_component *component)
774 dac33_read(component, DAC33_INT_OSC_STATUS, ®);
777 dev_err(component->dev,
784 struct snd_soc_component *component = dai->component;
785 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
796 struct snd_soc_component *component = dai->component;
797 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
808 struct snd_soc_component *component = dai->component;
809 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
817 dev_err(component->dev, "unsupported rate %d\n",
832 dev_err(component->dev, "unsupported width %d\n",
851 struct snd_soc_component *component)
853 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
865 dev_err(component->dev, "unsupported rate %d\n",
871 aictrl_a = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A);
874 fifoctrl_a = dac33_read_reg_cache(component, DAC33_FIFO_CTRL_A);
887 dev_err(component->dev, "unsupported format %d\n",
903 dac33_soft_power(component, 0);
904 dac33_soft_power(component, 1);
906 reg_tmp = dac33_read_reg_cache(component, DAC33_INT_OSC_CTRL);
907 dac33_write(component, DAC33_INT_OSC_CTRL, reg_tmp);
910 dac33_write16(component, DAC33_INT_OSC_FREQ_RAT_A, oscset);
913 dac33_write(component, DAC33_CALIB_TIME, 96);
916 dac33_write(component, DAC33_INT_OSC_CTRL_B, DAC33_ADJTHRSHLD(2) |
920 dac33_write(component, DAC33_INT_OSC_CTRL_C, DAC33_REFDIV(4));
922 pwr_ctrl = dac33_read_reg_cache(component, DAC33_PWR_CTRL);
924 dac33_write(component, DAC33_PWR_CTRL, pwr_ctrl);
926 dac33_oscwait(component);
931 dac33_write(component, DAC33_ASRC_CTRL_A, DAC33_SRCLKDIV(1));
932 dac33_write(component, DAC33_ASRC_CTRL_B, 1); /* ??? */
935 dac33_write16(component, DAC33_SRC_REF_CLK_RATIO_A, ratioset);
938 dac33_write(component, DAC33_INTP_CTRL_A, DAC33_INTPM_AHIGH);
942 dac33_write(component, DAC33_ASRC_CTRL_A, DAC33_SRCBYP);
943 dac33_write(component, DAC33_ASRC_CTRL_B, 0); /* ??? */
949 dac33_write(component, DAC33_FIFO_IRQ_MODE_B,
953 dac33_write(component, DAC33_FIFO_IRQ_MODE_A,
961 aictrl_b = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B);
1003 dac33_write(component, DAC33_FIFO_CTRL_A, fifoctrl_a);
1004 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_A, aictrl_a);
1005 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_B, aictrl_b);
1017 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_C,
1021 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_C, 32);
1023 dac33_write(component, DAC33_SER_AUDIOIF_CTRL_C, 16);
1027 dac33_write16(component, DAC33_ATHR_MSB,
1035 dac33_write16(component, DAC33_UTHR_MSB, DAC33_THRREG(dac33->uthr));
1036 dac33_write16(component, DAC33_LTHR_MSB,
1049 struct snd_soc_component *component)
1051 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1108 struct snd_soc_component *component = dai->component;
1109 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1140 struct snd_soc_component *component = dai->component;
1141 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1273 dev_warn(component->dev, "Unhandled FIFO mode: %d\n",
1284 struct snd_soc_component *component = codec_dai->component;
1285 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1288 ioc_reg = dac33_read_reg_cache(component, DAC33_INT_OSC_CTRL);
1289 asrcb_reg = dac33_read_reg_cache(component, DAC33_ASRC_CTRL_B);
1300 dev_err(component->dev, "Invalid clock ID (%d)\n", clk_id);
1305 dac33_write_reg_cache(component, DAC33_INT_OSC_CTRL, ioc_reg);
1306 dac33_write_reg_cache(component, DAC33_ASRC_CTRL_B, asrcb_reg);
1314 struct snd_soc_component *component = codec_dai->component;
1315 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1318 aictrl_a = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A);
1319 aictrl_b = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B);
1329 dev_err(component->dev, "FIFO mode requires master mode\n");
1355 dev_err(component->dev, "Unsupported format (%u)\n",
1360 dac33_write_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A, aictrl_a);
1361 dac33_write_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B, aictrl_b);
1366 static int dac33_soc_probe(struct snd_soc_component *component)
1368 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1371 dac33->component = component;
1374 ret = dac33_hard_power(component, 1);
1376 dev_err(component->dev, "Failed to power up component: %d\n", ret);
1379 ret = dac33_read_id(component);
1380 dac33_hard_power(component, 0);
1383 dev_err(component->dev, "Failed to read chip ID: %d\n", ret);
1392 component->name, component);
1394 dev_err(component->dev, "Could not request IRQ%d (%d)\n",
1405 snd_soc_add_component_controls(component, dac33_mode_snd_controls,
1412 static void dac33_soc_remove(struct snd_soc_component *component)
1414 struct tlv320dac33_priv *dac33 = snd_soc_component_get_drvdata(component);
1417 free_irq(dac33->irq, dac33->component);
1548 dac33_hard_power(dac33->component, 0);