Lines Matching refs:ice

61 static inline void stac9460_put(struct snd_ice1712 *ice, int reg, unsigned char val)
63 snd_vt1724_write_i2c(ice, PRODIGY192_STAC9460_ADDR, reg, val);
66 static inline unsigned char stac9460_get(struct snd_ice1712 *ice, int reg)
68 return snd_vt1724_read_i2c(ice, PRODIGY192_STAC9460_ADDR, reg);
78 static int stac9460_dac_mute(struct snd_ice1712 *ice, int idx,
83 old = stac9460_get(ice, idx);
87 /* dev_dbg(ice->card->dev, "Volume register 0x%02x: 0x%02x\n", idx, new);*/
88 stac9460_put(ice, idx, new);
96 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
104 val = stac9460_get(ice, idx);
111 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
112 struct prodigy192_spec *spec = ice->spec;
122 dev_dbg(ice->card->dev, "Mute put: reg 0x%02x, ctrl value: 0x%02x\n", idx,
125 change = stac9460_dac_mute(ice, idx, ucontrol->value.integer.value[0]);
144 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
152 vol = stac9460_get(ice, idx) & 0x7f;
160 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
170 tmp = stac9460_get(ice, idx);
174 stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
186 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
191 val = stac9460_get(ice, STAC946X_MIC_L_VOLUME + i);
200 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
207 old = stac9460_get(ice, reg);
211 stac9460_put(ice, reg, new);
231 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
237 vol = stac9460_get(ice, reg) & 0x0f;
246 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
254 ovol = 0x0f - stac9460_get(ice, reg);
257 stac9460_put(ice, reg, (0x0f - nvol) | (ovol & ~0x0f));
275 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
278 val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
286 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
289 old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
293 stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
299 static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
304 struct prodigy192_spec *spec = ice->spec;
314 old = stac9460_get(ice, STAC946X_MASTER_CLOCKING);
322 changed[idx] = stac9460_dac_mute(ice,
324 /*dev_dbg(ice->card->dev, "Rate change: %d, new MC: 0x%02x\n", rate, new);*/
325 stac9460_put(ice, STAC946X_MASTER_CLOCKING, new);
331 stac9460_dac_mute(ice, STAC946X_MASTER_VOLUME + idx, 1);
427 static void write_data(struct snd_ice1712 *ice, unsigned int gpio,
433 snd_ice1712_gpio_write(ice, gpio);
440 snd_ice1712_gpio_write(ice, gpio);
444 snd_ice1712_gpio_write(ice, gpio);
452 static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio,
460 snd_ice1712_gpio_write(ice, gpio);
463 if (snd_ice1712_gpio_read(ice) & VT1724_PRODIGY192_CDIN)
468 snd_ice1712_gpio_write(ice, gpio);
476 static unsigned int prodigy192_4wire_start(struct snd_ice1712 *ice)
480 snd_ice1712_save_gpio_status(ice);
481 tmp = snd_ice1712_gpio_read(ice);
485 snd_ice1712_gpio_write(ice, tmp);
493 static void prodigy192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp)
496 snd_ice1712_gpio_write(ice, tmp);
498 snd_ice1712_restore_gpio_status(ice);
507 struct snd_ice1712 *ice = private_data;
509 tmp = prodigy192_4wire_start(ice);
512 write_data(ice, tmp, addrdata, 15);
513 prodigy192_4wire_finish(ice, tmp);
522 struct snd_ice1712 *ice = private_data;
526 tmp = prodigy192_4wire_start(ice);
527 write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7);
528 data = read_data(ice, tmp, 7);
529 prodigy192_4wire_finish(ice, tmp);
546 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
549 val = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
560 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
564 old = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
571 prodigy192_ak4114_write(ice, AK4114_REG_IO1, new);
588 static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
604 struct prodigy192_spec *spec = ice->spec;
607 err = snd_ak4114_create(ice->card,
611 ice, &spec->ak4114);
623 struct snd_ice1712 *ice = entry->private_data;
627 val = stac9460_get(ice, reg);
633 static void stac9460_proc_init(struct snd_ice1712 *ice)
635 snd_card_ro_proc_new(ice->card, "stac9460_codec", ice,
640 static int prodigy192_add_controls(struct snd_ice1712 *ice)
642 struct prodigy192_spec *spec = ice->spec;
647 err = snd_ctl_add(ice->card,
648 snd_ctl_new1(&stac_controls[i], ice));
655 err = snd_ctl_add(ice->card,
657 ice));
663 ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
667 stac9460_proc_init(ice);
674 static int prodigy192_miodio_exists(struct snd_ice1712 *ice)
682 orig_value = prodigy192_ak4114_read(ice, addr);
683 prodigy192_ak4114_write(ice, addr, test_data);
684 if (prodigy192_ak4114_read(ice, addr) == test_data) {
687 prodigy192_ak4114_write(ice, addr, orig_value);
696 static int prodigy192_init(struct snd_ice1712 *ice)
715 ice->num_total_dacs = 6;
716 ice->num_total_adcs = 2;
717 ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */
722 ice->spec = spec;
728 stac9460_put(ice, p[0], p[1]);
729 ice->gpio.set_pro_rate = stac9460_set_rate_val;
732 if (prodigy192_miodio_exists(ice)) {
733 err = prodigy192_ak4114_init(ice);
737 dev_dbg(ice->card->dev,
740 dev_dbg(ice->card->dev, "AK4114 not found\n");