summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorguoyin.chen <guoyin.chen@freescale.com>2013-04-03 11:07:09 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2013-04-03 11:07:09 +0800
commit8fa723312b9701e767c2eda46e4aabb21e21ccb3 (patch)
treebcdb59722202cce2d2277d2fd7a785141cdf8bac /sound
parent029767ec3d45796a2d6a58debe3844cf6b814ec7 (diff)
parent573bab0be2427d6664420eaf9d8e272dbe9d840f (diff)
Merge remote-tracking branch 'fsl-linux-sdk/imx_3.0.35_4.0.0' into imx_3.0.35_android
Conflicts: drivers/net/fec.c
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42888.c10
-rw-r--r--sound/soc/codecs/mxc_spdif.c4
-rw-r--r--sound/soc/codecs/wm8962.c70
-rw-r--r--sound/soc/imx/imx-hdmi-dai.c8
-rw-r--r--sound/soc/imx/imx-hdmi.c8
-rw-r--r--sound/soc/imx/imx-wm8962.c12
6 files changed, 42 insertions, 70 deletions
diff --git a/sound/soc/codecs/cs42888.c b/sound/soc/codecs/cs42888.c
index 698ff4b59826..03f160b8cfad 100644
--- a/sound/soc/codecs/cs42888.c
+++ b/sound/soc/codecs/cs42888.c
@@ -1,6 +1,6 @@
/*
* cs42888.c -- CS42888 ALSA SoC Audio Driver
- * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
@@ -129,6 +129,11 @@ static const char *cs42888_supply_names[CS42888_NUM_SUPPLIES] = {
#define CS42888_TRANS_ADC_SNGVOL_MASK (1 << CS42888_TRANS_ADC_SNGVOL_OFFSET)
#define CS42888_TRANS_ADC_SZC_MASK (3 << CS42888_TRANS_ADC_SZC_OFFSET)
+#define CS42888_TRANS_DAC_SZC_IC (0 << CS42888_TRANS_DAC_SZC_OFFSET)
+#define CS42888_TRANS_DAC_SZC_ZC (1 << CS42888_TRANS_DAC_SZC_OFFSET)
+#define CS42888_TRANS_DAC_SZC_SR (2 << CS42888_TRANS_DAC_SZC_OFFSET)
+#define CS42888_TRANS_DAC_SZC_SRZC (3 << CS42888_TRANS_DAC_SZC_OFFSET)
+
#define CS42888_MUTE_AOUT8 (0x1 << 7)
#define CS42888_MUTE_AOUT7 (0x1 << 6)
#define CS42888_MUTE_AOUT6 (0x1 << 5)
@@ -717,7 +722,6 @@ static int cs42888_hw_params(struct snd_pcm_substream *substream,
pr_err("i2c write failed\n");
return ret;
}
- msleep(400);
ret = cs42888_fill_cache(codec);
if (ret < 0) {
@@ -884,6 +888,8 @@ static int cs42888_probe(struct snd_soc_codec *codec)
/* Disable auto-mute */
val = snd_soc_read(codec, CS42888_TRANS);
val &= ~CS42888_TRANS_AMUTE_MASK;
+ val &= ~CS42888_TRANS_DAC_SZC_MASK;
+ val |= CS42888_TRANS_DAC_SZC_SR;
ret = snd_soc_write(codec, CS42888_TRANS, val);
if (ret < 0) {
pr_err("i2c write failed\n");
diff --git a/sound/soc/codecs/mxc_spdif.c b/sound/soc/codecs/mxc_spdif.c
index 77e62aefe422..b358f719f195 100644
--- a/sound/soc/codecs/mxc_spdif.c
+++ b/sound/soc/codecs/mxc_spdif.c
@@ -888,8 +888,10 @@ static int mxc_spdif_capture_get(struct snd_kcontrol *kcontrol,
clk_enable(plat_data->spdif_clk);
- if (!(__raw_readl(spdif_base_addr + SPDIF_REG_SIS) & INT_CNEW))
+ if (!(__raw_readl(spdif_base_addr + SPDIF_REG_SIS) & INT_CNEW)) {
+ clk_disable(plat_data->spdif_clk);
return -EAGAIN;
+ }
cstatus = __raw_readl(spdif_base_addr + SPDIF_REG_SRCSLH);
ucontrol->value.iec958.status[0] = (cstatus >> 16) & 0xFF;
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 6e7a5e9e9444..3ec5cc7e06c4 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2337,61 +2337,6 @@ SOC_SINGLE_TLV("SPKOUTR Mixer DACR Volume", WM8962_SPEAKER_MIXER_5,
4, 1, 0, inmix_tlv),
};
-static int sysclk_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
-{
- struct snd_soc_codec *codec = w->codec;
- struct wm8962_priv *wm8962 = snd_soc_codec_get_drvdata(codec);
- unsigned long timeout;
- int src;
- int fll;
-
- src = snd_soc_read(codec, WM8962_CLOCKING2) & WM8962_SYSCLK_SRC_MASK;
-
- switch (src) {
- case 0: /* MCLK */
- fll = 0;
- break;
- case 0x200: /* FLL */
- fll = 1;
- break;
- default:
- dev_err(codec->dev, "Unknown SYSCLK source %x\n", src);
- return -EINVAL;
- }
-
- switch (event) {
- case SND_SOC_DAPM_PRE_PMU:
- if (fll) {
- try_wait_for_completion(&wm8962->fll_lock);
-
- snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
- WM8962_FLL_ENA, WM8962_FLL_ENA);
-
- timeout = msecs_to_jiffies(5);
- timeout = wait_for_completion_timeout(&wm8962->fll_lock,
- timeout);
-
- if (wm8962->irq && timeout == 0)
- dev_err(codec->dev,
- "Timed out starting FLL\n");
- }
- break;
-
- case SND_SOC_DAPM_POST_PMD:
- if (fll)
- snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
- WM8962_FLL_ENA, 0);
- break;
-
- default:
- BUG();
- return -EINVAL;
- }
-
- return 0;
-}
-
static int cp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
@@ -2677,8 +2622,7 @@ SND_SOC_DAPM_INPUT("DMICDAT"),
SND_SOC_DAPM_SUPPLY("MICBIAS", WM8962_PWR_MGMT_1, 1, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Class G", WM8962_CHARGE_PUMP_B, 0, 1, NULL, 0),
-SND_SOC_DAPM_SUPPLY("SYSCLK", WM8962_CLOCKING2, 5, 0, sysclk_event,
- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
+SND_SOC_DAPM_SUPPLY("SYSCLK", WM8962_CLOCKING2, 5, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Charge Pump", WM8962_CHARGE_PUMP_1, 0, 0, cp_event,
SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_SUPPLY("TOCLK", WM8962_ADDITIONAL_CONTROL_1, 0, 0, NULL, 0),
@@ -3418,7 +3362,7 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
struct _fll_div fll_div = {0};
unsigned long timeout;
int ret;
- int fll1 = snd_soc_read(codec, WM8962_FLL_CONTROL_1) & WM8962_FLL_ENA;
+ int fll1 = 0;
/* Any change? */
if (source == wm8962->fll_src && Fref == wm8962->fll_fref &&
@@ -3441,6 +3385,9 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
if (ret != 0)
return ret;
+ /* Parameters good, disable so we can reprogram */
+ snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0);
+
switch (fll_id) {
case WM8962_FLL_MCLK:
case WM8962_FLL_BCLK:
@@ -3461,6 +3408,9 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
if (fll_div.theta || fll_div.lambda)
fll1 |= WM8962_FLL_FRAC;
+ /* Stop the FLL while we reconfigure */
+ snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0);
+
snd_soc_update_bits(codec, WM8962_FLL_CONTROL_2,
WM8962_FLL_OUTDIV_MASK |
WM8962_FLL_REFCLK_DIV_MASK,
@@ -3478,7 +3428,9 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK |
- WM8962_FLL_ENA, fll1);
+ WM8962_FLL_ENA, fll1 | WM8962_FLL_ENA);
+
+ fll1 |= WM8962_FLL_ENA;
dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout);
diff --git a/sound/soc/imx/imx-hdmi-dai.c b/sound/soc/imx/imx-hdmi-dai.c
index 0a1686bfcacd..06805f38c5e2 100644
--- a/sound/soc/imx/imx-hdmi-dai.c
+++ b/sound/soc/imx/imx-hdmi-dai.c
@@ -1,7 +1,7 @@
/*
* ALSA SoC HDMI Audio Layer for MXS
*
- * Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
*
* Based on stmp3xxx_spdif_dai.c
* Vladimir Barinov <vbarinov@embeddedalley.com>
@@ -42,8 +42,10 @@ static int imx_hdmi_dai_probe(struct platform_device *pdev)
struct imx_hdmi *hdmi_data;
int ret = 0;
- if (!hdmi_get_registered())
- return -ENOMEM;
+ if (!hdmi_get_registered()) {
+ dev_err(&pdev->dev, "Failed: Load HDMI-video first.\n");
+ return -ENODEV;
+ }
hdmi_data = kzalloc(sizeof(*hdmi_data), GFP_KERNEL);
if (!hdmi_data)
diff --git a/sound/soc/imx/imx-hdmi.c b/sound/soc/imx/imx-hdmi.c
index a30d478af9de..f214cffc4a53 100644
--- a/sound/soc/imx/imx-hdmi.c
+++ b/sound/soc/imx/imx-hdmi.c
@@ -1,7 +1,7 @@
/*
* ASoC HDMI Transmitter driver for IMX development boards
*
- * Copyright (C) 2011-2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
*
* based on stmp3780_devb_spdif.c
*
@@ -57,8 +57,10 @@ static int __init imx_hdmi_init(void)
{
int ret = 0;
- if (!hdmi_get_registered())
- return -ENOMEM;
+ if (!hdmi_get_registered()) {
+ pr_err("Initialize HDMI-audio failed. Load HDMI-video first!\n");
+ return -ENODEV;
+ }
imx_hdmi_snd_device = platform_device_alloc("soc-audio", 4);
if (!imx_hdmi_snd_device) {
diff --git a/sound/soc/imx/imx-wm8962.c b/sound/soc/imx/imx-wm8962.c
index 367c2f8e9aa6..9c5682ff3e68 100644
--- a/sound/soc/imx/imx-wm8962.c
+++ b/sound/soc/imx/imx-wm8962.c
@@ -165,8 +165,8 @@ static int imx_hifi_hw_params(struct snd_pcm_substream *substream,
else
pll_out = sample_rate * 256;
- ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL_OSC,
- WM8962_FLL_OSC, priv->sysclk,
+ ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL_MCLK,
+ WM8962_FLL_MCLK, priv->sysclk,
pll_out);
if (ret < 0)
pr_err("Failed to start FLL: %d\n", ret);
@@ -216,6 +216,14 @@ static int imx_hifi_hw_free(struct snd_pcm_substream *substream)
pr_err("Failed to set MUTE: %d\n", ret);
return ret;
}
+
+ /* Disable FLL */
+ ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL,
+ WM8962_FLL_MCLK, 0, 0);
+ if (ret < 0) {
+ pr_err("Failed to set FLL: %d\n", ret);
+ return ret;
+ }
}
return 0;
}