[PATCH] topology: add support to parse private data for pcm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We have private data section in struct snd_soc_tplg_pcm, but alsatplg
doesn't support handling it yet, here add handling in tplg_parse_pcm()
to enable it.

Signed-off-by: Keyon Jie <yang.jie@xxxxxxxxxxxxxxx>
---
 src/topology/data.c | 3 +++
 src/topology/pcm.c  | 8 ++++++++
 2 files changed, 11 insertions(+)

diff --git a/src/topology/data.c b/src/topology/data.c
index b3f4421f..729ce1f4 100644
--- a/src/topology/data.c
+++ b/src/topology/data.c
@@ -53,6 +53,9 @@ struct snd_soc_tplg_private *get_priv_data(struct tplg_elem *elem)
 	case SND_TPLG_TYPE_BE:
 		priv = &elem->link->priv;
 		break;
+	case SND_TPLG_TYPE_PCM:
+		priv = &elem->pcm->priv;
+		break;
 	default:
 		SNDERR("error: '%s': no support for private data for type %d\n",
 			elem->id, elem->type);
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 5f586dc1..c533ee68 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -732,6 +732,14 @@ int tplg_parse_pcm(snd_tplg_t *tplg,
 				return err;
 			continue;
 		}
+
+		/* private data */
+		if (strcmp(id, "data") == 0) {
+			err = tplg_parse_data_refs(n, elem);
+			if (err < 0)
+				return err;
+			continue;
+		}
 	}
 
 	return 0;
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux