Commit 2af613d3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/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
parents 48beb121 d2255c01
...@@ -4953,6 +4953,16 @@ F: Documentation/input/multi-touch-protocol.txt ...@@ -4953,6 +4953,16 @@ F: Documentation/input/multi-touch-protocol.txt
F: drivers/input/input-mt.c F: drivers/input/input-mt.c
K: \b(ABS|SYN)_MT_ 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 INTEL C600 SERIES SAS CONTROLLER DRIVER
M: Intel SCU Linux support <intel-linux-scu@intel.com> M: Intel SCU Linux support <intel-linux-scu@intel.com>
M: Artur Paszkiewicz <artur.paszkiewicz@intel.com> M: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
......
...@@ -368,7 +368,7 @@ port@0 { ...@@ -368,7 +368,7 @@ port@0 {
}; };
i2s1: i2s@13960000 { i2s1: i2s@13960000 {
compatible = "samsung,s5pv210-i2s"; compatible = "samsung,s3c6410-i2s";
reg = <0x13960000 0x100>; reg = <0x13960000 0x100>;
clocks = <&clock CLK_I2S1>; clocks = <&clock CLK_I2S1>;
clock-names = "iis"; clock-names = "iis";
...@@ -378,7 +378,7 @@ i2s1: i2s@13960000 { ...@@ -378,7 +378,7 @@ i2s1: i2s@13960000 {
}; };
i2s2: i2s@13970000 { i2s2: i2s@13970000 {
compatible = "samsung,s5pv210-i2s"; compatible = "samsung,s3c6410-i2s";
reg = <0x13970000 0x100>; reg = <0x13970000 0x100>;
clocks = <&clock CLK_I2S2>; clocks = <&clock CLK_I2S2>;
clock-names = "iis"; clock-names = "iis";
......
...@@ -286,7 +286,7 @@ struct ak4113 { ...@@ -286,7 +286,7 @@ struct ak4113 {
ak4113_write_t *write; ak4113_write_t *write;
ak4113_read_t *read; ak4113_read_t *read;
void *private_data; void *private_data;
unsigned int init:1; atomic_t wq_processing;
spinlock_t lock; spinlock_t lock;
unsigned char regmap[AK4113_WRITABLE_REGS]; unsigned char regmap[AK4113_WRITABLE_REGS];
struct snd_kcontrol *kctls[AK4113_CONTROLS]; struct snd_kcontrol *kctls[AK4113_CONTROLS];
......
...@@ -168,7 +168,7 @@ struct ak4114 { ...@@ -168,7 +168,7 @@ struct ak4114 {
ak4114_write_t * write; ak4114_write_t * write;
ak4114_read_t * read; ak4114_read_t * read;
void * private_data; void * private_data;
unsigned int init: 1; atomic_t wq_processing;
spinlock_t lock; spinlock_t lock;
unsigned char regmap[6]; unsigned char regmap[6];
unsigned char txcsb[5]; unsigned char txcsb[5];
......
...@@ -498,6 +498,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, ...@@ -498,6 +498,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
unsigned int mask, unsigned int value); unsigned int mask, unsigned int value);
#ifdef CONFIG_SND_SOC_AC97_BUS #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); struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec);
void snd_soc_free_ac97_codec(struct snd_ac97 *ac97); void snd_soc_free_ac97_codec(struct snd_ac97 *ac97);
......
...@@ -56,8 +56,7 @@ static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg) ...@@ -56,8 +56,7 @@ static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg)
static void snd_ak4113_free(struct ak4113 *chip) static void snd_ak4113_free(struct ak4113 *chip)
{ {
chip->init = 1; /* don't schedule new work */ atomic_inc(&chip->wq_processing); /* don't schedule new work */
mb();
cancel_delayed_work_sync(&chip->work); cancel_delayed_work_sync(&chip->work);
kfree(chip); kfree(chip);
} }
...@@ -89,6 +88,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, ...@@ -89,6 +88,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
chip->write = write; chip->write = write;
chip->private_data = private_data; chip->private_data = private_data;
INIT_DELAYED_WORK(&chip->work, ak4113_stats); INIT_DELAYED_WORK(&chip->work, ak4113_stats);
atomic_set(&chip->wq_processing, 0);
for (reg = 0; reg < AK4113_WRITABLE_REGS ; reg++) for (reg = 0; reg < AK4113_WRITABLE_REGS ; reg++)
chip->regmap[reg] = pgm[reg]; chip->regmap[reg] = pgm[reg];
...@@ -139,13 +139,11 @@ static void ak4113_init_regs(struct ak4113 *chip) ...@@ -139,13 +139,11 @@ static void ak4113_init_regs(struct ak4113 *chip)
void snd_ak4113_reinit(struct ak4113 *chip) void snd_ak4113_reinit(struct ak4113 *chip)
{ {
chip->init = 1; if (atomic_inc_return(&chip->wq_processing) == 1)
mb(); cancel_delayed_work_sync(&chip->work);
flush_delayed_work(&chip->work);
ak4113_init_regs(chip); ak4113_init_regs(chip);
/* bring up statistics / event queing */ /* bring up statistics / event queing */
chip->init = 0; if (atomic_dec_and_test(&chip->wq_processing))
if (chip->kctls[0])
schedule_delayed_work(&chip->work, HZ / 10); schedule_delayed_work(&chip->work, HZ / 10);
} }
EXPORT_SYMBOL_GPL(snd_ak4113_reinit); EXPORT_SYMBOL_GPL(snd_ak4113_reinit);
...@@ -632,8 +630,9 @@ static void ak4113_stats(struct work_struct *work) ...@@ -632,8 +630,9 @@ static void ak4113_stats(struct work_struct *work)
{ {
struct ak4113 *chip = container_of(work, struct ak4113, work.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); 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);
} }
...@@ -66,8 +66,7 @@ static void reg_dump(struct ak4114 *ak4114) ...@@ -66,8 +66,7 @@ static void reg_dump(struct ak4114 *ak4114)
static void snd_ak4114_free(struct ak4114 *chip) static void snd_ak4114_free(struct ak4114 *chip)
{ {
chip->init = 1; /* don't schedule new work */ atomic_inc(&chip->wq_processing); /* don't schedule new work */
mb();
cancel_delayed_work_sync(&chip->work); cancel_delayed_work_sync(&chip->work);
kfree(chip); kfree(chip);
} }
...@@ -100,6 +99,7 @@ int snd_ak4114_create(struct snd_card *card, ...@@ -100,6 +99,7 @@ int snd_ak4114_create(struct snd_card *card,
chip->write = write; chip->write = write;
chip->private_data = private_data; chip->private_data = private_data;
INIT_DELAYED_WORK(&chip->work, ak4114_stats); INIT_DELAYED_WORK(&chip->work, ak4114_stats);
atomic_set(&chip->wq_processing, 0);
for (reg = 0; reg < 6; reg++) for (reg = 0; reg < 6; reg++)
chip->regmap[reg] = pgm[reg]; chip->regmap[reg] = pgm[reg];
...@@ -152,13 +152,11 @@ static void ak4114_init_regs(struct ak4114 *chip) ...@@ -152,13 +152,11 @@ static void ak4114_init_regs(struct ak4114 *chip)
void snd_ak4114_reinit(struct ak4114 *chip) void snd_ak4114_reinit(struct ak4114 *chip)
{ {
chip->init = 1; if (atomic_inc_return(&chip->wq_processing) == 1)
mb(); cancel_delayed_work_sync(&chip->work);
flush_delayed_work(&chip->work);
ak4114_init_regs(chip); ak4114_init_regs(chip);
/* bring up statistics / event queing */ /* bring up statistics / event queing */
chip->init = 0; if (atomic_dec_and_test(&chip->wq_processing))
if (chip->kctls[0])
schedule_delayed_work(&chip->work, HZ / 10); schedule_delayed_work(&chip->work, HZ / 10);
} }
...@@ -612,10 +610,10 @@ static void ak4114_stats(struct work_struct *work) ...@@ -612,10 +610,10 @@ static void ak4114_stats(struct work_struct *work)
{ {
struct ak4114 *chip = container_of(work, struct ak4114, work.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); snd_ak4114_check_rate_and_errors(chip, chip->check_flags);
if (atomic_dec_and_test(&chip->wq_processing))
schedule_delayed_work(&chip->work, HZ / 10); schedule_delayed_work(&chip->work, HZ / 10);
} }
EXPORT_SYMBOL(snd_ak4114_create); EXPORT_SYMBOL(snd_ak4114_create);
......
...@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct atmel_pcm_dma_params *dma_params; struct atmel_pcm_dma_params *dma_params;
int dir, channels, bits; int dir, channels, bits;
u32 tfmr, rfmr, tcmr, rcmr; u32 tfmr, rfmr, tcmr, rcmr;
int start_event;
int ret; int ret;
int fslen, fslen_ext; int fslen, fslen_ext;
...@@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -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 * The SSC transmit clock is obtained from the BCLK signal on
* on the TK line, and the SSC receive clock is * on the TK line, and the SSC receive clock is
* generated from the transmit clock. * 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) rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY) | 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_CKI, SSC_CKI_RISING)
| SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
...@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) rfmr = SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(RFMR_FSLEN, 0) | SSC_BF(RFMR_FSLEN, 0)
| SSC_BF(RFMR_DATNB, 0) | SSC_BF(RFMR_DATNB, (channels - 1))
| SSC_BIT(RFMR_MSBF) | SSC_BIT(RFMR_MSBF)
| SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_LOOP, 0)
| SSC_BF(RFMR_DATLEN, (bits - 1)); | SSC_BF(RFMR_DATLEN, (bits - 1));
tcmr = SSC_BF(TCMR_PERIOD, 0) tcmr = SSC_BF(TCMR_PERIOD, 0)
| SSC_BF(TCMR_STTDLY, START_DELAY) | 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_CKI, SSC_CKI_FALLING)
| SSC_BF(TCMR_CKO, SSC_CKO_NONE) | SSC_BF(TCMR_CKO, SSC_CKO_NONE)
| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
...@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
| SSC_BF(TFMR_FSDEN, 0) | SSC_BF(TFMR_FSDEN, 0)
| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
| SSC_BF(TFMR_FSLEN, 0) | SSC_BF(TFMR_FSLEN, 0)
| SSC_BF(TFMR_DATNB, 0) | SSC_BF(TFMR_DATNB, (channels - 1))
| SSC_BIT(TFMR_MSBF) | SSC_BIT(TFMR_MSBF)
| SSC_BF(TFMR_DATDEF, 0) | SSC_BF(TFMR_DATDEF, 0)
| SSC_BF(TFMR_DATLEN, (bits - 1)); | SSC_BF(TFMR_DATLEN, (bits - 1));
...@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -512,7 +502,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period) rcmr = SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
| SSC_BF(RCMR_STTDLY, 1) | SSC_BF(RCMR_STTDLY, 1)
| SSC_BF(RCMR_START, SSC_START_RISING_RF) | 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_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, SSC_CKS_DIV); | SSC_BF(RCMR_CKS, SSC_CKS_DIV);
...@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -527,7 +517,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period) tcmr = SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
| SSC_BF(TCMR_STTDLY, 1) | SSC_BF(TCMR_STTDLY, 1)
| SSC_BF(TCMR_START, SSC_START_RISING_RF) | 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_CKO, SSC_CKO_CONTINUOUS)
| SSC_BF(TCMR_CKS, SSC_CKS_DIV); | SSC_BF(TCMR_CKS, SSC_CKS_DIV);
...@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, ...@@ -556,7 +546,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
rcmr = SSC_BF(RCMR_PERIOD, 0) rcmr = SSC_BF(RCMR_PERIOD, 0)
| SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_STTDLY, START_DELAY)
| SSC_BF(RCMR_START, SSC_START_RISING_RF) | 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_CKO, SSC_CKO_NONE)
| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
SSC_CKS_PIN : SSC_CKS_CLOCK); SSC_CKS_PIN : SSC_CKS_CLOCK);
......
...@@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match); ...@@ -2124,6 +2124,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);
static struct acpi_device_id rt5640_acpi_match[] = { static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 }, { "INT33CA", 0 },
{ "10EC5640", 0 }, { "10EC5640", 0 },
{ "10EC5642", 0 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
......
...@@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -483,21 +483,21 @@ static int sgtl5000_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* setting i2s data format */ /* setting i2s data format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A: case SND_SOC_DAIFMT_DSP_A:
i2sctl |= SGTL5000_I2S_MODE_PCM; i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
break; break;
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
i2sctl |= SGTL5000_I2S_MODE_PCM; i2sctl |= SGTL5000_I2S_MODE_PCM << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRALIGN; i2sctl |= SGTL5000_I2S_LRALIGN;
break; break;
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
i2sctl |= SGTL5000_I2S_MODE_I2S_LJ; i2sctl |= SGTL5000_I2S_MODE_I2S_LJ << SGTL5000_I2S_MODE_SHIFT;
break; break;
case SND_SOC_DAIFMT_RIGHT_J: case SND_SOC_DAIFMT_RIGHT_J:
i2sctl |= SGTL5000_I2S_MODE_RJ; i2sctl |= SGTL5000_I2S_MODE_RJ << SGTL5000_I2S_MODE_SHIFT;
i2sctl |= SGTL5000_I2S_LRPOL; i2sctl |= SGTL5000_I2S_LRPOL;
break; break;
case SND_SOC_DAIFMT_LEFT_J: 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; i2sctl |= SGTL5000_I2S_LRALIGN;
break; break;
default: default:
...@@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, ...@@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
if (ret) if (ret)
return ret; return ret;
/* Need 8 clocks before I2C accesses */
udelay(1);
/* read chip information */ /* read chip information */
ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg); ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);
if (ret) if (ret)
......
...@@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream, ...@@ -1046,7 +1046,7 @@ static int aic3x_prepare(struct snd_pcm_substream *substream,
delay += aic3x->tdm_delay; delay += aic3x->tdm_delay;
/* Configure data 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; return 0;
} }
......
...@@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, ...@@ -717,6 +717,8 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
if (wm8731 == NULL) if (wm8731 == NULL)
return -ENOMEM; return -ENOMEM;
mutex_init(&wm8731->lock);
wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap); wm8731->regmap = devm_regmap_init_i2c(i2c, &wm8731_regmap);
if (IS_ERR(wm8731->regmap)) { if (IS_ERR(wm8731->regmap)) {
ret = PTR_ERR(wm8731->regmap); ret = PTR_ERR(wm8731->regmap);
......
...@@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec) ...@@ -344,23 +344,27 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
int ret = 0; int ret = 0;
ac97 = snd_soc_new_ac97_codec(codec); ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(ac97)) { if (IS_ERR(ac97)) {
ret = PTR_ERR(ac97); ret = PTR_ERR(ac97);
dev_err(codec->dev, "Failed to register AC97 codec\n"); dev_err(codec->dev, "Failed to register AC97 codec\n");
return ret; return ret;
} }
snd_soc_codec_set_drvdata(codec, ac97);
ret = wm9705_reset(codec); ret = wm9705_reset(codec);
if (ret) 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; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(ac97); put_device(&ac97->dev);
return ret; return ret;
} }
......
...@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
int ret = 0; int ret = 0;
wm9712->ac97 = snd_soc_new_ac97_codec(codec); wm9712->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9712->ac97)) { if (IS_ERR(wm9712->ac97)) {
ret = PTR_ERR(wm9712->ac97); ret = PTR_ERR(wm9712->ac97);
dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret); dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret);
...@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
ret = wm9712_reset(codec, 0); ret = wm9712_reset(codec, 0);
if (ret < 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 */ /* set alc mux to none */
ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
return 0; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(wm9712->ac97); put_device(&wm9712->ac97->dev);
return ret; return ret;
} }
......
...@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec);
int ret = 0, reg; int ret = 0, reg;
wm9713->ac97 = snd_soc_new_ac97_codec(codec); wm9713->ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(wm9713->ac97)) if (IS_ERR(wm9713->ac97))
return PTR_ERR(wm9713->ac97); return PTR_ERR(wm9713->ac97);
...@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
wm9713_reset(codec, 0); wm9713_reset(codec, 0);
ret = wm9713_reset(codec, 1); ret = wm9713_reset(codec, 1);
if (ret < 0) if (ret < 0)
goto reset_err; goto err_put_device;
ret = device_add(&wm9713->ac97->dev);
if (ret)
goto err_put_device;
/* unmute the adc - move to kcontrol */ /* unmute the adc - move to kcontrol */
reg = ac97_read(codec, AC97_CD) & 0x7fff; reg = ac97_read(codec, AC97_CD) & 0x7fff;
...@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
return 0; return 0;
reset_err: err_put_device:
snd_soc_free_ac97_codec(wm9713->ac97); put_device(&wm9713->ac97->dev);
return ret; return ret;
} }
......
...@@ -651,11 +651,11 @@ static void hsw_notification_work(struct work_struct *work) ...@@ -651,11 +651,11 @@ static void hsw_notification_work(struct work_struct *work)
} }
/* tell DSP that notification has been handled */ /* tell DSP that notification has been handled */
sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IPCD, sst_dsp_shim_update_bits(hsw->dsp, SST_IPCD,
SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE); SST_IPCD_BUSY | SST_IPCD_DONE, SST_IPCD_DONE);
/* unmask busy interrupt */ /* unmask busy interrupt */
sst_dsp_shim_update_bits_unlocked(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0); sst_dsp_shim_update_bits(hsw->dsp, SST_IMRX, SST_IMRX_BUSY, 0);
} }
static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header) static struct ipc_message *reply_find_msg(struct sst_hsw *hsw, u32 header)
......
...@@ -350,7 +350,7 @@ static struct sst_machines sst_acpi_bytcr[] = { ...@@ -350,7 +350,7 @@ static struct sst_machines sst_acpi_bytcr[] = {
/* Cherryview-based platforms: CherryTrail and Braswell */ /* Cherryview-based platforms: CherryTrail and Braswell */
static struct sst_machines sst_acpi_chv[] = { static struct sst_machines sst_acpi_chv[] = {
{"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "fw_sst_22a8.bin", {"10EC5670", "cht-bsw", "cht-bsw-rt5672", NULL, "intel/fw_sst_22a8.bin",
&chv_platform_data }, &chv_platform_data },
{}, {},
}; };
......
...@@ -48,15 +48,18 @@ static void soc_ac97_device_release(struct device *dev) ...@@ -48,15 +48,18 @@ static void soc_ac97_device_release(struct device *dev)
} }
/** /**
* snd_soc_new_ac97_codec - initailise AC97 device * snd_soc_alloc_ac97_codec() - Allocate new a AC'97 device
* @codec: audio codec * @codec: The CODEC for which to create the AC'97 device
* *
* Initialises AC97 codec resources for use by ad-hoc devices only. * Allocated a new snd_ac97 device and intializes it, but does not yet register
* it. The caller is responsible to either call device_add(&ac97->dev) to
* register the device, or to call put_device(&ac97->dev) to free the device.
*
* Returns: A snd_ac97 device or a PTR_ERR in case of an error.
*/ */
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec) struct snd_ac97 *snd_soc_alloc_ac97_codec(struct snd_soc_codec *codec)
{ {
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
int ret;
ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL);
if (ac97 == NULL) if (ac97 == NULL)
...@@ -73,7 +76,28 @@ struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec) ...@@ -73,7 +76,28 @@ struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
codec->component.card->snd_card->number, 0, codec->component.card->snd_card->number, 0,
codec->component.name); codec->component.name);
ret = device_register(&ac97->dev); device_initialize(&ac97->dev);
return ac97;
}
EXPORT_SYMBOL(snd_soc_alloc_ac97_codec);
/**
* snd_soc_new_ac97_codec - initailise AC97 device
* @codec: audio codec
*
* Initialises AC97 codec resources for use by ad-hoc devices only.
*/
struct snd_ac97 *snd_soc_new_ac97_codec(struct snd_soc_codec *codec)
{
struct snd_ac97 *ac97;
int ret;
ac97 = snd_soc_alloc_ac97_codec(codec);
if (IS_ERR(ac97))
return ac97;
ret = device_add(&ac97->dev);
if (ret) { if (ret) {
put_device(&ac97->dev); put_device(&ac97->dev);
return ERR_PTR(ret); return ERR_PTR(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment