diff options
| author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 11:05:08 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 11:05:08 -0400 |
| commit | 2db3002029d6c8fbd8ad4ab21f501475cd8c96f9 (patch) | |
| tree | 1b0165b2af59214e16a5e667c2cdbf148f4879f1 | |
| parent | c7aad3c317afc05418414c95e877173799145d0b (diff) | |
ALSA: lola - Rename to Digital SRC Capture Switch
Renamed to Digial SRC Capture Switch for more correct representation.
Also fixed analog volume control on Lola161611 and lola881.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | sound/pci/lola/lola.h | 1 | ||||
| -rw-r--r-- | sound/pci/lola/lola_mixer.c | 15 | ||||
| -rw-r--r-- | sound/pci/lola/lola_pcm.c | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/sound/pci/lola/lola.h b/sound/pci/lola/lola.h index 180c2c124620..400ab5ef4c6c 100644 --- a/sound/pci/lola/lola.h +++ b/sound/pci/lola/lola.h | |||
| @@ -242,6 +242,7 @@ struct lola_pin { | |||
| 242 | 242 | ||
| 243 | struct lola_pin_array { | 243 | struct lola_pin_array { |
| 244 | unsigned int num_pins; | 244 | unsigned int num_pins; |
| 245 | unsigned int num_analog_pins; | ||
| 245 | struct lola_pin pins[MAX_PINS]; | 246 | struct lola_pin pins[MAX_PINS]; |
| 246 | }; | 247 | }; |
| 247 | 248 | ||
diff --git a/sound/pci/lola/lola_mixer.c b/sound/pci/lola/lola_mixer.c index 0d09689d7b8d..5d518f1a712c 100644 --- a/sound/pci/lola/lola_mixer.c +++ b/sound/pci/lola/lola_mixer.c | |||
| @@ -99,6 +99,8 @@ int __devinit lola_init_pins(struct lola *chip, int dir, int *nidp) | |||
| 99 | err = lola_init_pin(chip, &chip->pin[dir].pins[i], dir, nid); | 99 | err = lola_init_pin(chip, &chip->pin[dir].pins[i], dir, nid); |
| 100 | if (err < 0) | 100 | if (err < 0) |
| 101 | return err; | 101 | return err; |
| 102 | if (chip->pin[dir].pins[i].is_analog) | ||
| 103 | chip->pin[dir].num_analog_pins++; | ||
| 102 | } | 104 | } |
| 103 | *nidp = nid; | 105 | *nidp = nid; |
| 104 | return 0; | 106 | return 0; |
| @@ -540,6 +542,9 @@ static int __devinit create_analog_mixer(struct lola *chip, int dir, char *name) | |||
| 540 | { | 542 | { |
| 541 | if (!chip->pin[dir].num_pins) | 543 | if (!chip->pin[dir].num_pins) |
| 542 | return 0; | 544 | return 0; |
| 545 | /* no analog volumes on digital only adapters */ | ||
| 546 | if (chip->pin[dir].num_pins != chip->pin[dir].num_analog_pins) | ||
| 547 | return 0; | ||
| 543 | lola_analog_mixer.name = name; | 548 | lola_analog_mixer.name = name; |
| 544 | lola_analog_mixer.private_value = dir; | 549 | lola_analog_mixer.private_value = dir; |
| 545 | return snd_ctl_add(chip->card, | 550 | return snd_ctl_add(chip->card, |
| @@ -547,6 +552,7 @@ static int __devinit create_analog_mixer(struct lola *chip, int dir, char *name) | |||
| 547 | } | 552 | } |
| 548 | 553 | ||
| 549 | /* | 554 | /* |
| 555 | * Hardware sample rate converter on digital input | ||
| 550 | */ | 556 | */ |
| 551 | static int lola_input_src_info(struct snd_kcontrol *kcontrol, | 557 | static int lola_input_src_info(struct snd_kcontrol *kcontrol, |
| 552 | struct snd_ctl_elem_info *uinfo) | 558 | struct snd_ctl_elem_info *uinfo) |
| @@ -587,15 +593,22 @@ static int lola_input_src_put(struct snd_kcontrol *kcontrol, | |||
| 587 | } | 593 | } |
| 588 | 594 | ||
| 589 | static struct snd_kcontrol_new lola_input_src_mixer __devinitdata = { | 595 | static struct snd_kcontrol_new lola_input_src_mixer __devinitdata = { |
| 590 | .name = "Analog Capture Switch", | 596 | .name = "Digital SRC Capture Switch", |
| 591 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 597 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
| 592 | .info = lola_input_src_info, | 598 | .info = lola_input_src_info, |
| 593 | .get = lola_input_src_get, | 599 | .get = lola_input_src_get, |
| 594 | .put = lola_input_src_put, | 600 | .put = lola_input_src_put, |
| 595 | }; | 601 | }; |
| 596 | 602 | ||
| 603 | /* | ||
| 604 | * Lola16161 or Lola881 can have Hardware sample rate converters | ||
| 605 | * on its digital input pins | ||
| 606 | */ | ||
| 597 | static int __devinit create_input_src_mixer(struct lola *chip) | 607 | static int __devinit create_input_src_mixer(struct lola *chip) |
| 598 | { | 608 | { |
| 609 | if (!chip->input_src_caps_mask) | ||
| 610 | return 0; | ||
| 611 | |||
| 599 | return snd_ctl_add(chip->card, | 612 | return snd_ctl_add(chip->card, |
| 600 | snd_ctl_new1(&lola_input_src_mixer, chip)); | 613 | snd_ctl_new1(&lola_input_src_mixer, chip)); |
| 601 | } | 614 | } |
diff --git a/sound/pci/lola/lola_pcm.c b/sound/pci/lola/lola_pcm.c index 5c0014cbff07..aa21750202fc 100644 --- a/sound/pci/lola/lola_pcm.c +++ b/sound/pci/lola/lola_pcm.c | |||
| @@ -472,7 +472,7 @@ static int lola_pcm_prepare(struct snd_pcm_substream *substream) | |||
| 472 | mutex_lock(&chip->open_mutex); | 472 | mutex_lock(&chip->open_mutex); |
| 473 | lola_stream_reset(chip, str); | 473 | lola_stream_reset(chip, str); |
| 474 | lola_cleanup_slave_streams(pcm, str); | 474 | lola_cleanup_slave_streams(pcm, str); |
| 475 | if (str->index + runtime->channels >= pcm->num_streams) { | 475 | if (str->index + runtime->channels > pcm->num_streams) { |
| 476 | mutex_unlock(&chip->open_mutex); | 476 | mutex_unlock(&chip->open_mutex); |
| 477 | return -EINVAL; | 477 | return -EINVAL; |
| 478 | } | 478 | } |
| @@ -538,7 +538,7 @@ static int lola_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
| 538 | 538 | ||
| 539 | /* | 539 | /* |
| 540 | * sample correct synchronization is only needed starting several | 540 | * sample correct synchronization is only needed starting several |
| 541 | * streams on stop or if only one stream do as quick as possible | 541 | * streams. On stop or if only one stream do as quick as possible |
| 542 | */ | 542 | */ |
| 543 | sync_streams = (start && snd_pcm_stream_linked(substream)); | 543 | sync_streams = (start && snd_pcm_stream_linked(substream)); |
| 544 | tstamp = lola_get_tstamp(chip, !sync_streams); | 544 | tstamp = lola_get_tstamp(chip, !sync_streams); |
