summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt5639.c24
-rw-r--r--sound/soc/codecs/rt5640.c23
-rw-r--r--sound/soc/tegra/tegra30_i2s.c4
-rw-r--r--sound/soc/tegra/tegra_p1852.c3
4 files changed, 54 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5639.c b/sound/soc/codecs/rt5639.c
index c9b14e9f0bc1..13190e21404b 100644
--- a/sound/soc/codecs/rt5639.c
+++ b/sound/soc/codecs/rt5639.c
@@ -105,6 +105,18 @@ static int rt5639_reg_init(struct snd_soc_codec *codec)
}
#endif
+static int rt5639_index_sync(struct snd_soc_codec *codec)
+{
+ int i;
+
+ for (i = 0; i < RT5639_INIT_REG_LEN; i++)
+ if (RT5639_PRIV_INDEX == init_list[i].reg ||
+ RT5639_PRIV_DATA == init_list[i].reg)
+ snd_soc_write(codec, init_list[i].reg,
+ init_list[i].val);
+ return 0;
+}
+
static const u16 rt5639_reg[RT5639_VENDOR_ID2 + 1] = {
[RT5639_RESET] = 0x0008,
[RT5639_SPK_VOL] = 0xc8c8,
@@ -2213,7 +2225,9 @@ static int rt5639_set_bias_level(struct snd_soc_codec *codec,
RT5639_PWR_FV1 | RT5639_PWR_FV2,
RT5639_PWR_FV1 | RT5639_PWR_FV2);
codec->cache_only = false;
+ codec->cache_sync = 1;
snd_soc_cache_sync(codec);
+ rt5639_index_sync(codec);
}
break;
@@ -2311,13 +2325,23 @@ static int rt5639_remove(struct snd_soc_codec *codec)
#ifdef CONFIG_PM
static int rt5639_suspend(struct snd_soc_codec *codec, pm_message_t state)
{
+ rt5639_reset(codec);
rt5639_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
}
static int rt5639_resume(struct snd_soc_codec *codec)
{
+ int ret = 0 ;
+
+ codec->cache_sync = 1;
+ ret = snd_soc_cache_sync(codec);
+ if (ret) {
+ dev_err(codec->dev,"Failed to sync cache: %d\n", ret);
+ return ret;
+ }
rt5639_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
return 0;
}
#else
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 8407c638cf8a..49256e2d151d 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -106,6 +106,18 @@ static int rt5640_reg_init(struct snd_soc_codec *codec)
}
#endif
+static int rt5640_index_sync(struct snd_soc_codec *codec)
+{
+ int i;
+
+ for (i = 0; i < RT5640_INIT_REG_LEN; i++)
+ if (RT5640_PRIV_INDEX == init_list[i].reg ||
+ RT5640_PRIV_DATA == init_list[i].reg)
+ snd_soc_write(codec, init_list[i].reg,
+ init_list[i].val);
+ return 0;
+}
+
static const u16 rt5640_reg[RT5640_VENDOR_ID2 + 1] = {
[RT5640_RESET] = 0x000c,
[RT5640_SPK_VOL] = 0xc8c8,
@@ -2269,7 +2281,9 @@ static int rt5640_set_bias_level(struct snd_soc_codec *codec,
RT5640_PWR_FV1 | RT5640_PWR_FV2,
RT5640_PWR_FV1 | RT5640_PWR_FV2);
codec->cache_only = false;
+ codec->cache_sync = 1;
snd_soc_cache_sync(codec);
+ rt5640_index_sync(codec);
}
break;
@@ -2381,6 +2395,7 @@ static int rt5640_remove(struct snd_soc_codec *codec)
#ifdef CONFIG_PM
static int rt5640_suspend(struct snd_soc_codec *codec, pm_message_t state)
{
+ rt5640_reset(codec);
rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF);
snd_soc_write(codec, RT5640_PWR_ANLG1, 0);
@@ -2389,6 +2404,14 @@ static int rt5640_suspend(struct snd_soc_codec *codec, pm_message_t state)
static int rt5640_resume(struct snd_soc_codec *codec)
{
+ int ret = 0 ;
+
+ codec->cache_sync = 1;
+ ret = snd_soc_cache_sync(codec);
+ if (ret) {
+ dev_err(codec->dev,"Failed to sync cache: %d\n", ret);
+ return ret;
+ }
rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
return 0;
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 449359837efb..8be00b840fb5 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -418,6 +418,10 @@ static int tegra30_i2s_tdm_hw_params(struct snd_pcm_substream *substream,
i2s_client_bits = TEGRA30_AUDIOCIF_BITS_32;
i2s->reg_ctrl |= TEGRA30_I2S_CTRL_BIT_SIZE_32;
break;
+ default:
+ dev_err(dev, "unknown slot_width %d\n",
+ i2s->dsp_config.slot_width);
+ return -EINVAL;
}
val = (0 << TEGRA30_AUDIOCIF_CTRL_FIFO_THRESHOLD_SHIFT) |
diff --git a/sound/soc/tegra/tegra_p1852.c b/sound/soc/tegra/tegra_p1852.c
index 85b4cee30c5f..199bb8046636 100644
--- a/sound/soc/tegra/tegra_p1852.c
+++ b/sound/soc/tegra/tegra_p1852.c
@@ -227,6 +227,9 @@ static __devinit int tegra_p1852_driver_probe(struct platform_device *pdev)
pdata->codec_info[i].codec_dai_name;
tegra_p1852_dai_link[i].name =
pdata->codec_info[i].name;
+ if (pdata->codec_info[i].pcm_driver)
+ tegra_p1852_dai_link[i].platform_name =
+ pdata->codec_info[i].pcm_driver;
}
ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev, card);