ASoC: core - Add Platform driver DAPM widgets/kcontrols.
In preparation for ASoC DSP support.
Allow platform drivers to export widgets and kcontrols.
This is required to support DSP dynamic DAI routing and power management where
platform DSP drivers have kcontrols, DAPM widgets etc.
Signed-off-by: Liam Girdwood <lrg@ti.com>
diff --git a/include/sound/soc.h b/include/sound/soc.h
index bf8a5d1..33db668 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -302,6 +302,10 @@
unsigned int reg);
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
unsigned int reg);
+unsigned int snd_soc_platform_read(struct snd_soc_platform *platform,
+ unsigned int reg);
+unsigned int snd_soc_platform_write(struct snd_soc_platform *platform,
+ unsigned int reg, unsigned int val);
/* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -354,6 +358,8 @@
const char *prefix);
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,
@@ -653,6 +659,9 @@
bool early_remove;
int (*stream_event)(struct snd_soc_dapm_context *dapm);
+ /* 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 {
@@ -664,6 +673,7 @@
unsigned int suspended:1; /* platform is suspended */
unsigned int probed:1;
+ struct snd_card *snd_card;
struct snd_soc_card *card;
struct list_head list;
struct list_head card_list;