aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2006-02-10 02:42:17 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:29:25 -0500
commitf7004f3975591f3d4cdf457f879e9ede57394500 (patch)
treec667bebd8b7c371aeda892946f41298d54b95682
parent9c4be3d334808d1dedea7db0ae84759bfac8e18e (diff)
[ALSA] ice1712 - Delta 1010LT S/PDIF fixes
Modules: ICE1712 driver See ALSA bug#1806 for details. Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/ice1712/delta.c36
-rw-r--r--sound/pci/ice1712/ice1712.c3
2 files changed, 38 insertions, 1 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index 4bbf1e2ae653..74c4d03720bb 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -393,6 +393,37 @@ static void delta_setup_spdif(struct snd_ice1712 *ice, int rate)
393 snd_ice1712_delta_cs8403_spdif_write(ice, tmp); 393 snd_ice1712_delta_cs8403_spdif_write(ice, tmp);
394} 394}
395 395
396int snd_ice1712_delta1010lt_wordclock_status_info(struct snd_kcontrol *kcontrol,
397 struct snd_ctl_elem_info *uinfo)
398{
399 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
400 uinfo->count = 1;
401 uinfo->value.integer.min = 0;
402 uinfo->value.integer.max = 1;
403 return 0;
404}
405
406int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kcontrol,
407 struct snd_ctl_elem_value *ucontrol)
408{
409 char reg = 0x10; // cs8427 receiver error register
410 struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
411
412 if (snd_i2c_sendbytes(ice->cs8427, &reg, 1) != 1)
413 snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg);
414 snd_i2c_readbytes(ice->cs8427, &reg, 1);
415 ucontrol->value.integer.value[0] = (reg ? 0 : 1);
416 return 0;
417}
418
419static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status __devinitdata =
420{
421 .access = (SNDRV_CTL_ELEM_ACCESS_READ),
422 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
423 .name = "Word Clock Status",
424 .info = snd_ice1712_delta1010lt_wordclock_status_info,
425 .get = snd_ice1712_delta1010lt_wordclock_status_get,
426};
396 427
397/* 428/*
398 * initialize the chips on M-Audio cards 429 * initialize the chips on M-Audio cards
@@ -622,7 +653,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
622static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = 653static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata =
623ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); 654ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0);
624static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = 655static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata =
625ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); 656ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 0, 0);
626static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = 657static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata =
627ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); 658ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE);
628static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata = 659static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata =
@@ -655,6 +686,9 @@ static int __devinit snd_ice1712_delta_add_controls(struct snd_ice1712 *ice)
655 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_select, ice)); 686 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_select, ice));
656 if (err < 0) 687 if (err < 0)
657 return err; 688 return err;
689 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_delta1010lt_wordclock_status, ice));
690 if (err < 0)
691 return err;
658 break; 692 break;
659 } 693 }
660 694
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index d6dfe001fde3..78098319209c 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -1584,6 +1584,9 @@ static void snd_ice1712_proc_read(struct snd_info_entry *entry,
1584 snd_iprintf(buffer, " CAPTURE : 0x%08x\n", inl(ICEMT(ice, ROUTE_CAPTURE))); 1584 snd_iprintf(buffer, " CAPTURE : 0x%08x\n", inl(ICEMT(ice, ROUTE_CAPTURE)));
1585 snd_iprintf(buffer, " SPDOUT : 0x%04x\n", (unsigned)inw(ICEMT(ice, ROUTE_SPDOUT))); 1585 snd_iprintf(buffer, " SPDOUT : 0x%04x\n", (unsigned)inw(ICEMT(ice, ROUTE_SPDOUT)));
1586 snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE))); 1586 snd_iprintf(buffer, " RATE : 0x%02x\n", (unsigned)inb(ICEMT(ice, RATE)));
1587 snd_iprintf(buffer, " GPIO_DATA : 0x%02x\n", (unsigned)snd_ice1712_get_gpio_data(ice));
1588 snd_iprintf(buffer, " GPIO_WRITE_MASK : 0x%02x\n", (unsigned)snd_ice1712_read(ice, ICE1712_IREG_GPIO_WRITE_MASK));
1589 snd_iprintf(buffer, " GPIO_DIRECTION : 0x%02x\n", (unsigned)snd_ice1712_read(ice, ICE1712_IREG_GPIO_DIRECTION));
1587} 1590}
1588 1591
1589static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice) 1592static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice)