Lines Matching refs:ice
27 static void revo_i2s_mclk_changed(struct snd_ice1712 *ice) in revo_i2s_mclk_changed() argument
30 outb(inb(ICEMT1724(ice, AC97_CMD)) | 0x80, ICEMT1724(ice, AC97_CMD)); in revo_i2s_mclk_changed()
33 outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD)); in revo_i2s_mclk_changed()
83 struct snd_ice1712 *ice = bus->private_data; in revo_i2c_start() local
84 snd_ice1712_save_gpio_status(ice); in revo_i2c_start()
89 struct snd_ice1712 *ice = bus->private_data; in revo_i2c_stop() local
90 snd_ice1712_restore_gpio_status(ice); in revo_i2c_stop()
95 struct snd_ice1712 *ice = bus->private_data; in revo_i2c_direction() local
104 ice->gpio.direction &= ~mask; in revo_i2c_direction()
105 ice->gpio.direction |= val; in revo_i2c_direction()
106 snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); in revo_i2c_direction()
107 snd_ice1712_gpio_set_mask(ice, ~mask); in revo_i2c_direction()
112 struct snd_ice1712 *ice = bus->private_data; in revo_i2c_setlines() local
119 snd_ice1712_gpio_write_bits(ice, in revo_i2c_setlines()
127 struct snd_ice1712 *ice = bus->private_data; in revo_i2c_getdata() local
132 bit = snd_ice1712_gpio_read_bits(ice, VT1724_REVO_I2C_DATA) ? 1 : 0; in revo_i2c_getdata()
144 static int revo51_i2c_init(struct snd_ice1712 *ice, in revo51_i2c_init() argument
153 ice->spec = spec; in revo51_i2c_init()
156 err = snd_i2c_bus_create(ice->card, "ICE1724 GPIO6", NULL, &ice->i2c); in revo51_i2c_init()
160 ice->i2c->private_data = ice; in revo51_i2c_init()
161 ice->i2c->hw_ops.bit = &revo51_bit_ops; in revo51_i2c_init()
164 err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, &spec->dev); in revo51_i2c_init()
168 pt->card = ice->card; in revo51_i2c_init()
169 pt->i2c_bus = ice->i2c; in revo51_i2c_init()
311 struct snd_ice1712 *ice = ak->private_data[0]; in ap192_set_rate_val() local
317 snd_ice1712_gpio_write_bits(ice, 1 << 8, rate > 96000 ? 1 << 8 : 0); in ap192_set_rate_val()
325 snd_ice1712_gpio_write_bits(ice, 3 << 9, dfs << 9); in ap192_set_rate_val()
327 snd_ice1712_gpio_write_bits(ice, 1 << 11, 0); in ap192_set_rate_val()
328 snd_ice1712_gpio_write_bits(ice, 1 << 11, 1 << 11); in ap192_set_rate_val()
364 static void write_data(struct snd_ice1712 *ice, unsigned int gpio, in write_data() argument
370 snd_ice1712_gpio_write(ice, gpio); in write_data()
377 snd_ice1712_gpio_write(ice, gpio); in write_data()
381 snd_ice1712_gpio_write(ice, gpio); in write_data()
386 static unsigned char read_data(struct snd_ice1712 *ice, unsigned int gpio, in read_data() argument
394 snd_ice1712_gpio_write(ice, gpio); in read_data()
397 if (snd_ice1712_gpio_read(ice) & VT1724_REVO_CDIN) in read_data()
402 snd_ice1712_gpio_write(ice, gpio); in read_data()
408 static unsigned int ap192_4wire_start(struct snd_ice1712 *ice) in ap192_4wire_start() argument
412 snd_ice1712_save_gpio_status(ice); in ap192_4wire_start()
413 tmp = snd_ice1712_gpio_read(ice); in ap192_4wire_start()
417 snd_ice1712_gpio_write(ice, tmp); in ap192_4wire_start()
422 static void ap192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp) in ap192_4wire_finish() argument
426 snd_ice1712_gpio_write(ice, tmp); in ap192_4wire_finish()
428 snd_ice1712_restore_gpio_status(ice); in ap192_4wire_finish()
434 struct snd_ice1712 *ice = private_data; in ap192_ak4114_write() local
437 tmp = ap192_4wire_start(ice); in ap192_ak4114_write()
440 write_data(ice, tmp, addrdata, 15); in ap192_ak4114_write()
441 ap192_4wire_finish(ice, tmp); in ap192_ak4114_write()
446 struct snd_ice1712 *ice = private_data; in ap192_ak4114_read() local
450 tmp = ap192_4wire_start(ice); in ap192_ak4114_read()
451 write_data(ice, tmp, (AK4114_ADDR << 6) | (addr & 0x1f), 7); in ap192_ak4114_read()
452 data = read_data(ice, tmp, 7); in ap192_ak4114_read()
453 ap192_4wire_finish(ice, tmp); in ap192_ak4114_read()
457 static int ap192_ak4114_init(struct snd_ice1712 *ice) in ap192_ak4114_init() argument
476 ice->spec = spec; in ap192_ak4114_init()
478 err = snd_ak4114_create(ice->card, in ap192_ak4114_init()
482 ice, &spec->ak4114); in ap192_ak4114_init()
492 static int revo_init(struct snd_ice1712 *ice) in revo_init() argument
498 switch (ice->eeprom.subvendor) { in revo_init()
500 ice->num_total_dacs = 8; in revo_init()
501 ice->num_total_adcs = 2; in revo_init()
502 ice->gpio.i2s_mclk_changed = revo_i2s_mclk_changed; in revo_init()
505 ice->num_total_dacs = 8; in revo_init()
506 ice->num_total_adcs = 2; in revo_init()
509 ice->num_total_dacs = 2; in revo_init()
510 ice->num_total_adcs = 2; in revo_init()
518 ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL); in revo_init()
521 switch (ice->eeprom.subvendor) { in revo_init()
523 ice->akm_codecs = 2; in revo_init()
525 &akm_revo_front_priv, ice); in revo_init()
529 &akm_revo_surround_priv, ice); in revo_init()
533 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, in revo_init()
537 ice->akm_codecs = 2; in revo_init()
539 &akm_revo51_priv, ice); in revo_init()
543 &akm_revo51_adc_priv, ice); in revo_init()
546 err = revo51_i2c_init(ice, &ptc_revo51_volume); in revo_init()
550 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, in revo_init()
554 ice->akm_codecs = 1; in revo_init()
556 ice); in revo_init()
559 err = ap192_ak4114_init(ice); in revo_init()
564 snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, in revo_init()
573 static int revo_add_controls(struct snd_ice1712 *ice) in revo_add_controls() argument
575 struct revo51_spec *spec = ice->spec; in revo_add_controls()
578 switch (ice->eeprom.subvendor) { in revo_add_controls()
580 err = snd_ice1712_akm4xxx_build_controls(ice); in revo_add_controls()
585 err = snd_ice1712_akm4xxx_build_controls(ice); in revo_add_controls()
588 spec = ice->spec; in revo_add_controls()
594 err = snd_ice1712_akm4xxx_build_controls(ice); in revo_add_controls()
599 ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); in revo_add_controls()