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