aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/delta.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712/delta.c')
-rw-r--r--sound/pci/ice1712/delta.c66
1 files changed, 65 insertions, 1 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index d216362626d0..20c6b079d0df 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -96,6 +96,11 @@ static unsigned char ap_cs8427_codec_select(struct snd_ice1712 *ice)
96 tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; 96 tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
97 tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; 97 tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
98 break; 98 break;
99 case ICE1712_SUBDEVICE_DELTA66E:
100 tmp |= ICE1712_DELTA_66E_CCLK | ICE1712_DELTA_66E_CS_CHIP_A |
101 ICE1712_DELTA_66E_CS_CHIP_B;
102 tmp &= ~ICE1712_DELTA_66E_CS_CS8427;
103 break;
99 case ICE1712_SUBDEVICE_VX442: 104 case ICE1712_SUBDEVICE_VX442:
100 tmp |= ICE1712_VX442_CCLK | ICE1712_VX442_CODEC_CHIP_A | ICE1712_VX442_CODEC_CHIP_B; 105 tmp |= ICE1712_VX442_CCLK | ICE1712_VX442_CODEC_CHIP_A | ICE1712_VX442_CODEC_CHIP_B;
101 tmp &= ~ICE1712_VX442_CS_DIGITAL; 106 tmp &= ~ICE1712_VX442_CS_DIGITAL;
@@ -119,6 +124,9 @@ static void ap_cs8427_codec_deassert(struct snd_ice1712 *ice, unsigned char tmp)
119 case ICE1712_SUBDEVICE_DELTA410: 124 case ICE1712_SUBDEVICE_DELTA410:
120 tmp |= ICE1712_DELTA_AP_CS_DIGITAL; 125 tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
121 break; 126 break;
127 case ICE1712_SUBDEVICE_DELTA66E:
128 tmp |= ICE1712_DELTA_66E_CS_CS8427;
129 break;
122 case ICE1712_SUBDEVICE_VX442: 130 case ICE1712_SUBDEVICE_VX442:
123 tmp |= ICE1712_VX442_CS_DIGITAL; 131 tmp |= ICE1712_VX442_CS_DIGITAL;
124 break; 132 break;
@@ -276,6 +284,20 @@ static void delta1010lt_ak4524_lock(struct snd_akm4xxx *ak, int chip)
276} 284}
277 285
278/* 286/*
287 * AK4524 on Delta66 rev E to choose the chip address
288 */
289static void delta66e_ak4524_lock(struct snd_akm4xxx *ak, int chip)
290{
291 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
292 struct snd_ice1712 *ice = ak->private_data[0];
293
294 snd_ice1712_save_gpio_status(ice);
295 priv->cs_mask =
296 priv->cs_addr = chip == 0 ? ICE1712_DELTA_66E_CS_CHIP_A :
297 ICE1712_DELTA_66E_CS_CHIP_B;
298}
299
300/*
279 * AK4528 on VX442 to choose the chip mask 301 * AK4528 on VX442 to choose the chip mask
280 */ 302 */
281static void vx442_ak4524_lock(struct snd_akm4xxx *ak, int chip) 303static void vx442_ak4524_lock(struct snd_akm4xxx *ak, int chip)
@@ -487,6 +509,29 @@ static struct snd_ak4xxx_private akm_delta1010lt_priv __devinitdata = {
487 .mask_flags = 0, 509 .mask_flags = 0,
488}; 510};
489 511
512static struct snd_akm4xxx akm_delta66e __devinitdata = {
513 .type = SND_AK4524,
514 .num_adcs = 4,
515 .num_dacs = 4,
516 .ops = {
517 .lock = delta66e_ak4524_lock,
518 .set_rate_val = delta_ak4524_set_rate_val
519 }
520};
521
522static struct snd_ak4xxx_private akm_delta66e_priv __devinitdata = {
523 .caddr = 2,
524 .cif = 0, /* the default level of the CIF pin from AK4524 */
525 .data_mask = ICE1712_DELTA_66E_DOUT,
526 .clk_mask = ICE1712_DELTA_66E_CCLK,
527 .cs_mask = 0,
528 .cs_addr = 0, /* set later */
529 .cs_none = 0,
530 .add_flags = 0,
531 .mask_flags = 0,
532};
533
534
490static struct snd_akm4xxx akm_delta44 __devinitdata = { 535static struct snd_akm4xxx akm_delta44 __devinitdata = {
491 .type = SND_AK4524, 536 .type = SND_AK4524,
492 .num_adcs = 4, 537 .num_adcs = 4,
@@ -535,6 +580,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
535{ 580{
536 int err; 581 int err;
537 struct snd_akm4xxx *ak; 582 struct snd_akm4xxx *ak;
583 unsigned char tmp;
538 584
539 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 && 585 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 &&
540 ice->eeprom.gpiodir == 0x7b) 586 ice->eeprom.gpiodir == 0x7b)
@@ -563,6 +609,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
563 case ICE1712_SUBDEVICE_DELTA1010E: 609 case ICE1712_SUBDEVICE_DELTA1010E:
564 case ICE1712_SUBDEVICE_DELTA1010LT: 610 case ICE1712_SUBDEVICE_DELTA1010LT:
565 case ICE1712_SUBDEVICE_MEDIASTATION: 611 case ICE1712_SUBDEVICE_MEDIASTATION:
612 case ICE1712_SUBDEVICE_EDIROLDA2496:
566 ice->num_total_dacs = 8; 613 ice->num_total_dacs = 8;
567 ice->num_total_adcs = 8; 614 ice->num_total_adcs = 8;
568 break; 615 break;
@@ -576,6 +623,12 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
576 break; 623 break;
577 } 624 }
578 625
626 /* initialize the SPI clock to high */
627 tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
628 tmp |= ICE1712_DELTA_AP_CCLK;
629 snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
630 udelay(5);
631
579 /* initialize spdif */ 632 /* initialize spdif */
580 switch (ice->eeprom.subvendor) { 633 switch (ice->eeprom.subvendor) {
581 case ICE1712_SUBDEVICE_AUDIOPHILE: 634 case ICE1712_SUBDEVICE_AUDIOPHILE:
@@ -635,6 +688,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
635 err = snd_ice1712_akm4xxx_init(ak, &akm_delta410, &akm_delta410_priv, ice); 688 err = snd_ice1712_akm4xxx_init(ak, &akm_delta410, &akm_delta410_priv, ice);
636 break; 689 break;
637 case ICE1712_SUBDEVICE_DELTA1010LT: 690 case ICE1712_SUBDEVICE_DELTA1010LT:
691 case ICE1712_SUBDEVICE_EDIROLDA2496:
638 err = snd_ice1712_akm4xxx_init(ak, &akm_delta1010lt, &akm_delta1010lt_priv, ice); 692 err = snd_ice1712_akm4xxx_init(ak, &akm_delta1010lt, &akm_delta1010lt_priv, ice);
639 break; 693 break;
640 case ICE1712_SUBDEVICE_DELTA66: 694 case ICE1712_SUBDEVICE_DELTA66:
@@ -642,9 +696,11 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
642 err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice); 696 err = snd_ice1712_akm4xxx_init(ak, &akm_delta44, &akm_delta44_priv, ice);
643 break; 697 break;
644 case ICE1712_SUBDEVICE_VX442: 698 case ICE1712_SUBDEVICE_VX442:
645 case ICE1712_SUBDEVICE_DELTA66E:
646 err = snd_ice1712_akm4xxx_init(ak, &akm_vx442, &akm_vx442_priv, ice); 699 err = snd_ice1712_akm4xxx_init(ak, &akm_vx442, &akm_vx442_priv, ice);
647 break; 700 break;
701 case ICE1712_SUBDEVICE_DELTA66E:
702 err = snd_ice1712_akm4xxx_init(ak, &akm_delta66e, &akm_delta66e_priv, ice);
703 break;
648 default: 704 default:
649 snd_BUG(); 705 snd_BUG();
650 return -EINVAL; 706 return -EINVAL;
@@ -734,6 +790,7 @@ static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice)
734 case ICE1712_SUBDEVICE_DELTA66: 790 case ICE1712_SUBDEVICE_DELTA66:
735 case ICE1712_SUBDEVICE_VX442: 791 case ICE1712_SUBDEVICE_VX442:
736 case ICE1712_SUBDEVICE_DELTA66E: 792 case ICE1712_SUBDEVICE_DELTA66E:
793 case ICE1712_SUBDEVICE_EDIROLDA2496:
737 err = snd_ice1712_akm4xxx_build_controls(ice); 794 err = snd_ice1712_akm4xxx_build_controls(ice);
738 if (err < 0) 795 if (err < 0)
739 return err; 796 return err;
@@ -813,5 +870,12 @@ struct snd_ice1712_card_info snd_ice1712_delta_cards[] __devinitdata = {
813 .chip_init = snd_ice1712_delta_init, 870 .chip_init = snd_ice1712_delta_init,
814 .build_controls = snd_ice1712_delta_add_controls, 871 .build_controls = snd_ice1712_delta_add_controls,
815 }, 872 },
873 {
874 .subvendor = ICE1712_SUBDEVICE_EDIROLDA2496,
875 .name = "Edirol DA2496",
876 .model = "da2496",
877 .chip_init = snd_ice1712_delta_init,
878 .build_controls = snd_ice1712_delta_add_controls,
879 },
816 { } /* terminator */ 880 { } /* terminator */
817}; 881};