From 0fb50e5539c1525939b89c1813b60cc72f90a3e1 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 7 Nov 2013 00:56:28 -0800 Subject: ASoC: rcar: select REGMAP 55e5b6fd5af04b6d8b0ac6635edf49476ff298ba (ASoC: rsnd: use regmap instead of original register mapping method) support regmap/regmap_field on Renesas sound driver. It needs CONFIG_REGMAP now. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index 14011d90d70a..ff60e11ecb56 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig @@ -37,6 +37,7 @@ config SND_SOC_SH4_SIU config SND_SOC_RCAR tristate "R-Car series SRU/SCU/SSIU/SSI support" select SND_SIMPLE_CARD + select REGMAP help This option enables R-Car SUR/SCU/SSIU/SSI sound support -- cgit v1.2.3 From 2ab2b74277a86afe0dd92976db695a2bb8b93366 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 22 Nov 2013 14:17:18 +0000 Subject: ASoC: wm8990: Mark the register map as dirty when powering down Otherwise we'll skip sync on resume. Signed-off-by: Mark Brown Acked-by: Charles Keepax Cc: stable@vger.kernel.org --- sound/soc/codecs/wm8990.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c index 253c88bb7a4c..4f05fb88bddf 100644 --- a/sound/soc/codecs/wm8990.c +++ b/sound/soc/codecs/wm8990.c @@ -1259,6 +1259,8 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, /* disable POBCTRL, SOFT_ST and BUFDCOPEN */ snd_soc_write(codec, WM8990_ANTIPOP2, 0x0); + + codec->cache_sync = 1; break; } -- cgit v1.2.3 From 46bec25da6a41b7308adde746cbcdbbd0bf9b39c Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Wed, 27 Nov 2013 18:05:09 +0800 Subject: ASoC: atmel: sam9x5_wm8731: fix oops when unload module As the priv is not assigned to card->drvdata, it is NULL, so when unload module, it will cause NULL pointer oops. Assign priv to card->drvdata to fix this issue. Signed-off-by: Bo Shen Signed-off-by: Mark Brown --- sound/soc/atmel/sam9x5_wm8731.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound') diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c index 992ae38d5a15..1b372283bd01 100644 --- a/sound/soc/atmel/sam9x5_wm8731.c +++ b/sound/soc/atmel/sam9x5_wm8731.c @@ -97,6 +97,8 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) goto out; } + snd_soc_card_set_drvdata(card, priv); + card->dev = &pdev->dev; card->owner = THIS_MODULE; card->dai_link = dai; -- cgit v1.2.3 From df9e3560923a54a559211629895ed9fa1e48ccc0 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Wed, 27 Nov 2013 15:22:13 +0000 Subject: ASoC: wm5110: Remove output OSR and PGA volume controls These are managed automatically in current revisions. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown --- sound/soc/codecs/wm5110.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c index c3c7396a6181..99b359e19d35 100644 --- a/sound/soc/codecs/wm5110.c +++ b/sound/soc/codecs/wm5110.c @@ -248,19 +248,6 @@ ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE), ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE), ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), -SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L, - ARIZONA_OUT1_OSR_SHIFT, 1, 0), -SOC_SINGLE("HPOUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L, - ARIZONA_OUT2_OSR_SHIFT, 1, 0), -SOC_SINGLE("HPOUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L, - ARIZONA_OUT3_OSR_SHIFT, 1, 0), -SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L, - ARIZONA_OUT4_OSR_SHIFT, 1, 0), -SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L, - ARIZONA_OUT5_OSR_SHIFT, 1, 0), -SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L, - ARIZONA_OUT6_OSR_SHIFT, 1, 0), - SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, @@ -293,18 +280,6 @@ SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L, ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT, 0xbf, 0, digital_tlv), -SOC_DOUBLE_R_RANGE_TLV("HPOUT1 Volume", ARIZONA_OUTPUT_PATH_CONFIG_1L, - ARIZONA_OUTPUT_PATH_CONFIG_1R, - ARIZONA_OUT1L_PGA_VOL_SHIFT, - 0x34, 0x40, 0, ana_tlv), -SOC_DOUBLE_R_RANGE_TLV("HPOUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L, - ARIZONA_OUTPUT_PATH_CONFIG_2R, - ARIZONA_OUT2L_PGA_VOL_SHIFT, - 0x34, 0x40, 0, ana_tlv), -SOC_DOUBLE_R_RANGE_TLV("HPOUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L, - ARIZONA_OUTPUT_PATH_CONFIG_3R, - ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv), - SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, ARIZONA_SPK1R_MUTE_SHIFT, 1, 1), SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, -- cgit v1.2.3 From 1c195ddb1de14ff9a6327c47f88428200f7c8d88 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Tue, 26 Nov 2013 10:41:40 +0100 Subject: ASoC: kirkwood: Fix invalid S/PDIF format This patch removes the 32 bits format which is not supported by S/PDIF output. Signed-off-by: Jean-Francois Moine Signed-off-by: Mark Brown --- sound/soc/kirkwood/kirkwood-i2s.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sound') diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index d34d91743e3f..b42492d87221 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -33,6 +33,10 @@ SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S32_LE) +#define KIRKWOOD_SPDIF_FORMATS \ + (SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE) + static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) { @@ -449,14 +453,14 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai[2] = { .channels_max = 2, .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000, - .formats = KIRKWOOD_I2S_FORMATS, + .formats = KIRKWOOD_SPDIF_FORMATS, }, .capture = { .channels_min = 1, .channels_max = 2, .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000, - .formats = KIRKWOOD_I2S_FORMATS, + .formats = KIRKWOOD_SPDIF_FORMATS, }, .ops = &kirkwood_i2s_dai_ops, }, @@ -493,7 +497,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { .rates = SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT, - .formats = KIRKWOOD_I2S_FORMATS, + .formats = KIRKWOOD_SPDIF_FORMATS, }, .capture = { .channels_min = 1, @@ -501,7 +505,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = { .rates = SNDRV_PCM_RATE_8000_192000 | SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT, - .formats = KIRKWOOD_I2S_FORMATS, + .formats = KIRKWOOD_SPDIF_FORMATS, }, .ops = &kirkwood_i2s_dai_ops, }, -- cgit v1.2.3 From 4f6f1478c1ada4524e9ed21190b4549233a816a3 Mon Sep 17 00:00:00 2001 From: Jean-Francois Moine Date: Mon, 25 Nov 2013 20:19:05 +0100 Subject: ASoC: kirkwood: Fix erroneous double output while playing This patch fixes the setting of the register KIRKWOOD_PLAYCTL which did always streaming on both I2S and SPDIF, ignoring the DAI ID. The bug was introduced by the commit 75b9b65ee5a "ASoC: kirkwood: add S/PDIF support" Signed-off-by: Jean-Francois Moine Signed-off-by: Mark Brown --- sound/soc/kirkwood/kirkwood-i2s.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index b42492d87221..0b18f654b413 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -248,15 +248,15 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream, ctl); } - if (dai->id == 0) - ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ - else - ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ - switch (cmd) { case SNDRV_PCM_TRIGGER_START: /* configure */ ctl = priv->ctl_play; + if (dai->id == 0) + ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */ + else + ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */ + value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; writel(value, priv->io + KIRKWOOD_PLAYCTL); -- cgit v1.2.3 From d6437c14df89cb2df2bd9ef3692958d979b75d49 Mon Sep 17 00:00:00 2001 From: Oskar Schirmer Date: Tue, 5 Nov 2013 12:13:54 +0000 Subject: ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation Originally snd_hrtimer_callback() used iprtd->period_time for some jiffies based estimation to determine the right moment to call snd_pcm_period_elapsed(). As timer drifts may well be a problem, this was changed in commit b4e82b5b785670b6 to be based on buffer transmission progress, using iprtd->offset and runtime->buffer_size to calculate the amount of data since last period had elapsed. Unfortunately, iprtd->offset counts in bytes, while runtime->buffer_size counts frames, so adding these to find some delta is like comparing apples and oranges, and eventually results in negative delta values every now and then. This is no big harm, because it simply causes snd_pcm_period_elapsed() being called more often than necessary, as negative delta is taken for a large unsigned value by implicit conversion rule. Nonetheless, the calculation is broken, so one would replace the runtime->buffer_size by its equivalent in bytes. But then, there are chances snd_pcm_period_elapsed() is called late, because calculating the moment for the elapsed period into delta is based against the iprtd->last_offset, which is not necessarily the first byte of the period in question, but some random byte which the FIQ handler left us with in r8/r9 by accident. Again, negative impact is low, as there are plenty of periods already prefilled with data, and snd_pcm_period_elapsed() will probably be called latest when the following period is reached. However, the calculation is conceptually broken, and we are best off removing the clever stuff altogether. snd_pcm_period_elapsed() is now simply called once everytime snd_hrtimer_callback() is run, which may not be most accurate, but at least this way we are quite sure we dont miss an end of period. There is not much extra effort wasted by superfluous calls to snd_pcm_period_elapsed(), as the timer frequency closely matches the period size anyway. Signed-off-by: Oskar Schirmer Signed-off-by: Mark Brown --- sound/soc/fsl/imx-pcm-fiq.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'sound') diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 2fc872b2deff..f53b3261b171 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -39,8 +39,6 @@ struct imx_pcm_runtime_data { unsigned int period; int periods; unsigned long offset; - unsigned long last_offset; - unsigned long size; struct hrtimer hrt; int poll_time_ns; struct snd_pcm_substream *substream; @@ -55,7 +53,6 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) struct snd_pcm_substream *substream = iprtd->substream; struct snd_pcm_runtime *runtime = substream->runtime; struct pt_regs regs; - unsigned long delta; if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing)) return HRTIMER_NORESTART; @@ -67,19 +64,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) else iprtd->offset = regs.ARM_r9 & 0xffff; - /* How much data have we transferred since the last period report? */ - if (iprtd->offset >= iprtd->last_offset) - delta = iprtd->offset - iprtd->last_offset; - else - delta = runtime->buffer_size + iprtd->offset - - iprtd->last_offset; - - /* If we've transferred at least a period then report it and - * reset our poll time */ - if (delta >= iprtd->period) { - snd_pcm_period_elapsed(substream); - iprtd->last_offset = iprtd->offset; - } + snd_pcm_period_elapsed(substream); hrtimer_forward_now(hrt, ns_to_ktime(iprtd->poll_time_ns)); @@ -96,11 +81,9 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; struct imx_pcm_runtime_data *iprtd = runtime->private_data; - iprtd->size = params_buffer_bytes(params); iprtd->periods = params_periods(params); - iprtd->period = params_period_bytes(params) ; + iprtd->period = params_period_bytes(params); iprtd->offset = 0; - iprtd->last_offset = 0; iprtd->poll_time_ns = 1000000000 / params_rate(params) * params_period_size(params); snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); -- cgit v1.2.3 From 23d8bb3bb65e3587ceff54e1b54dda3c48a14f28 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 8 Nov 2013 00:55:00 -0200 Subject: ASoC: fsl: imx-pcm-fiq: Remove unused 'runtime' variable Commit 68f9672b (ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation) introduced the following build warning: sound/soc/fsl/imx-pcm-fiq.c:53:26: warning: unused variable 'runtime' [-Wunused-variable] Remove the unused 'runtime' variable. Signed-off-by: Fabio Estevam Acked-by: Oskar Schirmer Signed-off-by: Mark Brown --- sound/soc/fsl/imx-pcm-fiq.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index f53b3261b171..f00b512dbada 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -51,7 +51,6 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) struct imx_pcm_runtime_data *iprtd = container_of(hrt, struct imx_pcm_runtime_data, hrt); struct snd_pcm_substream *substream = iprtd->substream; - struct snd_pcm_runtime *runtime = substream->runtime; struct pt_regs regs; if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing)) -- cgit v1.2.3 From 6c7ef410c986db7e57b83231427e4606a225606b Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sat, 9 Nov 2013 08:41:14 +0800 Subject: ASoC: fsl: set correct platform drvdata in pcm030_fabric_probe() platform_set_drvdata(op, pdata) in pcm030_fabric_probe() will be overwrited when calling snd_soc_register_card(card), but cm030_fabric_remove() use drvdata as a type of struct pcm030_audio_data, so we should move platform_set_drvdata() below snd_soc_register_card() call. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown --- sound/soc/fsl/pcm030-audio-fabric.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c index eb4373840bb6..3665f612819d 100644 --- a/sound/soc/fsl/pcm030-audio-fabric.c +++ b/sound/soc/fsl/pcm030-audio-fabric.c @@ -69,7 +69,6 @@ static int pcm030_fabric_probe(struct platform_device *op) return -ENOMEM; card->dev = &op->dev; - platform_set_drvdata(op, pdata); pdata->card = card; @@ -98,6 +97,8 @@ static int pcm030_fabric_probe(struct platform_device *op) if (ret) dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret); + platform_set_drvdata(op, pdata); + return ret; } -- cgit v1.2.3 From fb28a75ad4806e17512025e03ec7c8255d055478 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Sat, 30 Nov 2013 18:05:28 +0200 Subject: ASoC: omap: n810: Convert to clk_prepare_enable/clk_disable_unprepare N810 audio driver has stopped working at some point. Probably when OMAP2 was converted to common clock framework since now call to clk_enable dumps the stack trace in drivers/clk/clk.c: __clk_enable() due clk->prepare_count is zero. Fix this by converting clk_enable/_disable calls to those that take care of clock prepare/unprepare. I'm not queueing this to linux-stable since OMAP2 common clock framework conversion in commit ed1ebc4948fd ("ARM: OMAP2: clock: Convert to common clk") happened before N810 was really usable in mainline and user base for N810 is anyway small. Potential linux-stable candidates are only those after commit 3d3a6d18abc6 ("watchdog: introduce retu_wdt driver"). Signed-off-by: Jarkko Nikula Signed-off-by: Mark Brown --- sound/soc/omap/n810.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 6d216cb6c19b..3fde9e402710 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c @@ -100,12 +100,12 @@ static int n810_startup(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); n810_ext_control(&codec->dapm); - return clk_enable(sys_clkout2); + return clk_prepare_enable(sys_clkout2); } static void n810_shutdown(struct snd_pcm_substream *substream) { - clk_disable(sys_clkout2); + clk_disable_unprepare(sys_clkout2); } static int n810_hw_params(struct snd_pcm_substream *substream, -- cgit v1.2.3 From b4af6ef99a60c5b56df137d7accd81ba1ee1254e Mon Sep 17 00:00:00 2001 From: Bo Shen Date: Tue, 3 Dec 2013 18:04:54 +0800 Subject: ASoC: wm8731: fix dsp mode configuration According to WM8731 "PD, Rev 4.9 October 2012" datasheet, when it works in DSP mode A, LRP = 1, while works in DSP mode B, LRP = 0. So, fix LRP for DSP mode as the datesheet specification. Signed-off-by: Bo Shen Acked-by: Charles Keepax Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/wm8731.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 456bb8c6d759..bc7472c968e3 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -447,10 +447,10 @@ static int wm8731_set_dai_fmt(struct snd_soc_dai *codec_dai, iface |= 0x0001; break; case SND_SOC_DAIFMT_DSP_A: - iface |= 0x0003; + iface |= 0x0013; break; case SND_SOC_DAIFMT_DSP_B: - iface |= 0x0013; + iface |= 0x0003; break; default: return -EINVAL; -- cgit v1.2.3