diff options
Diffstat (limited to 'sound/pci/emu10k1/emumixer.c')
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 6c26319430d7..692b871bff57 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -501,17 +501,19 @@ static struct snd_kcontrol_new snd_emu1010_dac_pads[] __devinitdata = { | |||
501 | static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol, | 501 | static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol, |
502 | struct snd_ctl_elem_info *uinfo) | 502 | struct snd_ctl_elem_info *uinfo) |
503 | { | 503 | { |
504 | static char *texts[2] = { | 504 | static char *texts[4] = { |
505 | "44100", "48000" | 505 | "44100", "48000", "SPDIF", "ADAT" |
506 | }; | 506 | }; |
507 | 507 | ||
508 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 508 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
509 | uinfo->count = 1; | 509 | uinfo->count = 1; |
510 | uinfo->value.enumerated.items = 2; | 510 | uinfo->value.enumerated.items = 4; |
511 | if (uinfo->value.enumerated.item > 1) | 511 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
512 | uinfo->value.enumerated.item = 1; | 512 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; |
513 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); | 513 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); |
514 | return 0; | 514 | return 0; |
515 | |||
516 | |||
515 | } | 517 | } |
516 | 518 | ||
517 | static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol, | 519 | static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol, |
@@ -569,6 +571,44 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol, | |||
569 | /* Unmute all */ | 571 | /* Unmute all */ |
570 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); | 572 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); |
571 | break; | 573 | break; |
574 | |||
575 | case 2: /* Take clock from S/PDIF IN */ | ||
576 | /* Mute all */ | ||
577 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE ); | ||
578 | /* Default fallback clock 48kHz */ | ||
579 | snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K ); | ||
580 | /* Word Clock source, sync to S/PDIF input */ | ||
581 | snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, | ||
582 | EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X ); | ||
583 | /* Set LEDs on Audio Dock */ | ||
584 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, | ||
585 | EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK ); | ||
586 | /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */ | ||
587 | /* Allow DLL to settle */ | ||
588 | msleep(10); | ||
589 | /* Unmute all */ | ||
590 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); | ||
591 | break; | ||
592 | |||
593 | case 3: | ||
594 | /* Take clock from ADAT IN */ | ||
595 | /* Mute all */ | ||
596 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE ); | ||
597 | /* Default fallback clock 48kHz */ | ||
598 | snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K ); | ||
599 | /* Word Clock source, sync to ADAT input */ | ||
600 | snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, | ||
601 | EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X ); | ||
602 | /* Set LEDs on Audio Dock */ | ||
603 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK ); | ||
604 | /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */ | ||
605 | /* Allow DLL to settle */ | ||
606 | msleep(10); | ||
607 | /* Unmute all */ | ||
608 | snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE ); | ||
609 | |||
610 | |||
611 | break; | ||
572 | } | 612 | } |
573 | } | 613 | } |
574 | return change; | 614 | return change; |