Commit e2f45592 authored by Mark Brown's avatar Mark Brown

Merge tag 'asoc-v3.14-rc3' into asoc-linus

ASoC: Fixes for v3.14

A few fixes, all driver speccific ones.  The DaVinci ones aren't as
clear as they should be from the subject lines on the commits but they
fix issues which will prevent correct operation in some use cases and
only affect that particular driver so are reasonably safe.

# gpg: Signature made Wed 19 Feb 2014 13:23:13 KST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
parents 6d0abeca 895be5b3
...@@ -53,17 +53,25 @@ static int da9055_i2c_remove(struct i2c_client *i2c) ...@@ -53,17 +53,25 @@ static int da9055_i2c_remove(struct i2c_client *i2c)
return 0; return 0;
} }
/*
* DO NOT change the device Ids. The naming is intentionally specific as both
* the PMIC and CODEC parts of this chip are instantiated separately as I2C
* devices (both have configurable I2C addresses, and are to all intents and
* purposes separate). As a result there are specific DA9055 ids for PMIC
* and CODEC, which must be different to operate together.
*/
static struct i2c_device_id da9055_i2c_id[] = { static struct i2c_device_id da9055_i2c_id[] = {
{"da9055", 0}, {"da9055-pmic", 0},
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
static struct i2c_driver da9055_i2c_driver = { static struct i2c_driver da9055_i2c_driver = {
.probe = da9055_i2c_probe, .probe = da9055_i2c_probe,
.remove = da9055_i2c_remove, .remove = da9055_i2c_remove,
.id_table = da9055_i2c_id, .id_table = da9055_i2c_id,
.driver = { .driver = {
.name = "da9055", .name = "da9055-pmic",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
}; };
......
...@@ -11,7 +11,7 @@ config SND_BF5XX_I2S ...@@ -11,7 +11,7 @@ config SND_BF5XX_I2S
config SND_BF5XX_SOC_SSM2602 config SND_BF5XX_SOC_SSM2602
tristate "SoC SSM2602 Audio Codec Add-On Card support" tristate "SoC SSM2602 Audio Codec Add-On Card support"
depends on SND_BF5XX_I2S && (SPI_MASTER || I2C) depends on SND_BF5XX_I2S && SND_SOC_I2C_AND_SPI
select SND_BF5XX_SOC_I2S if !BF60x select SND_BF5XX_SOC_I2S if !BF60x
select SND_BF6XX_SOC_I2S if BF60x select SND_BF6XX_SOC_I2S if BF60x
select SND_SOC_SSM2602 select SND_SOC_SSM2602
...@@ -21,10 +21,9 @@ config SND_BF5XX_SOC_SSM2602 ...@@ -21,10 +21,9 @@ config SND_BF5XX_SOC_SSM2602
config SND_SOC_BFIN_EVAL_ADAU1701 config SND_SOC_BFIN_EVAL_ADAU1701
tristate "Support for the EVAL-ADAU1701MINIZ board on Blackfin eval boards" tristate "Support for the EVAL-ADAU1701MINIZ board on Blackfin eval boards"
depends on SND_BF5XX_I2S depends on SND_BF5XX_I2S && I2C
select SND_BF5XX_SOC_I2S select SND_BF5XX_SOC_I2S
select SND_SOC_ADAU1701 select SND_SOC_ADAU1701
select I2C
help help
Say Y if you want to add support for the Analog Devices EVAL-ADAU1701MINIZ Say Y if you want to add support for the Analog Devices EVAL-ADAU1701MINIZ
board connected to one of the Blackfin evaluation boards like the board connected to one of the Blackfin evaluation boards like the
...@@ -45,7 +44,7 @@ config SND_SOC_BFIN_EVAL_ADAU1373 ...@@ -45,7 +44,7 @@ config SND_SOC_BFIN_EVAL_ADAU1373
config SND_SOC_BFIN_EVAL_ADAV80X config SND_SOC_BFIN_EVAL_ADAV80X
tristate "Support for the EVAL-ADAV80X boards on Blackfin eval boards" tristate "Support for the EVAL-ADAV80X boards on Blackfin eval boards"
depends on SND_BF5XX_I2S && (SPI_MASTER || I2C) depends on SND_BF5XX_I2S && SND_SOC_I2C_AND_SPI
select SND_BF5XX_SOC_I2S select SND_BF5XX_SOC_I2S
select SND_SOC_ADAV80X select SND_SOC_ADAV80X
help help
...@@ -58,7 +57,7 @@ config SND_SOC_BFIN_EVAL_ADAV80X ...@@ -58,7 +57,7 @@ config SND_SOC_BFIN_EVAL_ADAV80X
config SND_BF5XX_SOC_AD1836 config SND_BF5XX_SOC_AD1836
tristate "SoC AD1836 Audio support for BF5xx" tristate "SoC AD1836 Audio support for BF5xx"
depends on SND_BF5XX_I2S depends on SND_BF5XX_I2S && SPI_MASTER
select SND_BF5XX_SOC_I2S select SND_BF5XX_SOC_I2S
select SND_SOC_AD1836 select SND_SOC_AD1836
help help
...@@ -66,7 +65,7 @@ config SND_BF5XX_SOC_AD1836 ...@@ -66,7 +65,7 @@ config SND_BF5XX_SOC_AD1836
config SND_BF5XX_SOC_AD193X config SND_BF5XX_SOC_AD193X
tristate "SoC AD193X Audio support for Blackfin" tristate "SoC AD193X Audio support for Blackfin"
depends on SND_BF5XX_I2S depends on SND_BF5XX_I2S && SND_SOC_I2C_AND_SPI
select SND_BF5XX_SOC_I2S select SND_BF5XX_SOC_I2S
select SND_SOC_AD193X select SND_SOC_AD193X
help help
......
...@@ -1523,8 +1523,15 @@ static int da9055_remove(struct i2c_client *client) ...@@ -1523,8 +1523,15 @@ static int da9055_remove(struct i2c_client *client)
return 0; return 0;
} }
/*
* DO NOT change the device Ids. The naming is intentionally specific as both
* the CODEC and PMIC parts of this chip are instantiated separately as I2C
* devices (both have configurable I2C addresses, and are to all intents and
* purposes separate). As a result there are specific DA9055 Ids for CODEC
* and PMIC, which must be different to operate together.
*/
static const struct i2c_device_id da9055_i2c_id[] = { static const struct i2c_device_id da9055_i2c_id[] = {
{ "da9055", 0 }, { "da9055-codec", 0 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id); MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
...@@ -1532,7 +1539,7 @@ MODULE_DEVICE_TABLE(i2c, da9055_i2c_id); ...@@ -1532,7 +1539,7 @@ MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
/* I2C codec control layer */ /* I2C codec control layer */
static struct i2c_driver da9055_i2c_driver = { static struct i2c_driver da9055_i2c_driver = {
.driver = { .driver = {
.name = "da9055", .name = "da9055-codec",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = da9055_i2c_probe, .probe = da9055_i2c_probe,
......
...@@ -336,6 +336,7 @@ static bool max98090_readable_register(struct device *dev, unsigned int reg) ...@@ -336,6 +336,7 @@ static bool max98090_readable_register(struct device *dev, unsigned int reg)
case M98090_REG_RECORD_TDM_SLOT: case M98090_REG_RECORD_TDM_SLOT:
case M98090_REG_SAMPLE_RATE: case M98090_REG_SAMPLE_RATE:
case M98090_REG_DMIC34_BIQUAD_BASE ... M98090_REG_DMIC34_BIQUAD_BASE + 0x0E: case M98090_REG_DMIC34_BIQUAD_BASE ... M98090_REG_DMIC34_BIQUAD_BASE + 0x0E:
case M98090_REG_REVISION_ID:
return true; return true;
default: default:
return false; return false;
...@@ -1769,16 +1770,6 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec, ...@@ -1769,16 +1770,6 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
switch (level) { switch (level) {
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
ret = regcache_sync(max98090->regmap);
if (ret != 0) {
dev_err(codec->dev,
"Failed to sync cache: %d\n", ret);
return ret;
}
}
if (max98090->jack_state == M98090_JACK_STATE_HEADSET) { if (max98090->jack_state == M98090_JACK_STATE_HEADSET) {
/* /*
* Set to normal bias level. * Set to normal bias level.
...@@ -1792,6 +1783,16 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec, ...@@ -1792,6 +1783,16 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
ret = regcache_sync(max98090->regmap);
if (ret != 0) {
dev_err(codec->dev,
"Failed to sync cache: %d\n", ret);
return ret;
}
}
break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
/* Set internal pull-up to lowest power mode */ /* Set internal pull-up to lowest power mode */
snd_soc_update_bits(codec, M98090_REG_JACK_DETECT, snd_soc_update_bits(codec, M98090_REG_JACK_DETECT,
......
...@@ -2093,6 +2093,7 @@ MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); ...@@ -2093,6 +2093,7 @@ MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id);
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
static struct acpi_device_id rt5640_acpi_match[] = { static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 }, { "INT33CA", 0 },
{ "10EC5640", 0 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
......
...@@ -1562,7 +1562,6 @@ static int wm8993_remove(struct snd_soc_codec *codec) ...@@ -1562,7 +1562,6 @@ static int wm8993_remove(struct snd_soc_codec *codec)
struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
wm8993_set_bias_level(codec, SND_SOC_BIAS_OFF); wm8993_set_bias_level(codec, SND_SOC_BIAS_OFF);
regulator_bulk_free(ARRAY_SIZE(wm8993->supplies), wm8993->supplies);
return 0; return 0;
} }
......
...@@ -399,6 +399,7 @@ static struct platform_driver davinci_evm_driver = { ...@@ -399,6 +399,7 @@ static struct platform_driver davinci_evm_driver = {
.driver = { .driver = {
.name = "davinci_evm", .name = "davinci_evm",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &snd_soc_pm_ops,
.of_match_table = of_match_ptr(davinci_evm_dt_ids), .of_match_table = of_match_ptr(davinci_evm_dt_ids),
}, },
}; };
......
...@@ -263,7 +263,9 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -263,7 +263,9 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt) unsigned int fmt)
{ {
struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai); struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai);
int ret = 0;
pm_runtime_get_sync(mcasp->dev);
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
case SND_SOC_DAIFMT_AC97: case SND_SOC_DAIFMT_AC97:
...@@ -317,7 +319,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -317,7 +319,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
break; break;
default: default:
return -EINVAL; ret = -EINVAL;
goto out;
} }
switch (fmt & SND_SOC_DAIFMT_INV_MASK) { switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
...@@ -354,10 +357,12 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, ...@@ -354,10 +357,12 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
break; break;
default: default:
return -EINVAL; ret = -EINVAL;
break;
} }
out:
return 0; pm_runtime_put_sync(mcasp->dev);
return ret;
} }
static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div) static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div)
...@@ -448,7 +453,7 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp, ...@@ -448,7 +453,7 @@ static int davinci_config_channel_size(struct davinci_mcasp *mcasp,
return 0; return 0;
} }
static int davinci_hw_common_param(struct davinci_mcasp *mcasp, int stream, static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
int channels) int channels)
{ {
int i; int i;
...@@ -524,12 +529,18 @@ static int davinci_hw_common_param(struct davinci_mcasp *mcasp, int stream, ...@@ -524,12 +529,18 @@ static int davinci_hw_common_param(struct davinci_mcasp *mcasp, int stream,
return 0; return 0;
} }
static void davinci_hw_param(struct davinci_mcasp *mcasp, int stream) static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream)
{ {
int i, active_slots; int i, active_slots;
u32 mask = 0; u32 mask = 0;
u32 busel = 0; u32 busel = 0;
if ((mcasp->tdm_slots < 2) || (mcasp->tdm_slots > 32)) {
dev_err(mcasp->dev, "tdm slot %d not supported\n",
mcasp->tdm_slots);
return -EINVAL;
}
active_slots = (mcasp->tdm_slots > 31) ? 32 : mcasp->tdm_slots; active_slots = (mcasp->tdm_slots > 31) ? 32 : mcasp->tdm_slots;
for (i = 0; i < active_slots; i++) for (i = 0; i < active_slots; i++)
mask |= (1 << i); mask |= (1 << i);
...@@ -539,35 +550,21 @@ static void davinci_hw_param(struct davinci_mcasp *mcasp, int stream) ...@@ -539,35 +550,21 @@ static void davinci_hw_param(struct davinci_mcasp *mcasp, int stream)
if (!mcasp->dat_port) if (!mcasp->dat_port)
busel = TXSEL; busel = TXSEL;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) { mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask);
/* bit stream is MSB first with no delay */ mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
/* DSP_B mode */ mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG,
mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask); FSXMOD(mcasp->tdm_slots), FSXMOD(0x1FF));
mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD);
mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask);
if ((mcasp->tdm_slots >= 2) && (mcasp->tdm_slots <= 32)) mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
FSXMOD(mcasp->tdm_slots), FSXMOD(0x1FF)); FSRMOD(mcasp->tdm_slots), FSRMOD(0x1FF));
else
printk(KERN_ERR "playback tdm slot %d not supported\n", return 0;
mcasp->tdm_slots);
} else {
/* bit stream is MSB first with no delay */
/* DSP_B mode */
mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD);
mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask);
if ((mcasp->tdm_slots >= 2) && (mcasp->tdm_slots <= 32))
mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG,
FSRMOD(mcasp->tdm_slots), FSRMOD(0x1FF));
else
printk(KERN_ERR "capture tdm slot %d not supported\n",
mcasp->tdm_slots);
}
} }
/* S/PDIF */ /* S/PDIF */
static void davinci_hw_dit_param(struct davinci_mcasp *mcasp) static int mcasp_dit_hw_param(struct davinci_mcasp *mcasp)
{ {
/* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0 /* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0
and LSB first */ and LSB first */
...@@ -589,6 +586,8 @@ static void davinci_hw_dit_param(struct davinci_mcasp *mcasp) ...@@ -589,6 +586,8 @@ static void davinci_hw_dit_param(struct davinci_mcasp *mcasp)
/* Enable the DIT */ /* Enable the DIT */
mcasp_set_bits(mcasp, DAVINCI_MCASP_TXDITCTL_REG, DITEN); mcasp_set_bits(mcasp, DAVINCI_MCASP_TXDITCTL_REG, DITEN);
return 0;
} }
static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
...@@ -605,13 +604,14 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, ...@@ -605,13 +604,14 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
u8 slots = mcasp->tdm_slots; u8 slots = mcasp->tdm_slots;
u8 active_serializers; u8 active_serializers;
int channels; int channels;
int ret;
struct snd_interval *pcm_channels = hw_param_interval(params, struct snd_interval *pcm_channels = hw_param_interval(params,
SNDRV_PCM_HW_PARAM_CHANNELS); SNDRV_PCM_HW_PARAM_CHANNELS);
channels = pcm_channels->min; channels = pcm_channels->min;
active_serializers = (channels + slots - 1) / slots; active_serializers = (channels + slots - 1) / slots;
if (davinci_hw_common_param(mcasp, substream->stream, channels) == -EINVAL) if (mcasp_common_hw_param(mcasp, substream->stream, channels) == -EINVAL)
return -EINVAL; return -EINVAL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
fifo_level = mcasp->txnumevt * active_serializers; fifo_level = mcasp->txnumevt * active_serializers;
...@@ -619,9 +619,12 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, ...@@ -619,9 +619,12 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
fifo_level = mcasp->rxnumevt * active_serializers; fifo_level = mcasp->rxnumevt * active_serializers;
if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE) if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
davinci_hw_dit_param(mcasp); ret = mcasp_dit_hw_param(mcasp);
else else
davinci_hw_param(mcasp, substream->stream); ret = mcasp_i2s_hw_param(mcasp, substream->stream);
if (ret)
return ret;
switch (params_format(params)) { switch (params_format(params)) {
case SNDRV_PCM_FORMAT_U8: case SNDRV_PCM_FORMAT_U8:
...@@ -678,19 +681,9 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, ...@@ -678,19 +681,9 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
ret = pm_runtime_get_sync(mcasp->dev);
if (IS_ERR_VALUE(ret))
dev_err(mcasp->dev, "pm_runtime_get_sync() failed\n");
davinci_mcasp_start(mcasp, substream->stream); davinci_mcasp_start(mcasp, substream->stream);
break; break;
case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_SUSPEND:
davinci_mcasp_stop(mcasp, substream->stream);
ret = pm_runtime_put_sync(mcasp->dev);
if (IS_ERR_VALUE(ret))
dev_err(mcasp->dev, "pm_runtime_put_sync() failed\n");
break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
davinci_mcasp_stop(mcasp, substream->stream); davinci_mcasp_stop(mcasp, substream->stream);
......
...@@ -326,7 +326,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, ...@@ -326,7 +326,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMA, regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMA,
ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(tx_mask)); ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(tx_mask));
regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMB, regmap_update_bits(esai_priv->regmap, REG_ESAI_TSMB,
ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(tx_mask)); ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(tx_mask));
regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR, regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(slots)); ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(slots));
...@@ -334,7 +334,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, ...@@ -334,7 +334,7 @@ static int fsl_esai_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMA, regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMA,
ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(rx_mask)); ESAI_xSMA_xS_MASK, ESAI_xSMA_xS(rx_mask));
regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMB, regmap_update_bits(esai_priv->regmap, REG_ESAI_RSMB,
ESAI_xSMA_xS_MASK, ESAI_xSMB_xS(rx_mask)); ESAI_xSMB_xS_MASK, ESAI_xSMB_xS(rx_mask));
esai_priv->slot_width = slot_width; esai_priv->slot_width = slot_width;
......
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
#define ESAI_xSMB_xS_SHIFT 0 #define ESAI_xSMB_xS_SHIFT 0
#define ESAI_xSMB_xS_WIDTH 16 #define ESAI_xSMB_xS_WIDTH 16
#define ESAI_xSMB_xS_MASK (((1 << ESAI_xSMB_xS_WIDTH) - 1) << ESAI_xSMB_xS_SHIFT) #define ESAI_xSMB_xS_MASK (((1 << ESAI_xSMB_xS_WIDTH) - 1) << ESAI_xSMB_xS_SHIFT)
#define ESAI_xSMB_xS(v) (((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMA_xS_MASK) #define ESAI_xSMB_xS(v) (((v) >> ESAI_xSMA_xS_WIDTH) & ESAI_xSMB_xS_MASK)
/* Port C Direction Register -- REG_ESAI_PRRC 0xF8 */ /* Port C Direction Register -- REG_ESAI_PRRC 0xF8 */
#define ESAI_PRRC_PDC_SHIFT 0 #define ESAI_PRRC_PDC_SHIFT 0
......
...@@ -160,7 +160,6 @@ static struct platform_driver imx_mc13783_audio_driver = { ...@@ -160,7 +160,6 @@ static struct platform_driver imx_mc13783_audio_driver = {
.driver = { .driver = {
.name = "imx_mc13783", .name = "imx_mc13783",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &snd_soc_pm_ops,
}, },
.probe = imx_mc13783_probe, .probe = imx_mc13783_probe,
.remove = imx_mc13783_remove .remove = imx_mc13783_remove
......
...@@ -33,8 +33,7 @@ struct imx_sgtl5000_data { ...@@ -33,8 +33,7 @@ struct imx_sgtl5000_data {
static int imx_sgtl5000_dai_init(struct snd_soc_pcm_runtime *rtd) static int imx_sgtl5000_dai_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct imx_sgtl5000_data *data = container_of(rtd->card, struct imx_sgtl5000_data *data = snd_soc_card_get_drvdata(rtd->card);
struct imx_sgtl5000_data, card);
struct device *dev = rtd->card->dev; struct device *dev = rtd->card->dev;
int ret; int ret;
...@@ -159,13 +158,15 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) ...@@ -159,13 +158,15 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
data->card.dapm_widgets = imx_sgtl5000_dapm_widgets; data->card.dapm_widgets = imx_sgtl5000_dapm_widgets;
data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets); data->card.num_dapm_widgets = ARRAY_SIZE(imx_sgtl5000_dapm_widgets);
platform_set_drvdata(pdev, &data->card);
snd_soc_card_set_drvdata(&data->card, data);
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
goto fail; goto fail;
} }
platform_set_drvdata(pdev, data);
of_node_put(ssi_np); of_node_put(ssi_np);
of_node_put(codec_np); of_node_put(codec_np);
...@@ -184,7 +185,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) ...@@ -184,7 +185,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
static int imx_sgtl5000_remove(struct platform_device *pdev) static int imx_sgtl5000_remove(struct platform_device *pdev)
{ {
struct imx_sgtl5000_data *data = platform_get_drvdata(pdev); struct snd_soc_card *card = platform_get_drvdata(pdev);
struct imx_sgtl5000_data *data = snd_soc_card_get_drvdata(card);
clk_put(data->codec_clk); clk_put(data->codec_clk);
......
...@@ -71,7 +71,7 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card, ...@@ -71,7 +71,7 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card,
{ {
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
struct imx_priv *priv = &card_priv; struct imx_priv *priv = &card_priv;
struct imx_wm8962_data *data = platform_get_drvdata(priv->pdev); struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
struct device *dev = &priv->pdev->dev; struct device *dev = &priv->pdev->dev;
unsigned int pll_out; unsigned int pll_out;
int ret; int ret;
...@@ -137,7 +137,7 @@ static int imx_wm8962_late_probe(struct snd_soc_card *card) ...@@ -137,7 +137,7 @@ static int imx_wm8962_late_probe(struct snd_soc_card *card)
{ {
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
struct imx_priv *priv = &card_priv; struct imx_priv *priv = &card_priv;
struct imx_wm8962_data *data = platform_get_drvdata(priv->pdev); struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
struct device *dev = &priv->pdev->dev; struct device *dev = &priv->pdev->dev;
int ret; int ret;
...@@ -264,13 +264,15 @@ static int imx_wm8962_probe(struct platform_device *pdev) ...@@ -264,13 +264,15 @@ static int imx_wm8962_probe(struct platform_device *pdev)
data->card.late_probe = imx_wm8962_late_probe; data->card.late_probe = imx_wm8962_late_probe;
data->card.set_bias_level = imx_wm8962_set_bias_level; data->card.set_bias_level = imx_wm8962_set_bias_level;
platform_set_drvdata(pdev, &data->card);
snd_soc_card_set_drvdata(&data->card, data);
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
goto clk_fail; goto clk_fail;
} }
platform_set_drvdata(pdev, data);
of_node_put(ssi_np); of_node_put(ssi_np);
of_node_put(codec_np); of_node_put(codec_np);
...@@ -289,7 +291,8 @@ static int imx_wm8962_probe(struct platform_device *pdev) ...@@ -289,7 +291,8 @@ static int imx_wm8962_probe(struct platform_device *pdev)
static int imx_wm8962_remove(struct platform_device *pdev) static int imx_wm8962_remove(struct platform_device *pdev)
{ {
struct imx_wm8962_data *data = platform_get_drvdata(pdev); struct snd_soc_card *card = platform_get_drvdata(pdev);
struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
if (!IS_ERR(data->codec_clk)) if (!IS_ERR(data->codec_clk))
clk_disable_unprepare(data->codec_clk); clk_disable_unprepare(data->codec_clk);
......
...@@ -59,7 +59,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750 ...@@ -59,7 +59,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750
select SND_SOC_WM8750 select SND_SOC_WM8750
select SND_S3C2412_SOC_I2S select SND_S3C2412_SOC_I2S
help help
Sat Y if you want to add support for SoC audio on the Jive. Say Y if you want to add support for SoC audio on the Jive.
config SND_SOC_SAMSUNG_SMDK_WM8580 config SND_SOC_SAMSUNG_SMDK_WM8580
tristate "SoC I2S Audio support for WM8580 on SMDK" tristate "SoC I2S Audio support for WM8580 on SMDK"
...@@ -145,11 +145,11 @@ config SND_SOC_SAMSUNG_RX1950_UDA1380 ...@@ -145,11 +145,11 @@ config SND_SOC_SAMSUNG_RX1950_UDA1380
config SND_SOC_SAMSUNG_SMDK_WM9713 config SND_SOC_SAMSUNG_SMDK_WM9713
tristate "SoC AC97 Audio support for SMDK with WM9713" tristate "SoC AC97 Audio support for SMDK with WM9713"
depends on SND_SOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110 || MACH_SMDKV310 || MACH_SMDKC210) depends on SND_SOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110)
select SND_SOC_WM9713 select SND_SOC_WM9713
select SND_SAMSUNG_AC97 select SND_SAMSUNG_AC97
help help
Sat Y if you want to add support for SoC audio on the SMDK. Say Y if you want to add support for SoC audio on the SMDK.
config SND_SOC_SMARTQ config SND_SOC_SMARTQ
tristate "SoC I2S Audio support for SmartQ board" tristate "SoC I2S Audio support for SmartQ board"
......
...@@ -183,14 +183,16 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev) ...@@ -183,14 +183,16 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0)
return irq; return irq;
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata)
return -ENOMEM;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drvdata->base = devm_ioremap_resource(&pdev->dev, r); drvdata->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(drvdata->base)) if (IS_ERR(drvdata->base))
return PTR_ERR(drvdata->base); return PTR_ERR(drvdata->base);
drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata); platform_set_drvdata(pdev, drvdata);
drvdata->physbase = r->start; drvdata->physbase = r->start;
if (sizeof(drvdata->physbase) > sizeof(r->start) && if (sizeof(drvdata->physbase) > sizeof(r->start) &&
......
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