Lines Matching +full:eeprom +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Lowlevel functions for M-Audio Delta 1010, 1010E, 44, 66, 66E, Dio2496,
37 for (idx = 7; idx >= 0; idx--) { in ap_cs8427_write_byte()
55 for (idx = 7; idx >= 0; idx--) { in ap_cs8427_read_byte()
73 switch (ice->eeprom.subvendor) { in ap_cs8427_codec_select()
102 switch (ice->eeprom.subvendor) { in ap_cs8427_codec_deassert()
125 struct snd_ice1712 *ice = device->bus->private_data; in ap_cs8427_sendbytes()
129 mutex_lock(&ice->gpio_mutex); in ap_cs8427_sendbytes()
131 ap_cs8427_write_byte(ice, (device->addr << 1) | 0, tmp); /* address + write mode */ in ap_cs8427_sendbytes()
132 while (count-- > 0) in ap_cs8427_sendbytes()
135 mutex_unlock(&ice->gpio_mutex); in ap_cs8427_sendbytes()
142 struct snd_ice1712 *ice = device->bus->private_data; in ap_cs8427_readbytes()
146 mutex_lock(&ice->gpio_mutex); in ap_cs8427_readbytes()
148 ap_cs8427_write_byte(ice, (device->addr << 1) | 1, tmp); /* address + read mode */ in ap_cs8427_readbytes()
149 while (count-- > 0) in ap_cs8427_readbytes()
152 mutex_unlock(&ice->gpio_mutex); in ap_cs8427_readbytes()
160 return -ENOENT; in ap_cs8427_probeaddr()
179 mutex_lock(&ice->gpio_mutex); in snd_ice1712_delta_cs8403_spdif_write()
181 for (idx = 7; idx >= 0; idx--) { in snd_ice1712_delta_cs8403_spdif_write()
193 mutex_unlock(&ice->gpio_mutex); in snd_ice1712_delta_cs8403_spdif_write()
199 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_bits); in delta_spdif_default_get()
207 val = snd_cs8403_encode_spdif_bits(&ucontrol->value.iec958); in delta_spdif_default_put()
208 spin_lock_irq(&ice->reg_lock); in delta_spdif_default_put()
209 change = ice->spdif.cs8403_bits != val; in delta_spdif_default_put()
210 ice->spdif.cs8403_bits = val; in delta_spdif_default_put()
211 if (change && ice->playback_pro_substream == NULL) { in delta_spdif_default_put()
212 spin_unlock_irq(&ice->reg_lock); in delta_spdif_default_put()
215 spin_unlock_irq(&ice->reg_lock); in delta_spdif_default_put()
222 snd_cs8403_decode_spdif_bits(&ucontrol->value.iec958, ice->spdif.cs8403_stream_bits); in delta_spdif_stream_get()
230 val = snd_cs8403_encode_spdif_bits(&ucontrol->value.iec958); in delta_spdif_stream_put()
231 spin_lock_irq(&ice->reg_lock); in delta_spdif_stream_put()
232 change = ice->spdif.cs8403_stream_bits != val; in delta_spdif_stream_put()
233 ice->spdif.cs8403_stream_bits = val; in delta_spdif_stream_put()
234 if (change && ice->playback_pro_substream != NULL) { in delta_spdif_stream_put()
235 spin_unlock_irq(&ice->reg_lock); in delta_spdif_stream_put()
238 spin_unlock_irq(&ice->reg_lock); in delta_spdif_stream_put()
249 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; in delta_ak4524_lock()
250 struct snd_ice1712 *ice = ak->private_data[0]; in delta_ak4524_lock()
253 priv->cs_mask = in delta_ak4524_lock()
254 priv->cs_addr = chip == 0 ? ICE1712_DELTA_CODEC_CHIP_A : in delta_ak4524_lock()
263 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; in delta1010lt_ak4524_lock()
264 struct snd_ice1712 *ice = ak->private_data[0]; in delta1010lt_ak4524_lock()
267 priv->cs_mask = ICE1712_DELTA_1010LT_CS; in delta1010lt_ak4524_lock()
268 priv->cs_addr = chip << 4; in delta1010lt_ak4524_lock()
276 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; in delta66e_ak4524_lock()
277 struct snd_ice1712 *ice = ak->private_data[0]; in delta66e_ak4524_lock()
280 priv->cs_mask = in delta66e_ak4524_lock()
281 priv->cs_addr = chip == 0 ? ICE1712_DELTA_66E_CS_CHIP_A : in delta66e_ak4524_lock()
290 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; in vx442_ak4524_lock()
291 struct snd_ice1712 *ice = ak->private_data[0]; in vx442_ak4524_lock()
294 priv->cs_mask = in vx442_ak4524_lock()
295 priv->cs_addr = chip == 0 ? ICE1712_VX442_CODEC_CHIP_A : in vx442_ak4524_lock()
306 if (rate == 0) /* no hint - S/PDIF input is master, simply return */ in delta_1010_set_rate_val()
309 mutex_lock(&ice->gpio_mutex); in delta_1010_set_rate_val()
316 mutex_unlock(&ice->gpio_mutex); in delta_1010_set_rate_val()
325 struct snd_ice1712 *ice = ak->private_data[0]; in delta_ak4524_set_rate_val()
327 if (rate == 0) /* no hint - S/PDIF input is master, simply return */ in delta_ak4524_set_rate_val()
331 mutex_lock(&ice->gpio_mutex); in delta_ak4524_set_rate_val()
333 mutex_unlock(&ice->gpio_mutex); in delta_ak4524_set_rate_val()
342 mutex_lock(&ice->gpio_mutex); in delta_ak4524_set_rate_val()
347 mutex_unlock(&ice->gpio_mutex); in delta_ak4524_set_rate_val()
376 ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits; in delta_open_spdif()
386 spin_lock_irqsave(&ice->reg_lock, flags); in delta_setup_spdif()
387 tmp = ice->spdif.cs8403_stream_bits; in delta_setup_spdif()
396 change = ice->spdif.cs8403_stream_bits != tmp; in delta_setup_spdif()
397 ice->spdif.cs8403_stream_bits = tmp; in delta_setup_spdif()
398 spin_unlock_irqrestore(&ice->reg_lock, flags); in delta_setup_spdif()
400 snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &ice->spdif.stream_ctl->id); in delta_setup_spdif()
413 if (snd_i2c_sendbytes(ice->cs8427, &reg, 1) != 1) in snd_ice1712_delta1010lt_wordclock_status_get()
414 dev_err(ice->card->dev, in snd_ice1712_delta1010lt_wordclock_status_get()
416 snd_i2c_readbytes(ice->cs8427, &reg, 1); in snd_ice1712_delta1010lt_wordclock_status_get()
417 ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0; in snd_ice1712_delta1010lt_wordclock_status_get()
425 .name = "Word Clock Status",
431 * initialize the chips on M-Audio cards
572 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_resume()
579 snd_cs8427_init(ice->i2c, ice->cs8427); in snd_ice1712_delta_resume()
588 snd_ice1712_delta_cs8403_spdif_write(ice, ice->spdif.cs8403_bits); in snd_ice1712_delta_resume()
593 if (ice->akm_codecs) { in snd_ice1712_delta_resume()
594 memcpy(akm_img_bak, ice->akm->images, sizeof(akm_img_bak)); in snd_ice1712_delta_resume()
595 memcpy(akm_vol_bak, ice->akm->volumes, sizeof(akm_vol_bak)); in snd_ice1712_delta_resume()
596 snd_akm4xxx_init(ice->akm); in snd_ice1712_delta_resume()
597 memcpy(ice->akm->images, akm_img_bak, sizeof(akm_img_bak)); in snd_ice1712_delta_resume()
598 memcpy(ice->akm->volumes, akm_vol_bak, sizeof(akm_vol_bak)); in snd_ice1712_delta_resume()
599 snd_akm4xxx_reset(ice->akm, 0); in snd_ice1712_delta_resume()
607 if (ice->akm_codecs) /* reset & mute codec */ in snd_ice1712_delta_suspend()
608 snd_akm4xxx_reset(ice->akm, 1); in snd_ice1712_delta_suspend()
620 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 && in snd_ice1712_delta_init()
621 ice->eeprom.gpiodir == 0x7b) in snd_ice1712_delta_init()
622 ice->eeprom.subvendor = ICE1712_SUBDEVICE_DELTA1010E; in snd_ice1712_delta_init()
624 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA66 && in snd_ice1712_delta_init()
625 ice->eeprom.gpiodir == 0xfb) in snd_ice1712_delta_init()
626 ice->eeprom.subvendor = ICE1712_SUBDEVICE_DELTA66E; in snd_ice1712_delta_init()
629 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_init()
631 ice->num_total_dacs = 2; in snd_ice1712_delta_init()
632 ice->num_total_adcs = 2; in snd_ice1712_delta_init()
635 ice->num_total_dacs = 8; in snd_ice1712_delta_init()
636 ice->num_total_adcs = 2; in snd_ice1712_delta_init()
640 ice->num_total_dacs = ice->omni ? 8 : 4; in snd_ice1712_delta_init()
641 ice->num_total_adcs = ice->omni ? 8 : 4; in snd_ice1712_delta_init()
648 ice->num_total_dacs = 8; in snd_ice1712_delta_init()
649 ice->num_total_adcs = 8; in snd_ice1712_delta_init()
652 ice->num_total_dacs = 4; /* two AK4324 codecs */ in snd_ice1712_delta_init()
656 ice->num_total_dacs = 4; in snd_ice1712_delta_init()
657 ice->num_total_adcs = 4; in snd_ice1712_delta_init()
661 ice->pm_resume = snd_ice1712_delta_resume; in snd_ice1712_delta_init()
662 ice->pm_suspend = snd_ice1712_delta_suspend; in snd_ice1712_delta_init()
663 ice->pm_suspend_enabled = 1; in snd_ice1712_delta_init()
672 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_init()
679 err = snd_i2c_bus_create(ice->card, "ICE1712 GPIO 1", NULL, &ice->i2c); in snd_ice1712_delta_init()
681 dev_err(ice->card->dev, "unable to create I2C bus\n"); in snd_ice1712_delta_init()
684 ice->i2c->private_data = ice; in snd_ice1712_delta_init()
685 ice->i2c->ops = &ap_cs8427_i2c_ops; in snd_ice1712_delta_init()
692 ice->gpio.set_pro_rate = delta_1010_set_rate_val; in snd_ice1712_delta_init()
695 ice->gpio.set_pro_rate = delta_1010_set_rate_val; in snd_ice1712_delta_init()
698 ice->spdif.ops.open = delta_open_spdif; in snd_ice1712_delta_init()
699 ice->spdif.ops.setup_rate = delta_setup_spdif; in snd_ice1712_delta_init()
700 ice->spdif.ops.default_get = delta_spdif_default_get; in snd_ice1712_delta_init()
701 ice->spdif.ops.default_put = delta_spdif_default_put; in snd_ice1712_delta_init()
702 ice->spdif.ops.stream_get = delta_spdif_stream_get; in snd_ice1712_delta_init()
703 ice->spdif.ops.stream_put = delta_spdif_stream_put; in snd_ice1712_delta_init()
705 snd_ice1712_delta_cs8403_spdif_write(ice, ice->spdif.cs8403_bits); in snd_ice1712_delta_init()
710 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_init()
719 ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); in snd_ice1712_delta_init()
721 return -ENOMEM; in snd_ice1712_delta_init()
722 ice->akm_codecs = 1; in snd_ice1712_delta_init()
724 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_init()
747 return -EINVAL; in snd_ice1712_delta_init()
755 * additional controls for M-Audio cards
775 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_add_controls()
778 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010_wordclock_select, ice)); in snd_ice1712_delta_add_controls()
781 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010_wordclock_status, ice)); in snd_ice1712_delta_add_controls()
786 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_deltadio2496_spdif_in_select, ice)); in snd_ice1712_delta_add_controls()
792 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_select, ice)); in snd_ice1712_delta_add_controls()
795 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_status, ice)); in snd_ice1712_delta_add_controls()
802 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_add_controls()
814 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_add_controls()
819 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta_spdif_in_status, ice)); in snd_ice1712_delta_add_controls()
826 switch (ice->eeprom.subvendor) { in snd_ice1712_delta_add_controls()
849 .name = "M Audio Delta 1010",
856 .name = "M Audio Delta DiO 2496",
864 .name = "M Audio Delta 66",
872 .name = "M Audio Delta 44",
880 .name = "M Audio Audiophile 24/96",
887 .name = "M Audio Delta 410",
894 .name = "M Audio Delta 1010LT",
901 .name = "Digigram VX442",
909 .name = "Lionstracs Mediastation",
916 .name = "Edirol DA2496",