Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa4c495e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix a copmile warning
  ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2
  ALSA: hda - Change all ADCs for dual-adc switching mode for Realtek
  ASoC: Manage WM8731 ACTIVE bit as a supply widget
  ASoC: Don't set invalid name string to snd_card->driver field
  ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
  ASoC: Tegra: I2S: Ensure clock is enabled when writing regs
  ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values
  ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state
  ASoC: tlv320aic3x: Don't sync first two registers from register cache
  audio: tlv320aic26: fix PLL register configuration
parents 2169ce92 e8fd86ef
Loading
Loading
Loading
Loading
+23 −10
Original line number Original line Diff line number Diff line
@@ -2715,17 +2715,30 @@ typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
				 struct snd_ctl_elem_value *ucontrol,
				 struct snd_ctl_elem_value *ucontrol,
				 getput_call_t func)
				 getput_call_t func, bool check_adc_switch)
{
{
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
	struct alc_spec *spec = codec->spec;
	struct alc_spec *spec = codec->spec;
	unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
	int i, err = 0;
	int err;
	mutex_lock(&codec->control_mutex);
	mutex_lock(&codec->control_mutex);
	kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
	if (check_adc_switch && spec->dual_adc_switch) {
		for (i = 0; i < spec->num_adc_nids; i++) {
			kcontrol->private_value =
				HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
						    3, 0, HDA_INPUT);
						    3, 0, HDA_INPUT);
			err = func(kcontrol, ucontrol);
			err = func(kcontrol, ucontrol);
			if (err < 0)
				goto error;
		}
	} else {
		i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
		kcontrol->private_value =
			HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
					    3, 0, HDA_INPUT);
		err = func(kcontrol, ucontrol);
	}
 error:
	mutex_unlock(&codec->control_mutex);
	mutex_unlock(&codec->control_mutex);
	return err;
	return err;
}
}
@@ -2734,14 +2747,14 @@ static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_value *ucontrol)
			   struct snd_ctl_elem_value *ucontrol)
{
{
	return alc_cap_getput_caller(kcontrol, ucontrol,
	return alc_cap_getput_caller(kcontrol, ucontrol,
				     snd_hda_mixer_amp_volume_get);
				     snd_hda_mixer_amp_volume_get, false);
}
}
static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_value *ucontrol)
			   struct snd_ctl_elem_value *ucontrol)
{
{
	return alc_cap_getput_caller(kcontrol, ucontrol,
	return alc_cap_getput_caller(kcontrol, ucontrol,
				     snd_hda_mixer_amp_volume_put);
				     snd_hda_mixer_amp_volume_put, true);
}
}
/* capture mixer elements */
/* capture mixer elements */
@@ -2751,14 +2764,14 @@ static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
			  struct snd_ctl_elem_value *ucontrol)
{
{
	return alc_cap_getput_caller(kcontrol, ucontrol,
	return alc_cap_getput_caller(kcontrol, ucontrol,
				     snd_hda_mixer_amp_switch_get);
				     snd_hda_mixer_amp_switch_get, false);
}
}
static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
			  struct snd_ctl_elem_value *ucontrol)
			  struct snd_ctl_elem_value *ucontrol)
{
{
	return alc_cap_getput_caller(kcontrol, ucontrol,
	return alc_cap_getput_caller(kcontrol, ucontrol,
				     snd_hda_mixer_amp_switch_put);
				     snd_hda_mixer_amp_switch_put, true);
}
}
#define _DEFINE_CAPMIX(num) \
#define _DEFINE_CAPMIX(num) \
+11 −2
Original line number Original line Diff line number Diff line
@@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
	pr_debug("%s enter\n", __func__);
	pr_debug("%s enter\n", __func__);
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
		diff = sport_curr_offset_tx(sport);
		diff = sport_curr_offset_tx(sport);
		frames = bytes_to_frames(substream->runtime, diff);
	} else {
	} else {
		diff = sport_curr_offset_rx(sport);
		diff = sport_curr_offset_rx(sport);
		frames = bytes_to_frames(substream->runtime, diff);
	}
	}

	/*
	 * TX at least can report one frame beyond the end of the
	 * buffer if we hit the wraparound case - clamp to within the
	 * buffer as the ALSA APIs require.
	 */
	if (diff == snd_pcm_lib_buffer_bytes(substream))
		diff = 0;

	frames = bytes_to_frames(substream->runtime, diff);

	return frames;
	return frames;
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
	default:
	default:
		return -EINVAL;
		return -EINVAL;
	}
	}
	snd_soc_update_bits(codec, PW_MGMT2, MS, data);
	snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data);
	snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko);
	snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko);


	/* format type */
	/* format type */
+11 −3
Original line number Original line Diff line number Diff line
@@ -161,10 +161,18 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
		dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
		dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
	}
	}


	/* Configure PLL */
	/**
	 * Configure PLL
	 * fsref = (mclk * PLLM) / 2048
	 * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal)
	 */
	pval = 1;
	pval = 1;
	jval = (fsref == 44100) ? 7 : 8;
	/* compute J portion of multiplier */
	dval = (fsref == 44100) ? 5264 : 1920;
	jval = fsref / (aic26->mclk / 2048);
	/* compute fractional DDDD component of multiplier */
	dval = fsref - (jval * (aic26->mclk / 2048));
	dval = (10000 * dval) / (aic26->mclk / 2048);
	dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval);
	qval = 0;
	qval = 0;
	reg = 0x8000 | qval << 11 | pval << 8 | jval << 2;
	reg = 0x8000 | qval << 11 | pval << 8 | jval << 2;
	aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg);
	aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg);
+8 −1
Original line number Original line Diff line number Diff line
@@ -1114,12 +1114,19 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)


		/* Sync reg_cache with the hardware */
		/* Sync reg_cache with the hardware */
		codec->cache_only = 0;
		codec->cache_only = 0;
		for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++)
		for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++)
			snd_soc_write(codec, i, cache[i]);
			snd_soc_write(codec, i, cache[i]);
		if (aic3x->model == AIC3X_MODEL_3007)
		if (aic3x->model == AIC3X_MODEL_3007)
			aic3x_init_3007(codec);
			aic3x_init_3007(codec);
		codec->cache_sync = 0;
		codec->cache_sync = 0;
	} else {
	} else {
		/*
		 * Do soft reset to this codec instance in order to clear
		 * possible VDD leakage currents in case the supply regulators
		 * remain on
		 */
		snd_soc_write(codec, AIC3X_RESET, SOFT_RESET);
		codec->cache_sync = 1;
		aic3x->power = 0;
		aic3x->power = 0;
		/* HW writes are needless when bias is off */
		/* HW writes are needless when bias is off */
		codec->cache_only = 1;
		codec->cache_only = 1;
Loading