summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@slimlogic.co.uk>2011-05-31 09:22:45 +0100
committerAndy Green <andy.green@linaro.org>2011-05-31 09:22:45 +0100
commit7065b3ea167c9647c442686ea1efae42d0c3fa16 (patch)
treeb7bd33ce9e8a270c70fb981f2f51013e7b5b6f9d /include
parentf485e9bb6e9bcf7f7c72410bc1b0d24c9f5dbd65 (diff)
ASoC: core: Add support for platform DAPM components
Add support for platform based components so that DAPM features can be propagated to platform code. Change-Id: I5b9ffdb71fd2bb90bc3a7c729c25f08721ee3aae Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com> Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-dapm.h2
-rw-r--r--include/sound/soc.h23
2 files changed, 25 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 92821081776..dce21e2189a 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -437,6 +437,7 @@ struct snd_soc_dapm_widget {
char *name; /* widget name */
char *sname; /* stream name */
struct snd_soc_codec *codec;
+ struct snd_soc_platform *platform;
struct list_head list;
struct snd_soc_dapm_context *dapm;
@@ -495,6 +496,7 @@ struct snd_soc_dapm_context {
struct device *dev; /* from parent - for debug */
struct snd_soc_codec *codec; /* parent codec */
+ struct snd_soc_platform *platform; /*parent platform */
struct snd_soc_card *card; /* parent card */
/* used during DAPM updates */
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 74921f20a1d..d787268e533 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -235,6 +235,7 @@ struct snd_soc_codec_driver;
struct soc_enum;
struct snd_soc_jack;
struct snd_soc_jack_pin;
+struct snd_soc_dapm_context;
struct snd_soc_cache_ops;
#include <sound/soc-dapm.h>
@@ -324,6 +325,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
void *data, char *long_name);
int snd_soc_add_controls(struct snd_soc_codec *codec,
const struct snd_kcontrol_new *controls, int num_controls);
+int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
+ const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -543,6 +546,10 @@ struct snd_soc_platform_driver {
/* platform stream ops */
struct snd_pcm_ops *ops;
+
+ /* platform DAPM IO TODO: refactor this */
+ unsigned int (*read)(struct snd_soc_platform *, unsigned int);
+ int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
};
struct snd_soc_platform {
@@ -557,6 +564,10 @@ struct snd_soc_platform {
struct snd_soc_card *card;
struct list_head list;
struct list_head card_list;
+ int num_dai;
+
+ /* dapm */
+ struct snd_soc_dapm_context dapm;
};
struct snd_soc_dai_link {
@@ -718,6 +729,18 @@ struct soc_enum {
unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg);
unsigned int snd_soc_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int val);
+/* platform DAPM IO - refactor */
+static inline unsigned int snd_soc_platform_read(struct snd_soc_platform *platform,
+ unsigned int reg)
+{
+ return platform->driver->read(platform, reg);
+}
+
+static inline unsigned int snd_soc_platform_write(struct snd_soc_platform *platform,
+ unsigned int reg, unsigned int val)
+{
+ return platform->driver->write(platform, reg, val);
+}
/* device driver data */