diff options
-rw-r--r-- | sound/pci/ice1712/delta.c | 36 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 3 |
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 | ||
396 | int 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 | |||
406 | int 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, ®, 1) != 1) | ||
413 | snd_printk(KERN_ERR "unable to send register 0x%x byte to CS8427\n", reg); | ||
414 | snd_i2c_readbytes(ice->cs8427, ®, 1); | ||
415 | ucontrol->value.integer.value[0] = (reg ? 0 : 1); | ||
416 | return 0; | ||
417 | } | ||
418 | |||
419 | static 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) | |||
622 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = | 653 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select __devinitdata = |
623 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); | 654 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); |
624 | static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = | 655 | static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select __devinitdata = |
625 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 1, 0); | 656 | ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 0, 0); |
626 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = | 657 | static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status __devinitdata = |
627 | ICE1712_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); | 658 | ICE1712_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); |
628 | static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select __devinitdata = | 659 | static 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 | ||
1589 | static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice) | 1592 | static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice) |