Skip to content

Commit

Permalink
ALSA: lola - Rename to Digital SRC Capture Switch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed May 3, 2011
1 parent c7aad3c commit 2db3002
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions sound/pci/lola/lola.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ struct lola_pin {

struct lola_pin_array {
unsigned int num_pins;
unsigned int num_analog_pins;
struct lola_pin pins[MAX_PINS];
};

Expand Down
15 changes: 14 additions & 1 deletion sound/pci/lola/lola_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ int __devinit lola_init_pins(struct lola *chip, int dir, int *nidp)
err = lola_init_pin(chip, &chip->pin[dir].pins[i], dir, nid);
if (err < 0)
return err;
if (chip->pin[dir].pins[i].is_analog)
chip->pin[dir].num_analog_pins++;
}
*nidp = nid;
return 0;
Expand Down Expand Up @@ -540,13 +542,17 @@ static int __devinit create_analog_mixer(struct lola *chip, int dir, char *name)
{
if (!chip->pin[dir].num_pins)
return 0;
/* no analog volumes on digital only adapters */
if (chip->pin[dir].num_pins != chip->pin[dir].num_analog_pins)
return 0;
lola_analog_mixer.name = name;
lola_analog_mixer.private_value = dir;
return snd_ctl_add(chip->card,
snd_ctl_new1(&lola_analog_mixer, chip));
}

/*
* Hardware sample rate converter on digital input
*/
static int lola_input_src_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
Expand Down Expand Up @@ -587,15 +593,22 @@ static int lola_input_src_put(struct snd_kcontrol *kcontrol,
}

static struct snd_kcontrol_new lola_input_src_mixer __devinitdata = {
.name = "Analog Capture Switch",
.name = "Digital SRC Capture Switch",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.info = lola_input_src_info,
.get = lola_input_src_get,
.put = lola_input_src_put,
};

/*
* Lola16161 or Lola881 can have Hardware sample rate converters
* on its digital input pins
*/
static int __devinit create_input_src_mixer(struct lola *chip)
{
if (!chip->input_src_caps_mask)
return 0;

return snd_ctl_add(chip->card,
snd_ctl_new1(&lola_input_src_mixer, chip));
}
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/lola/lola_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static int lola_pcm_prepare(struct snd_pcm_substream *substream)
mutex_lock(&chip->open_mutex);
lola_stream_reset(chip, str);
lola_cleanup_slave_streams(pcm, str);
if (str->index + runtime->channels >= pcm->num_streams) {
if (str->index + runtime->channels > pcm->num_streams) {
mutex_unlock(&chip->open_mutex);
return -EINVAL;
}
Expand Down Expand Up @@ -538,7 +538,7 @@ static int lola_pcm_trigger(struct snd_pcm_substream *substream, int cmd)

/*
* sample correct synchronization is only needed starting several
* streams on stop or if only one stream do as quick as possible
* streams. On stop or if only one stream do as quick as possible
*/
sync_streams = (start && snd_pcm_stream_linked(substream));
tstamp = lola_get_tstamp(chip, !sync_streams);
Expand Down

0 comments on commit 2db3002

Please sign in to comment.