* [PATCH] ASoC: DAPM - Export mixer|mux_update_power() to public API.
@ 2012-02-06 13:32 Liam Girdwood
2012-02-06 13:40 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Liam Girdwood @ 2012-02-06 13:32 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Liam Girdwood
Allow for the operation of custom mixer and mux DAPM widgets that can call
snd_soc_dapm_mixer_update_power() and snd_soc_dapm_mux_update_power() directly
after updating their status. This is useful with complex DAPM Mixer operations
where we need to do additional work in addition to setting a few mixer register
bits.
Signed-off-by: Liam Girdwood <lrg@ti.com>
---
include/sound/soc-dapm.h | 7 +++++++
sound/soc/soc-dapm.c | 16 +++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index d26a9b7..4f12faa 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -365,6 +365,13 @@ int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
const char *stream, int event);
void snd_soc_dapm_shutdown(struct snd_soc_card *card);
+/* external DAPM widget events */
+int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
+ struct snd_kcontrol *kcontrol, int connect);
+int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
+ struct snd_kcontrol *kcontrol, int change,
+ int mux, struct soc_enum *e);
+
/* dapm sys fs - used by the core */
int snd_soc_dapm_sys_add(struct device *dev);
void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3ad1f59..49b944a 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1659,7 +1659,7 @@ static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
#endif
/* test and update the power status of a mux widget */
-static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
+int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int change,
int mux, struct soc_enum *e)
{
@@ -1702,9 +1702,10 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
return 0;
}
+EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);
/* test and update the power status of a mixer or switch widget */
-static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
+int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, int connect)
{
struct snd_soc_dapm_path *path;
@@ -1733,6 +1734,7 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
return 0;
}
+EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power);
/* show dapm widget status in sys fs */
static ssize_t dapm_widget_show(struct device *dev,
@@ -2315,7 +2317,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;
- dapm_mixer_update_power(widget, kcontrol, connect);
+ snd_soc_dapm_mixer_update_power(widget, kcontrol, connect);
widget->dapm->update = NULL;
}
@@ -2406,7 +2408,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;
- dapm_mux_update_power(widget, kcontrol, change, mux, e);
+ snd_soc_dapm_mux_update_power(widget, kcontrol, change, mux, e);
widget->dapm->update = NULL;
}
@@ -2467,8 +2469,8 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
widget->value = ucontrol->value.enumerated.item[0];
- dapm_mux_update_power(widget, kcontrol, change,
- widget->value, e);
+ snd_soc_dapm_mux_update_power(widget, kcontrol, change,
+ widget->value, e);
}
}
@@ -2571,7 +2573,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
update.val = val;
widget->dapm->update = &update;
- dapm_mux_update_power(widget, kcontrol, change, mux, e);
+ snd_soc_dapm_mux_update_power(widget, kcontrol, change, mux, e);
widget->dapm->update = NULL;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: DAPM - Export mixer|mux_update_power() to public API.
2012-02-06 13:32 [PATCH] ASoC: DAPM - Export mixer|mux_update_power() to public API Liam Girdwood
@ 2012-02-06 13:40 ` Mark Brown
2012-02-06 14:24 ` Liam Girdwood
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-02-06 13:40 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 441 bytes --]
On Mon, Feb 06, 2012 at 01:32:15PM +0000, Liam Girdwood wrote:
> +int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
> + struct snd_kcontrol *kcontrol, int change,
> + int mux, struct soc_enum *e);
We should get rid of the change parameter before exporting this, we've
already got all the conditionals in the callers so it never gets called
without change being set and any users should be doing the same thing.
[-- 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] 3+ messages in thread
* Re: [PATCH] ASoC: DAPM - Export mixer|mux_update_power() to public API.
2012-02-06 13:40 ` Mark Brown
@ 2012-02-06 14:24 ` Liam Girdwood
0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2012-02-06 14:24 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel
On Mon, 2012-02-06 at 13:40 +0000, Mark Brown wrote:
> On Mon, Feb 06, 2012 at 01:32:15PM +0000, Liam Girdwood wrote:
>
> > +int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
> > + struct snd_kcontrol *kcontrol, int change,
> > + int mux, struct soc_enum *e);
>
> We should get rid of the change parameter before exporting this, we've
> already got all the conditionals in the callers so it never gets called
> without change being set and any users should be doing the same thing.
That's true, and I can't quite remember why there was a change parameter
to begin with.
Liam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-06 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 13:32 [PATCH] ASoC: DAPM - Export mixer|mux_update_power() to public API Liam Girdwood
2012-02-06 13:40 ` Mark Brown
2012-02-06 14:24 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).