Lines Matching refs:component

216 static void wm8900_reset(struct snd_soc_component *component)
218 snd_soc_component_write(component, WM8900_REG_RESET, 0);
224 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
225 u16 hpctl1 = snd_soc_component_read(component, WM8900_REG_HPCTL1);
232 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
241 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
248 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
252 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
254 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
260 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
264 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
270 snd_soc_component_write(component, WM8900_REG_HPCTL1, hpctl1);
275 snd_soc_component_write(component, WM8900_REG_HPCTL1, 0);
629 struct snd_soc_component *component = dai->component;
632 reg = snd_soc_component_read(component, WM8900_REG_AUDIO1) & ~0x60;
650 snd_soc_component_write(component, WM8900_REG_AUDIO1, reg);
653 reg = snd_soc_component_read(component, WM8900_REG_DACCTRL);
660 snd_soc_component_write(component, WM8900_REG_DACCTRL, reg);
745 static int wm8900_set_fll(struct snd_soc_component *component,
748 struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component);
755 snd_soc_component_update_bits(component, WM8900_REG_POWER1,
760 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING1,
762 snd_soc_component_update_bits(component, WM8900_REG_FLLCTL1,
778 snd_soc_component_write(component, WM8900_REG_FLLCTL1,
781 snd_soc_component_write(component, WM8900_REG_FLLCTL4, fll_div.n >> 5);
782 snd_soc_component_write(component, WM8900_REG_FLLCTL5,
786 snd_soc_component_write(component, WM8900_REG_FLLCTL2,
788 snd_soc_component_write(component, WM8900_REG_FLLCTL3, fll_div.k & 0xff);
790 snd_soc_component_write(component, WM8900_REG_FLLCTL2, 0);
793 snd_soc_component_write(component, WM8900_REG_FLLCTL6,
796 snd_soc_component_write(component, WM8900_REG_FLLCTL6, 0);
798 snd_soc_component_update_bits(component, WM8900_REG_POWER1,
803 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING1,
812 return wm8900_set_fll(codec_dai->component, pll_id, freq_in, freq_out);
818 struct snd_soc_component *component = codec_dai->component;
822 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING1,
826 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING1,
830 snd_soc_component_update_bits(component, WM8900_REG_AUDIO4,
834 snd_soc_component_update_bits(component, WM8900_REG_AUDIO3,
838 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING2,
842 snd_soc_component_update_bits(component, WM8900_REG_CLOCKING2,
846 snd_soc_component_update_bits(component, WM8900_REG_DACCTRL,
860 struct snd_soc_component *component = codec_dai->component;
863 clocking1 = snd_soc_component_read(component, WM8900_REG_CLOCKING1);
864 aif1 = snd_soc_component_read(component, WM8900_REG_AUDIO1);
865 aif3 = snd_soc_component_read(component, WM8900_REG_AUDIO3);
866 aif4 = snd_soc_component_read(component, WM8900_REG_AUDIO4);
962 snd_soc_component_write(component, WM8900_REG_CLOCKING1, clocking1);
963 snd_soc_component_write(component, WM8900_REG_AUDIO1, aif1);
964 snd_soc_component_write(component, WM8900_REG_AUDIO3, aif3);
965 snd_soc_component_write(component, WM8900_REG_AUDIO4, aif4);
972 struct snd_soc_component *component = codec_dai->component;
975 reg = snd_soc_component_read(component, WM8900_REG_DACCTRL);
982 snd_soc_component_write(component, WM8900_REG_DACCTRL, reg);
1023 static int wm8900_set_bias_level(struct snd_soc_component *component,
1031 snd_soc_component_update_bits(component, WM8900_REG_GPIO,
1034 snd_soc_component_update_bits(component, WM8900_REG_ADDCTL,
1044 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
1046 snd_soc_component_write(component, WM8900_REG_POWER1,
1050 snd_soc_component_write(component, WM8900_REG_ADDCTL,
1055 snd_soc_component_write(component, WM8900_REG_POWER1,
1062 snd_soc_component_write(component, WM8900_REG_POWER1,
1066 snd_soc_component_write(component, WM8900_REG_ADDCTL, 0);
1068 snd_soc_component_write(component, WM8900_REG_POWER1,
1072 reg = snd_soc_component_read(component, WM8900_REG_POWER1);
1073 snd_soc_component_write(component, WM8900_REG_POWER1,
1076 snd_soc_component_write(component, WM8900_REG_POWER2,
1078 snd_soc_component_write(component, WM8900_REG_POWER3, 0);
1083 reg = snd_soc_component_read(component, WM8900_REG_POWER1);
1084 snd_soc_component_write(component, WM8900_REG_POWER1,
1086 snd_soc_component_write(component, WM8900_REG_ADDCTL,
1091 snd_soc_component_write(component, WM8900_REG_POWER1,
1096 snd_soc_component_write(component, WM8900_REG_HPCTL1, 0);
1099 snd_soc_component_write(component, WM8900_REG_ADDCTL, 0);
1100 snd_soc_component_write(component, WM8900_REG_POWER1, 0);
1101 snd_soc_component_write(component, WM8900_REG_POWER2, 0);
1102 snd_soc_component_write(component, WM8900_REG_POWER3, 0);
1108 snd_soc_component_write(component, WM8900_REG_POWER2,
1115 static int wm8900_suspend(struct snd_soc_component *component)
1117 struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component);
1123 ret = wm8900_set_fll(component, 0, 0, 0);
1125 dev_err(component->dev, "Failed to stop FLL\n");
1132 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
1137 static int wm8900_resume(struct snd_soc_component *component)
1139 struct wm8900_priv *wm8900 = snd_soc_component_get_drvdata(component);
1142 wm8900_reset(component);
1146 dev_err(component->dev, "Failed to restore cache: %d\n", ret);
1150 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY);
1160 ret = wm8900_set_fll(component, 0, fll_in, fll_out);
1162 dev_err(component->dev, "Failed to restart FLL\n");
1170 static int wm8900_probe(struct snd_soc_component *component)
1174 reg = snd_soc_component_read(component, WM8900_REG_ID);
1176 dev_err(component->dev, "Device is not a WM8900 - ID %x\n", reg);
1180 wm8900_reset(component);
1183 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_STANDBY);
1186 snd_soc_component_update_bits(component, WM8900_REG_LINVOL, 0x100, 0x100);
1187 snd_soc_component_update_bits(component, WM8900_REG_RINVOL, 0x100, 0x100);
1188 snd_soc_component_update_bits(component, WM8900_REG_LOUT1CTL, 0x100, 0x100);
1189 snd_soc_component_update_bits(component, WM8900_REG_ROUT1CTL, 0x100, 0x100);
1190 snd_soc_component_update_bits(component, WM8900_REG_LOUT2CTL, 0x100, 0x100);
1191 snd_soc_component_update_bits(component, WM8900_REG_ROUT2CTL, 0x100, 0x100);
1192 snd_soc_component_update_bits(component, WM8900_REG_LDAC_DV, 0x100, 0x100);
1193 snd_soc_component_update_bits(component, WM8900_REG_RDAC_DV, 0x100, 0x100);
1194 snd_soc_component_update_bits(component, WM8900_REG_LADC_DV, 0x100, 0x100);
1195 snd_soc_component_update_bits(component, WM8900_REG_RADC_DV, 0x100, 0x100);
1198 snd_soc_component_write(component, WM8900_REG_OUTBIASCTL, 0x81);