Skip to content

Commit

Permalink
Merge tag 'sound-3.19' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Hopefully the final pull request for 3.19: this ended up with a
  slightly higher volume than wished, but I put them all as they are
  either stable or 3.19 regression fixes.

  Most of commits are from ASoC, and have been stewed for a while in
  linux-next.  The only change in the common code is the regression
  fixes for ASoC AC97 stuff wrt device registrations.  The rest are
  device-specific, mostly small fixes in various ASoC drivers and ak411x
  on ice1724 boards"

* tag 'sound-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ASoC: Intel: fix sst firmware path for cht-bsw-rt5672
  ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs
  ASoC: sgtl5000: add delay before first I2C access
  MAINTAINERS: ASoC: add maintainer for Intel BDW/HSW ASoC driver
  ASoC: atmel_ssc_dai: fix the setting for DSP mode
  ASoC: sgtl5000: Use shift mask when setting codec mode
  ASoC: tlv320aic3x: Fix data delay configuration
  ALSA: ak411x: Fix stall in work callback
  ASoC: Intel: Used lock version to update shim registers
  ASoC: wm8731: init mutex in i2c init path
  ASoC: atmel_ssc_dai: fix start event for I2S mode
  ASoC: rt5640: Add RT5642 ACPI ID for Intel Baytrail
  ASoC: wm97xx: Reset AC'97 device before registering it
  ASoC: Add support for allocating AC'97 device before registering it
  • Loading branch information
torvalds committed Feb 6, 2015
2 parents 48beb12 + d2255c0 commit 2af613d
Show file tree
Hide file tree
Showing 18 changed files with 109 additions and 69 deletions.
10 changes: 10 additions & 0 deletions MAINTAINERS
Expand Up @@ -4953,6 +4953,16 @@ F: Documentation/input/multi-touch-protocol.txt
F: drivers/input/input-mt.c
K: \b(ABS|SYN)_MT_

INTEL ASoC BDW/HSW DRIVERS
M: Jie Yang <yang.jie@linux.intel.com>
L: alsa-devel@alsa-project.org
S: Supported
F: sound/soc/intel/sst-haswell*
F: sound/soc/intel/sst-dsp*
F: sound/soc/intel/sst-firmware.c
F: sound/soc/intel/broadwell.c
F: sound/soc/intel/haswell.c

INTEL C600 SERIES SAS CONTROLLER DRIVER
M: Intel SCU Linux support <intel-linux-scu@intel.com>
M: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/exynos4.dtsi
Expand Up @@ -368,7 +368,7 @@
};

i2s1: i2s@13960000 {
compatible = "samsung,s5pv210-i2s";
compatible = "samsung,s3c6410-i2s";
reg = <0x13960000 0x100>;
clocks = <&clock CLK_I2S1>;
clock-names = "iis";
Expand All @@ -378,7 +378,7 @@
};

i2s2: i2s@13970000 {
compatible = "samsung,s5pv210-i2s";
compatible = "samsung,s3c6410-i2s";
reg = <0x13970000 0x100>;
clocks = <&clock CLK_I2S2>;
clock-names = "iis";
Expand Down
2 changes: 1 addition & 1 deletion include/sound/ak4113.h
Expand Up @@ -286,7 +286,7 @@ struct ak4113 {
ak4113_write_t *write;
ak4113_read_t *read;
void *private_data;
unsigned int init:1;
atomic_t wq_processing;
spinlock_t lock;
unsigned char regmap[AK4113_WRITABLE_REGS];
struct snd_kcontrol *kctls[AK4113_CONTROLS];
Expand Down
2 changes: 1 addition & 1 deletion include/sound/ak4114.h
Expand Up @@ -168,7 +168,7 @@ struct ak4114 {
ak4114_write_t * write;
ak4114_read_t * read;
void * private_data;
unsigned int init: 1;
atomic_t wq_processing;
spinlock_t lock;
unsigned char regmap[6];
unsigned char txcsb[5];
Expand Down
1 change: 1 addition & 0 deletions include/sound/soc.h
Expand Up @@ -498,6 +498,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
unsigned int mask, unsigned int value);

#ifdef CONFIG_SND_SOC_AC97_BUS
struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec);
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec);
void snd_soc_free_ac97_codec(struct snd_ac97 *ac97);

Expand Down
17 changes: 8 additions & 9 deletions sound/i2c/other/ak4113.c
Expand Up @@ -56,8 +56,7 @@ static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg)

static void snd_ak4113_free(struct ak4113 *chip)
{
chip->init = 1; /* don't schedule new work */
mb();
atomic_inc(&chip->wq_processing); /* don't schedule new work */
cancel_delayed_work_sync(&chip->work);
kfree(chip);
}
Expand Down Expand Up @@ -89,6 +88,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
chip->write = write;
chip->private_data = private_data;
INIT_DELAYED_WORK(&chip->work, ak4113_stats);
atomic_set(&chip->wq_processing, 0);

for (reg = 0; reg < AK4113_WRITABLE_REGS ; reg++)
chip->regmap[reg] = pgm[reg];
Expand Down Expand Up @@ -139,13 +139,11 @@ static void ak4113_init_regs(struct ak4113 *chip)

void snd_ak4113_reinit(struct ak4113 *chip)
{
chip->init = 1;
mb();
flush_delayed_work(&chip->work);
if (atomic_inc_return(&chip->wq_processing) == 1)
cancel_delayed_work_sync(&chip->work);
ak4113_init_regs(chip);
/* bring up statistics / event queing */
chip->init = 0;
if (chip->kctls[0])
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10);
}
EXPORT_SYMBOL_GPL(snd_ak4113_reinit);
Expand Down Expand Up @@ -632,8 +630,9 @@ static void ak4113_stats(struct work_struct *work)
{
struct ak4113 *chip = container_of(work, struct ak4113, work.work);

if (!chip->init)
if (atomic_inc_return(&chip->wq_processing) == 1)
snd_ak4113_check_rate_and_errors(chip, chip->check_flags);

schedule_delayed_work(&chip->work, HZ / 10);
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10);
}
18 changes: 8 additions & 10 deletions sound/i2c/other/ak4114.c
Expand Up @@ -66,8 +66,7 @@ static void reg_dump(struct ak4114 *ak4114)

static void snd_ak4114_free(struct ak4114 *chip)
{
chip->init = 1; /* don't schedule new work */
mb();
atomic_inc(&chip->wq_processing); /* don't schedule new work */
cancel_delayed_work_sync(&chip->work);
kfree(chip);
}
Expand Down Expand Up @@ -100,6 +99,7 @@ int snd_ak4114_create(struct snd_card *card,
chip->write = write;
chip->private_data = private_data;
INIT_DELAYED_WORK(&chip->work, ak4114_stats);
atomic_set(&chip->wq_processing, 0);

for (reg = 0; reg < 6; reg++)
chip->regmap[reg] = pgm[reg];
Expand Down Expand Up @@ -152,13 +152,11 @@ static void ak4114_init_regs(struct ak4114 *chip)

void snd_ak4114_reinit(struct ak4114 *chip)
{
chip->init = 1;
mb();
flush_delayed_work(&chip->work);
if (atomic_inc_return(&chip->wq_processing) == 1)
cancel_delayed_work_sync(&chip->work);
ak4114_init_regs(chip);
/* bring up statistics / event queing */
chip->init = 0;
if (chip->kctls[0])
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10);
}

Expand Down Expand Up @@ -612,10 +610,10 @@ static void ak4114_stats(struct work_struct *work)
{
struct ak4114 *chip = container_of(work, struct ak4114, work.work);

if (!chip->init)
if (atomic_inc_return(&chip->wq_processing) == 1)
snd_ak4114_check_rate_and_errors(chip, chip->check_flags);

schedule_delayed_work(&chip->work, HZ / 10);
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10);
}

EXPORT_SYMBOL(snd_ak4114_create);
Expand Down
24 changes: 7 additions & 17 deletions sound/soc/atmel/atmel_ssc_dai.c
Expand Up @@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct atmel_pcm_dma_params *dma_params;
int dir, channels, bits;
u32 tfmr, rfmr, tcmr, rcmr;
int start_event;
int ret;
int fslen, fslen_ext;

Expand Down Expand Up @@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
* The SSC transmit clock is obtained from the BCLK signal on
* on the TK line, and the SSC receive clock is
* generated from the transmit clock.
*
* For single channel data, one sample is transferred
* on the falling edge of the LRC clock.
* For two channel data, one sample is
* transferred on both edges of the LRC clock.
*/
start_event = ((channels == 1)
? SSC_START_FALLING_RF
: SSC_START_EDGE_RF);

rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY)
| SSC_BF(RCMR_START, start_event)
| SSC_BF(RCMR_START, SSC_START_FALLING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
Expand All @@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(RFMR_FSLEN, 0)
| SSC_BF(RFMR_DATNB, 0)
| SSC_BF(RFMR_DATNB, (channels - 1))
| SSC_BIT(RFMR_MSBF)
| SSC_BF(RFMR_LOOP, 0)
| SSC_BF(RFMR_DATLEN, (bits - 1));

tcmr = SSC_BF(TCMR_PERIOD, 0)
| SSC_BF(TCMR_STTDLY, START_DELAY)
| SSC_BF(TCMR_START, start_event)
| SSC_BF(TCMR_START, SSC_START_FALLING_RF)
| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(TCMR_CKO, SSC_CKO_NONE)
| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
Expand All @@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
| SSC_BF(TFMR_FSDEN, 0)
| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(TFMR_FSLEN, 0)
| SSC_BF(TFMR_DATNB, 0)
| SSC_BF(TFMR_DATNB, (channels - 1))
| SSC_BIT(TFMR_MSBF)
| SSC_BF(TFMR_DATDEF, 0)
| SSC_BF(TFMR_DATLEN, (bits - 1));
Expand All @@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
| SSC_BF(RCMR_STTDLY, 1)
| SSC_BF(RCMR_START, SSC_START_RISING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
| SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, SSC_CKS_DIV);

Expand All @@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
| SSC_BF(TCMR_STTDLY, 1)
| SSC_BF(TCMR_START, SSC_START_RISING_RF)
| SSC_BF(TCMR_CKI, SSC_CKI_RISING)
| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(TCMR_CKO, SSC_CKO_CONTINUOUS)
| SSC_BF(TCMR_CKS, SSC_CKS_DIV);

Expand Down Expand Up @@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY)
| SSC_BF(RCMR_START, SSC_START_RISING_RF)
| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
| SSC_BF(RCMR_CKI, SSC_CKI_FALLING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
SSC_CKS_PIN : SSC_CKS_CLOCK);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/rt5640.c
Expand Up @@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);
static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 },
{ "10EC5640", 0 },
{ "10EC5642", 0 },
{ },
};
MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
Expand Down
13 changes: 8 additions & 5 deletions sound/soc/codecs/sgtl5000.c
Expand Up @@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* setting i2s data format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A:
i2sctl |= SGTL5000_I2S_MODE_PCM;
i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
break;
case SND_SOC_DAIFMT_DSP_B:
i2sctl |= SGTL5000_I2S_MODE_PCM;
i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRALIGN;
break;
case SND_SOC_DAIFMT_I2S:
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ;
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
break;
case SND_SOC_DAIFMT_RIGHT_J:
i2sctl |= SGTL5000_I2S_MODE_RJ;
i2sctl |= SGTL5000_I2S_MODE_RJ << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRPOL;
break;
case SND_SOC_DAIFMT_LEFT_J:
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ;
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRALIGN;
break;
default:
Expand Down Expand Up @@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
if (ret)
return ret;

/* Need 8 clocks before I2C accesses */
udelay(1);

/* read chip information */
ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/tlv320aic3x.c
Expand Up @@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream,
delay += aic3x->tdm_delay;

/* Configure data delay */
snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, aic3x->tdm_delay);
snd_soc_write(codec, AIC3X_ASD_INTF_CTRLC, delay);

return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/wm8731.c
Expand Up @@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
if (wm8731 == NULL)
return -ENOMEM;

mutex_init(&wm8731->lock);

wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
if (IS_ERR(wm8731->regmap)) {
ret = PTR_ERR(wm8731->regmap);
Expand Down
16 changes: 10 additions & 6 deletions sound/soc/codecs/wm9705.c
Expand Up @@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
struct snd_ac97 *ac97;
int ret = 0;

ac97 = snd_soc_new_ac97_codec(codec);
ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(ac97)) {
ret = PTR_ERR(ac97);
dev_err(codec->dev, "Failed to register AC97 codec\n");
return ret;
}

snd_soc_codec_set_drvdata(codec, ac97);

ret = wm9705_reset(codec);
if (ret)
goto reset_err;
goto err_put_device;

ret = device_add(&ac97->dev);
if (ret)
goto err_put_device;

snd_soc_codec_set_drvdata(codec, ac97);

return 0;

reset_err:
snd_soc_free_ac97_codec(ac97);
err_put_device:
put_device(&ac97->dev);
return ret;
}

Expand Down
12 changes: 8 additions & 4 deletions sound/soc/codecs/wm9712.c
Expand Up @@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
int ret = 0;

wm9712->ac97 = snd_soc_new_ac97_codec(codec);
wm9712->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9712->ac97)) {
ret = PTR_ERR(wm9712->ac97);
dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret);
Expand All @@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)

ret = wm9712_reset(codec, 0);
if (ret < 0)
goto reset_err;
goto err_put_device;

ret = device_add(&wm9712->ac97->dev);
if (ret)
goto err_put_device;

/* set alc mux to none */
ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);

return 0;

reset_err:
snd_soc_free_ac97_codec(wm9712->ac97);
err_put_device:
put_device(&wm9712->ac97->dev);
return ret;
}

Expand Down

0 comments on commit 2af613d

Please sign in to comment.