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

Commit 33d31d34 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "All small fixes in random various drivers, mostly for ASoC at this
  time, which look reasonable for a high rc number"

* tag 'sound-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: rockchip-i2s: dt: swap tx and rx channed request number in example
  ASoC: rockchip-i2s: fix registers' property of rockchip i2s controller
  ASoC: rockchip-i2s: fix master mode set bit error
  ASoC: cs4265: Fix register address to set the proper data type.
  ALSA: hda - Fix invalid pin powermap without jack detection
  ASoC: soc-pcm: fix dpcm_path_get error handling
  ASoC: samsung-i2s: Check secondary DAI exists before referencing
  ASoC: Update email id of the author
  ASoC: dwc: Update email id of the author
  ASoC: davinci-mcasp: Correct rx format unit configuration
  ASoC: tlv320aic31xx: Fix 24bit samples with I2S format and 12MHz mclk
parents 153a9f13 77960852
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ i2s@ff890000 {
	#address-cells = <1>;
	#size-cells = <0>;
	dmas = <&pdma1 0>, <&pdma1 1>;
	dma-names = "rx", "tx";
	dma-names = "tx", "rx";
	clock-names = "i2s_hclk", "i2s_clk";
	clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
};
+12 −5
Original line number Diff line number Diff line
@@ -566,8 +566,8 @@ static void stac_init_power_map(struct hda_codec *codec)
		if (snd_hda_jack_tbl_get(codec, nid))
			continue;
		if (def_conf == AC_JACK_PORT_COMPLEX &&
		    !(spec->vref_mute_led_nid == nid ||
		      is_jack_detectable(codec, nid))) {
		    spec->vref_mute_led_nid != nid &&
		    is_jack_detectable(codec, nid)) {
			snd_hda_jack_detect_enable_callback(codec, nid,
							    STAC_PWR_EVENT,
							    jack_update_power);
@@ -4276,11 +4276,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
			return err;
	}

	stac_init_power_map(codec);

	return 0;
}

static int stac_build_controls(struct hda_codec *codec)
{
	int err = snd_hda_gen_build_controls(codec);

	if (err < 0)
		return err;
	stac_init_power_map(codec);
	return 0;
}

static int stac_init(struct hda_codec *codec)
{
@@ -4392,7 +4399,7 @@ static int stac_suspend(struct hda_codec *codec)
#endif /* CONFIG_PM */

static const struct hda_codec_ops stac_patch_ops = {
	.build_controls = snd_hda_gen_build_controls,
	.build_controls = stac_build_controls,
	.build_pcms = snd_hda_gen_build_pcms,
	.init = stac_init,
	.free = stac_free,
+3 −3
Original line number Diff line number Diff line
@@ -458,12 +458,12 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
		if (params_width(params) == 16) {
			snd_soc_update_bits(codec, CS4265_DAC_CTL,
				CS4265_DAC_CTL_DIF, (1 << 5));
			snd_soc_update_bits(codec, CS4265_ADC_CTL,
			snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
				CS4265_SPDIF_CTL2_DIF, (1 << 7));
		} else {
			snd_soc_update_bits(codec, CS4265_DAC_CTL,
				CS4265_DAC_CTL_DIF, (3 << 5));
			snd_soc_update_bits(codec, CS4265_ADC_CTL,
			snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
				CS4265_SPDIF_CTL2_DIF, (1 << 7));
		}
		break;
@@ -472,7 +472,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream,
			CS4265_DAC_CTL_DIF, 0);
		snd_soc_update_bits(codec, CS4265_ADC_CTL,
			CS4265_ADC_DIF, 0);
		snd_soc_update_bits(codec, CS4265_ADC_CTL,
		snd_soc_update_bits(codec, CS4265_SPDIF_CTL2,
			CS4265_SPDIF_CTL2_DIF, (1 << 6));

		break;
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
 * sound/soc/codecs/sta529.c -- spear ALSA Soc codec driver
 *
 * Copyright (C) 2012 ST Microelectronics
 * Rajeev Kumar <rajeev-dlh.kumar@st.com>
 * Rajeev Kumar <rajeevkumar.linux@gmail.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
@@ -426,5 +426,5 @@ static struct i2c_driver sta529_i2c_driver = {
module_i2c_driver(sta529_i2c_driver);

MODULE_DESCRIPTION("ASoC STA529 codec driver");
MODULE_AUTHOR("Rajeev Kumar <rajeev-dlh.kumar@st.com>");
MODULE_AUTHOR("Rajeev Kumar <rajeevkumar.linux@gmail.com>");
MODULE_LICENSE("GPL");
+39 −12
Original line number Diff line number Diff line
@@ -189,46 +189,57 @@ static const struct aic31xx_rate_divs aic31xx_divs[] = {
	/* mclk      rate  pll: p  j	 d     dosr ndac mdac  aors nadc madc */
	/* 8k rate */
	{12000000,   8000,	1, 8, 1920,	128,  48,  2,	128,  48,  2},
	{12000000,   8000,	1, 8, 1920,	128,  32,  3,	128,  32,  3},
	{24000000,   8000,	2, 8, 1920,	128,  48,  2,	128,  48,  2},
	{25000000,   8000,	2, 7, 8643,	128,  48,  2,	128,  48,  2},
	/* 11.025k rate */
	{12000000,  11025,	1, 7, 5264,	128,  32,  2,	128,  32,  2},
	{12000000,  11025,	1, 8, 4672,	128,  24,  3,	128,  24,  3},
	{24000000,  11025,	2, 7, 5264,	128,  32,  2,	128,  32,  2},
	{25000000,  11025,	2, 7, 2253,	128,  32,  2,	128,  32,  2},
	/* 16k rate */
	{12000000,  16000,	1, 8, 1920,	128,  24,  2,	128,  24,  2},
	{12000000,  16000,	1, 8, 1920,	128,  16,  3,	128,  16,  3},
	{24000000,  16000,	2, 8, 1920,	128,  24,  2,	128,  24,  2},
	{25000000,  16000,	2, 7, 8643,	128,  24,  2,	128,  24,  2},
	/* 22.05k rate */
	{12000000,  22050,	1, 7, 5264,	128,  16,  2,	128,  16,  2},
	{12000000,  22050,	1, 8, 4672,	128,  12,  3,	128,  12,  3},
	{24000000,  22050,	2, 7, 5264,	128,  16,  2,	128,  16,  2},
	{25000000,  22050,	2, 7, 2253,	128,  16,  2,	128,  16,  2},
	/* 32k rate */
	{12000000,  32000,	1, 8, 1920,	128,  12,  2,	128,  12,  2},
	{12000000,  32000,	1, 8, 1920,	128,   8,  3,	128,   8,  3},
	{24000000,  32000,	2, 8, 1920,	128,  12,  2,	128,  12,  2},
	{25000000,  32000,	2, 7, 8643,	128,  12,  2,	128,  12,  2},
	/* 44.1k rate */
	{12000000,  44100,	1, 7, 5264,	128,   8,  2,	128,   8,  2},
	{12000000,  44100,	1, 8, 4672,	128,   6,  3,	128,   6,  3},
	{24000000,  44100,	2, 7, 5264,	128,   8,  2,	128,   8,  2},
	{25000000,  44100,	2, 7, 2253,	128,   8,  2,	128,   8,  2},
	/* 48k rate */
	{12000000,  48000,	1, 8, 1920,	128,   8,  2,	128,   8,  2},
	{12000000,  48000,	1, 7, 6800,	 96,   5,  4,	 96,   5,  4},
	{24000000,  48000,	2, 8, 1920,	128,   8,  2,	128,   8,  2},
	{25000000,  48000,	2, 7, 8643,	128,   8,  2,	128,   8,  2},
	/* 88.2k rate */
	{12000000,  88200,	1, 7, 5264,	 64,   8,  2,	 64,   8,  2},
	{12000000,  88200,	1, 8, 4672,	 64,   6,  3,	 64,   6,  3},
	{24000000,  88200,	2, 7, 5264,	 64,   8,  2,	 64,   8,  2},
	{25000000,  88200,	2, 7, 2253,	 64,   8,  2,	 64,   8,  2},
	/* 96k rate */
	{12000000,  96000,	1, 8, 1920,	 64,   8,  2,	 64,   8,  2},
	{12000000,  96000,	1, 7, 6800,	 48,   5,  4,	 48,   5,  4},
	{24000000,  96000,	2, 8, 1920,	 64,   8,  2,	 64,   8,  2},
	{25000000,  96000,	2, 7, 8643,	 64,   8,  2,	 64,   8,  2},
	/* 176.4k rate */
	{12000000, 176400,	1, 7, 5264,	 32,   8,  2,	 32,   8,  2},
	{12000000, 176400,	1, 8, 4672,	 32,   6,  3,	 32,   6,  3},
	{24000000, 176400,	2, 7, 5264,	 32,   8,  2,	 32,   8,  2},
	{25000000, 176400,	2, 7, 2253,	 32,   8,  2,	 32,   8,  2},
	/* 192k rate */
	{12000000, 192000,	1, 8, 1920,	 32,   8,  2,	 32,   8,  2},
	{12000000, 192000,	1, 7, 6800,	 24,   5,  4,	 24,   5,  4},
	{24000000, 192000,	2, 8, 1920,	 32,   8,  2,	 32,   8,  2},
	{25000000, 192000,	2, 7, 8643,	 32,   8,  2,	 32,   8,  2},
};
@@ -680,7 +691,9 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
			     struct snd_pcm_hw_params *params)
{
	struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
	int bclk_score = snd_soc_params_to_frame_size(params);
	int bclk_n = 0;
	int match = -1;
	int i;

	/* Use PLL as CODEC_CLKIN and DAC_CLK as BDIV_CLKIN */
@@ -691,15 +704,37 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,

	for (i = 0; i < ARRAY_SIZE(aic31xx_divs); i++) {
		if (aic31xx_divs[i].rate == params_rate(params) &&
		    aic31xx_divs[i].mclk == aic31xx->sysclk)
			break;
		    aic31xx_divs[i].mclk == aic31xx->sysclk) {
			int s =	(aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) %
				snd_soc_params_to_frame_size(params);
			int bn = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac) /
				snd_soc_params_to_frame_size(params);
			if (s < bclk_score && bn > 0) {
				match = i;
				bclk_n = bn;
				bclk_score = s;
			}
		}
	}

	if (i == ARRAY_SIZE(aic31xx_divs)) {
		dev_err(codec->dev, "%s: Sampling rate %u not supported\n",
	if (match == -1) {
		dev_err(codec->dev,
			"%s: Sample rate (%u) and format not supported\n",
			__func__, params_rate(params));
		/* See bellow for details how fix this. */
		return -EINVAL;
	}
	if (bclk_score != 0) {
		dev_warn(codec->dev, "Can not produce exact bitclock");
		/* This is fine if using dsp format, but if using i2s
		   there may be trouble. To fix the issue edit the
		   aic31xx_divs table for your mclk and sample
		   rate. Details can be found from:
		   http://www.ti.com/lit/ds/symlink/tlv320aic3100.pdf
		   Section: 5.6 CLOCK Generation and PLL
		*/
	}
	i = match;

	/* PLL configuration */
	snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK,
@@ -729,14 +764,6 @@ static int aic31xx_setup_pll(struct snd_soc_codec *codec,
	snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr);

	/* Bit clock divider configuration. */
	bclk_n = (aic31xx_divs[i].dosr * aic31xx_divs[i].mdac)
		/ snd_soc_params_to_frame_size(params);
	if (bclk_n == 0) {
		dev_err(codec->dev, "%s: Not enough BLCK bandwidth\n",
			__func__);
		return -EINVAL;
	}

	snd_soc_update_bits(codec, AIC31XX_BCLKN,
			    AIC31XX_PLL_MASK, bclk_n);

Loading