Lines Matching defs:component
53 static int wm8753_hifi_write_dai_fmt(struct snd_soc_component *component,
55 static int wm8753_voice_write_dai_fmt(struct snd_soc_component *component,
227 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
228 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
237 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
238 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
244 if (snd_soc_component_active(component))
247 ioctl = snd_soc_component_read(component, WM8753_IOCTL);
255 snd_soc_component_write(component, WM8753_IOCTL, ioctl);
258 wm8753_hifi_write_dai_fmt(component, wm8753->hifi_fmt);
259 wm8753_voice_write_dai_fmt(component, wm8753->voice_fmt);
743 struct snd_soc_component *component = codec_dai->component;
751 reg = snd_soc_component_read(component, WM8753_CLOCK) & 0xffef;
755 reg = snd_soc_component_read(component, WM8753_CLOCK) & 0xfff7;
760 snd_soc_component_write(component, WM8753_PLL1CTL1 + offset, 0x0026);
761 snd_soc_component_write(component, WM8753_CLOCK, reg);
772 snd_soc_component_write(component, WM8753_PLL1CTL2 + offset, value);
776 snd_soc_component_write(component, WM8753_PLL1CTL3 + offset, value);
780 snd_soc_component_write(component, WM8753_PLL1CTL4 + offset, value);
783 snd_soc_component_write(component, WM8753_PLL1CTL1 + offset, 0x0027 |
785 snd_soc_component_write(component, WM8753_CLOCK, reg | enable);
864 struct snd_soc_component *component = codec_dai->component;
865 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
888 static int wm8753_vdac_adc_set_dai_fmt(struct snd_soc_component *component,
891 u16 voice = snd_soc_component_read(component, WM8753_PCM) & 0x01ec;
913 snd_soc_component_write(component, WM8753_PCM, voice);
924 struct snd_soc_component *component = dai->component;
925 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
926 u16 voice = snd_soc_component_read(component, WM8753_PCM) & 0x01f3;
927 u16 srate = snd_soc_component_read(component, WM8753_SRATE1) & 0x017f;
947 snd_soc_component_write(component, WM8753_SRATE1, srate);
949 snd_soc_component_write(component, WM8753_PCM, voice);
956 static int wm8753_pcm_set_dai_fmt(struct snd_soc_component *component,
961 voice = snd_soc_component_read(component, WM8753_PCM) & 0x011f;
962 ioctl = snd_soc_component_read(component, WM8753_IOCTL) & 0x015d;
1017 snd_soc_component_write(component, WM8753_PCM, voice);
1018 snd_soc_component_write(component, WM8753_IOCTL, ioctl);
1025 struct snd_soc_component *component = codec_dai->component;
1030 reg = snd_soc_component_read(component, WM8753_CLOCK) & 0x003f;
1031 snd_soc_component_write(component, WM8753_CLOCK, reg | div);
1034 reg = snd_soc_component_read(component, WM8753_SRATE2) & 0x01c7;
1035 snd_soc_component_write(component, WM8753_SRATE2, reg | div);
1038 reg = snd_soc_component_read(component, WM8753_SRATE2) & 0x003f;
1039 snd_soc_component_write(component, WM8753_SRATE2, reg | div);
1050 static int wm8753_hdac_set_dai_fmt(struct snd_soc_component *component,
1053 u16 hifi = snd_soc_component_read(component, WM8753_HIFI) & 0x01e0;
1075 snd_soc_component_write(component, WM8753_HIFI, hifi);
1082 static int wm8753_i2s_set_dai_fmt(struct snd_soc_component *component,
1087 hifi = snd_soc_component_read(component, WM8753_HIFI) & 0x013f;
1088 ioctl = snd_soc_component_read(component, WM8753_IOCTL) & 0x00ae;
1143 snd_soc_component_write(component, WM8753_HIFI, hifi);
1144 snd_soc_component_write(component, WM8753_IOCTL, ioctl);
1155 struct snd_soc_component *component = dai->component;
1156 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1157 u16 srate = snd_soc_component_read(component, WM8753_SRATE1) & 0x01c0;
1158 u16 hifi = snd_soc_component_read(component, WM8753_HIFI) & 0x01f3;
1167 snd_soc_component_write(component, WM8753_SRATE1, srate | (coeff_div[coeff].sr << 1) |
1185 snd_soc_component_write(component, WM8753_HIFI, hifi);
1189 static int wm8753_mode1v_set_dai_fmt(struct snd_soc_component *component,
1195 clock = snd_soc_component_read(component, WM8753_CLOCK) & 0xfffb;
1196 snd_soc_component_write(component, WM8753_CLOCK, clock);
1198 return wm8753_vdac_adc_set_dai_fmt(component, fmt);
1201 static int wm8753_mode1h_set_dai_fmt(struct snd_soc_component *component,
1204 return wm8753_hdac_set_dai_fmt(component, fmt);
1207 static int wm8753_mode2_set_dai_fmt(struct snd_soc_component *component,
1213 clock = snd_soc_component_read(component, WM8753_CLOCK) & 0xfffb;
1214 snd_soc_component_write(component, WM8753_CLOCK, clock);
1216 return wm8753_vdac_adc_set_dai_fmt(component, fmt);
1219 static int wm8753_mode3_4_set_dai_fmt(struct snd_soc_component *component,
1225 clock = snd_soc_component_read(component, WM8753_CLOCK) & 0xfffb;
1226 snd_soc_component_write(component, WM8753_CLOCK, clock | 0x4);
1228 if (wm8753_hdac_set_dai_fmt(component, fmt) < 0)
1230 return wm8753_vdac_adc_set_dai_fmt(component, fmt);
1233 static int wm8753_hifi_write_dai_fmt(struct snd_soc_component *component,
1236 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1241 ret = wm8753_mode1h_set_dai_fmt(component, fmt);
1244 ret = wm8753_mode2_set_dai_fmt(component, fmt);
1248 ret = wm8753_mode3_4_set_dai_fmt(component, fmt);
1256 return wm8753_i2s_set_dai_fmt(component, fmt);
1262 struct snd_soc_component *component = codec_dai->component;
1263 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1267 return wm8753_hifi_write_dai_fmt(component, fmt);
1270 static int wm8753_voice_write_dai_fmt(struct snd_soc_component *component,
1273 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1279 ret = wm8753_mode1v_set_dai_fmt(component, fmt);
1282 ret = wm8753_pcm_set_dai_fmt(component, fmt);
1292 struct snd_soc_component *component = codec_dai->component;
1293 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1297 return wm8753_voice_write_dai_fmt(component, fmt);
1302 struct snd_soc_component *component = dai->component;
1303 u16 mute_reg = snd_soc_component_read(component, WM8753_DAC) & 0xfff7;
1304 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1309 if (!snd_soc_component_active(component))
1310 snd_soc_component_write(component, WM8753_DAC, mute_reg | 0x8);
1313 snd_soc_component_write(component, WM8753_DAC, mute_reg | 0x8);
1315 snd_soc_component_write(component, WM8753_DAC, mute_reg);
1330 static int wm8753_set_bias_level(struct snd_soc_component *component,
1333 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1334 u16 pwr_reg = snd_soc_component_read(component, WM8753_PWR1) & 0xfe3e;
1339 snd_soc_component_write(component, WM8753_PWR1, pwr_reg | 0x00c0);
1346 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
1348 snd_soc_component_write(component, WM8753_PWR1, pwr_reg | 0x01c1);
1353 snd_soc_component_write(component, WM8753_PWR1, pwr_reg | 0x0141);
1358 snd_soc_component_write(component, WM8753_PWR1, 0x0001);
1442 static int wm8753_resume(struct snd_soc_component *component)
1444 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1451 static int wm8753_probe(struct snd_soc_component *component)
1453 struct wm8753_priv *wm8753 = snd_soc_component_get_drvdata(component);
1458 ret = wm8753_reset(component);
1460 dev_err(component->dev, "Failed to issue reset: %d\n", ret);
1467 snd_soc_component_update_bits(component, WM8753_LDAC, 0x0100, 0x0100);
1468 snd_soc_component_update_bits(component, WM8753_RDAC, 0x0100, 0x0100);
1469 snd_soc_component_update_bits(component, WM8753_LADC, 0x0100, 0x0100);
1470 snd_soc_component_update_bits(component, WM8753_RADC, 0x0100, 0x0100);
1471 snd_soc_component_update_bits(component, WM8753_LOUT1V, 0x0100, 0x0100);
1472 snd_soc_component_update_bits(component, WM8753_ROUT1V, 0x0100, 0x0100);
1473 snd_soc_component_update_bits(component, WM8753_LOUT2V, 0x0100, 0x0100);
1474 snd_soc_component_update_bits(component, WM8753_ROUT2V, 0x0100, 0x0100);
1475 snd_soc_component_update_bits(component, WM8753_LINVOL, 0x0100, 0x0100);
1476 snd_soc_component_update_bits(component, WM8753_RINVOL, 0x0100, 0x0100);