From 79861bbb759053a9b91026becc0915d0f1f8d37d Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 10 Apr 2014 18:16:33 -0700 Subject: [PATCH 1/7] ASoC: rsnd: fix clock prepare/unprepare As with the previous commit, before a clock can be used it must be prepared for use. Change from clk_enable() and clk_disable() to the versions of the calls which also prepare and un-prepare the clocks. Will fix warnings from the clock code when this is used. Signed-off-by: Ben Dooks Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/src.c | 4 ++-- sound/soc/sh/rcar/ssi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 6232b7d307aa..4d0720ed5a90 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -258,7 +258,7 @@ static int rsnd_src_init(struct rsnd_mod *mod, { struct rsnd_src *src = rsnd_mod_to_src(mod); - clk_enable(src->clk); + clk_prepare_enable(src->clk); return 0; } @@ -269,7 +269,7 @@ static int rsnd_src_quit(struct rsnd_mod *mod, { struct rsnd_src *src = rsnd_mod_to_src(mod); - clk_disable(src->clk); + clk_disable_unprepare(src->clk); return 0; } diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 4b7e20603dd7..1d8387c25bd8 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -171,7 +171,7 @@ static void rsnd_ssi_hw_start(struct rsnd_ssi *ssi, u32 cr; if (0 == ssi->usrcnt) { - clk_enable(ssi->clk); + clk_prepare_enable(ssi->clk); if (rsnd_dai_is_clk_master(rdai)) { if (rsnd_ssi_clk_from_parent(ssi)) @@ -230,7 +230,7 @@ static void rsnd_ssi_hw_stop(struct rsnd_ssi *ssi, rsnd_ssi_master_clk_stop(ssi); } - clk_disable(ssi->clk); + clk_disable_unprepare(ssi->clk); } dev_dbg(dev, "ssi%d hw stopped\n", rsnd_mod_id(&ssi->mod)); From 3b5b24315781c744ab3868edee931ddb2145e6b5 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Sat, 5 Apr 2014 23:35:53 +0200 Subject: [PATCH 2/7] ASoC: tlv320aic3x: fix shared reset pin for DT Currently the second tlv320aic3x instance fails to be probed from DT if the reset pin is shared with the first one. This patch fixes it by moving the list add of the reset pin into the i2c_probe method. Signed-off-by: Sebastian Reichel Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic3x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index b1835103e9b4..d7349bc89ad3 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c @@ -1399,7 +1399,6 @@ static int aic3x_probe(struct snd_soc_codec *codec) } aic3x_add_widgets(codec); - list_add(&aic3x->list, &reset_list); return 0; @@ -1569,7 +1568,13 @@ static int aic3x_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_aic3x, &aic3x_dai, 1); - return ret; + + if (ret != 0) + goto err_gpio; + + list_add(&aic3x->list, &reset_list); + + return 0; err_gpio: if (gpio_is_valid(aic3x->gpio_reset) && From eb4dd20c2ac9ad394401694d8762e0a13bc469ef Mon Sep 17 00:00:00 2001 From: Alexandre Belloni Date: Fri, 18 Apr 2014 02:06:30 +0200 Subject: [PATCH 3/7] ASoC: tlv320aic31xx: document that the regulators are mandatory The driver will not probe if regulators are not provided. Move the regulator properties to the required section. Signed-off-by: Alexandre Belloni Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/sound/tlv320aic31xx.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt b/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt index 74c66dee3e14..eff12be5e789 100644 --- a/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt +++ b/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt @@ -13,6 +13,9 @@ Required properties: "ti,tlv320aic3111" - TLV320AIC3111 (stereo speaker amp, MiniDSP) - reg - - I2C slave address +- HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply, + DVDD-supply : power supplies for the device as covered in + Documentation/devicetree/bindings/regulator/regulator.txt Optional properties: @@ -24,9 +27,6 @@ Optional properties: 3 or MICBIAS_AVDD - MICBIAS output is connected to AVDD If this node is not mentioned or if the value is unknown, then micbias is set to 2.0V. -- HPVDD-supply, SPRVDD-supply, SPLVDD-supply, AVDD-supply, IOVDD-supply, - DVDD-supply : power supplies for the device as covered in - Documentation/devicetree/bindings/regulator/regulator.txt CODEC output pins: * HPL From 7897ab78f64008a81344af9fecec6527dbab7a31 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 16 Apr 2014 18:38:11 +0300 Subject: [PATCH 4/7] ASoC: Intel: some incorrect sizeof() usages The intent was to say "sizeof(*pos)" and not "sizeof(pos)". The sizeof(*pos) is 8 bytes so the bug won't show up on 64 bit systems. The sizeof(*dx) is 172 bytes so that will be a bugfix. Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown --- sound/soc/intel/sst-haswell-ipc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index f46bb4ddde6f..4ed2d1706a83 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -617,7 +617,7 @@ static void hsw_notification_work(struct work_struct *work) case IPC_POSITION_CHANGED: trace_ipc_notification("DSP stream position changed for", stream->reply.stream_hw_id); - sst_dsp_inbox_read(hsw->dsp, pos, sizeof(pos)); + sst_dsp_inbox_read(hsw->dsp, pos, sizeof(*pos)); if (stream->notify_position) stream->notify_position(stream, stream->pdata); @@ -1609,7 +1609,7 @@ int sst_hsw_dx_set_state(struct sst_hsw *hsw, trace_ipc_request("PM enter Dx state", state); ret = ipc_tx_message_wait(hsw, header, &state_, sizeof(state_), - dx, sizeof(dx)); + dx, sizeof(*dx)); if (ret < 0) { dev_err(hsw->dev, "ipc: error set dx state %d failed\n", state); return ret; From bf657d2479d179a03668cd7ab8aec96415592f02 Mon Sep 17 00:00:00 2001 From: Christian Engelmayer Date: Sun, 13 Apr 2014 19:56:36 +0200 Subject: [PATCH 5/7] ASoC: Intel: Fix incorrect sizeof() in sst_hsw_stream_get_volume() Fix an incorrect sizeof() usage in sst_hsw_stream_get_volume(). sst_dsp_read() is called to read into a variable of type u32, but is passed sizeof(u32 *) for argument 'size_t bytes'. Detected by Coverity: CID 1195260. Signed-off-by: Christian Engelmayer Signed-off-by: Mark Brown --- sound/soc/intel/sst-haswell-ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index 4ed2d1706a83..50e4246d4b57 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -991,7 +991,8 @@ int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream return -EINVAL; sst_dsp_read(hsw->dsp, volume, - stream->reply.volume_register_address[channel], sizeof(volume)); + stream->reply.volume_register_address[channel], + sizeof(*volume)); return 0; } From 95e9ee92e20162681e9f65c25962e0606db9d149 Mon Sep 17 00:00:00 2001 From: Wenkai Du Date: Tue, 22 Apr 2014 16:38:54 +0300 Subject: [PATCH 6/7] ASoC: Intel: Fix audio crash due to negative address offset There were occasional ADSP crash during reboot testing: [ 11.883364] BUG: unable to handle kernel paging request at ffffc90121700000 [ 11.883380] IP: [] sst_module_insert_fixed_block+0x24f/0x26d [snd_soc_sst_dsp] [ 11.883397] PGD 7800b067 PUD 0 [ 11.883405] Oops: 0002 [#1] SMP [ 11.886418] gsmi: Log Shutdown Reason 0x03 The virtual address, ffffc90121700000, was out of range. The virtual address is calculated by adding LPE base address with an offset: sst_memcpy32(dsp->addr.lpe + data->offset, data->data, data->size); The offset is calculated in sst_byt_parse_module, by subtraction of two virtual addresses dsp->addr.fw_ext and dsp->addr.lpe: block_data.offset = block->ram_offset + (dsp->addr.fw_ext - dsp->addr.lpe); These virtual addresses are assigned by kernel from ioremap: sst->addr.lpe = ioremap(pdata->lpe_base, pdata->lpe_size); sst->addr.fw_ext = ioremap(pdata->fw_base, pdata->fw_size); In current driver code, offset is defined as unsigned int32: struct sst_module_data { ... u32 offset; /* offset in FW file */ }; Most of the time kernel assigned virtual addresses with addr.fw_ext greater than addr.lpe. But sometimes it was the other way round. Fix the problem by declaring offset as signed int32_t. Signed-off-by: Wenkai Du Signed-off-by: Jarkko Nikula Signed-off-by: Mark Brown --- sound/soc/intel/sst-dsp-priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/sst-dsp-priv.h b/sound/soc/intel/sst-dsp-priv.h index fe8e81aad646..30ca14a6a835 100644 --- a/sound/soc/intel/sst-dsp-priv.h +++ b/sound/soc/intel/sst-dsp-priv.h @@ -136,7 +136,7 @@ struct sst_module_data { enum sst_data_type data_type; /* type of module data */ u32 size; /* size in bytes */ - u32 offset; /* offset in FW file */ + int32_t offset; /* offset in FW file */ u32 data_offset; /* offset in ADSP memory space */ void *data; /* module data */ }; From eebdec044e82a4c694b7c1f4996e3ab82d64482c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 22 Apr 2014 22:46:31 +0200 Subject: [PATCH 7/7] ASoC: jz4740: Remove Makefile entry for removed file Commit 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver") jz4740-pcm.c file, but neglected to remove the Makefile entries. Fixes: 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver") Reported-by: kbuild test robot Reported-by: Ralf Baechle Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/jz4740/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/jz4740/Makefile b/sound/soc/jz4740/Makefile index be873c1b0c20..d32c540555c4 100644 --- a/sound/soc/jz4740/Makefile +++ b/sound/soc/jz4740/Makefile @@ -1,10 +1,8 @@ # # Jz4740 Platform Support # -snd-soc-jz4740-objs := jz4740-pcm.o snd-soc-jz4740-i2s-objs := jz4740-i2s.o -obj-$(CONFIG_SND_JZ4740_SOC) += snd-soc-jz4740.o obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-soc-jz4740-i2s.o # Jz4740 Machine Support