Lines Matching defs:ice
76 static inline void stac9460_put(struct snd_ice1712 *ice, int reg, unsigned char val)
78 snd_vt1724_write_i2c(ice, PRODIGY192_STAC9460_ADDR, reg, val);
81 static inline unsigned char stac9460_get(struct snd_ice1712 *ice, int reg)
83 return snd_vt1724_read_i2c(ice, PRODIGY192_STAC9460_ADDR, reg);
93 static int stac9460_dac_mute(struct snd_ice1712 *ice, int idx,
98 old = stac9460_get(ice, idx);
103 stac9460_put(ice, idx, new);
111 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
119 val = stac9460_get(ice, idx);
126 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
127 struct prodigy192_spec *spec = ice->spec;
140 change = stac9460_dac_mute(ice, idx, ucontrol->value.integer.value[0]);
159 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
167 vol = stac9460_get(ice, idx) & 0x7f;
175 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
185 tmp = stac9460_get(ice, idx);
194 stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
206 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
211 val = stac9460_get(ice, STAC946X_MIC_L_VOLUME + i);
220 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
227 old = stac9460_get(ice, reg);
231 stac9460_put(ice, reg, new);
251 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
257 vol = stac9460_get(ice, reg) & 0x0f;
266 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
274 ovol = 0x0f - stac9460_get(ice, reg);
277 stac9460_put(ice, reg, (0x0f - nvol) | (ovol & ~0x0f));
303 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
306 val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
314 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
317 old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
321 stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
327 static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
332 struct prodigy192_spec *spec = ice->spec;
342 old = stac9460_get(ice, STAC946X_MASTER_CLOCKING);
350 changed[idx] = stac9460_dac_mute(ice,
353 stac9460_put(ice, STAC946X_MASTER_CLOCKING, new);
359 stac9460_dac_mute(ice, STAC946X_MASTER_VOLUME + idx, 1);
455 static void write_data(struct snd_ice1712 *ice, unsigned int gpio,
461 snd_ice1712_gpio_write(ice, gpio);
468 snd_ice1712_gpio_write(ice, gpio);
472 snd_ice1712_gpio_write(ice, gpio);
480 static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio,
488 snd_ice1712_gpio_write(ice, gpio);
491 if (snd_ice1712_gpio_read(ice) & VT1724_PRODIGY192_CDIN)
496 snd_ice1712_gpio_write(ice, gpio);
504 static unsigned int prodigy192_4wire_start(struct snd_ice1712 *ice)
508 snd_ice1712_save_gpio_status(ice);
509 tmp = snd_ice1712_gpio_read(ice);
513 snd_ice1712_gpio_write(ice, tmp);
521 static void prodigy192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp)
524 snd_ice1712_gpio_write(ice, tmp);
526 snd_ice1712_restore_gpio_status(ice);
535 struct snd_ice1712 *ice = private_data;
537 tmp = prodigy192_4wire_start(ice);
540 write_data(ice, tmp, addrdata, 15);
541 prodigy192_4wire_finish(ice, tmp);
550 struct snd_ice1712 *ice = private_data;
554 tmp = prodigy192_4wire_start(ice);
555 write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7);
556 data = read_data(ice, tmp, 7);
557 prodigy192_4wire_finish(ice, tmp);
580 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
583 val = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
594 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
598 old = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
605 prodigy192_ak4114_write(ice, AK4114_REG_IO1, new);
622 static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
638 struct prodigy192_spec *spec = ice->spec;
641 err = snd_ak4114_create(ice->card,
645 ice, &spec->ak4114);
657 struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
661 val = stac9460_get(ice, reg);
667 static void stac9460_proc_init(struct snd_ice1712 *ice)
670 if (!snd_card_proc_new(ice->card, "stac9460_codec", &entry))
671 snd_info_set_text_ops(entry, ice, stac9460_proc_regs_read);
675 static int __devinit prodigy192_add_controls(struct snd_ice1712 *ice)
677 struct prodigy192_spec *spec = ice->spec;
682 err = snd_ctl_add(ice->card,
683 snd_ctl_new1(&stac_controls[i], ice));
690 err = snd_ctl_add(ice->card,
692 ice));
698 ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
702 stac9460_proc_init(ice);
709 static int prodigy192_miodio_exists(struct snd_ice1712 *ice)
717 orig_value = prodigy192_ak4114_read(ice, addr);
718 prodigy192_ak4114_write(ice, addr, test_data);
719 if (prodigy192_ak4114_read(ice, addr) == test_data) {
722 prodigy192_ak4114_write(ice, addr, orig_value);
731 static int __devinit prodigy192_init(struct snd_ice1712 *ice)
750 ice->num_total_dacs = 6;
751 ice->num_total_adcs = 2;
752 ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */
757 ice->spec = spec;
763 stac9460_put(ice, p[0], p[1]);
764 ice->gpio.set_pro_rate = stac9460_set_rate_val;
767 if (prodigy192_miodio_exists(ice)) {
768 err = prodigy192_ak4114_init(ice);