All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC: wm_adsp: Couple of updates
@ 2013-11-01 15:56 Dimitris Papastamos
  2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Patch-set generated against sound/for-next this time.

Dimitris Papastamos (5):
  ASoC: wm_adsp: Print error when regmap reads/writes fail
  ASoC: wm_adsp: Release firmware on memory allocation failure
  ASoC: wm_adsp: Add debug info on get()/put() transfers
  ASoC: wm_adsp: Remove and free algorithm regions for ADSP1
  ASoC: wm_adsp: Print out the firmware version

Nariman Poushin (1):
  ASoC: wm_adsp: Interpret ADSP memory region lengths as 32  bit words

 sound/soc/codecs/wm_adsp.c | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:48   ` Mark Brown
  2013-11-01 15:56 ` [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure Dimitris Papastamos
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index b38f350..076da02 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -396,8 +396,8 @@ static int wm_coeff_write_control(struct snd_kcontrol *kcontrol,
 	ret = regmap_raw_write(adsp->regmap, reg, scratch,
 			       ctl->len);
 	if (ret) {
-		adsp_err(adsp, "Failed to write %zu bytes to %x\n",
-			 ctl->len, reg);
+		adsp_err(adsp, "Failed to write %zu bytes to %x: %d\n",
+			 ctl->len, reg, ret);
 		kfree(scratch);
 		return ret;
 	}
@@ -450,8 +450,8 @@ static int wm_coeff_read_control(struct snd_kcontrol *kcontrol,
 
 	ret = regmap_raw_read(adsp->regmap, reg, scratch, ctl->len);
 	if (ret) {
-		adsp_err(adsp, "Failed to read %zu bytes from %x\n",
-			 ctl->len, reg);
+		adsp_err(adsp, "Failed to read %zu bytes from %x: %d\n",
+			 ctl->len, reg, ret);
 		kfree(scratch);
 		return ret;
 	}
@@ -1313,8 +1313,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 						     le32_to_cpu(blk->len));
 			if (ret != 0) {
 				adsp_err(dsp,
-					"%s.%d: Failed to write to %x in %s\n",
-					file, blocks, reg, region_name);
+					"%s.%d: Failed to write to %x in %s: %d\n",
+					file, blocks, reg, region_name, ret);
 			}
 		}
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
  2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:48   ` Mark Brown
  2013-11-01 15:56 ` [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words Dimitris Papastamos
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 076da02..4008ceb 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -689,7 +689,8 @@ static int wm_adsp_load(struct wm_adsp *dsp)
 						&buf_list);
 			if (!buf) {
 				adsp_err(dsp, "Out of memory\n");
-				return -ENOMEM;
+				ret = -ENOMEM;
+				goto out_fw;
 			}
 
 			ret = regmap_raw_write_async(regmap, reg, buf->buf,
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
  2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
  2013-11-01 15:56 ` [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:47   ` Mark Brown
  2013-11-01 15:56 ` [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers Dimitris Papastamos
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

From: Nariman Poushin <nariman@opensource.wolfsonmicro.com>

Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate
lengths based on padded ADSP words instead of treating them as bytes

Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 4008ceb..4039d05 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1063,6 +1063,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
 			if (i + 1 < algs) {
 				region->len = be32_to_cpu(adsp1_alg[i + 1].dm);
 				region->len -= be32_to_cpu(adsp1_alg[i].dm);
+				region->len *= 4;
 				wm_adsp_create_control(dsp, region);
 			} else {
 				adsp_warn(dsp, "Missing length info for region DM with ID %x\n",
@@ -1080,6 +1081,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
 			if (i + 1 < algs) {
 				region->len = be32_to_cpu(adsp1_alg[i + 1].zm);
 				region->len -= be32_to_cpu(adsp1_alg[i].zm);
+				region->len *= 4;
 				wm_adsp_create_control(dsp, region);
 			} else {
 				adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
@@ -1109,6 +1111,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
 			if (i + 1 < algs) {
 				region->len = be32_to_cpu(adsp2_alg[i + 1].xm);
 				region->len -= be32_to_cpu(adsp2_alg[i].xm);
+				region->len *= 4;
 				wm_adsp_create_control(dsp, region);
 			} else {
 				adsp_warn(dsp, "Missing length info for region XM with ID %x\n",
@@ -1126,6 +1129,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
 			if (i + 1 < algs) {
 				region->len = be32_to_cpu(adsp2_alg[i + 1].ym);
 				region->len -= be32_to_cpu(adsp2_alg[i].ym);
+				region->len *= 4;
 				wm_adsp_create_control(dsp, region);
 			} else {
 				adsp_warn(dsp, "Missing length info for region YM with ID %x\n",
@@ -1143,6 +1147,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)
 			if (i + 1 < algs) {
 				region->len = be32_to_cpu(adsp2_alg[i + 1].zm);
 				region->len -= be32_to_cpu(adsp2_alg[i].zm);
+				region->len *= 4;
 				wm_adsp_create_control(dsp, region);
 			} else {
 				adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
                   ` (2 preceding siblings ...)
  2013-11-01 15:56 ` [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:49   ` Mark Brown
  2013-11-01 15:56 ` [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1 Dimitris Papastamos
  2013-11-01 15:56 ` [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version Dimitris Papastamos
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 4039d05..79dc4aa 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -401,6 +401,7 @@ static int wm_coeff_write_control(struct snd_kcontrol *kcontrol,
 		kfree(scratch);
 		return ret;
 	}
+	adsp_dbg(adsp, "Wrote %zu bytes to %x\n", ctl->len, reg);
 
 	kfree(scratch);
 
@@ -455,6 +456,7 @@ static int wm_coeff_read_control(struct snd_kcontrol *kcontrol,
 		kfree(scratch);
 		return ret;
 	}
+	adsp_dbg(adsp, "Read %zu bytes from %x\n", ctl->len, reg);
 
 	memcpy(buf, scratch, ctl->len);
 	kfree(scratch);
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
                   ` (3 preceding siblings ...)
  2013-11-01 15:56 ` [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:49   ` Mark Brown
  2013-11-01 15:56 ` [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version Dimitris Papastamos
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Do it in a similar fashion as we do for ADSP2.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 79dc4aa..1761f65 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1366,6 +1366,7 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
 	struct snd_soc_codec *codec = w->codec;
 	struct wm_adsp *dsps = snd_soc_codec_get_drvdata(codec);
 	struct wm_adsp *dsp = &dsps[w->shift];
+	struct wm_adsp_alg_region *alg_region;
 	struct wm_coeff_ctl *ctl;
 	int ret;
 	int val;
@@ -1443,6 +1444,14 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
 
 		list_for_each_entry(ctl, &dsp->ctl_list, list)
 			ctl->enabled = 0;
+
+		while (!list_empty(&dsp->alg_regions)) {
+			alg_region = list_first_entry(&dsp->alg_regions,
+						      struct wm_adsp_alg_region,
+						      list);
+			list_del(&alg_region->list);
+			kfree(alg_region);
+		}
 		break;
 
 	default:
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version
  2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
                   ` (4 preceding siblings ...)
  2013-11-01 15:56 ` [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1 Dimitris Papastamos
@ 2013-11-01 15:56 ` Dimitris Papastamos
  2013-11-01 17:49   ` Mark Brown
  5 siblings, 1 reply; 13+ messages in thread
From: Dimitris Papastamos @ 2013-11-01 15:56 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, patches

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 1761f65..df95e5a 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -570,6 +570,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
 			 file, header->ver);
 		goto out_fw;
 	}
+	adsp_info(dsp, "Firmware version: %d\n", header->ver);
 
 	if (header->core != dsp->type) {
 		adsp_err(dsp, "%s: invalid core %d != %d\n",
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
  2013-11-01 15:56 ` [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words Dimitris Papastamos
@ 2013-11-01 17:47   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:47 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 450 bytes --]

On Fri, Nov 01, 2013 at 03:56:54PM +0000, Dimitris Papastamos wrote:
> From: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
> 
> Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate
> lengths based on padded ADSP words instead of treating them as bytes
> 
> Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
> ---

If you're forwarding someone else's patch you need to add your own
signoff as well.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail
  2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
@ 2013-11-01 17:48   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:48 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 157 bytes --]

On Fri, Nov 01, 2013 at 03:56:52PM +0000, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure
  2013-11-01 15:56 ` [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure Dimitris Papastamos
@ 2013-11-01 17:48   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:48 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 157 bytes --]

On Fri, Nov 01, 2013 at 03:56:53PM +0000, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers
  2013-11-01 15:56 ` [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers Dimitris Papastamos
@ 2013-11-01 17:49   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:49 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 157 bytes --]

On Fri, Nov 01, 2013 at 03:56:55PM +0000, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1
  2013-11-01 15:56 ` [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1 Dimitris Papastamos
@ 2013-11-01 17:49   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:49 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 136 bytes --]

On Fri, Nov 01, 2013 at 03:56:56PM +0000, Dimitris Papastamos wrote:
> Do it in a similar fashion as we do for ADSP2.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version
  2013-11-01 15:56 ` [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version Dimitris Papastamos
@ 2013-11-01 17:49   ` Mark Brown
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2013-11-01 17:49 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: alsa-devel, patches


[-- Attachment #1.1: Type: text/plain, Size: 157 bytes --]

On Fri, Nov 01, 2013 at 03:56:57PM +0000, Dimitris Papastamos wrote:
> Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-11-01 17:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 15:56 [PATCH 0/6] ASoC: wm_adsp: Couple of updates Dimitris Papastamos
2013-11-01 15:56 ` [PATCH 1/6] ASoC: wm_adsp: Print error when regmap reads/writes fail Dimitris Papastamos
2013-11-01 17:48   ` Mark Brown
2013-11-01 15:56 ` [PATCH 2/6] ASoC: wm_adsp: Release firmware on memory allocation failure Dimitris Papastamos
2013-11-01 17:48   ` Mark Brown
2013-11-01 15:56 ` [PATCH 3/6] ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words Dimitris Papastamos
2013-11-01 17:47   ` Mark Brown
2013-11-01 15:56 ` [PATCH 4/6] ASoC: wm_adsp: Add debug info on get()/put() transfers Dimitris Papastamos
2013-11-01 17:49   ` Mark Brown
2013-11-01 15:56 ` [PATCH 5/6] ASoC: wm_adsp: Remove and free algorithm regions for ADSP1 Dimitris Papastamos
2013-11-01 17:49   ` Mark Brown
2013-11-01 15:56 ` [PATCH 6/6] ASoC: wm_adsp: Print out the firmware version Dimitris Papastamos
2013-11-01 17:49   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.