summaryrefslogtreecommitdiff
path: root/include/sound
diff options
context:
space:
mode:
authorSudheer Papothi <spapothi@codeaurora.org>2016-01-29 02:40:28 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:10:19 -0700
commitabe342c13b3d2a6523eccc35ff4a9d124e48cc59 (patch)
treea91366fdfaba758fddd62644a3985d407d349b61 /include/sound
parent6ba6d2e98322dd4d8ea07b39d5129671c403ec03 (diff)
ALSA: PCM: User contol API implementation
Introduced a new helper function snd_pcm_add_usr_ctls() to create control elements representing the user control for each PCM (sub)stream Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 048b456ca32d..d27aed5c6f4e 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -519,6 +519,7 @@ struct snd_pcm_str {
#endif
struct snd_kcontrol *chmap_kctl; /* channel-mapping controls */
struct snd_kcontrol *vol_kctl; /* volume controls */
+ struct snd_kcontrol *usr_kctl; /* user controls */
struct device dev;
};
@@ -1435,6 +1436,30 @@ int snd_pcm_add_volume_ctls(struct snd_pcm *pcm, int stream,
unsigned long private_value,
struct snd_pcm_volume **info_ret);
+/*
+ * PCM User control API
+ */
+/* array element of usr elem */
+struct snd_pcm_usr_elem {
+ int val[128];
+};
+
+/* pp information; retrieved via snd_kcontrol_chip() */
+struct snd_pcm_usr {
+ struct snd_pcm *pcm; /* assigned PCM instance */
+ int stream; /* PLAYBACK or CAPTURE */
+ struct snd_kcontrol *kctl;
+ const struct snd_pcm_usr_elem *usr;
+ int max_length;
+ void *private_data; /* optional: private data pointer */
+};
+
+int snd_pcm_add_usr_ctls(struct snd_pcm *pcm, int stream,
+ const struct snd_pcm_usr_elem *usr,
+ int max_length, int max_control_str_len,
+ unsigned long private_value,
+ struct snd_pcm_usr **info_ret);
+
/* printk helpers */
#define pcm_err(pcm, fmt, args...) \
dev_err((pcm)->card->dev, fmt, ##args)