ASoC: Add support for cross-device paths without dai and without name collision
Subsystems (12)
Hi
I'm sending here four set of patches that are build on top of another. They are trying to solve issues with following setup:
CPU <-> [Codec x.0] -> [Codec x.1] -> out
Here only Codec x.0 has DAI link between codec and CPU, Codec x.1 is used as an amplifier and the same codec driver is used for both codec instances.
Currently this setup is not possible because ASoC doesn't support cross-device paths, i.e. DAPM is per codec, there is no support to register dailess codecs and no resolution for name collisions that would occur when multiple codec instances tries to register same kcontrols and when trying to build paths between widgets.
I've separated patches to these problems to separate sets so that reviewing would be easier. However, they depend on previous sets so they must be applied sequentially and thus each set is named as RFC_[i-iv]/iv.
I've based this work on of top of Liam's DAPM decoupling patches. Those must be squashed together but I'm sending here them separately because they include core change from Liam and trivial conversions and minor fixes from me.
i Decoupling DAPM from codecs. Core implementation from Liam Girdwood
and some minor bits from me, conversion of new codecs and all the platforms. I've build tested the codecs and OMAP platforms and if some platform doesn't build, it's my fault.
ii Extend ASoC core to handle cross-device paths. Decoupling paths and
widgets from DAPM context and handling cross-device bias and widget power changes.
iii Support for dailess codecs. This is achieved by renaming dai_link as
dev_map, i.e. the former struct snd_soc_dai_link becomes struct snd_soc_dev_map so it does not only describe platform, cpu dai and codec binding but also registration of dailess codecs.
iv Optional name_prefix to struct snd_soc_dev_map. With this a machine
driver can specify a name that is used to prefix codec kcontrols, widgets and internal route names for avoiding name collision that would occur if multiple codec instances are registered.
Signature · 1 line
Jarkko
PATCH 1/3 ASoC: Decouple DAPM from CODECs. Part core (will be squashed)
This patch de-couples DAPM from the CODEC in order for other components to have DAPM widgets.
Core implementation:
[[email protected]: This is combined from two patches made originally by [email protected] and [email protected] in branch origin/topic/L24.9 of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6.git.
Author did some minor changes due changed structures in ASoC and restricted the patch to deal only with DAPM context of codec and let subsequent patches to add DAPM context to other components]
--- include/sound/soc-dapm.h | 42 +++++-- include/sound/soc.h | 8 +- sound/soc/soc-core.c | 48 +++++-- sound/soc/soc-dapm.c | 323 ++++++++++++++++++++++++---------------------- sound/soc/soc-jack.c | 6 +- 5 files changed, 238 insertions(+), 189 deletions(-)
include/sound/soc-dapm.h +30 -12
@@ -324,16 +324,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *uncontrol);int snd_soc_dapm_put_pin_switch (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *uncontrol); -int snd_soc_dapm_new_control (struct snd_soc_codec *codec, +int snd_soc_dapm_new_control (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget); -int snd_soc_dapm_new_controls (struct snd_soc_codec *codec, +int snd_soc_dapm_new_controls (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget,int num);/* dapm path setup */ -int snd_soc_dapm_new_widgets (struct snd_soc_codec *codec); -void snd_soc_dapm_free (struct snd_soc_codec *codec); -int snd_soc_dapm_add_routes (struct snd_soc_codec *codec, +int snd_soc_dapm_new_widgets (struct snd_soc_dapm_context *dapm); +void snd_soc_dapm_free (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_add_routes (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_route *route,int num);/* dapm events */
@@ -343,15 +343,15 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);/* 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_codec *codec); +void snd_soc_dapm_debugfs_init (struct snd_soc_dapm_context *dapm);/* dapm audio pin control and status */ -int snd_soc_dapm_enable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_disable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_nc_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_get_pin_status (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_sync (struct snd_soc_codec *codec); -int snd_soc_dapm_force_enable_pin (struct snd_soc_codec *codec, +int snd_soc_dapm_enable_pin (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_disable_pin (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_nc_pin (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_get_pin_status (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_sync (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_force_enable_pin (struct snd_soc_dapm_context *dapm,const char *pin);int snd_soc_dapm_ignore_suspend (struct snd_soc_codec *codec,const char *pin);
@@ -425,6 +425,7 @@ struct snd_soc_dapm_widget {char *sname;/* stream name */ struct snd_soc_codec *codec;struct list_head list; +struct snd_soc_dapm_context *dapm;/* dapm control */ short reg;/* negative reg = no direct dapm */
@@ -461,4 +462,21 @@ struct snd_soc_dapm_widget { struct list_head power_list; }; +/* DAPM context */ +struct snd_soc_dapm_context { +u32 pop_time; +struct list_head widgets; +struct list_head paths; +enum snd_soc_bias_level bias_level; +enum snd_soc_bias_level suspend_bias_level; +struct delayed_work delayed_work; +unsigned int idle_bias_off:1 ;/* Use BIAS_OFF instead of STANDBY */ + +struct device *dev;/* from parent - for debug */ +struct snd_soc_codec *codec;/* parent codec */ +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_dapm; +#endif +}; +#endif
include/sound/soc.h +2 -6
@@ -238,6 +238,7 @@ struct soc_enum;struct snd_soc_ac97_ops ;struct snd_soc_jack ;struct snd_soc_jack_pin ; +struct snd_soc_dapm_context ;#ifdef CONFIG_GPIOLIB struct snd_soc_jack_gpio ;
@@ -452,12 +453,7 @@ struct snd_soc_codec {void *reg_cache;/* dapm */ -u32 pop_time; -struct list_head dapm_widgets; -struct list_head dapm_paths; -enum snd_soc_bias_level bias_level; -enum snd_soc_bias_level suspend_bias_level; -struct delayed_work delayed_work; +struct snd_soc_dapm_context *dapm;#ifdef CONFIG_DEBUG_FS struct dentry *debugfs_codec_root;
sound/soc/soc-core.c +35 -13
130 lines not on this page · raw message
sound/soc/soc-dapm.c +168 -155
906 lines not on this page · raw message
sound/soc/soc-jack.c +3 -3
@@ -88,15 +88,15 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) enable = !enable;if (enable) -snd_soc_dapm_enable_pin (codec, pin->pin); +snd_soc_dapm_enable_pin (codec->dapm, pin->pin);else -snd_soc_dapm_disable_pin (codec, pin->pin); +snd_soc_dapm_disable_pin (codec->dapm, pin->pin); }/* Report before the DAPM sync to help users updating micbias status */ blocking_notifier_call_chain (&jack->notifier, status,NULL ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (codec->dapm);snd_jack_report (jack->jack, status);
Signature · 1 line
1.7.2.3
Re: [RFC_i/iv 1/3] ASoC: Decouple DAPM from CODECs. Part core (will be squashed)
sound/soc/soc-core.c static void soc_init_codec_debugfs(struct snd_soc_codec *codec) · line 254
Quoted 4 lines · Jarkko Nikula
sound/soc/soc-core.c +1
-1codec->debugfs_pop_time =debugfs_create_u32 ("dapm_pop_time" ,0644 , codec->debugfs_codec_root, - &codec->pop_time); + &codec->dapm->pop_time);
The pop time feels like it should have an effect over the full card rather than over individual CODECs - the power sequencing is obviously going to be done over the entire card rather than individual devices so it's a little unclear how competing values for different devices would be applied. This is a simple code motion patch and this is only debugfs but perhaps it's worth first doing this as a split which moves the pop time onto the card.
sound/soc/soc-core.c static int soc_suspend(struct device *dev) · line 1016
Quoted 4 lines
sound/soc/soc-core.c +1
-1for (i =0 ; i < card->num_rtd; i++) {run_delayed_work (&card->rtd[i].delayed_work); - card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; + card->rtd[i].codec->dapm->suspend_bias_level = card->rtd[i].codec->dapm->bias_level;
Hrm, this is going to miss out devices that don't have a DAI (and run multiple times on devices that do have a DAI, which is unfortunate).
Quoted 6 lines
sound/soc/soc-core.c +2
-0@@ -2957,6 +2957,21 @@ static inline char *fmt_multiple_name(struct device *dev,return kstrdup (dai_drv->name,GFP_KERNEL ); } +static struct snd_soc_dapm_context *soc_new_dapm_context (struct device *dev) +{
sound/soc/soc-core.c static inline char *fmt_multiple_name(struct device *dev, · line 2971
Quoted 10 lines
sound/soc/soc-core.c +10
-0+struct snd_soc_dapm_context *dapm; + + dapm =kzalloc (sizeof (struct snd_soc_dapm_context ),GFP_KERNEL ); +if (dapm) { +INIT_LIST_HEAD (&dapm->widgets); +INIT_LIST_HEAD (&dapm->paths); + dapm->bias_level =SND_SOC_BIAS_OFF ; + dapm->dev = dev; + } +return dapm;
I'd be more inclined to just embed the struct in the objects that need it rather than individually allocating them - it saves error checking and deallocation, and I can't see any cases where we'd want to optionally have a DAPM object.
sound/soc/soc-dapm.c static inline struct snd_soc_dapm_widget *dapm_cnew_widget( · line 151
Quoted 8 lines
sound/soc/soc-dapm.c +3
-3if (ret ==0 ) { -if (codec->driver->set_bias_level) - ret = codec->driver->set_bias_level (codec, level); +if (dapm->codec && dapm->codec->driver->set_bias_level) + ret = dapm->codec->driver->set_bias_level (dapm->codec, level);else - codec->bias_level = level; + dapm->bias_level = level;
This is all feeling like the DAPM object needs a vtable to do this indirection to the operation on the individual object types.
sound/soc/soc-dapm.c static int dapm_power_widgets(struct snd_soc_codec *codec, int event) · line 980
Quoted 7 lines
sound/soc/soc-dapm.c +3
-3/* If we're changing to all on or all off then prepare */ -if ((sys_power && codec->bias_level ==SND_SOC_BIAS_STANDBY ) || - (!sys_power && codec->bias_level ==SND_SOC_BIAS_ON )) { - ret =snd_soc_dapm_set_bias_level (card, codec,SND_SOC_BIAS_PREPARE ); +if ((sys_power && dapm->bias_level ==SND_SOC_BIAS_STANDBY ) || + (!sys_power && dapm->bias_level ==SND_SOC_BIAS_ON )) { + ret =snd_soc_dapm_set_bias_level (card, dapm,SND_SOC_BIAS_PREPARE );
So, this is all going to be run per DAPM object from the looks of things. That's really not what we want - we want to be doing the sequencing over all DAPM objects in the card, rather than per DAPM object. It'll need to be fixed at some point later in the series...
Re: [RFC_i/iv 1/3] ASoC: Decouple DAPM from CODECs. Part core (will be squashed)
Quoted 15 lines · Mark Brown
sound/soc/soc-core.c static void soc_init_codec_debugfs(struct snd_soc_codec *codec) · line 254
Quoted 4 lines · Jarkko Nikula
sound/soc/soc-core.c +1
-1codec->debugfs_pop_time =debugfs_create_u32 ("dapm_pop_time" ,0644 , codec->debugfs_codec_root, - &codec->pop_time); + &codec->dapm->pop_time);The pop time feels like it should have an effect over the full card rather than over individual CODECs - the power sequencing is obviously going to be done over the entire card rather than individual devices so it's a little unclear how competing values for different devices would be applied. This is a simple code motion patch and this is only debugfs but perhaps it's worth first doing this as a split which moves the pop time onto the card.
Quoted 7 lines
sound/soc/soc-core.c static int soc_suspend(struct device *dev) · line 1016
Quoted 4 lines
sound/soc/soc-core.c +1
-1for (i =0 ; i < card->num_rtd; i++) {run_delayed_work (&card->rtd[i].delayed_work); - card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; + card->rtd[i].codec->dapm->suspend_bias_level = card->rtd[i].codec->dapm->bias_level;Hrm, this is going to miss out devices that don't have a DAI (and run multiple times on devices that do have a DAI, which is unfortunate).
Ah, I think we may be missing a later patch here that did add a DAPM context to card and platform.
Btw, not sure what you mean by this 1 line change being run multiple times being different to the old line.
Quoted 14 lines
Quoted 14 lines
sound/soc/soc-core.c +9
-0@@ -2957,6 +2957,21 @@ static inline char *fmt_multiple_name(struct device *dev,return kstrdup (dai_drv->name,GFP_KERNEL ); } +static struct snd_soc_dapm_context *soc_new_dapm_context (struct device *dev) +{ +struct snd_soc_dapm_context *dapm; + + dapm =kzalloc (sizeof (struct snd_soc_dapm_context ),GFP_KERNEL ); +if (dapm) { +INIT_LIST_HEAD (&dapm->widgets); +INIT_LIST_HEAD (&dapm->paths); + dapm->bias_level =SND_SOC_BIAS_OFF ;
Quoted 8 lines
sound/soc/soc-core.c static inline char *fmt_multiple_name(struct device *dev, · line 2971
Quoted 3 lines
sound/soc/soc-core.c +3
-0+ dapm->dev = dev; + } +return dapm;I'd be more inclined to just embed the struct in the objects that need it rather than individually allocating them - it saves error checking and deallocation, and I can't see any cases where we'd want to optionally have a DAPM object.
Yeah, the reason for this is because it was unclear at the time whether we will need to share a context between DAI backend and frontends. So this can be embedded now.
Quoted 13 lines
sound/soc/soc-dapm.c static inline struct snd_soc_dapm_widget *dapm_cnew_widget( · line 151
Quoted 9 lines
sound/soc/soc-dapm.c +3
-3if (ret ==0 ) { -if (codec->driver->set_bias_level) - ret = codec->driver->set_bias_level (codec, level); +if (dapm->codec && dapm->codec->driver->set_bias_level) + ret = dapm->codec->driver->set_bias_level (dapm->codec, level);else - codec->bias_level = level; + dapm->bias_level = level;This is all feeling like the DAPM object needs a vtable to do this indirection to the operation on the individual object types.
Quoted 12 lines
sound/soc/soc-dapm.c static int dapm_power_widgets(struct snd_soc_codec *codec, int event) · line 980
Quoted 7 lines
sound/soc/soc-dapm.c +3
-3/* If we're changing to all on or all off then prepare */ -if ((sys_power && codec->bias_level ==SND_SOC_BIAS_STANDBY ) || - (!sys_power && codec->bias_level ==SND_SOC_BIAS_ON )) { - ret =snd_soc_dapm_set_bias_level (card, codec,SND_SOC_BIAS_PREPARE ); +if ((sys_power && dapm->bias_level ==SND_SOC_BIAS_STANDBY ) || + (!sys_power && dapm->bias_level ==SND_SOC_BIAS_ON )) { + ret =snd_soc_dapm_set_bias_level (card, dapm,SND_SOC_BIAS_PREPARE );So, this is all going to be run per DAPM object from the looks of things. That's really not what we want - we want to be doing the sequencing over all DAPM objects in the card, rather than per DAPM object. It'll need to be fixed at some point later in the series...
I should just add that Jarkko picked this up as work in progress, with some of the details requiring completion or cleanup.
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Re: [RFC_i/iv 1/3] ASoC: Decouple DAPM from CODECs. Part core (will be squashed)
Quoted 16 lines · On Sat, 30 Oct 2010 19:01:54 +0100 Liam Girdwood <[email protected]> wrote:
Quoted 15 lines · Mark Brown
sound/soc/soc-core.c static void soc_init_codec_debugfs(struct snd_soc_codec *codec) · line 254
Quoted 4 lines · Jarkko Nikula
sound/soc/soc-core.c +1
-1codec->debugfs_pop_time =debugfs_create_u32 ("dapm_pop_time" ,0644 , codec->debugfs_codec_root, - &codec->pop_time); + &codec->dapm->pop_time);The pop time feels like it should have an effect over the full card rather than over individual CODECs - the power sequencing is obviously going to be done over the entire card rather than individual devices so it's a little unclear how competing values for different devices would be applied. This is a simple code motion patch and this is only debugfs but perhaps it's worth first doing this as a split which moves the pop time onto the card.
True. Looks like worth to add a patch doing pop decoupling in this set.
Quoted 3 lines
Ah, I think we may be missing a later patch here that did add a DAPM context to card and platform.
Yeah, I simplified a bit Liam's code and not added DAPM to other than codecs since there is no yet use for it in these series.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
sound/soc/soc-dapm.c +0
-3/* If we're changing to all on or all off then prepare */ -if ((sys_power && codec->bias_level ==SND_SOC_BIAS_STANDBY ) || - (!sys_power && codec->bias_level ==SND_SOC_BIAS_ON )) { - ret =snd_soc_dapm_set_bias_level (card, codec,SND_SOC_BIAS_PREPARE );
Quoted 9 lines
Quoted 8 lines
sound/soc/soc-dapm.c static int dapm_power_widgets(struct snd_soc_codec *codec, int event) · line 980
Quoted 3 lines
sound/soc/soc-dapm.c +3
-0+if ((sys_power && dapm->bias_level ==SND_SOC_BIAS_STANDBY ) || + (!sys_power && dapm->bias_level ==SND_SOC_BIAS_ON )) { + ret =snd_soc_dapm_set_bias_level (card, dapm,SND_SOC_BIAS_PREPARE );So, this is all going to be run per DAPM object from the looks of things. That's really not what we want - we want to be doing the sequencing over all DAPM objects in the card, rather than per DAPM object. It'll need to be fixed at some point later in the series...
Reason is that here is no need to touch other DAPM contexts until RFC_ii/iv 3/3 since DAPM decoupling doesn't change yet how things work currently.
Signature · 1 line
Jarkko
Re: [RFC_i/iv 1/3] ASoC: Decouple DAPM from CODECs. Part core (will be squashed)
In reply to Liam GirdwoodQuoted 8 lines · Liam Girdwood
Quoted 3 lines · Mark Brown
sound/soc/soc-core.c static int soc_suspend(struct device *dev) · line 1016
Quoted 3 lines
sound/soc/soc-core.c +1
-1run_delayed_work (&card->rtd[i].delayed_work); - card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; + card->rtd[i].codec->dapm->suspend_bias_level = card->rtd[i].codec->dapm->bias_level;Btw, not sure what you mean by this 1 line change being run multiple times being different to the old line.
It's not different, a lot of the stuff here is things that we need to do in the series that are thrown up by the series as a result of it touching all relevant places. I tried to mention this in the places I noted it, but some of them I will have forgotten.
Quoted 8 lines
Quoted 4 lines
I'd be more inclined to just embed the struct in the objects that need it rather than individually allocating them - it saves error checking and deallocation, and I can't see any cases where we'd want to optionally have a DAPM object.
Yeah, the reason for this is because it was unclear at the time whether we will need to share a context between DAI backend and frontends. So this can be embedded now.
Jarkko, with this change I think this first patch is good to go - I think we should try to get the early bits in while we're iterating on the rest.
PATCH 1/1 ASoC: Decouple DAPM from CODECs
From: Liam Girdwood <[email protected]>
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths.
This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec.
This patch does not change current functionality and a large part of changes come because of structure and internal API changes.
Core implementation is from Liam Girdwood <[email protected]> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <[email protected]>.
---
v2 (Jarkko):
- Machine driver developers/maintainers Cc'ed for getting more build coverage than OMAP boards and codecs
- Patch is for branch for-2.6.38 of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
- Rebased on top of Peter's race fix (they conflict in dapm_power_widgets):
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-November/033362.html
- RFC_[i-iii]/iv squashed into one patch as the 1st version shows the authorship of each parts. 1st set here:
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-October/033195.html
- struct snd_soc_dapm_context embedded into struct snd_soc_codec instead of allocating it. Based on discussion there is no need for DAPM without device context and this saves a few code lines from allocation/deallocation. A few include statement soc-dapm.h => soc.h changes in drivers because of that
- API of snd_soc_dapm_ignore_suspend changed also to be pair with other DAPM functions
- variable dapm instead of &codec->dapm used in drivers to make code more readable and to cut long lines. max98088 is space indented and this patch doesn't change that
- Function argument comments (codec => dapm) updated in soc-dapm.c
- Long soc-dapm function headers that this patch is touching are cut
--- include/sound/soc-dapm.h | 49 +++- include/sound/soc.h | 9 +- sound/soc/atmel/playpaq_wm8510.c | 11 +- sound/soc/atmel/sam9g20_wm8731.c | 17 +- sound/soc/atmel/snd-soc-afeb9260.c | 13 +- sound/soc/codecs/88pm860x-codec.c | 9 +- sound/soc/codecs/ad1836.c | 5 +- sound/soc/codecs/ad193x.c | 5 +- sound/soc/codecs/ak4535.c | 9 +- sound/soc/codecs/ak4642.c | 2 +- sound/soc/codecs/ak4671.c | 9 +- sound/soc/codecs/alc5623.c | 23 +- sound/soc/codecs/cq93vc.c | 2 +- sound/soc/codecs/cs42l51.c | 5 +- sound/soc/codecs/cx20442.c | 15 +- sound/soc/codecs/da7210.c | 2 +- sound/soc/codecs/jz4740.c | 10 +- sound/soc/codecs/max98088.c | 12 +- sound/soc/codecs/ssm2602.c | 9 +- sound/soc/codecs/stac9766.c | 3 +- sound/soc/codecs/tlv320aic23.c | 9 +- sound/soc/codecs/tlv320aic3x.c | 22 +- sound/soc/codecs/tlv320dac33.c | 15 +- sound/soc/codecs/tpa6130a2.c | 5 +- sound/soc/codecs/twl4030.c | 13 +- sound/soc/codecs/twl6040.c | 12 +- sound/soc/codecs/uda134x.c | 2 +- sound/soc/codecs/uda1380.c | 13 +- sound/soc/codecs/wm2000.c | 5 +- sound/soc/codecs/wm8350.c | 28 +- sound/soc/codecs/wm8400.c | 11 +- sound/soc/codecs/wm8510.c | 11 +- sound/soc/codecs/wm8523.c | 11 +- sound/soc/codecs/wm8580.c | 11 +- sound/soc/codecs/wm8711.c | 9 +- sound/soc/codecs/wm8728.c | 11 +- sound/soc/codecs/wm8731.c | 13 +- sound/soc/codecs/wm8741.c | 7 +- sound/soc/codecs/wm8750.c | 11 +- sound/soc/codecs/wm8753.c | 29 +- sound/soc/codecs/wm8776.c | 9 +- sound/soc/codecs/wm8804.c | 6 +- sound/soc/codecs/wm8900.c | 11 +- sound/soc/codecs/wm8903.c | 11 +- sound/soc/codecs/wm8904.c | 33 ++- sound/soc/codecs/wm8940.c | 5 +- sound/soc/codecs/wm8955.c | 11 +- sound/soc/codecs/wm8960.c | 25 +- sound/soc/codecs/wm8961.c | 11 +- sound/soc/codecs/wm8962.c | 30 +- sound/soc/codecs/wm8971.c | 29 +- sound/soc/codecs/wm8974.c | 11 +- sound/soc/codecs/wm8978.c | 11 +- sound/soc/codecs/wm8985.c | 11 +- sound/soc/codecs/wm8988.c | 9 +- sound/soc/codecs/wm8990.c | 11 +- sound/soc/codecs/wm8993.c | 9 +- sound/soc/codecs/wm8994.c | 13 +- sound/soc/codecs/wm9081.c | 9 +- sound/soc/codecs/wm9090.c | 17 +- sound/soc/codecs/wm9705.c | 6 +- sound/soc/codecs/wm9712.c | 9 +- sound/soc/codecs/wm9713.c | 8 +- sound/soc/codecs/wm_hubs.c | 18 +- sound/soc/davinci/davinci-evm.c | 21 +- sound/soc/ep93xx/snappercl15.c | 5 +- sound/soc/imx/wm1133-ev1.c | 7 +- sound/soc/jz4740/qi_lb60.c | 13 +- sound/soc/kirkwood/kirkwood-t5325.c | 13 +- sound/soc/omap/am3517evm.c | 13 +- sound/soc/omap/ams-delta.c | 82 +++--- sound/soc/omap/n810.c | 42 ++-- sound/soc/omap/omap3pandora.c | 44 ++-- sound/soc/omap/osk5912.c | 13 +- sound/soc/omap/rx51.c | 25 +- sound/soc/omap/sdp3430.c | 43 ++-- sound/soc/omap/sdp4430.c | 19 +- sound/soc/omap/zoom2.c | 35 ++-- sound/soc/pxa/corgi.c | 51 ++-- sound/soc/pxa/e740_wm9705.c | 29 +- sound/soc/pxa/e750_wm9705.c | 29 +- sound/soc/pxa/e800_wm9712.c | 7 +- sound/soc/pxa/magician.c | 35 ++- sound/soc/pxa/mioa701_wm9713.c | 17 +- sound/soc/pxa/palm27x.c | 33 ++- sound/soc/pxa/poodle.c | 25 +- sound/soc/pxa/saarb.c | 17 +- sound/soc/pxa/spitz.c | 69 +++--- sound/soc/pxa/tavorevb3.c | 17 +- sound/soc/pxa/tosa.c | 37 ++-- sound/soc/pxa/z2.c | 15 +- sound/soc/pxa/zylonite.c | 11 +- sound/soc/s3c24xx/aquila_wm8994.c | 25 +- sound/soc/s3c24xx/goni_wm8994.c | 21 +- sound/soc/s3c24xx/jive_wm8750.c | 19 +- sound/soc/s3c24xx/neo1973_gta02_wm8753.c | 41 ++-- sound/soc/s3c24xx/neo1973_wm8753.c | 123 +++++---- sound/soc/s3c24xx/rx1950_uda1380.c | 11 +- sound/soc/s3c24xx/s3c24xx_simtec_hermes.c | 15 +- sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c | 15 +- sound/soc/s3c24xx/smartq_wm8987.c | 21 +- sound/soc/s3c24xx/smdk64xx_wm8580.c | 16 +- sound/soc/s6000/s6105-ipcam.c | 40 ++-- sound/soc/sh/migor.c | 5 +- sound/soc/sh/sh7760-ac97.c | 2 +- sound/soc/soc-core.c | 29 +- sound/soc/soc-dapm.c | 355 +++++++++++++----------- sound/soc/soc-jack.c | 8 +- 108 files changed, 1239 insertions(+), 1064 deletions(-)
include/sound/soc-dapm.h +36 -13
@@ -297,6 +297,7 @@ enum snd_soc_dapm_type;struct snd_soc_dapm_path ;struct snd_soc_dapm_pin ;struct snd_soc_dapm_route ; +struct snd_soc_dapm_context ;int dapm_reg_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event);
@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *uncontrol);int snd_soc_dapm_put_pin_switch (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *uncontrol); -int snd_soc_dapm_new_control (struct snd_soc_codec *codec, +int snd_soc_dapm_new_control (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget); -int snd_soc_dapm_new_controls (struct snd_soc_codec *codec, +int snd_soc_dapm_new_controls (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget,int num);/* dapm path setup */ -int snd_soc_dapm_new_widgets (struct snd_soc_codec *codec); -void snd_soc_dapm_free (struct snd_soc_codec *codec); -int snd_soc_dapm_add_routes (struct snd_soc_codec *codec, +int snd_soc_dapm_new_widgets (struct snd_soc_dapm_context *dapm); +void snd_soc_dapm_free (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_add_routes (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_route *route,int num);/* dapm events */
@@ -343,17 +344,21 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);/* 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_codec *codec); +void snd_soc_dapm_debugfs_init (struct snd_soc_dapm_context *dapm);/* dapm audio pin control and status */ -int snd_soc_dapm_enable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_disable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_nc_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_get_pin_status (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_sync (struct snd_soc_codec *codec); -int snd_soc_dapm_force_enable_pin (struct snd_soc_codec *codec, +int snd_soc_dapm_enable_pin (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_disable_pin (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_nc_pin (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_get_pin_status (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_sync (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_force_enable_pin (struct snd_soc_dapm_context *dapm,const char *pin); -int snd_soc_dapm_ignore_suspend (struct snd_soc_codec *codec,const char *pin); +int snd_soc_dapm_ignore_suspend (struct snd_soc_dapm_context *dapm, +const char *pin);/* dapm widget types */ enum snd_soc_dapm_type {
@@ -425,6 +430,7 @@ struct snd_soc_dapm_widget {char *sname;/* stream name */ struct snd_soc_codec *codec;struct list_head list; +struct snd_soc_dapm_context *dapm;/* dapm control */ short reg;/* negative reg = no direct dapm */
@@ -461,4 +467,21 @@ struct snd_soc_dapm_widget { struct list_head power_list; }; +/* DAPM context */ +struct snd_soc_dapm_context { +u32 pop_time; +struct list_head widgets; +struct list_head paths; +enum snd_soc_bias_level bias_level; +enum snd_soc_bias_level suspend_bias_level; +struct delayed_work delayed_work; +unsigned int idle_bias_off:1 ;/* Use BIAS_OFF instead of STANDBY */ + +struct device *dev;/* from parent - for debug */ +struct snd_soc_codec *codec;/* parent codec */ +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_dapm; +#endif +}; +#endif
include/sound/soc.h +2 -7
@@ -238,6 +238,7 @@ struct soc_enum;struct snd_soc_ac97_ops ;struct snd_soc_jack ;struct snd_soc_jack_pin ; +#include <sound/soc-dapm.h> #ifdef CONFIG_GPIOLIB struct snd_soc_jack_gpio ;
@@ -436,7 +437,6 @@ struct snd_soc_codec {/* runtime */ struct snd_ac97 *ac97;/* for ad-hoc ac97 devices */ unsigned int active; - unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ unsigned int cache_only:1; /* Suppress writes to hardware */ unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ unsigned int suspended:1; /* Codec is in suspend PM state */
@@ -452,12 +452,7 @@ struct snd_soc_codec {void *reg_cache;/* dapm */ -u32 pop_time; -struct list_head dapm_widgets; -struct list_head dapm_paths; -enum snd_soc_bias_level bias_level; -enum snd_soc_bias_level suspend_bias_level; -struct delayed_work delayed_work; +struct snd_soc_dapm_context dapm;#ifdef CONFIG_DEBUG_FS struct dentry *debugfs_codec_root;
sound/soc/atmel/playpaq_wm8510.c +6 -5
@@ -318,27 +318,28 @@ static const struct snd_soc_dapm_route intercon[] = {static int playpaq_wm8510_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int i;/* * Add DAPM widgets */ for (i =0 ; i <ARRAY_SIZE (playpaq_dapm_widgets); i++) -snd_soc_dapm_new_control (codec, &playpaq_dapm_widgets[i]); +snd_soc_dapm_new_control (dapm, &playpaq_dapm_widgets[i]);/* * Setup audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));/* always connected pins */ -snd_soc_dapm_enable_pin (codec,"Int Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_enable_pin (dapm,"Int Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_sync (dapm);
sound/soc/atmel/sam9g20_wm8731.c +9 -8
@@ -140,6 +140,7 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;struct snd_soc_dai *codec_dai = rtd->codec_dai; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; printk(KERN_DEBUG
@@ -154,25 +155,25 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd) }/* Add specific widgets */ -snd_soc_dapm_new_controls (codec, at91sam9g20ek_dapm_widgets, +snd_soc_dapm_new_controls (dapm, at91sam9g20ek_dapm_widgets,ARRAY_SIZE (at91sam9g20ek_dapm_widgets));/* Set up specific audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));/* not connected */ -snd_soc_dapm_nc_pin (codec,"RLINEIN" ); -snd_soc_dapm_nc_pin (codec,"LLINEIN" ); +snd_soc_dapm_nc_pin (dapm,"RLINEIN" ); +snd_soc_dapm_nc_pin (dapm,"LLINEIN" );#ifdef ENABLE_MIC_INPUT -snd_soc_dapm_enable_pin (codec,"Int Mic" ); +snd_soc_dapm_enable_pin (dapm,"Int Mic" );#else -snd_soc_dapm_nc_pin (codec,"Int Mic" ); +snd_soc_dapm_nc_pin (dapm,"Int Mic" );#endif /* always connected */ -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/atmel/snd-soc-afeb9260.c +7 -6
@@ -105,19 +105,20 @@ static const struct snd_soc_dapm_route audio_map[] = {static int afeb9260_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add afeb9260 specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up afeb9260 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/codecs/88pm860x-codec.c +5 -4
@@ -1172,7 +1172,7 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable Audio PLL & Audio section */ data =AUDIO_PLL |AUDIO_SECTION_RESET |AUDIO_SECTION_ON ;
@@ -1185,7 +1185,7 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,pm860x_set_bits (codec->control_data,REG_MISC2 , data,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1346,6 +1346,7 @@ EXPORT_SYMBOL_GPL(pm860x_mic_jack_detect);static int pm860x_probe (struct snd_soc_codec *codec) {struct pm860x_priv *pm860x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int i, ret; pm860x->codec = codec;
@@ -1374,9 +1375,9 @@ static int pm860x_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, pm860x_snd_controls,ARRAY_SIZE (pm860x_snd_controls)); -snd_soc_dapm_new_controls (codec, pm860x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, pm860x_dapm_widgets,ARRAY_SIZE (pm860x_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; out_codec:
sound/soc/codecs/ad1836.c +3 -2
@@ -220,6 +220,7 @@ static struct snd_soc_dai_driver ad1836_dai = {static int ad1836_probe (struct snd_soc_codec *codec) {struct ad1836_priv *ad1836 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ; codec->control_data = ad1836->control_data;
@@ -252,9 +253,9 @@ static int ad1836_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, ad1836_snd_controls,ARRAY_SIZE (ad1836_snd_controls)); -snd_soc_dapm_new_controls (codec, ad1836_dapm_widgets, +snd_soc_dapm_new_controls (dapm, ad1836_dapm_widgets,ARRAY_SIZE (ad1836_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/ad193x.c +3 -2
@@ -353,6 +353,7 @@ static struct snd_soc_dai_driver ad193x_dai = {static int ad193x_probe (struct snd_soc_codec *codec) {struct ad193x_priv *ad193x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; codec->control_data = ad193x->control_data;
@@ -385,9 +386,9 @@ static int ad193x_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, ad193x_snd_controls,ARRAY_SIZE (ad193x_snd_controls)); -snd_soc_dapm_new_controls (codec, ad193x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, ad193x_dapm_widgets,ARRAY_SIZE (ad193x_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/ak4535.c +5 -4
@@ -290,10 +290,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int ak4535_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ak4535_dapm_widgets, -ARRAY_SIZE (ak4535_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, ak4535_dapm_widgets, +ARRAY_SIZE (ak4535_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -399,7 +400,7 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,ak4535_write (codec,AK4535_PM1 , i & (~0x80 ));break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/ak4642.c +1 -1
@@ -26,7 +26,7 @@#include <linux/i2c.h> #include <linux/platform_device.h> #include <linux/slab.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h>
sound/soc/codecs/ak4671.c +5 -4
@@ -437,10 +437,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int ak4671_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ak4671_dapm_widgets, -ARRAY_SIZE (ak4671_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, ak4671_dapm_widgets, +ARRAY_SIZE (ak4671_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -602,7 +603,7 @@ static int ak4671_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,AK4671_AD_DA_POWER_MANAGEMENT ,0x00 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/alc5623.c +12 -11
@@ -832,7 +832,7 @@ static int alc5623_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,ALC5623_PWR_MANAG_ADD1 ,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -888,10 +888,10 @@ static int alc5623_resume(struct snd_soc_codec *codec)alc5623_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge alc5623 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) {alc5623_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); - codec->bias_level =SND_SOC_BIAS_ON ; -alc5623_set_bias_level (codec, codec->bias_level); + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +alc5623_set_bias_level (codec, codec->dapm.bias_level); }return 0 ;
@@ -900,6 +900,7 @@ static int alc5623_resume(struct snd_soc_codec *codec)static int alc5623_probe (struct snd_soc_codec *codec) {struct alc5623_priv *alc5623 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; ret =snd_soc_codec_set_cache_io (codec,8 ,16 , alc5623->control_type);
@@ -943,24 +944,24 @@ static int alc5623_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, alc5623_snd_controls,ARRAY_SIZE (alc5623_snd_controls)); -snd_soc_dapm_new_controls (codec, alc5623_dapm_widgets, +snd_soc_dapm_new_controls (dapm, alc5623_dapm_widgets,ARRAY_SIZE (alc5623_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));switch (alc5623->id) {default :case 0x21 :case 0x22 : -snd_soc_dapm_new_controls (codec, alc5623_dapm_amp_widgets, +snd_soc_dapm_new_controls (dapm, alc5623_dapm_amp_widgets,ARRAY_SIZE (alc5623_dapm_amp_widgets)); -snd_soc_dapm_add_routes (codec, intercon_amp_spk, -ARRAY_SIZE (intercon_amp_spk)); +snd_soc_dapm_add_routes (dapm, intercon_amp_spk, +ARRAY_SIZE (intercon_amp_spk));break ;case 0x23 : -snd_soc_dapm_add_routes (codec, intercon_spk, -ARRAY_SIZE (intercon_spk)); +snd_soc_dapm_add_routes (dapm, intercon_spk, +ARRAY_SIZE (intercon_spk));break ; }
sound/soc/codecs/cq93vc.c +1 -1
@@ -116,7 +116,7 @@ static int cq93vc_set_bias_level(struct snd_soc_codec *codec, DAVINCI_VC_REG12_POWER_ALL_OFF);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/cs42l51.c +3 -2
@@ -519,6 +519,7 @@ static struct snd_soc_dai_driver cs42l51_dai = {static int cs42l51_probe (struct snd_soc_codec *codec) {struct cs42l51_private *cs42l51 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, reg; codec->control_data = cs42l51->control_data;
@@ -550,9 +551,9 @@ static int cs42l51_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, cs42l51_snd_controls,ARRAY_SIZE (cs42l51_snd_controls)); -snd_soc_dapm_new_controls (codec, cs42l51_dapm_widgets, +snd_soc_dapm_new_controls (dapm, cs42l51_dapm_widgets,ARRAY_SIZE (cs42l51_dapm_widgets)); -snd_soc_dapm_add_routes (codec, cs42l51_routes, +snd_soc_dapm_add_routes (dapm, cs42l51_routes,ARRAY_SIZE (cs42l51_routes));return 0 ;
sound/soc/codecs/cx20442.c +8 -7
@@ -18,7 +18,7 @@#include <sound/core.h> #include <sound/initval.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include "cx20442.h"
@@ -89,10 +89,11 @@ static const struct snd_soc_dapm_route cx20442_audio_map[] = {static int cx20442_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, cx20442_dapm_widgets, -ARRAY_SIZE (cx20442_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, cx20442_audio_map, +snd_soc_dapm_new_controls (dapm, cx20442_dapm_widgets, +ARRAY_SIZE (cx20442_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, cx20442_audio_map,ARRAY_SIZE (cx20442_audio_map));return 0 ;
@@ -263,7 +264,7 @@ static void v253_close(struct tty_struct *tty)/* Prevent the codec driver from further accessing the modem */ codec->hw_write =NULL ; cx20442->control_data =NULL ; - codec->pop_time =0 ; + codec->dapm.pop_time =0 ; }/* Line discipline .hangup() */
@@ -291,7 +292,7 @@ static void v253_receive(struct tty_struct *tty,/* Set up codec driver access to modem controls */ cx20442->control_data = tty; codec->hw_write = (hw_write_t )tty->ops->write; - codec->pop_time =1 ; + codec->dapm.pop_time =1 ; } }
@@ -348,7 +349,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) cx20442->control_data =NULL ; codec->hw_write =NULL ; - codec->pop_time =0 ; + codec->dapm.pop_time =0 ;return 0 ; }
sound/soc/codecs/da7210.c +1 -1
@@ -21,7 +21,7 @@#include <linux/slab.h> #include <sound/pcm.h> #include <sound/pcm_params.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h>
sound/soc/codecs/jz4740.c +6 -4
@@ -266,7 +266,7 @@ static int jz4740_codec_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY :/* The only way to clear the suspend flag is to reset the codec */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )jz4740_codec_wakeup (codec); mask = JZ4740_CODEC_1_VREF_DISABLE |
@@ -288,23 +288,25 @@ static int jz4740_codec_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }static int jz4740_codec_dev_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_update_bits (codec,JZ4740_REG_CODEC_1 ,JZ4740_CODEC_1_SW2_ENABLE ,JZ4740_CODEC_1_SW2_ENABLE );snd_soc_add_controls (codec, jz4740_codec_controls,ARRAY_SIZE (jz4740_codec_controls)); -snd_soc_dapm_new_controls (codec, jz4740_codec_dapm_widgets, +snd_soc_dapm_new_controls (dapm, jz4740_codec_dapm_widgets,ARRAY_SIZE (jz4740_codec_dapm_widgets)); -snd_soc_dapm_add_routes (codec, jz4740_codec_dapm_routes, +snd_soc_dapm_add_routes (dapm, jz4740_codec_dapm_routes,ARRAY_SIZE (jz4740_codec_dapm_routes));snd_soc_dapm_new_widgets (codec);
sound/soc/codecs/max98088.c +7 -5
@@ -1224,15 +1224,17 @@ static const struct snd_soc_dapm_route audio_map[] = {static int max98088_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, max98088_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, max98088_dapm_widgets,ARRAY_SIZE (max98088_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));snd_soc_add_controls (codec, max98088_snd_controls,ARRAY_SIZE (max98088_snd_controls)); -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -1617,7 +1619,7 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )max98088_sync_cache (codec); snd_soc_update_bits(codec, M98088_REG_4C_PWR_EN_IN,
@@ -1630,7 +1632,7 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec, codec->cache_sync =1 ;break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/ssm2602.c +5 -4
@@ -207,10 +207,11 @@ static const struct snd_soc_dapm_route audio_conn[] = {static int ssm2602_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ssm2602_dapm_widgets, -ARRAY_SIZE (ssm2602_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_conn,ARRAY_SIZE (audio_conn)); +snd_soc_dapm_new_controls (dapm, ssm2602_dapm_widgets, +ARRAY_SIZE (ssm2602_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_conn,ARRAY_SIZE (audio_conn));return 0 ; }
@@ -493,7 +494,7 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/stac9766.c +2 -1
@@ -24,6 +24,7 @@#include <sound/initval.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-dapm.h> #include <sound/tlv.h> #include "stac9766.h"
@@ -236,7 +237,7 @@ static int stac9766_set_bias_level(struct snd_soc_codec *codec,stac9766_ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/tlv320aic23.c +5 -4
@@ -391,11 +391,12 @@ static int set_sample_rate_control(struct snd_soc_codec *codec, int mclk,static int tlv320aic23_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, -ARRAY_SIZE (tlv320aic23_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets, +ARRAY_SIZE (tlv320aic23_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -574,7 +575,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,tlv320aic23_write (codec,TLV320AIC23_PWR ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/tlv320aic3x.c +12 -10
@@ -183,7 +183,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,if (snd_soc_test_bits (widget->codec, reg, val_mask, val)) {/* find dapm widget path assoc with kcontrol */ -list_for_each_entry (path, &widget->codec->dapm_paths, list) { +list_for_each_entry (path, &widget->dapm->paths, list) {if (path->kcontrol != kcontrol)continue ;
@@ -199,7 +199,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, }if (found) -snd_soc_dapm_sync (widget->codec); +snd_soc_dapm_sync (widget->dapm); } ret =snd_soc_update_bits (widget->codec, reg, val_mask, val);
@@ -788,17 +788,19 @@ static const struct snd_soc_dapm_route intercon_3007[] = {static int aic3x_add_widgets (struct snd_soc_codec *codec) {struct aic3x_priv *aic3x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, aic3x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3x_dapm_widgets,ARRAY_SIZE (aic3x_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));if (aic3x->model ==AIC3X_MODEL_3007 ) { -snd_soc_dapm_new_controls (codec, aic3007_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3007_dapm_widgets,ARRAY_SIZE (aic3007_dapm_widgets)); -snd_soc_dapm_add_routes (codec, intercon_3007,ARRAY_SIZE (intercon_3007)); +snd_soc_dapm_add_routes (dapm, intercon_3007, +ARRAY_SIZE (intercon_3007)); }return 0 ;
@@ -1135,7 +1137,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_ON :break ;case SND_SOC_BIAS_PREPARE : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY && +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY && aic3x->master) {/* enable pll */ reg =snd_soc_read (codec,AIC3X_PLL_PROGA_REG );
@@ -1146,7 +1148,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :if (!aic3x->power)aic3x_set_power (codec,1 ); -if (codec->bias_level ==SND_SOC_BIAS_PREPARE && +if (codec->dapm.bias_level ==SND_SOC_BIAS_PREPARE && aic3x->master) {/* disable pll */ reg =snd_soc_read (codec,AIC3X_PLL_PROGA_REG );
@@ -1159,7 +1161,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,aic3x_set_power (codec,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1351,7 +1353,7 @@ static int aic3x_probe(struct snd_soc_codec *codec) codec->control_data = aic3x->control_data; aic3x->codec = codec; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,8 ,8 , aic3x->control_type);if (ret !=0 ) {
sound/soc/codecs/tlv320dac33.c +8 -7
@@ -622,11 +622,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int dac33_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, dac33_dapm_widgets, -ARRAY_SIZE (dac33_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, dac33_dapm_widgets, +ARRAY_SIZE (dac33_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -643,7 +644,7 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Coming from OFF, switch on the codec */ ret =dac33_hard_power (codec,1 );if (ret !=0 )
@@ -654,14 +655,14 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_OFF :/* Do not power off, when the codec is already off */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )return 0 ; ret =dac33_hard_power (codec,0 );if (ret !=0 )return ret;break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1405,7 +1406,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec) codec->control_data = dac33->control_data; codec->hw_write = (hw_write_t ) i2c_master_send; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; dac33->codec = codec;/* Read the tlv320dac33 ID registers */
sound/soc/codecs/tpa6130a2.c +3 -2
@@ -388,16 +388,17 @@ static const struct snd_soc_dapm_route audio_map[] = {int tpa6130a2_add_controls (struct snd_soc_codec *codec) {struct tpa6130a2_data *data; +struct snd_soc_dapm_context *dapm = &codec->dapm;if (tpa6130a2_client ==NULL )return -ENODEV ; data =i2c_get_clientdata (tpa6130a2_client); -snd_soc_dapm_new_controls (codec, tpa6130a2_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tpa6130a2_dapm_widgets,ARRAY_SIZE (tpa6130a2_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (data->id ==TPA6140A2 ) return snd_soc_add_controls(codec, tpa6140a2_controls,
sound/soc/codecs/twl4030.c +7 -6
@@ -1621,10 +1621,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int twl4030_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, twl4030_dapm_widgets, -ARRAY_SIZE (twl4030_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, twl4030_dapm_widgets, +ARRAY_SIZE (twl4030_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -1638,14 +1639,14 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )twl4030_codec_enable (codec,1 );break ;case SND_SOC_BIAS_OFF :twl4030_codec_enable (codec,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -2245,7 +2246,7 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)snd_soc_codec_set_drvdata (codec, twl4030);/* Set the defaults, and power up the codec */ twl4030->sysclk =twl4030_codec_get_mclk () /1000 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;twl4030_init_chip (codec);
sound/soc/codecs/twl6040.c +6 -6
@@ -641,12 +641,12 @@ static const struct snd_soc_dapm_route intercon[] = {static int twl6040_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, twl6040_dapm_widgets, -ARRAY_SIZE (twl6040_dapm_widgets)); - -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_controls (dapm, twl6040_dapm_widgets, +ARRAY_SIZE (twl6040_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -739,7 +739,7 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/uda134x.c +1 -1
@@ -389,7 +389,7 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec, pd->power (0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/uda1380.c +7 -6
@@ -414,10 +414,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int uda1380_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, uda1380_dapm_widgets, -ARRAY_SIZE (uda1380_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, uda1380_dapm_widgets, +ARRAY_SIZE (uda1380_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -603,7 +604,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,int reg;struct uda1380_platform_data *pdata = codec->dev->platform_data; -if (codec->bias_level == level) +if (codec->dapm.bias_level == level)return 0 ;switch (level) {
@@ -613,7 +614,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,uda1380_write (codec,UDA1380_PM ,R02_PON_BIAS | pm);break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {if (gpio_is_valid (pdata->gpio_power)) {gpio_set_value (pdata->gpio_power,1 );mdelay (1 );
@@ -636,7 +637,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,for (reg =UDA1380_MVOL ; reg <UDA1380_CACHEREGNUM ; reg++)set_bit (reg -0x10 , &uda1380_cache_dirty); } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm2000.c +3 -2
@@ -705,6 +705,7 @@ static const struct snd_soc_dapm_route audio_map[] = {/* Called from the machine driver */ int wm2000_add_controls (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;if (!wm2000_i2c) {
@@ -712,12 +713,12 @@ int wm2000_add_controls(struct snd_soc_codec *codec)return -ENODEV ; } - ret =snd_soc_dapm_new_controls (codec, wm2000_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, wm2000_dapm_widgets,ARRAY_SIZE (wm2000_dapm_widgets));if (ret <0 )return ret; - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret <0 )return ret;
sound/soc/codecs/wm8350.c +15 -13
@@ -230,8 +230,9 @@ static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)*/ static void wm8350_pga_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, delayed_work.work); +struct snd_soc_codec *codec = dapm->codec;struct wm8350_data *wm8350_data =snd_soc_codec_get_drvdata (codec);struct wm8350_output *out1 = &wm8350_data->out1, *out2 = &wm8350_data->out2;
@@ -302,8 +303,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_UP ; out->active =1 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm.delayed_work)) +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (1 ));break ;
@@ -311,8 +312,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_DOWN ; out->active =0 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm.delayed_work)) +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (1 ));break ; }
@@ -786,9 +787,10 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8350_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; - ret =snd_soc_dapm_new_controls (codec, + ret =snd_soc_dapm_new_controls (dapm, wm8350_dapm_widgets,ARRAY_SIZE (wm8350_dapm_widgets));if (ret !=0 ) {
@@ -797,7 +799,7 @@ static int wm8350_add_widgets(struct snd_soc_codec *codec) }/* set up audio paths */ - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret !=0 ) {dev_err (codec->dev,"DAPM route register failed\n" );return ret;
@@ -1184,7 +1186,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (priv->supplies), priv->supplies);if (ret !=0 )
@@ -1317,7 +1319,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec, priv->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1550,7 +1552,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)/* Put the codec into reset if it wasn't already */ wm8350_clear_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA ); -INIT_DELAYED_WORK (&codec->delayed_work, wm8350_pga_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8350_pga_work);/* Enable the codec */ wm8350_set_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA );
@@ -1635,12 +1637,12 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) priv->mic.jack =NULL ;/* cancel any work waiting to be queued. */ - ret =cancel_delayed_work (&codec->delayed_work); + ret =cancel_delayed_work (&codec->dapm.delayed_work);/* if there was any work waiting then we run it now and * wait for its completion */ if (ret) { -schedule_delayed_work (&codec->delayed_work,0 ); +schedule_delayed_work (&codec->dapm.delayed_work,0 );flush_scheduled_work (); }
sound/soc/codecs/wm8400.c +6 -5
@@ -911,10 +911,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8400_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8400_dapm_widgets, -ARRAY_SIZE (wm8400_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8400_dapm_widgets, +ARRAY_SIZE (wm8400_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1219,7 +1220,7 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (power), &power[0 ]);if (ret !=0 ) {
@@ -1306,7 +1307,7 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8510.c +6 -5
@@ -216,10 +216,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8510_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8510_dapm_widgets, -ARRAY_SIZE (wm8510_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8510_dapm_widgets, +ARRAY_SIZE (wm8510_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -478,7 +479,7 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY : power1 |=WM8510_POWER1_BIASEN |WM8510_POWER1_BUFIOEN ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8510_POWER1 , power1 |0x3 );mdelay (100 );
@@ -495,7 +496,7 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8523.c +6 -5
@@ -110,10 +110,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8523_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8523_dapm_widgets, -ARRAY_SIZE (wm8523_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8523_dapm_widgets, +ARRAY_SIZE (wm8523_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -328,7 +329,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8523->supplies), wm8523->supplies);if (ret !=0 ) {
@@ -367,7 +368,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, wm8523->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8580.c +6 -5
@@ -302,10 +302,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8580_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8580_dapm_widgets, -ARRAY_SIZE (wm8580_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8580_dapm_widgets, +ARRAY_SIZE (wm8580_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -767,7 +768,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Power up and get individual control of the DACs */ reg =snd_soc_read (codec,WM8580_PWRDN1 ); reg &= ~(WM8580_PWRDN1_PWDN |WM8580_PWRDN1_ALLDACPD );
@@ -785,7 +786,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8580_PWRDN1 , reg |WM8580_PWRDN1_PWDN );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8711.c +5 -4
@@ -93,10 +93,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8711_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8711_dapm_widgets, -ARRAY_SIZE (wm8711_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8711_dapm_widgets, +ARRAY_SIZE (wm8711_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -318,7 +319,7 @@ static int wm8711_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8711_PWR ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8728.c +6 -5
@@ -73,10 +73,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8728_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8728_dapm_widgets, -ARRAY_SIZE (wm8728_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8728_dapm_widgets, +ARRAY_SIZE (wm8728_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -180,7 +181,7 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_ON :case SND_SOC_BIAS_PREPARE :case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Power everything up... */ reg =snd_soc_read (codec,WM8728_DACCTL );snd_soc_write (codec,WM8728_DACCTL , reg & ~0x4 );
@@ -197,7 +198,7 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8728_DACCTL , reg |0x4 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8731.c +7 -6
@@ -165,10 +165,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8731_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8731_dapm_widgets, -ARRAY_SIZE (wm8731_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8731_dapm_widgets, +ARRAY_SIZE (wm8731_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -319,7 +320,7 @@ static int wm8731_set_dai_sysclk(struct snd_soc_dai *codec_dai,return -EINVAL ; } -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (&codec->dapm);return 0 ; }
@@ -399,7 +400,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8731->supplies), wm8731->supplies);if (ret !=0 )
@@ -428,7 +429,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, wm8731->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8741.c +4 -3
@@ -95,10 +95,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8741_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8741_dapm_widgets, -ARRAY_SIZE (wm8741_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8741_dapm_widgets, +ARRAY_SIZE (wm8741_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
sound/soc/codecs/wm8750.c +6 -5
@@ -399,10 +399,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8750_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8750_dapm_widgets, -ARRAY_SIZE (wm8750_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8750_dapm_widgets, +ARRAY_SIZE (wm8750_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -615,7 +616,7 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Set VMID to 5k */ snd_soc_write (codec,WM8750_PWR1 , pwr_reg |0x01c1 );
@@ -630,7 +631,7 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8750_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8753.c +16 -13
@@ -670,10 +670,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8753_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8753_dapm_widgets, -ARRAY_SIZE (wm8753_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8753_dapm_widgets, +ARRAY_SIZE (wm8753_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1292,7 +1293,7 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec,wm8753_write (codec,WM8753_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1482,9 +1483,11 @@ static void wm8753_set_dai_mode(struct snd_soc_codec *codec,static void wm8753_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); -wm8753_set_bias_level (codec, codec->bias_level); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, + delayed_work.work); +struct snd_soc_codec *codec = dapm->codec; +wm8753_set_bias_level (codec, dapm->bias_level); }static int wm8753_suspend (struct snd_soc_codec *codec,pm_message_t state)
@@ -1516,10 +1519,10 @@ static int wm8753_resume(struct snd_soc_codec *codec)wm8753_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge wm8753 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) {wm8753_set_bias_level (codec,SND_SOC_BIAS_PREPARE ); - codec->bias_level =SND_SOC_BIAS_ON ; -schedule_delayed_work (&codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (caps_charge)); }
@@ -1550,7 +1553,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)struct wm8753_priv *wm8753 =snd_soc_codec_get_drvdata (codec);int ret =0 , reg; -INIT_DELAYED_WORK (&codec->delayed_work, wm8753_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8753_work); ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8753->control_type);if (ret <0 ) {
@@ -1569,7 +1572,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)/* charge output caps */ wm8753_set_bias_level (codec,SND_SOC_BIAS_PREPARE ); -schedule_delayed_work (&codec->delayed_work, +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (caps_charge));/* set the update bits */
@@ -1604,7 +1607,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)/* power down chip */ static int wm8753_remove (struct snd_soc_codec *codec) { -run_delayed_work (&codec->delayed_work); +run_delayed_work (&codec->dapm.delayed_work);wm8753_set_bias_level (codec,SND_SOC_BIAS_OFF );return 0 ;
sound/soc/codecs/wm8776.c +5 -4
@@ -307,7 +307,7 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Disable the global powerdown; DAPM does the rest */ snd_soc_update_bits (codec,WM8776_PWRDOWN ,1 ,0 ); }
@@ -318,7 +318,7 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -405,6 +405,7 @@ static int wm8776_resume(struct snd_soc_codec *codec)static int wm8776_probe (struct snd_soc_codec *codec) {struct wm8776_priv *wm8776 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ; ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8776->control_type);
@@ -428,9 +429,9 @@ static int wm8776_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8776_snd_controls,ARRAY_SIZE (wm8776_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8776_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8776_dapm_widgets,ARRAY_SIZE (wm8776_dapm_widgets)); -snd_soc_dapm_add_routes (codec, routes,ARRAY_SIZE (routes)); +snd_soc_dapm_add_routes (dapm, routes,ARRAY_SIZE (routes));return ret; }
sound/soc/codecs/wm8804.c +3 -3
@@ -515,7 +515,7 @@ static int wm8804_set_bias_level(struct snd_soc_codec *codec,snd_soc_update_bits (codec,WM8804_PWRDN ,0x9 ,0 );break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8804->supplies), wm8804->supplies);if (ret) {
@@ -537,7 +537,7 @@ static int wm8804_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -581,7 +581,7 @@ static int wm8804_probe(struct snd_soc_codec *codec) wm8804 =snd_soc_codec_get_drvdata (codec); wm8804->codec = codec; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,8 ,8 , wm8804->control_type);if (ret <0 ) {
sound/soc/codecs/wm8900.c +6 -5
@@ -611,10 +611,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8900_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8900_dapm_widgets, -ARRAY_SIZE (wm8900_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8900_dapm_widgets, +ARRAY_SIZE (wm8900_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1051,7 +1052,7 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :/* Charge capacitors if initial power up */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* STARTUP_BIAS_ENA on */ snd_soc_write (codec,WM8900_REG_POWER1 ,WM8900_REG_POWER1_STARTUP_BIAS_ENA );
@@ -1119,7 +1120,7 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec, WM8900_REG_POWER2_SYSCLK_ENA);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8903.c +6 -5
@@ -923,10 +923,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8903_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8903_dapm_widgets, -ARRAY_SIZE (wm8903_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8903_dapm_widgets, +ARRAY_SIZE (wm8903_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -946,7 +947,7 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {snd_soc_write (codec,WM8903_CLOCK_RATES_2 ,WM8903_CLK_SYS_ENA );
@@ -991,7 +992,7 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8904.c +17 -16
@@ -1428,10 +1428,11 @@ static const struct snd_soc_dapm_route wm8912_intercon[] = {static int wm8904_add_widgets (struct snd_soc_codec *codec) {struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, wm8904_core_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_core_dapm_widgets,ARRAY_SIZE (wm8904_core_dapm_widgets)); -snd_soc_dapm_add_routes (codec, core_intercon, +snd_soc_dapm_add_routes (dapm, core_intercon,ARRAY_SIZE (core_intercon));switch (wm8904->devtype) {
@@ -1443,20 +1444,20 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8904_snd_controls,ARRAY_SIZE (wm8904_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8904_adc_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_adc_dapm_widgets,ARRAY_SIZE (wm8904_adc_dapm_widgets)); -snd_soc_dapm_new_controls (codec, wm8904_dac_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dac_dapm_widgets,ARRAY_SIZE (wm8904_dac_dapm_widgets)); -snd_soc_dapm_new_controls (codec, wm8904_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dapm_widgets,ARRAY_SIZE (wm8904_dapm_widgets)); -snd_soc_dapm_add_routes (codec, core_intercon, +snd_soc_dapm_add_routes (dapm, core_intercon,ARRAY_SIZE (core_intercon)); -snd_soc_dapm_add_routes (codec, adc_intercon, +snd_soc_dapm_add_routes (dapm, adc_intercon,ARRAY_SIZE (adc_intercon)); -snd_soc_dapm_add_routes (codec, dac_intercon, +snd_soc_dapm_add_routes (dapm, dac_intercon,ARRAY_SIZE (dac_intercon)); -snd_soc_dapm_add_routes (codec, wm8904_intercon, +snd_soc_dapm_add_routes (dapm, wm8904_intercon,ARRAY_SIZE (wm8904_intercon));break ;
@@ -1464,17 +1465,17 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8904_dac_snd_controls,ARRAY_SIZE (wm8904_dac_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8904_dac_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dac_dapm_widgets,ARRAY_SIZE (wm8904_dac_dapm_widgets)); -snd_soc_dapm_add_routes (codec, dac_intercon, +snd_soc_dapm_add_routes (dapm, dac_intercon,ARRAY_SIZE (dac_intercon)); -snd_soc_dapm_add_routes (codec, wm8912_intercon, +snd_soc_dapm_add_routes (dapm, wm8912_intercon,ARRAY_SIZE (wm8912_intercon));break ; } -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -2139,7 +2140,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8904->supplies), wm8904->supplies);if (ret !=0 ) {
@@ -2198,7 +2199,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, wm8904->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -2373,7 +2374,7 @@ static int wm8904_probe(struct snd_soc_codec *codec)int ret, i; codec->cache_sync =1 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;switch (wm8904->devtype) {case WM8904 :
sound/soc/codecs/wm8940.c +3 -2
@@ -291,13 +291,14 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8940_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; - ret =snd_soc_dapm_new_controls (codec, wm8940_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, wm8940_dapm_widgets,ARRAY_SIZE (wm8940_dapm_widgets));if (ret) goto error_ret; - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret) goto error_ret;
sound/soc/codecs/wm8955.c +6 -5
@@ -577,13 +577,14 @@ static const struct snd_soc_dapm_route wm8955_intercon[] = {static int wm8955_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_add_controls (codec, wm8955_snd_controls,ARRAY_SIZE (wm8955_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8955_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8955_dapm_widgets,ARRAY_SIZE (wm8955_dapm_widgets)); - -snd_soc_dapm_add_routes (codec, wm8955_intercon, +snd_soc_dapm_add_routes (dapm, wm8955_intercon,ARRAY_SIZE (wm8955_intercon));return 0 ;
@@ -786,7 +787,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8955->supplies), wm8955->supplies);if (ret !=0 ) {
@@ -850,7 +851,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec, wm8955->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8960.c +13 -12
@@ -388,27 +388,28 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec) {struct wm8960_data *pdata = codec->dev->platform_data;struct wm8960_priv *wm8960 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;struct snd_soc_dapm_widget *w; -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets,ARRAY_SIZE (wm8960_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));/* In capless mode OUT3 is used to provide VMID for the * headphone outputs, otherwise it is used as a mono mixer. */ if (pdata && pdata->capless) { -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets_capless, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets_capless,ARRAY_SIZE (wm8960_dapm_widgets_capless)); -snd_soc_dapm_add_routes (codec, audio_paths_capless, +snd_soc_dapm_add_routes (dapm, audio_paths_capless,ARRAY_SIZE (audio_paths_capless)); }else { -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets_out3, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets_out3,ARRAY_SIZE (wm8960_dapm_widgets_out3)); -snd_soc_dapm_add_routes (codec, audio_paths_out3, +snd_soc_dapm_add_routes (dapm, audio_paths_out3,ARRAY_SIZE (audio_paths_out3)); }
@@ -417,7 +418,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)* list each time to find the desired power state do so now * and save the result. */ -list_for_each_entry (w, &codec->dapm_widgets, list) { +list_for_each_entry (w, &codec->dapm.widgets, list) {if (strcmp (w->name,"LOUT1 PGA" ) ==0 ) wm8960->lout1 = w;if (strcmp (w->name,"ROUT1 PGA" ) ==0 )
@@ -572,7 +573,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable anti-pop features */ snd_soc_write(codec, WM8960_APOP1, WM8960_POBCTRL | WM8960_SOFT_ST |
@@ -610,7 +611,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -626,7 +627,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_PREPARE : -switch (codec->bias_level) { +switch (codec->dapm.bias_level) {case SND_SOC_BIAS_STANDBY :/* Enable anti pop mode */ snd_soc_update_bits(codec, WM8960_APOP1,
@@ -681,7 +682,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -switch (codec->bias_level) { +switch (codec->dapm.bias_level) {case SND_SOC_BIAS_PREPARE :/* Disable HP discharge */ snd_soc_update_bits(codec, WM8960_APOP2,
@@ -705,7 +706,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8961.c +6 -5
@@ -882,7 +882,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_PREPARE : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY ) {/* Enable bias generation */ reg =snd_soc_read (codec,WM8961_ANTI_POP ); reg |=WM8961_BUFIOEN |WM8961_BUFDCOPEN ;
@@ -897,7 +897,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_PREPARE ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_PREPARE ) {/* VREF off */ reg =snd_soc_read (codec,WM8961_PWR_MGMT_1 ); reg &= ~WM8961_VREF ;
@@ -919,7 +919,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -959,6 +959,7 @@ static struct snd_soc_dai_driver wm8961_dai = {static int wm8961_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ;u16 reg;
@@ -1024,9 +1025,9 @@ static int wm8961_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8961_snd_controls,ARRAY_SIZE (wm8961_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8961_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8961_dapm_widgets,ARRAY_SIZE (wm8961_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return 0 ; }
sound/soc/codecs/wm8962.c +16 -14
@@ -2682,6 +2682,7 @@ static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = {static int wm8962_add_widgets (struct snd_soc_codec *codec) {struct wm8962_pdata *pdata =dev_get_platdata (codec->dev); +struct snd_soc_dapm_context *dapm = &codec->dapm;snd_soc_add_controls (codec, wm8962_snd_controls,ARRAY_SIZE (wm8962_snd_controls));
@@ -2693,26 +2694,26 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec) ARRAY_SIZE(wm8962_spk_stereo_controls)); -snd_soc_dapm_new_controls (codec, wm8962_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_widgets,ARRAY_SIZE (wm8962_dapm_widgets));if (pdata && pdata->spk_mono) -snd_soc_dapm_new_controls (codec, wm8962_dapm_spk_mono_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_spk_mono_widgets,ARRAY_SIZE (wm8962_dapm_spk_mono_widgets));else -snd_soc_dapm_new_controls (codec, wm8962_dapm_spk_stereo_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_spk_stereo_widgets,ARRAY_SIZE (wm8962_dapm_spk_stereo_widgets)); -snd_soc_dapm_add_routes (codec, wm8962_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_intercon,ARRAY_SIZE (wm8962_intercon));if (pdata && pdata->spk_mono) -snd_soc_dapm_add_routes (codec, wm8962_spk_mono_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_spk_mono_intercon,ARRAY_SIZE (wm8962_spk_mono_intercon));else -snd_soc_dapm_add_routes (codec, wm8962_spk_stereo_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_spk_stereo_intercon,ARRAY_SIZE (wm8962_spk_stereo_intercon)); -snd_soc_dapm_disable_pin (codec,"Beep" ); +snd_soc_dapm_disable_pin (dapm,"Beep" );return 0 ; }
@@ -2819,7 +2820,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,struct wm8962_priv *wm8962 =snd_soc_codec_get_drvdata (codec);int ret; -if (level == codec->bias_level) +if (level == codec->dapm.bias_level)return 0 ;switch (level) {
@@ -2833,7 +2834,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8962->supplies), wm8962->supplies);if (ret !=0 ) {
@@ -2883,7 +2884,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec, wm8962->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -3441,6 +3442,7 @@ static void wm8962_beep_work(struct work_struct *work)struct wm8962_priv *wm8962 = container_of(work, struct wm8962_priv, beep_work);struct snd_soc_codec *codec = wm8962->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int i;int reg =0 ;int best =0 ;
@@ -3457,16 +3459,16 @@ static void wm8962_beep_work(struct work_struct *work) reg =WM8962_BEEP_ENA | (best <<WM8962_BEEP_RATE_SHIFT ); -snd_soc_dapm_enable_pin (codec,"Beep" ); +snd_soc_dapm_enable_pin (dapm,"Beep" ); }else {dev_dbg (codec->dev,"Disabling beep\n" ); -snd_soc_dapm_disable_pin (codec,"Beep" ); +snd_soc_dapm_disable_pin (dapm,"Beep" ); }snd_soc_update_bits (codec,WM8962_BEEP_GENERATOR_1 ,WM8962_BEEP_ENA |WM8962_BEEP_RATE_MASK , reg); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm); }/* For usability define a way of injecting beep events for the device -
@@ -3710,7 +3712,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)INIT_DELAYED_WORK (&wm8962->mic_work, wm8962_mic_work); codec->cache_sync =1 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,16 ,16 ,SND_SOC_I2C );if (ret !=0 ) {
sound/soc/codecs/wm8971.c +16 -13
@@ -333,10 +333,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8971_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8971_dapm_widgets, -ARRAY_SIZE (wm8971_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8971_dapm_widgets, +ARRAY_SIZE (wm8971_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -553,7 +554,7 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8971_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -590,9 +591,11 @@ static struct snd_soc_dai_driver wm8971_dai = {static void wm8971_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); -wm8971_set_bias_level (codec, codec->bias_level); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, + delayed_work.work); +struct snd_soc_codec *codec = dapm->codec; +wm8971_set_bias_level (codec, codec->dapm.bias_level); }static int wm8971_suspend (struct snd_soc_codec *codec,pm_message_t state)
@@ -620,11 +623,11 @@ static int wm8971_resume(struct snd_soc_codec *codec)wm8971_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge wm8971 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) { reg =snd_soc_read (codec,WM8971_PWR1 ) &0xfe3e ;snd_soc_write (codec,WM8971_PWR1 , reg |0x01c0 ); - codec->bias_level =SND_SOC_BIAS_ON ; -queue_delayed_work (wm8971_workq, &codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +queue_delayed_work (wm8971_workq, &codec->dapm.delayed_work,msecs_to_jiffies (1000 )); }
@@ -643,7 +646,7 @@ static int wm8971_probe(struct snd_soc_codec *codec)return ret; } -INIT_DELAYED_WORK (&codec->delayed_work, wm8971_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8971_work); wm8971_workq =create_workqueue ("wm8971" );if (wm8971_workq ==NULL )return -ENOMEM ;
@@ -653,8 +656,8 @@ static int wm8971_probe(struct snd_soc_codec *codec)/* charge output caps - set vmid to 5k for quick power up */ reg =snd_soc_read (codec,WM8971_PWR1 ) &0xfe3e ;snd_soc_write (codec,WM8971_PWR1 , reg |0x01c0 ); - codec->bias_level =SND_SOC_BIAS_STANDBY ; -queue_delayed_work (wm8971_workq, &codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_STANDBY ; +queue_delayed_work (wm8971_workq, &codec->dapm.delayed_work,msecs_to_jiffies (1000 ));/* set the update bits */
sound/soc/codecs/wm8974.c +6 -5
@@ -274,10 +274,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8974_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8974_dapm_widgets, -ARRAY_SIZE (wm8974_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8974_dapm_widgets, +ARRAY_SIZE (wm8974_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -530,7 +531,7 @@ static int wm8974_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY : power1 |=WM8974_POWER1_BIASEN |WM8974_POWER1_BUFIOEN ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8974_POWER1 , power1 |0x3 );mdelay (100 );
@@ -547,7 +548,7 @@ static int wm8974_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8978.c +6 -5
@@ -355,11 +355,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8978_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8978_dapm_widgets, -ARRAY_SIZE (wm8978_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, wm8978_dapm_widgets, +ARRAY_SIZE (wm8978_dapm_widgets));/* set up the WM8978 audio map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -837,7 +838,7 @@ static int wm8978_set_bias_level(struct snd_soc_codec *codec,/* bit 3: enable bias, bit 2: enable I/O tie off buffer */ power1 |=0xc ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8978_POWER_MANAGEMENT_1 , power1 |0x3 );
@@ -857,7 +858,7 @@ static int wm8978_set_bias_level(struct snd_soc_codec *codec,dev_dbg (codec->dev,"%s: %d, %x\n" , __func__, level, power1); - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8985.c +6 -5
@@ -533,10 +533,11 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,static int wm8985_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8985_dapm_widgets, -ARRAY_SIZE (wm8985_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map, +snd_soc_dapm_new_controls (dapm, wm8985_dapm_widgets, +ARRAY_SIZE (wm8985_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -879,7 +880,7 @@ static int wm8985_set_bias_level(struct snd_soc_codec *codec, 1 << WM8985_VMIDSEL_SHIFT);break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8985->supplies), wm8985->supplies);if (ret) {
@@ -939,7 +940,7 @@ static int wm8985_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8988.c +5 -4
@@ -677,7 +677,7 @@ static int wm8988_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* VREF, VMID=2x5k */ snd_soc_write (codec,WM8988_PWR1 , pwr_reg |0x1c1 );
@@ -693,7 +693,7 @@ static int wm8988_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8988_PWR1 ,0x0000 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -759,6 +759,7 @@ static int wm8988_resume(struct snd_soc_codec *codec)static int wm8988_probe (struct snd_soc_codec *codec) {struct wm8988_priv *wm8988 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ;u16 reg;
@@ -790,9 +791,9 @@ static int wm8988_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8988_snd_controls,ARRAY_SIZE (wm8988_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8988_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8988_dapm_widgets,ARRAY_SIZE (wm8988_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/codecs/wm8990.c +6 -5
@@ -914,11 +914,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8990_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8990_dapm_widgets, -ARRAY_SIZE (wm8990_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, wm8990_dapm_widgets, +ARRAY_SIZE (wm8990_dapm_widgets));/* set up the WM8990 audio map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1170,7 +1171,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable all output discharge bits */ snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE | WM8990_DIS_RLINE | WM8990_DIS_OUT3 |
@@ -1266,7 +1267,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8993.c +5 -4
@@ -970,7 +970,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8993->supplies), wm8993->supplies);if (ret !=0 )
@@ -1045,7 +1045,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1424,6 +1424,7 @@ static struct snd_soc_dai_driver wm8993_dai = {static int wm8993_probe (struct snd_soc_codec *codec) {struct wm8993_priv *wm8993 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, i, val; wm8993->hubs_data.hp_startup_mode =1 ;
@@ -1505,11 +1506,11 @@ static int wm8993_probe(struct snd_soc_codec *codec) ARRAY_SIZE(wm8993_eq_controls)); } -snd_soc_dapm_new_controls (codec, wm8993_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8993_dapm_widgets,ARRAY_SIZE (wm8993_dapm_widgets));wm_hubs_add_analogue_controls (codec); -snd_soc_dapm_add_routes (codec, routes,ARRAY_SIZE (routes)); +snd_soc_dapm_add_routes (dapm, routes,ARRAY_SIZE (routes));wm_hubs_add_analogue_routes (codec, wm8993->pdata.lineout1_diff, wm8993->pdata.lineout2_diff);
sound/soc/codecs/wm8994.c +7 -6
@@ -1835,7 +1835,7 @@ static int configure_clock(struct snd_soc_codec *codec)snd_soc_update_bits (codec,WM8994_CLOCKING_1 ,WM8994_SYSCLK_SRC , new); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (&codec->dapm);return 0 ; }
@@ -3108,7 +3108,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Tweak DC servo and DSP configuration for * improved performance. */ if (wm8994->revision <4 ) {
@@ -3152,7 +3152,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_OFF : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY ) {/* Switch over to startup biases */ snd_soc_update_bits(codec, WM8994_ANTIPOP_2, WM8994_BIAS_SRC |
@@ -3187,7 +3187,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, }break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -3895,6 +3895,7 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data)static int wm8994_codec_probe (struct snd_soc_codec *codec) {struct wm8994_priv *wm8994; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, i; codec->control_data =dev_get_drvdata (codec->dev->parent);
@@ -4033,10 +4034,10 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)wm_hubs_add_analogue_controls (codec);snd_soc_add_controls (codec, wm8994_snd_controls,ARRAY_SIZE (wm8994_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8994_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8994_dapm_widgets,ARRAY_SIZE (wm8994_dapm_widgets));wm_hubs_add_analogue_routes (codec,0 ,0 ); -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ;
sound/soc/codecs/wm9081.c +5 -4
@@ -805,7 +805,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :/* Initial cold start */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Disable LINEOUT discharge */ reg =snd_soc_read (codec,WM9081_ANTI_POP_CONTROL ); reg &= ~WM9081_LINEOUT_DISCH ;
@@ -865,7 +865,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1228,6 +1228,7 @@ static struct snd_soc_dai_driver wm9081_dai = {static int wm9081_probe (struct snd_soc_codec *codec) {struct wm9081_priv *wm9081 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;u16 reg;
@@ -1269,9 +1270,9 @@ static int wm9081_probe(struct snd_soc_codec *codec) ARRAY_SIZE(wm9081_eq_controls)); } -snd_soc_dapm_new_controls (codec, wm9081_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm9081_dapm_widgets,ARRAY_SIZE (wm9081_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/wm9090.c +9 -8
@@ -443,31 +443,32 @@ static const struct snd_soc_dapm_route audio_map_in2_diff[] = {static int wm9090_add_controls (struct snd_soc_codec *codec) {struct wm9090_priv *wm9090 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int i; -snd_soc_dapm_new_controls (codec, wm9090_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm9090_dapm_widgets,ARRAY_SIZE (wm9090_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));snd_soc_add_controls (codec, wm9090_controls,ARRAY_SIZE (wm9090_controls));if (wm9090->pdata.lin1_diff) { -snd_soc_dapm_add_routes (codec, audio_map_in1_diff, +snd_soc_dapm_add_routes (dapm, audio_map_in1_diff,ARRAY_SIZE (audio_map_in1_diff)); }else { -snd_soc_dapm_add_routes (codec, audio_map_in1_se, +snd_soc_dapm_add_routes (dapm, audio_map_in1_se,ARRAY_SIZE (audio_map_in1_se));snd_soc_add_controls (codec, wm9090_in1_se_controls,ARRAY_SIZE (wm9090_in1_se_controls)); }if (wm9090->pdata.lin2_diff) { -snd_soc_dapm_add_routes (codec, audio_map_in2_diff, +snd_soc_dapm_add_routes (dapm, audio_map_in2_diff,ARRAY_SIZE (audio_map_in2_diff)); }else { -snd_soc_dapm_add_routes (codec, audio_map_in2_se, +snd_soc_dapm_add_routes (dapm, audio_map_in2_se,ARRAY_SIZE (audio_map_in2_se));snd_soc_add_controls (codec, wm9090_in2_se_controls,ARRAY_SIZE (wm9090_in2_se_controls));
@@ -514,7 +515,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Restore the register cache */ for (i =1 ; i < codec->driver->reg_cache_size; i++) {if (reg_cache[i] == wm9090_reg_defaults[i])
@@ -544,7 +545,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm9705.c +4 -2
@@ -203,9 +203,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9705_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9705_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, wm9705_dapm_widgets,ARRAY_SIZE (wm9705_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/codecs/wm9712.c +5 -4
@@ -432,10 +432,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9712_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9712_dapm_widgets, -ARRAY_SIZE (wm9712_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm9712_dapm_widgets, +ARRAY_SIZE (wm9712_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -570,7 +571,7 @@ static int wm9712_set_bias_level(struct snd_soc_codec *codec,ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm9713.c +5 -3
@@ -647,10 +647,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9713_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9713_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, wm9713_dapm_widgets,ARRAY_SIZE (wm9713_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1147,7 +1149,7 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec,ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm_hubs.c +11 -7
@@ -814,6 +814,8 @@ static const struct snd_soc_dapm_route lineout2_se_routes[] = {int wm_hubs_add_analogue_controls (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +/* Latch volume update bits & default ZC on */ snd_soc_update_bits (codec,WM8993_LEFT_LINE_INPUT_1_2_VOLUME ,WM8993_IN1_VU ,WM8993_IN1_VU );
@@ -842,7 +844,7 @@ int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)snd_soc_add_controls (codec, analogue_snd_controls,ARRAY_SIZE (analogue_snd_controls)); -snd_soc_dapm_new_controls (codec, analogue_dapm_widgets, +snd_soc_dapm_new_controls (dapm, analogue_dapm_widgets,ARRAY_SIZE (analogue_dapm_widgets));return 0 ; }
@@ -851,24 +853,26 @@ EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_controls);int wm_hubs_add_analogue_routes (struct snd_soc_codec *codec,int lineout1_diff,int lineout2_diff) { -snd_soc_dapm_add_routes (codec, analogue_routes, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_add_routes (dapm, analogue_routes,ARRAY_SIZE (analogue_routes));if (lineout1_diff) -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout1_diff_routes,ARRAY_SIZE (lineout1_diff_routes));else -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout1_se_routes,ARRAY_SIZE (lineout1_se_routes));if (lineout2_diff) -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout2_diff_routes,ARRAY_SIZE (lineout2_diff_routes));else -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout2_se_routes,ARRAY_SIZE (lineout2_se_routes));
@@ -895,7 +899,7 @@ int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec,* VMID as an output and can disable it. */ if (lineout1_diff && lineout2_diff) - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;if (lineout1fb) snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
sound/soc/davinci/davinci-evm.c +11 -10
@@ -132,26 +132,27 @@ static const struct snd_soc_dapm_route audio_map[] = {static int evm_aic3x_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add davinci-evm specific widgets */ -snd_soc_dapm_new_controls (codec, aic3x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3x_dapm_widgets,ARRAY_SIZE (aic3x_dapm_widgets));/* Set up davinci-evm specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* not connected */ -snd_soc_dapm_disable_pin (codec,"MONO_LOUT" ); -snd_soc_dapm_disable_pin (codec,"HPLCOM" ); -snd_soc_dapm_disable_pin (codec,"HPRCOM" ); +snd_soc_dapm_disable_pin (dapm,"MONO_LOUT" ); +snd_soc_dapm_disable_pin (dapm,"HPLCOM" ); +snd_soc_dapm_disable_pin (dapm,"HPRCOM" );/* always connected */ -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line Out" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line Out" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/ep93xx/snappercl15.c +3 -2
@@ -79,11 +79,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int snappercl15_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/imx/wm1133-ev1.c +4 -3
@@ -213,11 +213,12 @@ static struct snd_soc_jack_pin mic_jack_pins[] = {static int wm1133_ev1_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, wm1133_ev1_widgets, +snd_soc_dapm_new_controls (dapm, wm1133_ev1_widgets,ARRAY_SIZE (wm1133_ev1_widgets)); -snd_soc_dapm_add_routes (codec, wm1133_ev1_map, +snd_soc_dapm_add_routes (dapm, wm1133_ev1_map,ARRAY_SIZE (wm1133_ev1_map));/* Headphone jack detection */
@@ -234,7 +235,7 @@ static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd)wm8350_mic_jack_detect (codec, &mic_jack,SND_JACK_MICROPHONE ,SND_JACK_BTN_0 ); -snd_soc_dapm_force_enable_pin (codec,"Mic Bias" ); +snd_soc_dapm_force_enable_pin (dapm,"Mic Bias" );return 0 ; }
sound/soc/jz4740/qi_lb60.c +8 -5
@@ -59,10 +59,11 @@ static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;struct snd_soc_dai *cpu_dai = rtd->cpu_dai; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; -snd_soc_dapm_nc_pin (codec,"LIN" ); -snd_soc_dapm_nc_pin (codec,"RIN" ); +snd_soc_dapm_nc_pin (dapm,"LIN" ); +snd_soc_dapm_nc_pin (dapm,"RIN" ); ret =snd_soc_dai_set_fmt (cpu_dai,QI_LB60_DAIFMT );if (ret <0 ) {
@@ -70,9 +71,11 @@ static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd)return ret; } -snd_soc_dapm_new_controls (codec, qi_lb60_widgets,ARRAY_SIZE (qi_lb60_widgets)); -snd_soc_dapm_add_routes (codec, qi_lb60_routes,ARRAY_SIZE (qi_lb60_routes)); -snd_soc_dapm_sync (codec); +snd_soc_dapm_new_controls (dapm, qi_lb60_widgets, +ARRAY_SIZE (qi_lb60_widgets)); +snd_soc_dapm_add_routes (dapm, qi_lb60_routes, +ARRAY_SIZE (qi_lb60_routes)); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/kirkwood/kirkwood-t5325.c +7 -6
@@ -69,17 +69,18 @@ static const struct snd_soc_dapm_route t5325_route[] = {static int t5325_dai_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, t5325_dapm_widgets, +snd_soc_dapm_new_controls (dapm, t5325_dapm_widgets,ARRAY_SIZE (t5325_dapm_widgets)); -snd_soc_dapm_add_routes (codec, t5325_route,ARRAY_SIZE (t5325_route)); +snd_soc_dapm_add_routes (dapm, t5325_route,ARRAY_SIZE (t5325_route)); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Speaker" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Speaker" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/am3517evm.c +7 -6
@@ -114,20 +114,21 @@ static const struct snd_soc_dapm_route audio_map[] = {static int am3517evm_aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add am3517-evm specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up davinci-evm specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* always connected */ -snd_soc_dapm_enable_pin (codec,"Line Out" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic In" ); +snd_soc_dapm_enable_pin (dapm,"Line Out" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic In" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/ams-delta.c +43 -39
190 lines not on this page · raw message
sound/soc/omap/n810.c +22 -20
83 lines not on this page · raw message
sound/soc/omap/omap3pandora.c +23 -21
74 lines not on this page · raw message
sound/soc/omap/osk5912.c +7 -6
@@ -116,19 +116,20 @@ static const struct snd_soc_dapm_route audio_map[] = {static int osk_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add osk5912 specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up osk5912 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/rx51.c +14 -11
@@ -58,19 +58,21 @@ static int rx51_jack_func;static void rx51_ext_control (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +if (rx51_spk_func) -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" );else -snd_soc_dapm_disable_pin (codec,"Ext Spk" ); +snd_soc_dapm_disable_pin (dapm,"Ext Spk" );if (rx51_dmic_func) -snd_soc_dapm_enable_pin (codec,"DMic" ); +snd_soc_dapm_enable_pin (dapm,"DMic" );else -snd_soc_dapm_disable_pin (codec,"DMic" ); +snd_soc_dapm_disable_pin (dapm,"DMic" );gpio_set_value (RX51_TVOUT_SEL_GPIO , rx51_jack_func ==RX51_JACK_TVOUT ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm); }static int rx51_startup (struct snd_pcm_substream *substream)
@@ -244,12 +246,13 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {static int rx51_aic34_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int err;/* Set up NC codec pins */ -snd_soc_dapm_nc_pin (codec,"MIC3L" ); -snd_soc_dapm_nc_pin (codec,"MIC3R" ); -snd_soc_dapm_nc_pin (codec,"LINE1R" ); +snd_soc_dapm_nc_pin (dapm,"MIC3L" ); +snd_soc_dapm_nc_pin (dapm,"MIC3R" ); +snd_soc_dapm_nc_pin (dapm,"LINE1R" );/* Add RX-51 specific controls */ err = snd_soc_add_controls(codec, aic34_rx51_controls,
@@ -258,13 +261,13 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)return err;/* Add RX-51 specific widgets */ -snd_soc_dapm_new_controls (codec, aic34_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic34_dapm_widgets,ARRAY_SIZE (aic34_dapm_widgets));/* Set up RX-51 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);/* AV jack detection */ err = snd_soc_jack_new(codec, "AV Jack",
sound/soc/omap/sdp3430.c +22 -21
61 lines not on this page · raw message
sound/soc/omap/sdp4430.c +10 -9
@@ -129,6 +129,7 @@ static const struct snd_soc_dapm_route audio_map[] = {static int sdp4430_twl6040_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;/* Add SDP4430 specific controls */
@@ -138,25 +139,25 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)return ret;/* Add SDP4430 specific widgets */ - ret =snd_soc_dapm_new_controls (codec, sdp4430_twl6040_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, sdp4430_twl6040_dapm_widgets,ARRAY_SIZE (sdp4430_twl6040_dapm_widgets));if (ret)return ret;/* Set up SDP4430 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* SDP4430 connected pins */ -snd_soc_dapm_enable_pin (codec,"Ext Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_enable_pin (codec,"Headset Mic" ); -snd_soc_dapm_enable_pin (codec,"Headset Stereophone" ); +snd_soc_dapm_enable_pin (dapm,"Ext Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Headset Mic" ); +snd_soc_dapm_enable_pin (dapm,"Headset Stereophone" );/* TWL6040 not connected pins */ -snd_soc_dapm_nc_pin (codec,"AFML" ); -snd_soc_dapm_nc_pin (codec,"AFMR" ); +snd_soc_dapm_nc_pin (dapm,"AFML" ); +snd_soc_dapm_nc_pin (dapm,"AFMR" ); - ret =snd_soc_dapm_sync (codec); + ret =snd_soc_dapm_sync (dapm);return ret; }
sound/soc/omap/zoom2.c +18 -17
@@ -162,35 +162,36 @@ static const struct snd_soc_dapm_route audio_map[] = {static int zoom2_twl4030_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;/* Add Zoom2 specific widgets */ - ret =snd_soc_dapm_new_controls (codec, zoom2_twl4030_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, zoom2_twl4030_dapm_widgets,ARRAY_SIZE (zoom2_twl4030_dapm_widgets));if (ret)return ret;/* Set up Zoom2 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* Zoom2 connected pins */ -snd_soc_dapm_enable_pin (codec,"Ext Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_enable_pin (codec,"Headset Mic" ); -snd_soc_dapm_enable_pin (codec,"Headset Stereophone" ); -snd_soc_dapm_enable_pin (codec,"Aux In" ); +snd_soc_dapm_enable_pin (dapm,"Ext Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Headset Mic" ); +snd_soc_dapm_enable_pin (dapm,"Headset Stereophone" ); +snd_soc_dapm_enable_pin (dapm,"Aux In" );/* TWL4030 not connected pins */ -snd_soc_dapm_nc_pin (codec,"CARKITMIC" ); -snd_soc_dapm_nc_pin (codec,"DIGIMIC0" ); -snd_soc_dapm_nc_pin (codec,"DIGIMIC1" ); -snd_soc_dapm_nc_pin (codec,"EARPIECE" ); -snd_soc_dapm_nc_pin (codec,"PREDRIVEL" ); -snd_soc_dapm_nc_pin (codec,"PREDRIVER" ); -snd_soc_dapm_nc_pin (codec,"CARKITL" ); -snd_soc_dapm_nc_pin (codec,"CARKITR" ); - - ret =snd_soc_dapm_sync (codec); +snd_soc_dapm_nc_pin (dapm,"CARKITMIC" ); +snd_soc_dapm_nc_pin (dapm,"DIGIMIC0" ); +snd_soc_dapm_nc_pin (dapm,"DIGIMIC1" ); +snd_soc_dapm_nc_pin (dapm,"EARPIECE" ); +snd_soc_dapm_nc_pin (dapm,"PREDRIVEL" );
Lines of this file are not shown. View the raw message.
sound/soc/pxa/corgi.c +27 -24
51 lines not on this page · raw message
sound/soc/pxa/spitz.c +36 -33
69 lines not on this page · raw message
sound/soc/s3c24xx/neo1973_gta02_wm8753.c +21 -20
41 lines not on this page · raw message
sound/soc/s3c24xx/neo1973_wm8753.c +63 -60
123 lines not on this page · raw message
sound/soc/s3c24xx/s3c24xx_simtec_hermes.c +8 -7
Lines of this file are not shown. View the raw message.
sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c +8 -7
Lines of this file are not shown. View the raw message.
sound/soc/soc-dapm.c +187 -168
355 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.2.3
Part of the diff is not shown here. View the raw message.
Re: [PATCH] ASoC: Decouple DAPM from CODECs
Quoted 5 lines · Jarkko Nikula
From: Liam Girdwood <[email protected]>
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths.
This looks good but won't apply without your DAPM locking change. In a case like this where the patch is going to be applied on a different branch to the one the dependency is on it's usually best to let the merge get sorted out when the branches get merged.
Re: [PATCH] ASoC: Decouple DAPM from CODECs
Quoted 11 lines · On Thu, 4 Nov 2010 23:29:20 -0400 Mark Brown…
Quoted 5 lines · Jarkko Nikula
From: Liam Girdwood <[email protected]>
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths.
This looks good but won't apply without your DAPM locking change. In a case like this where the patch is going to be applied on a different branch to the one the dependency is on it's usually best to let the merge get sorted out when the branches get merged.
Lets not take honor from Peter Ujfalusi who find the locking issue in DAPM :-)
As this patch is huge, a small fixup below to those conflicting lines (and only those) of patch file. That makes the patch to apply on top of for-2.6.38 branch.
Signature · 25 lines
Jarkko
-------------------- fixup.diff --------------------
--- [PATCH]_ASoC__Decouple_DAPM_from_CODECs.orig 2010-11-05 09:14:14.000000000 +0200
+++ [PATCH]_ASoC__Decouple_DAPM_from_CODECs 2010-11-05 09:15:44.000000000 +0200
@@ -5707,9 +5707,9 @@
LIST_HEAD(up_list);
LIST_HEAD(down_list);
@@ -903,7 +909,7 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
+ /* Check which widgets we need to power and store them in
* lists indicating if they should be powered up or down.
*/
- mutex_lock(&card->dpw_mutex);
- list_for_each_entry(w, &codec->dapm_widgets, list) {
+ list_for_each_entry(w, &dapm->widgets, list) {
switch (w->id) {
@@ -5800,9 +5800,9 @@
+ pop_dbg(dapm->pop_time, "DAPM sequencing finished, waiting %dms\n",
+ dapm->pop_time);
+ pop_wait(dapm->pop_time);
- mutex_unlock(&card->dpw_mutex);
return 0;
+ }
@@ -1037,9 +1043,9 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
return -ENOMEM;Re: [PATCH] ASoC: Decouple DAPM from CODECs
Quoted 2 lines · Jarkko Nikula
Lets not take honor from Peter Ujfalusi who find the locking issue in DAPM :-)
Remember that From: can be added when you send the patch.
Quoted 3 lines
As this patch is huge, a small fixup below to those conflicting lines (and only those) of patch file. That makes the patch to apply on top of for-2.6.38 branch.
Please resend something I can apply directly. It's difficult to apply this fixup since the patch it's fixing up won't apply in the first place.
PATCH 1/1 ASoC: Decouple DAPM from CODECs
From: Liam Girdwood <[email protected]>
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths.
This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec.
This patch does not change current functionality and a large part of changes come because of structure and internal API changes.
Core implementation is from Liam Girdwood <[email protected]> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <[email protected]>.
---
- Machine driver developers/maintainers Cc'ed for getting more build coverage than OMAP boards and codecs
- Patch is for branch for-2.6.38 of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
- RFC_[i-iii]/iv squashed into one patch as the 1st version shows the authorship of each parts. 1st set here:
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-October/033195.html
- struct snd_soc_dapm_context embedded into struct snd_soc_codec instead of allocating it. Based on discussion there is no need for DAPM without device context and this saves a few code lines from allocation/deallocation. A few include statement soc-dapm.h => soc.h changes in drivers because of that
- API of snd_soc_dapm_ignore_suspend changed also to be pair with other DAPM functions
- variable dapm instead of &codec->dapm used in drivers to make code more readable and to cut long lines. max98088 is space indented and this patch doesn't change that
- Function argument comments (codec => dapm) updated in soc-dapm.c
- Long soc-dapm function headers that this patch is touching are cut
--- include/sound/soc-dapm.h | 49 +++- include/sound/soc.h | 9 +- sound/soc/atmel/playpaq_wm8510.c | 11 +- sound/soc/atmel/sam9g20_wm8731.c | 17 +- sound/soc/atmel/snd-soc-afeb9260.c | 13 +- sound/soc/codecs/88pm860x-codec.c | 9 +- sound/soc/codecs/ad1836.c | 5 +- sound/soc/codecs/ad193x.c | 5 +- sound/soc/codecs/ak4535.c | 9 +- sound/soc/codecs/ak4642.c | 2 +- sound/soc/codecs/ak4671.c | 9 +- sound/soc/codecs/alc5623.c | 23 +- sound/soc/codecs/cq93vc.c | 2 +- sound/soc/codecs/cs42l51.c | 5 +- sound/soc/codecs/cx20442.c | 15 +- sound/soc/codecs/da7210.c | 2 +- sound/soc/codecs/jz4740.c | 10 +- sound/soc/codecs/max98088.c | 12 +- sound/soc/codecs/ssm2602.c | 9 +- sound/soc/codecs/stac9766.c | 3 +- sound/soc/codecs/tlv320aic23.c | 9 +- sound/soc/codecs/tlv320aic3x.c | 22 +- sound/soc/codecs/tlv320dac33.c | 15 +- sound/soc/codecs/tpa6130a2.c | 5 +- sound/soc/codecs/twl4030.c | 13 +- sound/soc/codecs/twl6040.c | 12 +- sound/soc/codecs/uda134x.c | 2 +- sound/soc/codecs/uda1380.c | 13 +- sound/soc/codecs/wm2000.c | 5 +- sound/soc/codecs/wm8350.c | 28 +- sound/soc/codecs/wm8400.c | 11 +- sound/soc/codecs/wm8510.c | 11 +- sound/soc/codecs/wm8523.c | 11 +- sound/soc/codecs/wm8580.c | 11 +- sound/soc/codecs/wm8711.c | 9 +- sound/soc/codecs/wm8728.c | 11 +- sound/soc/codecs/wm8731.c | 13 +- sound/soc/codecs/wm8741.c | 7 +- sound/soc/codecs/wm8750.c | 11 +- sound/soc/codecs/wm8753.c | 29 +- sound/soc/codecs/wm8776.c | 9 +- sound/soc/codecs/wm8804.c | 6 +- sound/soc/codecs/wm8900.c | 11 +- sound/soc/codecs/wm8903.c | 11 +- sound/soc/codecs/wm8904.c | 33 ++- sound/soc/codecs/wm8940.c | 5 +- sound/soc/codecs/wm8955.c | 11 +- sound/soc/codecs/wm8960.c | 25 +- sound/soc/codecs/wm8961.c | 11 +- sound/soc/codecs/wm8962.c | 30 +- sound/soc/codecs/wm8971.c | 29 +- sound/soc/codecs/wm8974.c | 11 +- sound/soc/codecs/wm8978.c | 11 +- sound/soc/codecs/wm8985.c | 11 +- sound/soc/codecs/wm8988.c | 9 +- sound/soc/codecs/wm8990.c | 11 +- sound/soc/codecs/wm8993.c | 9 +- sound/soc/codecs/wm8994.c | 13 +- sound/soc/codecs/wm9081.c | 9 +- sound/soc/codecs/wm9090.c | 17 +- sound/soc/codecs/wm9705.c | 6 +- sound/soc/codecs/wm9712.c | 9 +- sound/soc/codecs/wm9713.c | 8 +- sound/soc/codecs/wm_hubs.c | 18 +- sound/soc/davinci/davinci-evm.c | 21 +- sound/soc/ep93xx/snappercl15.c | 5 +- sound/soc/imx/wm1133-ev1.c | 7 +- sound/soc/jz4740/qi_lb60.c | 13 +- sound/soc/kirkwood/kirkwood-t5325.c | 13 +- sound/soc/omap/am3517evm.c | 13 +- sound/soc/omap/ams-delta.c | 82 +++--- sound/soc/omap/n810.c | 42 ++-- sound/soc/omap/omap3pandora.c | 44 ++-- sound/soc/omap/osk5912.c | 13 +- sound/soc/omap/rx51.c | 25 +- sound/soc/omap/sdp3430.c | 43 ++-- sound/soc/omap/sdp4430.c | 19 +- sound/soc/omap/zoom2.c | 35 ++-- sound/soc/pxa/corgi.c | 51 ++-- sound/soc/pxa/e740_wm9705.c | 29 +- sound/soc/pxa/e750_wm9705.c | 29 +- sound/soc/pxa/e800_wm9712.c | 7 +- sound/soc/pxa/magician.c | 35 ++- sound/soc/pxa/mioa701_wm9713.c | 17 +- sound/soc/pxa/palm27x.c | 33 ++- sound/soc/pxa/poodle.c | 25 +- sound/soc/pxa/saarb.c | 17 +- sound/soc/pxa/spitz.c | 69 +++--- sound/soc/pxa/tavorevb3.c | 17 +- sound/soc/pxa/tosa.c | 37 ++-- sound/soc/pxa/z2.c | 15 +- sound/soc/pxa/zylonite.c | 11 +- sound/soc/s3c24xx/aquila_wm8994.c | 25 +- sound/soc/s3c24xx/goni_wm8994.c | 21 +- sound/soc/s3c24xx/jive_wm8750.c | 19 +- sound/soc/s3c24xx/neo1973_gta02_wm8753.c | 41 ++-- sound/soc/s3c24xx/neo1973_wm8753.c | 123 +++++---- sound/soc/s3c24xx/rx1950_uda1380.c | 11 +- sound/soc/s3c24xx/s3c24xx_simtec_hermes.c | 15 +- sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c | 15 +- sound/soc/s3c24xx/smartq_wm8987.c | 21 +- sound/soc/s3c24xx/smdk64xx_wm8580.c | 16 +- sound/soc/s6000/s6105-ipcam.c | 40 ++-- sound/soc/sh/migor.c | 5 +- sound/soc/sh/sh7760-ac97.c | 2 +- sound/soc/soc-core.c | 29 +- sound/soc/soc-dapm.c | 355 +++++++++++++----------- sound/soc/soc-jack.c | 8 +- 108 files changed, 1239 insertions(+), 1064 deletions(-)
include/sound/soc-dapm.h +36 -13
@@ -297,6 +297,7 @@ enum snd_soc_dapm_type;struct snd_soc_dapm_path ;struct snd_soc_dapm_pin ;struct snd_soc_dapm_route ; +struct snd_soc_dapm_context ;int dapm_reg_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event);
@@ -324,16 +325,16 @@ int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *uncontrol);int snd_soc_dapm_put_pin_switch (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_value *uncontrol); -int snd_soc_dapm_new_control (struct snd_soc_codec *codec, +int snd_soc_dapm_new_control (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget); -int snd_soc_dapm_new_controls (struct snd_soc_codec *codec, +int snd_soc_dapm_new_controls (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_widget *widget,int num);/* dapm path setup */ -int snd_soc_dapm_new_widgets (struct snd_soc_codec *codec); -void snd_soc_dapm_free (struct snd_soc_codec *codec); -int snd_soc_dapm_add_routes (struct snd_soc_codec *codec, +int snd_soc_dapm_new_widgets (struct snd_soc_dapm_context *dapm); +void snd_soc_dapm_free (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_add_routes (struct snd_soc_dapm_context *dapm,const struct snd_soc_dapm_route *route,int num);/* dapm events */
@@ -343,17 +344,21 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card);/* 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_codec *codec); +void snd_soc_dapm_debugfs_init (struct snd_soc_dapm_context *dapm);/* dapm audio pin control and status */ -int snd_soc_dapm_enable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_disable_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_nc_pin (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_get_pin_status (struct snd_soc_codec *codec,const char *pin); -int snd_soc_dapm_sync (struct snd_soc_codec *codec); -int snd_soc_dapm_force_enable_pin (struct snd_soc_codec *codec, +int snd_soc_dapm_enable_pin (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_disable_pin (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_nc_pin (struct snd_soc_dapm_context *dapm,const char *pin); +int snd_soc_dapm_get_pin_status (struct snd_soc_dapm_context *dapm, +const char *pin); +int snd_soc_dapm_sync (struct snd_soc_dapm_context *dapm); +int snd_soc_dapm_force_enable_pin (struct snd_soc_dapm_context *dapm,const char *pin); -int snd_soc_dapm_ignore_suspend (struct snd_soc_codec *codec,const char *pin); +int snd_soc_dapm_ignore_suspend (struct snd_soc_dapm_context *dapm, +const char *pin);/* dapm widget types */ enum snd_soc_dapm_type {
@@ -425,6 +430,7 @@ struct snd_soc_dapm_widget {char *sname;/* stream name */ struct snd_soc_codec *codec;struct list_head list; +struct snd_soc_dapm_context *dapm;/* dapm control */ short reg;/* negative reg = no direct dapm */
@@ -461,4 +467,21 @@ struct snd_soc_dapm_widget { struct list_head power_list; }; +/* DAPM context */ +struct snd_soc_dapm_context { +u32 pop_time; +struct list_head widgets; +struct list_head paths; +enum snd_soc_bias_level bias_level; +enum snd_soc_bias_level suspend_bias_level; +struct delayed_work delayed_work; +unsigned int idle_bias_off:1 ;/* Use BIAS_OFF instead of STANDBY */ + +struct device *dev;/* from parent - for debug */ +struct snd_soc_codec *codec;/* parent codec */ +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_dapm; +#endif +}; +#endif
include/sound/soc.h +2 -7
@@ -238,6 +238,7 @@ struct soc_enum;struct snd_soc_ac97_ops ;struct snd_soc_jack ;struct snd_soc_jack_pin ; +#include <sound/soc-dapm.h> #ifdef CONFIG_GPIOLIB struct snd_soc_jack_gpio ;
@@ -436,7 +437,6 @@ struct snd_soc_codec {/* runtime */ struct snd_ac97 *ac97;/* for ad-hoc ac97 devices */ unsigned int active; - unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ unsigned int cache_only:1; /* Suppress writes to hardware */ unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ unsigned int suspended:1; /* Codec is in suspend PM state */
@@ -452,12 +452,7 @@ struct snd_soc_codec {void *reg_cache;/* dapm */ -u32 pop_time; -struct list_head dapm_widgets; -struct list_head dapm_paths; -enum snd_soc_bias_level bias_level; -enum snd_soc_bias_level suspend_bias_level; -struct delayed_work delayed_work; +struct snd_soc_dapm_context dapm;#ifdef CONFIG_DEBUG_FS struct dentry *debugfs_codec_root;
sound/soc/atmel/playpaq_wm8510.c +6 -5
@@ -318,27 +318,28 @@ static const struct snd_soc_dapm_route intercon[] = {static int playpaq_wm8510_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int i;/* * Add DAPM widgets */ for (i =0 ; i <ARRAY_SIZE (playpaq_dapm_widgets); i++) -snd_soc_dapm_new_control (codec, &playpaq_dapm_widgets[i]); +snd_soc_dapm_new_control (dapm, &playpaq_dapm_widgets[i]);/* * Setup audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));/* always connected pins */ -snd_soc_dapm_enable_pin (codec,"Int Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_enable_pin (dapm,"Int Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_sync (dapm);
sound/soc/atmel/sam9g20_wm8731.c +9 -8
@@ -140,6 +140,7 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;struct snd_soc_dai *codec_dai = rtd->codec_dai; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; printk(KERN_DEBUG
@@ -154,25 +155,25 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd) }/* Add specific widgets */ -snd_soc_dapm_new_controls (codec, at91sam9g20ek_dapm_widgets, +snd_soc_dapm_new_controls (dapm, at91sam9g20ek_dapm_widgets,ARRAY_SIZE (at91sam9g20ek_dapm_widgets));/* Set up specific audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));/* not connected */ -snd_soc_dapm_nc_pin (codec,"RLINEIN" ); -snd_soc_dapm_nc_pin (codec,"LLINEIN" ); +snd_soc_dapm_nc_pin (dapm,"RLINEIN" ); +snd_soc_dapm_nc_pin (dapm,"LLINEIN" );#ifdef ENABLE_MIC_INPUT -snd_soc_dapm_enable_pin (codec,"Int Mic" ); +snd_soc_dapm_enable_pin (dapm,"Int Mic" );#else -snd_soc_dapm_nc_pin (codec,"Int Mic" ); +snd_soc_dapm_nc_pin (dapm,"Int Mic" );#endif /* always connected */ -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/atmel/snd-soc-afeb9260.c +7 -6
@@ -105,19 +105,20 @@ static const struct snd_soc_dapm_route audio_map[] = {static int afeb9260_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add afeb9260 specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up afeb9260 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/codecs/88pm860x-codec.c +5 -4
@@ -1172,7 +1172,7 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable Audio PLL & Audio section */ data =AUDIO_PLL |AUDIO_SECTION_RESET |AUDIO_SECTION_ON ;
@@ -1185,7 +1185,7 @@ static int pm860x_set_bias_level(struct snd_soc_codec *codec,pm860x_set_bits (codec->control_data,REG_MISC2 , data,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1346,6 +1346,7 @@ EXPORT_SYMBOL_GPL(pm860x_mic_jack_detect);static int pm860x_probe (struct snd_soc_codec *codec) {struct pm860x_priv *pm860x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int i, ret; pm860x->codec = codec;
@@ -1374,9 +1375,9 @@ static int pm860x_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, pm860x_snd_controls,ARRAY_SIZE (pm860x_snd_controls)); -snd_soc_dapm_new_controls (codec, pm860x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, pm860x_dapm_widgets,ARRAY_SIZE (pm860x_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; out_codec:
sound/soc/codecs/ad1836.c +3 -2
@@ -220,6 +220,7 @@ static struct snd_soc_dai_driver ad1836_dai = {static int ad1836_probe (struct snd_soc_codec *codec) {struct ad1836_priv *ad1836 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ; codec->control_data = ad1836->control_data;
@@ -252,9 +253,9 @@ static int ad1836_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, ad1836_snd_controls,ARRAY_SIZE (ad1836_snd_controls)); -snd_soc_dapm_new_controls (codec, ad1836_dapm_widgets, +snd_soc_dapm_new_controls (dapm, ad1836_dapm_widgets,ARRAY_SIZE (ad1836_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/ad193x.c +3 -2
@@ -353,6 +353,7 @@ static struct snd_soc_dai_driver ad193x_dai = {static int ad193x_probe (struct snd_soc_codec *codec) {struct ad193x_priv *ad193x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; codec->control_data = ad193x->control_data;
@@ -385,9 +386,9 @@ static int ad193x_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, ad193x_snd_controls,ARRAY_SIZE (ad193x_snd_controls)); -snd_soc_dapm_new_controls (codec, ad193x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, ad193x_dapm_widgets,ARRAY_SIZE (ad193x_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/ak4535.c +5 -4
@@ -290,10 +290,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int ak4535_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ak4535_dapm_widgets, -ARRAY_SIZE (ak4535_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, ak4535_dapm_widgets, +ARRAY_SIZE (ak4535_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -399,7 +400,7 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,ak4535_write (codec,AK4535_PM1 , i & (~0x80 ));break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/ak4642.c +1 -1
@@ -26,7 +26,7 @@#include <linux/i2c.h> #include <linux/platform_device.h> #include <linux/slab.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h>
sound/soc/codecs/ak4671.c +5 -4
@@ -437,10 +437,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int ak4671_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ak4671_dapm_widgets, -ARRAY_SIZE (ak4671_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, ak4671_dapm_widgets, +ARRAY_SIZE (ak4671_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -602,7 +603,7 @@ static int ak4671_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,AK4671_AD_DA_POWER_MANAGEMENT ,0x00 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/alc5623.c +12 -11
@@ -832,7 +832,7 @@ static int alc5623_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,ALC5623_PWR_MANAG_ADD1 ,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -888,10 +888,10 @@ static int alc5623_resume(struct snd_soc_codec *codec)alc5623_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge alc5623 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) {alc5623_set_bias_level (codec,SND_SOC_BIAS_STANDBY ); - codec->bias_level =SND_SOC_BIAS_ON ; -alc5623_set_bias_level (codec, codec->bias_level); + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +alc5623_set_bias_level (codec, codec->dapm.bias_level); }return 0 ;
@@ -900,6 +900,7 @@ static int alc5623_resume(struct snd_soc_codec *codec)static int alc5623_probe (struct snd_soc_codec *codec) {struct alc5623_priv *alc5623 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; ret =snd_soc_codec_set_cache_io (codec,8 ,16 , alc5623->control_type);
@@ -943,24 +944,24 @@ static int alc5623_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, alc5623_snd_controls,ARRAY_SIZE (alc5623_snd_controls)); -snd_soc_dapm_new_controls (codec, alc5623_dapm_widgets, +snd_soc_dapm_new_controls (dapm, alc5623_dapm_widgets,ARRAY_SIZE (alc5623_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));switch (alc5623->id) {default :case 0x21 :case 0x22 : -snd_soc_dapm_new_controls (codec, alc5623_dapm_amp_widgets, +snd_soc_dapm_new_controls (dapm, alc5623_dapm_amp_widgets,ARRAY_SIZE (alc5623_dapm_amp_widgets)); -snd_soc_dapm_add_routes (codec, intercon_amp_spk, -ARRAY_SIZE (intercon_amp_spk)); +snd_soc_dapm_add_routes (dapm, intercon_amp_spk, +ARRAY_SIZE (intercon_amp_spk));break ;case 0x23 : -snd_soc_dapm_add_routes (codec, intercon_spk, -ARRAY_SIZE (intercon_spk)); +snd_soc_dapm_add_routes (dapm, intercon_spk, +ARRAY_SIZE (intercon_spk));break ; }
sound/soc/codecs/cq93vc.c +1 -1
@@ -116,7 +116,7 @@ static int cq93vc_set_bias_level(struct snd_soc_codec *codec, DAVINCI_VC_REG12_POWER_ALL_OFF);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/cs42l51.c +3 -2
@@ -519,6 +519,7 @@ static struct snd_soc_dai_driver cs42l51_dai = {static int cs42l51_probe (struct snd_soc_codec *codec) {struct cs42l51_private *cs42l51 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, reg; codec->control_data = cs42l51->control_data;
@@ -550,9 +551,9 @@ static int cs42l51_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, cs42l51_snd_controls,ARRAY_SIZE (cs42l51_snd_controls)); -snd_soc_dapm_new_controls (codec, cs42l51_dapm_widgets, +snd_soc_dapm_new_controls (dapm, cs42l51_dapm_widgets,ARRAY_SIZE (cs42l51_dapm_widgets)); -snd_soc_dapm_add_routes (codec, cs42l51_routes, +snd_soc_dapm_add_routes (dapm, cs42l51_routes,ARRAY_SIZE (cs42l51_routes));return 0 ;
sound/soc/codecs/cx20442.c +8 -7
@@ -18,7 +18,7 @@#include <sound/core.h> #include <sound/initval.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include "cx20442.h"
@@ -89,10 +89,11 @@ static const struct snd_soc_dapm_route cx20442_audio_map[] = {static int cx20442_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, cx20442_dapm_widgets, -ARRAY_SIZE (cx20442_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, cx20442_audio_map, +snd_soc_dapm_new_controls (dapm, cx20442_dapm_widgets, +ARRAY_SIZE (cx20442_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, cx20442_audio_map,ARRAY_SIZE (cx20442_audio_map));return 0 ;
@@ -263,7 +264,7 @@ static void v253_close(struct tty_struct *tty)/* Prevent the codec driver from further accessing the modem */ codec->hw_write =NULL ; cx20442->control_data =NULL ; - codec->pop_time =0 ; + codec->dapm.pop_time =0 ; }/* Line discipline .hangup() */
@@ -291,7 +292,7 @@ static void v253_receive(struct tty_struct *tty,/* Set up codec driver access to modem controls */ cx20442->control_data = tty; codec->hw_write = (hw_write_t )tty->ops->write; - codec->pop_time =1 ; + codec->dapm.pop_time =1 ; } }
@@ -348,7 +349,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) cx20442->control_data =NULL ; codec->hw_write =NULL ; - codec->pop_time =0 ; + codec->dapm.pop_time =0 ;return 0 ; }
sound/soc/codecs/da7210.c +1 -1
@@ -21,7 +21,7 @@#include <linux/slab.h> #include <sound/pcm.h> #include <sound/pcm_params.h> -#include <sound/soc-dapm.h> +#include <sound/soc.h> #include <sound/initval.h> #include <sound/tlv.h>
sound/soc/codecs/jz4740.c +6 -4
@@ -266,7 +266,7 @@ static int jz4740_codec_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY :/* The only way to clear the suspend flag is to reset the codec */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )jz4740_codec_wakeup (codec); mask = JZ4740_CODEC_1_VREF_DISABLE |
@@ -288,23 +288,25 @@ static int jz4740_codec_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }static int jz4740_codec_dev_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_update_bits (codec,JZ4740_REG_CODEC_1 ,JZ4740_CODEC_1_SW2_ENABLE ,JZ4740_CODEC_1_SW2_ENABLE );snd_soc_add_controls (codec, jz4740_codec_controls,ARRAY_SIZE (jz4740_codec_controls)); -snd_soc_dapm_new_controls (codec, jz4740_codec_dapm_widgets, +snd_soc_dapm_new_controls (dapm, jz4740_codec_dapm_widgets,ARRAY_SIZE (jz4740_codec_dapm_widgets)); -snd_soc_dapm_add_routes (codec, jz4740_codec_dapm_routes, +snd_soc_dapm_add_routes (dapm, jz4740_codec_dapm_routes,ARRAY_SIZE (jz4740_codec_dapm_routes));snd_soc_dapm_new_widgets (codec);
sound/soc/codecs/max98088.c +7 -5
@@ -1224,15 +1224,17 @@ static const struct snd_soc_dapm_route audio_map[] = {static int max98088_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, max98088_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, max98088_dapm_widgets,ARRAY_SIZE (max98088_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));snd_soc_add_controls (codec, max98088_snd_controls,ARRAY_SIZE (max98088_snd_controls)); -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -1617,7 +1619,7 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )max98088_sync_cache (codec); snd_soc_update_bits(codec, M98088_REG_4C_PWR_EN_IN,
@@ -1630,7 +1632,7 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec, codec->cache_sync =1 ;break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/ssm2602.c +5 -4
@@ -207,10 +207,11 @@ static const struct snd_soc_dapm_route audio_conn[] = {static int ssm2602_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, ssm2602_dapm_widgets, -ARRAY_SIZE (ssm2602_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_conn,ARRAY_SIZE (audio_conn)); +snd_soc_dapm_new_controls (dapm, ssm2602_dapm_widgets, +ARRAY_SIZE (ssm2602_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_conn,ARRAY_SIZE (audio_conn));return 0 ; }
@@ -493,7 +494,7 @@ static int ssm2602_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/stac9766.c +2 -1
@@ -24,6 +24,7 @@#include <sound/initval.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-dapm.h> #include <sound/tlv.h> #include "stac9766.h"
@@ -236,7 +237,7 @@ static int stac9766_set_bias_level(struct snd_soc_codec *codec,stac9766_ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/tlv320aic23.c +5 -4
@@ -391,11 +391,12 @@ static int set_sample_rate_control(struct snd_soc_codec *codec, int mclk,static int tlv320aic23_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, -ARRAY_SIZE (tlv320aic23_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets, +ARRAY_SIZE (tlv320aic23_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -574,7 +575,7 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,tlv320aic23_write (codec,TLV320AIC23_PWR ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/tlv320aic3x.c +12 -10
@@ -183,7 +183,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,if (snd_soc_test_bits (widget->codec, reg, val_mask, val)) {/* find dapm widget path assoc with kcontrol */ -list_for_each_entry (path, &widget->codec->dapm_paths, list) { +list_for_each_entry (path, &widget->dapm->paths, list) {if (path->kcontrol != kcontrol)continue ;
@@ -199,7 +199,7 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol, }if (found) -snd_soc_dapm_sync (widget->codec); +snd_soc_dapm_sync (widget->dapm); } ret =snd_soc_update_bits (widget->codec, reg, val_mask, val);
@@ -788,17 +788,19 @@ static const struct snd_soc_dapm_route intercon_3007[] = {static int aic3x_add_widgets (struct snd_soc_codec *codec) {struct aic3x_priv *aic3x =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, aic3x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3x_dapm_widgets,ARRAY_SIZE (aic3x_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));if (aic3x->model ==AIC3X_MODEL_3007 ) { -snd_soc_dapm_new_controls (codec, aic3007_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3007_dapm_widgets,ARRAY_SIZE (aic3007_dapm_widgets)); -snd_soc_dapm_add_routes (codec, intercon_3007,ARRAY_SIZE (intercon_3007)); +snd_soc_dapm_add_routes (dapm, intercon_3007, +ARRAY_SIZE (intercon_3007)); }return 0 ;
@@ -1135,7 +1137,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_ON :break ;case SND_SOC_BIAS_PREPARE : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY && +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY && aic3x->master) {/* enable pll */ reg =snd_soc_read (codec,AIC3X_PLL_PROGA_REG );
@@ -1146,7 +1148,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :if (!aic3x->power)aic3x_set_power (codec,1 ); -if (codec->bias_level ==SND_SOC_BIAS_PREPARE && +if (codec->dapm.bias_level ==SND_SOC_BIAS_PREPARE && aic3x->master) {/* disable pll */ reg =snd_soc_read (codec,AIC3X_PLL_PROGA_REG );
@@ -1159,7 +1161,7 @@ static int aic3x_set_bias_level(struct snd_soc_codec *codec,aic3x_set_power (codec,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1351,7 +1353,7 @@ static int aic3x_probe(struct snd_soc_codec *codec) codec->control_data = aic3x->control_data; aic3x->codec = codec; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,8 ,8 , aic3x->control_type);if (ret !=0 ) {
sound/soc/codecs/tlv320dac33.c +8 -7
@@ -622,11 +622,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int dac33_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, dac33_dapm_widgets, -ARRAY_SIZE (dac33_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, dac33_dapm_widgets, +ARRAY_SIZE (dac33_dapm_widgets));/* set up audio path interconnects */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -643,7 +644,7 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Coming from OFF, switch on the codec */ ret =dac33_hard_power (codec,1 );if (ret !=0 )
@@ -654,14 +655,14 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_OFF :/* Do not power off, when the codec is already off */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )return 0 ; ret =dac33_hard_power (codec,0 );if (ret !=0 )return ret;break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1405,7 +1406,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec) codec->control_data = dac33->control_data; codec->hw_write = (hw_write_t ) i2c_master_send; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; dac33->codec = codec;/* Read the tlv320dac33 ID registers */
sound/soc/codecs/tpa6130a2.c +3 -2
@@ -388,16 +388,17 @@ static const struct snd_soc_dapm_route audio_map[] = {int tpa6130a2_add_controls (struct snd_soc_codec *codec) {struct tpa6130a2_data *data; +struct snd_soc_dapm_context *dapm = &codec->dapm;if (tpa6130a2_client ==NULL )return -ENODEV ; data =i2c_get_clientdata (tpa6130a2_client); -snd_soc_dapm_new_controls (codec, tpa6130a2_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tpa6130a2_dapm_widgets,ARRAY_SIZE (tpa6130a2_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (data->id ==TPA6140A2 ) return snd_soc_add_controls(codec, tpa6140a2_controls,
sound/soc/codecs/twl4030.c +7 -6
@@ -1621,10 +1621,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int twl4030_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, twl4030_dapm_widgets, -ARRAY_SIZE (twl4030_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, twl4030_dapm_widgets, +ARRAY_SIZE (twl4030_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -1638,14 +1639,14 @@ static int twl4030_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF )twl4030_codec_enable (codec,1 );break ;case SND_SOC_BIAS_OFF :twl4030_codec_enable (codec,0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -2245,7 +2246,7 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)snd_soc_codec_set_drvdata (codec, twl4030);/* Set the defaults, and power up the codec */ twl4030->sysclk =twl4030_codec_get_mclk () /1000 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;twl4030_init_chip (codec);
sound/soc/codecs/twl6040.c +6 -6
@@ -641,12 +641,12 @@ static const struct snd_soc_dapm_route intercon[] = {static int twl6040_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, twl6040_dapm_widgets, -ARRAY_SIZE (twl6040_dapm_widgets)); - -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_controls (dapm, twl6040_dapm_widgets, +ARRAY_SIZE (twl6040_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -739,7 +739,7 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/uda134x.c +1 -1
@@ -389,7 +389,7 @@ static int uda134x_set_bias_level(struct snd_soc_codec *codec, pd->power (0 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/uda1380.c +7 -6
@@ -414,10 +414,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int uda1380_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, uda1380_dapm_widgets, -ARRAY_SIZE (uda1380_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, uda1380_dapm_widgets, +ARRAY_SIZE (uda1380_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -603,7 +604,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,int reg;struct uda1380_platform_data *pdata = codec->dev->platform_data; -if (codec->bias_level == level) +if (codec->dapm.bias_level == level)return 0 ;switch (level) {
@@ -613,7 +614,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,uda1380_write (codec,UDA1380_PM ,R02_PON_BIAS | pm);break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {if (gpio_is_valid (pdata->gpio_power)) {gpio_set_value (pdata->gpio_power,1 );mdelay (1 );
@@ -636,7 +637,7 @@ static int uda1380_set_bias_level(struct snd_soc_codec *codec,for (reg =UDA1380_MVOL ; reg <UDA1380_CACHEREGNUM ; reg++)set_bit (reg -0x10 , &uda1380_cache_dirty); } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm2000.c +3 -2
@@ -705,6 +705,7 @@ static const struct snd_soc_dapm_route audio_map[] = {/* Called from the machine driver */ int wm2000_add_controls (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;if (!wm2000_i2c) {
@@ -712,12 +713,12 @@ int wm2000_add_controls(struct snd_soc_codec *codec)return -ENODEV ; } - ret =snd_soc_dapm_new_controls (codec, wm2000_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, wm2000_dapm_widgets,ARRAY_SIZE (wm2000_dapm_widgets));if (ret <0 )return ret; - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret <0 )return ret;
sound/soc/codecs/wm8350.c +15 -13
@@ -230,8 +230,9 @@ static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)*/ static void wm8350_pga_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, delayed_work.work); +struct snd_soc_codec *codec = dapm->codec;struct wm8350_data *wm8350_data =snd_soc_codec_get_drvdata (codec);struct wm8350_output *out1 = &wm8350_data->out1, *out2 = &wm8350_data->out2;
@@ -302,8 +303,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_UP ; out->active =1 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm.delayed_work)) +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (1 ));break ;
@@ -311,8 +312,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_DOWN ; out->active =0 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm.delayed_work)) +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (1 ));break ; }
@@ -786,9 +787,10 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8350_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; - ret =snd_soc_dapm_new_controls (codec, + ret =snd_soc_dapm_new_controls (dapm, wm8350_dapm_widgets,ARRAY_SIZE (wm8350_dapm_widgets));if (ret !=0 ) {
@@ -797,7 +799,7 @@ static int wm8350_add_widgets(struct snd_soc_codec *codec) }/* set up audio paths */ - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret !=0 ) {dev_err (codec->dev,"DAPM route register failed\n" );return ret;
@@ -1184,7 +1186,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (priv->supplies), priv->supplies);if (ret !=0 )
@@ -1317,7 +1319,7 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec, priv->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1550,7 +1552,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)/* Put the codec into reset if it wasn't already */ wm8350_clear_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA ); -INIT_DELAYED_WORK (&codec->delayed_work, wm8350_pga_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8350_pga_work);/* Enable the codec */ wm8350_set_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA );
@@ -1635,12 +1637,12 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) priv->mic.jack =NULL ;/* cancel any work waiting to be queued. */ - ret =cancel_delayed_work (&codec->delayed_work); + ret =cancel_delayed_work (&codec->dapm.delayed_work);/* if there was any work waiting then we run it now and * wait for its completion */ if (ret) { -schedule_delayed_work (&codec->delayed_work,0 ); +schedule_delayed_work (&codec->dapm.delayed_work,0 );flush_scheduled_work (); }
sound/soc/codecs/wm8400.c +6 -5
@@ -911,10 +911,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8400_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8400_dapm_widgets, -ARRAY_SIZE (wm8400_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8400_dapm_widgets, +ARRAY_SIZE (wm8400_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1219,7 +1220,7 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (power), &power[0 ]);if (ret !=0 ) {
@@ -1306,7 +1307,7 @@ static int wm8400_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8510.c +6 -5
@@ -216,10 +216,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8510_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8510_dapm_widgets, -ARRAY_SIZE (wm8510_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8510_dapm_widgets, +ARRAY_SIZE (wm8510_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -478,7 +479,7 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY : power1 |=WM8510_POWER1_BIASEN |WM8510_POWER1_BUFIOEN ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8510_POWER1 , power1 |0x3 );mdelay (100 );
@@ -495,7 +496,7 @@ static int wm8510_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8523.c +6 -5
@@ -110,10 +110,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8523_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8523_dapm_widgets, -ARRAY_SIZE (wm8523_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8523_dapm_widgets, +ARRAY_SIZE (wm8523_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -328,7 +329,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8523->supplies), wm8523->supplies);if (ret !=0 ) {
@@ -367,7 +368,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, wm8523->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8580.c +6 -5
@@ -302,10 +302,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8580_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8580_dapm_widgets, -ARRAY_SIZE (wm8580_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8580_dapm_widgets, +ARRAY_SIZE (wm8580_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -767,7 +768,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Power up and get individual control of the DACs */ reg =snd_soc_read (codec,WM8580_PWRDN1 ); reg &= ~(WM8580_PWRDN1_PWDN |WM8580_PWRDN1_ALLDACPD );
@@ -785,7 +786,7 @@ static int wm8580_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8580_PWRDN1 , reg |WM8580_PWRDN1_PWDN );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8711.c +5 -4
@@ -93,10 +93,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8711_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8711_dapm_widgets, -ARRAY_SIZE (wm8711_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8711_dapm_widgets, +ARRAY_SIZE (wm8711_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -318,7 +319,7 @@ static int wm8711_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8711_PWR ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8728.c +6 -5
@@ -73,10 +73,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8728_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8728_dapm_widgets, -ARRAY_SIZE (wm8728_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8728_dapm_widgets, +ARRAY_SIZE (wm8728_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -180,7 +181,7 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_ON :case SND_SOC_BIAS_PREPARE :case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Power everything up... */ reg =snd_soc_read (codec,WM8728_DACCTL );snd_soc_write (codec,WM8728_DACCTL , reg & ~0x4 );
@@ -197,7 +198,7 @@ static int wm8728_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8728_DACCTL , reg |0x4 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8731.c +7 -6
@@ -165,10 +165,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8731_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8731_dapm_widgets, -ARRAY_SIZE (wm8731_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8731_dapm_widgets, +ARRAY_SIZE (wm8731_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -319,7 +320,7 @@ static int wm8731_set_dai_sysclk(struct snd_soc_dai *codec_dai,return -EINVAL ; } -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (&codec->dapm);return 0 ; }
@@ -399,7 +400,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8731->supplies), wm8731->supplies);if (ret !=0 )
@@ -428,7 +429,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, wm8731->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8741.c +4 -3
@@ -95,10 +95,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8741_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8741_dapm_widgets, -ARRAY_SIZE (wm8741_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8741_dapm_widgets, +ARRAY_SIZE (wm8741_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
sound/soc/codecs/wm8750.c +6 -5
@@ -399,10 +399,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8750_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8750_dapm_widgets, -ARRAY_SIZE (wm8750_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8750_dapm_widgets, +ARRAY_SIZE (wm8750_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -615,7 +616,7 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Set VMID to 5k */ snd_soc_write (codec,WM8750_PWR1 , pwr_reg |0x01c1 );
@@ -630,7 +631,7 @@ static int wm8750_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8750_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8753.c +16 -13
@@ -670,10 +670,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8753_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8753_dapm_widgets, -ARRAY_SIZE (wm8753_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8753_dapm_widgets, +ARRAY_SIZE (wm8753_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1292,7 +1293,7 @@ static int wm8753_set_bias_level(struct snd_soc_codec *codec,wm8753_write (codec,WM8753_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1482,9 +1483,11 @@ static void wm8753_set_dai_mode(struct snd_soc_codec *codec,static void wm8753_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); -wm8753_set_bias_level (codec, codec->bias_level); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, + delayed_work.work); +struct snd_soc_codec *codec = dapm->codec; +wm8753_set_bias_level (codec, dapm->bias_level); }static int wm8753_suspend (struct snd_soc_codec *codec,pm_message_t state)
@@ -1516,10 +1519,10 @@ static int wm8753_resume(struct snd_soc_codec *codec)wm8753_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge wm8753 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) {wm8753_set_bias_level (codec,SND_SOC_BIAS_PREPARE ); - codec->bias_level =SND_SOC_BIAS_ON ; -schedule_delayed_work (&codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (caps_charge)); }
@@ -1550,7 +1553,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)struct wm8753_priv *wm8753 =snd_soc_codec_get_drvdata (codec);int ret =0 , reg; -INIT_DELAYED_WORK (&codec->delayed_work, wm8753_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8753_work); ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8753->control_type);if (ret <0 ) {
@@ -1569,7 +1572,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)/* charge output caps */ wm8753_set_bias_level (codec,SND_SOC_BIAS_PREPARE ); -schedule_delayed_work (&codec->delayed_work, +schedule_delayed_work (&codec->dapm.delayed_work,msecs_to_jiffies (caps_charge));/* set the update bits */
@@ -1604,7 +1607,7 @@ static int wm8753_probe(struct snd_soc_codec *codec)/* power down chip */ static int wm8753_remove (struct snd_soc_codec *codec) { -run_delayed_work (&codec->delayed_work); +run_delayed_work (&codec->dapm.delayed_work);wm8753_set_bias_level (codec,SND_SOC_BIAS_OFF );return 0 ;
sound/soc/codecs/wm8776.c +5 -4
@@ -307,7 +307,7 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_PREPARE :break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Disable the global powerdown; DAPM does the rest */ snd_soc_update_bits (codec,WM8776_PWRDOWN ,1 ,0 ); }
@@ -318,7 +318,7 @@ static int wm8776_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -405,6 +405,7 @@ static int wm8776_resume(struct snd_soc_codec *codec)static int wm8776_probe (struct snd_soc_codec *codec) {struct wm8776_priv *wm8776 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ; ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8776->control_type);
@@ -428,9 +429,9 @@ static int wm8776_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8776_snd_controls,ARRAY_SIZE (wm8776_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8776_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8776_dapm_widgets,ARRAY_SIZE (wm8776_dapm_widgets)); -snd_soc_dapm_add_routes (codec, routes,ARRAY_SIZE (routes)); +snd_soc_dapm_add_routes (dapm, routes,ARRAY_SIZE (routes));return ret; }
sound/soc/codecs/wm8804.c +3 -3
@@ -515,7 +515,7 @@ static int wm8804_set_bias_level(struct snd_soc_codec *codec,snd_soc_update_bits (codec,WM8804_PWRDN ,0x9 ,0 );break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8804->supplies), wm8804->supplies);if (ret) {
@@ -537,7 +537,7 @@ static int wm8804_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -581,7 +581,7 @@ static int wm8804_probe(struct snd_soc_codec *codec) wm8804 =snd_soc_codec_get_drvdata (codec); wm8804->codec = codec; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,8 ,8 , wm8804->control_type);if (ret <0 ) {
sound/soc/codecs/wm8900.c +6 -5
@@ -611,10 +611,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8900_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8900_dapm_widgets, -ARRAY_SIZE (wm8900_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8900_dapm_widgets, +ARRAY_SIZE (wm8900_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1051,7 +1052,7 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :/* Charge capacitors if initial power up */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* STARTUP_BIAS_ENA on */ snd_soc_write (codec,WM8900_REG_POWER1 ,WM8900_REG_POWER1_STARTUP_BIAS_ENA );
@@ -1119,7 +1120,7 @@ static int wm8900_set_bias_level(struct snd_soc_codec *codec, WM8900_REG_POWER2_SYSCLK_ENA);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8903.c +6 -5
@@ -923,10 +923,11 @@ static const struct snd_soc_dapm_route intercon[] = {static int wm8903_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8903_dapm_widgets, -ARRAY_SIZE (wm8903_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_new_controls (dapm, wm8903_dapm_widgets, +ARRAY_SIZE (wm8903_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ; }
@@ -946,7 +947,7 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {snd_soc_write (codec,WM8903_CLOCK_RATES_2 ,WM8903_CLK_SYS_ENA );
@@ -991,7 +992,7 @@ static int wm8903_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8904.c +17 -16
@@ -1428,10 +1428,11 @@ static const struct snd_soc_dapm_route wm8912_intercon[] = {static int wm8904_add_widgets (struct snd_soc_codec *codec) {struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, wm8904_core_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_core_dapm_widgets,ARRAY_SIZE (wm8904_core_dapm_widgets)); -snd_soc_dapm_add_routes (codec, core_intercon, +snd_soc_dapm_add_routes (dapm, core_intercon,ARRAY_SIZE (core_intercon));switch (wm8904->devtype) {
@@ -1443,20 +1444,20 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8904_snd_controls,ARRAY_SIZE (wm8904_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8904_adc_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_adc_dapm_widgets,ARRAY_SIZE (wm8904_adc_dapm_widgets)); -snd_soc_dapm_new_controls (codec, wm8904_dac_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dac_dapm_widgets,ARRAY_SIZE (wm8904_dac_dapm_widgets)); -snd_soc_dapm_new_controls (codec, wm8904_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dapm_widgets,ARRAY_SIZE (wm8904_dapm_widgets)); -snd_soc_dapm_add_routes (codec, core_intercon, +snd_soc_dapm_add_routes (dapm, core_intercon,ARRAY_SIZE (core_intercon)); -snd_soc_dapm_add_routes (codec, adc_intercon, +snd_soc_dapm_add_routes (dapm, adc_intercon,ARRAY_SIZE (adc_intercon)); -snd_soc_dapm_add_routes (codec, dac_intercon, +snd_soc_dapm_add_routes (dapm, dac_intercon,ARRAY_SIZE (dac_intercon)); -snd_soc_dapm_add_routes (codec, wm8904_intercon, +snd_soc_dapm_add_routes (dapm, wm8904_intercon,ARRAY_SIZE (wm8904_intercon));break ;
@@ -1464,17 +1465,17 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8904_dac_snd_controls,ARRAY_SIZE (wm8904_dac_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8904_dac_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8904_dac_dapm_widgets,ARRAY_SIZE (wm8904_dac_dapm_widgets)); -snd_soc_dapm_add_routes (codec, dac_intercon, +snd_soc_dapm_add_routes (dapm, dac_intercon,ARRAY_SIZE (dac_intercon)); -snd_soc_dapm_add_routes (codec, wm8912_intercon, +snd_soc_dapm_add_routes (dapm, wm8912_intercon,ARRAY_SIZE (wm8912_intercon));break ; } -snd_soc_dapm_new_widgets (codec); +snd_soc_dapm_new_widgets (dapm);return 0 ; }
@@ -2139,7 +2140,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8904->supplies), wm8904->supplies);if (ret !=0 ) {
@@ -2198,7 +2199,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, wm8904->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -2373,7 +2374,7 @@ static int wm8904_probe(struct snd_soc_codec *codec)int ret, i; codec->cache_sync =1 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;switch (wm8904->devtype) {case WM8904 :
sound/soc/codecs/wm8940.c +3 -2
@@ -291,13 +291,14 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8940_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; - ret =snd_soc_dapm_new_controls (codec, wm8940_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, wm8940_dapm_widgets,ARRAY_SIZE (wm8940_dapm_widgets));if (ret) goto error_ret; - ret =snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); + ret =snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));if (ret) goto error_ret;
sound/soc/codecs/wm8955.c +6 -5
@@ -577,13 +577,14 @@ static const struct snd_soc_dapm_route wm8955_intercon[] = {static int wm8955_add_widgets (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_add_controls (codec, wm8955_snd_controls,ARRAY_SIZE (wm8955_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8955_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8955_dapm_widgets,ARRAY_SIZE (wm8955_dapm_widgets)); - -snd_soc_dapm_add_routes (codec, wm8955_intercon, +snd_soc_dapm_add_routes (dapm, wm8955_intercon,ARRAY_SIZE (wm8955_intercon));return 0 ;
@@ -786,7 +787,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8955->supplies), wm8955->supplies);if (ret !=0 ) {
@@ -850,7 +851,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec, wm8955->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8960.c +13 -12
@@ -388,27 +388,28 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec) {struct wm8960_data *pdata = codec->dev->platform_data;struct wm8960_priv *wm8960 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;struct snd_soc_dapm_widget *w; -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets,ARRAY_SIZE (wm8960_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));/* In capless mode OUT3 is used to provide VMID for the * headphone outputs, otherwise it is used as a mono mixer. */ if (pdata && pdata->capless) { -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets_capless, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets_capless,ARRAY_SIZE (wm8960_dapm_widgets_capless)); -snd_soc_dapm_add_routes (codec, audio_paths_capless, +snd_soc_dapm_add_routes (dapm, audio_paths_capless,ARRAY_SIZE (audio_paths_capless)); }else { -snd_soc_dapm_new_controls (codec, wm8960_dapm_widgets_out3, +snd_soc_dapm_new_controls (dapm, wm8960_dapm_widgets_out3,ARRAY_SIZE (wm8960_dapm_widgets_out3)); -snd_soc_dapm_add_routes (codec, audio_paths_out3, +snd_soc_dapm_add_routes (dapm, audio_paths_out3,ARRAY_SIZE (audio_paths_out3)); }
@@ -417,7 +418,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)* list each time to find the desired power state do so now * and save the result. */ -list_for_each_entry (w, &codec->dapm_widgets, list) { +list_for_each_entry (w, &codec->dapm.widgets, list) {if (strcmp (w->name,"LOUT1 PGA" ) ==0 ) wm8960->lout1 = w;if (strcmp (w->name,"ROUT1 PGA" ) ==0 )
@@ -572,7 +573,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable anti-pop features */ snd_soc_write(codec, WM8960_APOP1, WM8960_POBCTRL | WM8960_SOFT_ST |
@@ -610,7 +611,7 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -626,7 +627,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_PREPARE : -switch (codec->bias_level) { +switch (codec->dapm.bias_level) {case SND_SOC_BIAS_STANDBY :/* Enable anti pop mode */ snd_soc_update_bits(codec, WM8960_APOP1,
@@ -681,7 +682,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -switch (codec->bias_level) { +switch (codec->dapm.bias_level) {case SND_SOC_BIAS_PREPARE :/* Disable HP discharge */ snd_soc_update_bits(codec, WM8960_APOP2,
@@ -705,7 +706,7 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8961.c +6 -5
@@ -882,7 +882,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_PREPARE : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY ) {/* Enable bias generation */ reg =snd_soc_read (codec,WM8961_ANTI_POP ); reg |=WM8961_BUFIOEN |WM8961_BUFDCOPEN ;
@@ -897,7 +897,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_PREPARE ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_PREPARE ) {/* VREF off */ reg =snd_soc_read (codec,WM8961_PWR_MGMT_1 ); reg &= ~WM8961_VREF ;
@@ -919,7 +919,7 @@ static int wm8961_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -959,6 +959,7 @@ static struct snd_soc_dai_driver wm8961_dai = {static int wm8961_probe (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ;u16 reg;
@@ -1024,9 +1025,9 @@ static int wm8961_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8961_snd_controls,ARRAY_SIZE (wm8961_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8961_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8961_dapm_widgets,ARRAY_SIZE (wm8961_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return 0 ; }
sound/soc/codecs/wm8962.c +16 -14
@@ -2682,6 +2682,7 @@ static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = {static int wm8962_add_widgets (struct snd_soc_codec *codec) {struct wm8962_pdata *pdata =dev_get_platdata (codec->dev); +struct snd_soc_dapm_context *dapm = &codec->dapm;snd_soc_add_controls (codec, wm8962_snd_controls,ARRAY_SIZE (wm8962_snd_controls));
@@ -2693,26 +2694,26 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec) ARRAY_SIZE(wm8962_spk_stereo_controls)); -snd_soc_dapm_new_controls (codec, wm8962_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_widgets,ARRAY_SIZE (wm8962_dapm_widgets));if (pdata && pdata->spk_mono) -snd_soc_dapm_new_controls (codec, wm8962_dapm_spk_mono_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_spk_mono_widgets,ARRAY_SIZE (wm8962_dapm_spk_mono_widgets));else -snd_soc_dapm_new_controls (codec, wm8962_dapm_spk_stereo_widgets, +snd_soc_dapm_new_controls (dapm, wm8962_dapm_spk_stereo_widgets,ARRAY_SIZE (wm8962_dapm_spk_stereo_widgets)); -snd_soc_dapm_add_routes (codec, wm8962_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_intercon,ARRAY_SIZE (wm8962_intercon));if (pdata && pdata->spk_mono) -snd_soc_dapm_add_routes (codec, wm8962_spk_mono_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_spk_mono_intercon,ARRAY_SIZE (wm8962_spk_mono_intercon));else -snd_soc_dapm_add_routes (codec, wm8962_spk_stereo_intercon, +snd_soc_dapm_add_routes (dapm, wm8962_spk_stereo_intercon,ARRAY_SIZE (wm8962_spk_stereo_intercon)); -snd_soc_dapm_disable_pin (codec,"Beep" ); +snd_soc_dapm_disable_pin (dapm,"Beep" );return 0 ; }
@@ -2819,7 +2820,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,struct wm8962_priv *wm8962 =snd_soc_codec_get_drvdata (codec);int ret; -if (level == codec->bias_level) +if (level == codec->dapm.bias_level)return 0 ;switch (level) {
@@ -2833,7 +2834,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8962->supplies), wm8962->supplies);if (ret !=0 ) {
@@ -2883,7 +2884,7 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec, wm8962->supplies);break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -3441,6 +3442,7 @@ static void wm8962_beep_work(struct work_struct *work)struct wm8962_priv *wm8962 = container_of(work, struct wm8962_priv, beep_work);struct snd_soc_codec *codec = wm8962->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int i;int reg =0 ;int best =0 ;
@@ -3457,16 +3459,16 @@ static void wm8962_beep_work(struct work_struct *work) reg =WM8962_BEEP_ENA | (best <<WM8962_BEEP_RATE_SHIFT ); -snd_soc_dapm_enable_pin (codec,"Beep" ); +snd_soc_dapm_enable_pin (dapm,"Beep" ); }else {dev_dbg (codec->dev,"Disabling beep\n" ); -snd_soc_dapm_disable_pin (codec,"Beep" ); +snd_soc_dapm_disable_pin (dapm,"Beep" ); }snd_soc_update_bits (codec,WM8962_BEEP_GENERATOR_1 ,WM8962_BEEP_ENA |WM8962_BEEP_RATE_MASK , reg); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm); }/* For usability define a way of injecting beep events for the device -
@@ -3710,7 +3712,7 @@ static int wm8962_probe(struct snd_soc_codec *codec)INIT_DELAYED_WORK (&wm8962->mic_work, wm8962_mic_work); codec->cache_sync =1 ; - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ; ret =snd_soc_codec_set_cache_io (codec,16 ,16 ,SND_SOC_I2C );if (ret !=0 ) {
sound/soc/codecs/wm8971.c +16 -13
@@ -333,10 +333,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8971_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8971_dapm_widgets, -ARRAY_SIZE (wm8971_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8971_dapm_widgets, +ARRAY_SIZE (wm8971_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -553,7 +554,7 @@ static int wm8971_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8971_PWR1 ,0x0001 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -590,9 +591,11 @@ static struct snd_soc_dai_driver wm8971_dai = {static void wm8971_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); -wm8971_set_bias_level (codec, codec->bias_level); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, + delayed_work.work); +struct snd_soc_codec *codec = dapm->codec; +wm8971_set_bias_level (codec, codec->dapm.bias_level); }static int wm8971_suspend (struct snd_soc_codec *codec,pm_message_t state)
@@ -620,11 +623,11 @@ static int wm8971_resume(struct snd_soc_codec *codec)wm8971_set_bias_level (codec,SND_SOC_BIAS_STANDBY );/* charge wm8971 caps */ -if (codec->suspend_bias_level ==SND_SOC_BIAS_ON ) { +if (codec->dapm.suspend_bias_level ==SND_SOC_BIAS_ON ) { reg =snd_soc_read (codec,WM8971_PWR1 ) &0xfe3e ;snd_soc_write (codec,WM8971_PWR1 , reg |0x01c0 ); - codec->bias_level =SND_SOC_BIAS_ON ; -queue_delayed_work (wm8971_workq, &codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_ON ; +queue_delayed_work (wm8971_workq, &codec->dapm.delayed_work,msecs_to_jiffies (1000 )); }
@@ -643,7 +646,7 @@ static int wm8971_probe(struct snd_soc_codec *codec)return ret; } -INIT_DELAYED_WORK (&codec->delayed_work, wm8971_work); +INIT_DELAYED_WORK (&codec->dapm.delayed_work, wm8971_work); wm8971_workq =create_workqueue ("wm8971" );if (wm8971_workq ==NULL )return -ENOMEM ;
@@ -653,8 +656,8 @@ static int wm8971_probe(struct snd_soc_codec *codec)/* charge output caps - set vmid to 5k for quick power up */ reg =snd_soc_read (codec,WM8971_PWR1 ) &0xfe3e ;snd_soc_write (codec,WM8971_PWR1 , reg |0x01c0 ); - codec->bias_level =SND_SOC_BIAS_STANDBY ; -queue_delayed_work (wm8971_workq, &codec->delayed_work, + codec->dapm.bias_level =SND_SOC_BIAS_STANDBY ; +queue_delayed_work (wm8971_workq, &codec->dapm.delayed_work,msecs_to_jiffies (1000 ));/* set the update bits */
sound/soc/codecs/wm8974.c +6 -5
@@ -274,10 +274,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8974_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8974_dapm_widgets, -ARRAY_SIZE (wm8974_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm8974_dapm_widgets, +ARRAY_SIZE (wm8974_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -530,7 +531,7 @@ static int wm8974_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY : power1 |=WM8974_POWER1_BIASEN |WM8974_POWER1_BUFIOEN ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8974_POWER1 , power1 |0x3 );mdelay (100 );
@@ -547,7 +548,7 @@ static int wm8974_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8978.c +6 -5
@@ -355,11 +355,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8978_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8978_dapm_widgets, -ARRAY_SIZE (wm8978_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, wm8978_dapm_widgets, +ARRAY_SIZE (wm8978_dapm_widgets));/* set up the WM8978 audio map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -837,7 +838,7 @@ static int wm8978_set_bias_level(struct snd_soc_codec *codec,/* bit 3: enable bias, bit 2: enable I/O tie off buffer */ power1 |=0xc ; -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Initial cap charge at VMID 5k */ snd_soc_write (codec,WM8978_POWER_MANAGEMENT_1 , power1 |0x3 );
@@ -857,7 +858,7 @@ static int wm8978_set_bias_level(struct snd_soc_codec *codec,dev_dbg (codec->dev,"%s: %d, %x\n" , __func__, level, power1); - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8985.c +6 -5
@@ -533,10 +533,11 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,static int wm8985_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8985_dapm_widgets, -ARRAY_SIZE (wm8985_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map, +snd_soc_dapm_new_controls (dapm, wm8985_dapm_widgets, +ARRAY_SIZE (wm8985_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -879,7 +880,7 @@ static int wm8985_set_bias_level(struct snd_soc_codec *codec, 1 << WM8985_VMIDSEL_SHIFT);break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8985->supplies), wm8985->supplies);if (ret) {
@@ -939,7 +940,7 @@ static int wm8985_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8988.c +5 -4
@@ -677,7 +677,7 @@ static int wm8988_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* VREF, VMID=2x5k */ snd_soc_write (codec,WM8988_PWR1 , pwr_reg |0x1c1 );
@@ -693,7 +693,7 @@ static int wm8988_set_bias_level(struct snd_soc_codec *codec,snd_soc_write (codec,WM8988_PWR1 ,0x0000 );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -759,6 +759,7 @@ static int wm8988_resume(struct snd_soc_codec *codec)static int wm8988_probe (struct snd_soc_codec *codec) {struct wm8988_priv *wm8988 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret =0 ;u16 reg;
@@ -790,9 +791,9 @@ static int wm8988_probe(struct snd_soc_codec *codec)snd_soc_add_controls (codec, wm8988_snd_controls,ARRAY_SIZE (wm8988_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8988_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8988_dapm_widgets,ARRAY_SIZE (wm8988_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/codecs/wm8990.c +6 -5
@@ -914,11 +914,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm8990_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm8990_dapm_widgets, -ARRAY_SIZE (wm8990_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; +snd_soc_dapm_new_controls (dapm, wm8990_dapm_widgets, +ARRAY_SIZE (wm8990_dapm_widgets));/* set up the WM8990 audio map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1170,7 +1171,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Enable all output discharge bits */ snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE | WM8990_DIS_RLINE | WM8990_DIS_OUT3 |
@@ -1266,7 +1267,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm8993.c +5 -4
@@ -970,7 +970,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) { ret =regulator_bulk_enable (ARRAY_SIZE (wm8993->supplies), wm8993->supplies);if (ret !=0 )
@@ -1045,7 +1045,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1424,6 +1424,7 @@ static struct snd_soc_dai_driver wm8993_dai = {static int wm8993_probe (struct snd_soc_codec *codec) {struct wm8993_priv *wm8993 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, i, val; wm8993->hubs_data.hp_startup_mode =1 ;
@@ -1505,11 +1506,11 @@ static int wm8993_probe(struct snd_soc_codec *codec) ARRAY_SIZE(wm8993_eq_controls)); } -snd_soc_dapm_new_controls (codec, wm8993_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8993_dapm_widgets,ARRAY_SIZE (wm8993_dapm_widgets));wm_hubs_add_analogue_controls (codec); -snd_soc_dapm_add_routes (codec, routes,ARRAY_SIZE (routes)); +snd_soc_dapm_add_routes (dapm, routes,ARRAY_SIZE (routes));wm_hubs_add_analogue_routes (codec, wm8993->pdata.lineout1_diff, wm8993->pdata.lineout2_diff);
sound/soc/codecs/wm8994.c +7 -6
@@ -1835,7 +1835,7 @@ static int configure_clock(struct snd_soc_codec *codec)snd_soc_update_bits (codec,WM8994_CLOCKING_1 ,WM8994_SYSCLK_SRC , new); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (&codec->dapm);return 0 ; }
@@ -3108,7 +3108,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Tweak DC servo and DSP configuration for * improved performance. */ if (wm8994->revision <4 ) {
@@ -3152,7 +3152,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_OFF : -if (codec->bias_level ==SND_SOC_BIAS_STANDBY ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_STANDBY ) {/* Switch over to startup biases */ snd_soc_update_bits(codec, WM8994_ANTIPOP_2, WM8994_BIAS_SRC |
@@ -3187,7 +3187,7 @@ static int wm8994_set_bias_level(struct snd_soc_codec *codec, }break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -3895,6 +3895,7 @@ static irqreturn_t wm8994_mic_irq(int irq, void *data)static int wm8994_codec_probe (struct snd_soc_codec *codec) {struct wm8994_priv *wm8994; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret, i; codec->control_data =dev_get_drvdata (codec->dev->parent);
@@ -4033,10 +4034,10 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)wm_hubs_add_analogue_controls (codec);snd_soc_add_controls (codec, wm8994_snd_controls,ARRAY_SIZE (wm8994_snd_controls)); -snd_soc_dapm_new_controls (codec, wm8994_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm8994_dapm_widgets,ARRAY_SIZE (wm8994_dapm_widgets));wm_hubs_add_analogue_routes (codec,0 ,0 ); -snd_soc_dapm_add_routes (codec, intercon,ARRAY_SIZE (intercon)); +snd_soc_dapm_add_routes (dapm, intercon,ARRAY_SIZE (intercon));return 0 ;
sound/soc/codecs/wm9081.c +5 -4
@@ -805,7 +805,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,case SND_SOC_BIAS_STANDBY :/* Initial cold start */ -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Disable LINEOUT discharge */ reg =snd_soc_read (codec,WM9081_ANTI_POP_CONTROL ); reg &= ~WM9081_LINEOUT_DISCH ;
@@ -865,7 +865,7 @@ static int wm9081_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
@@ -1228,6 +1228,7 @@ static struct snd_soc_dai_driver wm9081_dai = {static int wm9081_probe (struct snd_soc_codec *codec) {struct wm9081_priv *wm9081 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;u16 reg;
@@ -1269,9 +1270,9 @@ static int wm9081_probe(struct snd_soc_codec *codec) ARRAY_SIZE(wm9081_eq_controls)); } -snd_soc_dapm_new_controls (codec, wm9081_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm9081_dapm_widgets,ARRAY_SIZE (wm9081_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_paths,ARRAY_SIZE (audio_paths)); +snd_soc_dapm_add_routes (dapm, audio_paths,ARRAY_SIZE (audio_paths));return ret; }
sound/soc/codecs/wm9090.c +9 -8
@@ -443,31 +443,32 @@ static const struct snd_soc_dapm_route audio_map_in2_diff[] = {static int wm9090_add_controls (struct snd_soc_codec *codec) {struct wm9090_priv *wm9090 =snd_soc_codec_get_drvdata (codec); +struct snd_soc_dapm_context *dapm = &codec->dapm;int i; -snd_soc_dapm_new_controls (codec, wm9090_dapm_widgets, +snd_soc_dapm_new_controls (dapm, wm9090_dapm_widgets,ARRAY_SIZE (wm9090_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));snd_soc_add_controls (codec, wm9090_controls,ARRAY_SIZE (wm9090_controls));if (wm9090->pdata.lin1_diff) { -snd_soc_dapm_add_routes (codec, audio_map_in1_diff, +snd_soc_dapm_add_routes (dapm, audio_map_in1_diff,ARRAY_SIZE (audio_map_in1_diff)); }else { -snd_soc_dapm_add_routes (codec, audio_map_in1_se, +snd_soc_dapm_add_routes (dapm, audio_map_in1_se,ARRAY_SIZE (audio_map_in1_se));snd_soc_add_controls (codec, wm9090_in1_se_controls,ARRAY_SIZE (wm9090_in1_se_controls)); }if (wm9090->pdata.lin2_diff) { -snd_soc_dapm_add_routes (codec, audio_map_in2_diff, +snd_soc_dapm_add_routes (dapm, audio_map_in2_diff,ARRAY_SIZE (audio_map_in2_diff)); }else { -snd_soc_dapm_add_routes (codec, audio_map_in2_se, +snd_soc_dapm_add_routes (dapm, audio_map_in2_se,ARRAY_SIZE (audio_map_in2_se));snd_soc_add_controls (codec, wm9090_in2_se_controls,ARRAY_SIZE (wm9090_in2_se_controls));
@@ -514,7 +515,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,break ;case SND_SOC_BIAS_STANDBY : -if (codec->bias_level ==SND_SOC_BIAS_OFF ) { +if (codec->dapm.bias_level ==SND_SOC_BIAS_OFF ) {/* Restore the register cache */ for (i =1 ; i < codec->driver->reg_cache_size; i++) {if (reg_cache[i] == wm9090_reg_defaults[i])
@@ -544,7 +545,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm9705.c +4 -2
@@ -203,9 +203,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9705_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9705_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, wm9705_dapm_widgets,ARRAY_SIZE (wm9705_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/codecs/wm9712.c +5 -4
@@ -432,10 +432,11 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9712_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9712_dapm_widgets, -ARRAY_SIZE (wm9712_dapm_widgets)); +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_new_controls (dapm, wm9712_dapm_widgets, +ARRAY_SIZE (wm9712_dapm_widgets)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -570,7 +571,7 @@ static int wm9712_set_bias_level(struct snd_soc_codec *codec,ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm9713.c +5 -3
@@ -647,10 +647,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int wm9713_add_widgets (struct snd_soc_codec *codec) { -snd_soc_dapm_new_controls (codec, wm9713_dapm_widgets, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_new_controls (dapm, wm9713_dapm_widgets,ARRAY_SIZE (wm9713_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
@@ -1147,7 +1149,7 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec,ac97_write (codec,AC97_POWERDOWN ,0xffff );break ; } - codec->bias_level = level; + codec->dapm.bias_level = level;return 0 ; }
sound/soc/codecs/wm_hubs.c +11 -7
@@ -814,6 +814,8 @@ static const struct snd_soc_dapm_route lineout2_se_routes[] = {int wm_hubs_add_analogue_controls (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +/* Latch volume update bits & default ZC on */ snd_soc_update_bits (codec,WM8993_LEFT_LINE_INPUT_1_2_VOLUME ,WM8993_IN1_VU ,WM8993_IN1_VU );
@@ -842,7 +844,7 @@ int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)snd_soc_add_controls (codec, analogue_snd_controls,ARRAY_SIZE (analogue_snd_controls)); -snd_soc_dapm_new_controls (codec, analogue_dapm_widgets, +snd_soc_dapm_new_controls (dapm, analogue_dapm_widgets,ARRAY_SIZE (analogue_dapm_widgets));return 0 ; }
@@ -851,24 +853,26 @@ EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_controls);int wm_hubs_add_analogue_routes (struct snd_soc_codec *codec,int lineout1_diff,int lineout2_diff) { -snd_soc_dapm_add_routes (codec, analogue_routes, +struct snd_soc_dapm_context *dapm = &codec->dapm; + +snd_soc_dapm_add_routes (dapm, analogue_routes,ARRAY_SIZE (analogue_routes));if (lineout1_diff) -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout1_diff_routes,ARRAY_SIZE (lineout1_diff_routes));else -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout1_se_routes,ARRAY_SIZE (lineout1_se_routes));if (lineout2_diff) -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout2_diff_routes,ARRAY_SIZE (lineout2_diff_routes));else -snd_soc_dapm_add_routes (codec, +snd_soc_dapm_add_routes (dapm, lineout2_se_routes,ARRAY_SIZE (lineout2_se_routes));
@@ -895,7 +899,7 @@ int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec,* VMID as an output and can disable it. */ if (lineout1_diff && lineout2_diff) - codec->idle_bias_off =1 ; + codec->dapm.idle_bias_off =1 ;if (lineout1fb) snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
sound/soc/davinci/davinci-evm.c +11 -10
@@ -132,26 +132,27 @@ static const struct snd_soc_dapm_route audio_map[] = {static int evm_aic3x_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add davinci-evm specific widgets */ -snd_soc_dapm_new_controls (codec, aic3x_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic3x_dapm_widgets,ARRAY_SIZE (aic3x_dapm_widgets));/* Set up davinci-evm specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* not connected */ -snd_soc_dapm_disable_pin (codec,"MONO_LOUT" ); -snd_soc_dapm_disable_pin (codec,"HPLCOM" ); -snd_soc_dapm_disable_pin (codec,"HPRCOM" ); +snd_soc_dapm_disable_pin (dapm,"MONO_LOUT" ); +snd_soc_dapm_disable_pin (dapm,"HPLCOM" ); +snd_soc_dapm_disable_pin (dapm,"HPRCOM" );/* always connected */ -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line Out" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line Out" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/ep93xx/snappercl15.c +3 -2
@@ -79,11 +79,12 @@ static const struct snd_soc_dapm_route audio_map[] = {static int snappercl15_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets)); -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));return 0 ; }
sound/soc/imx/wm1133-ev1.c +4 -3
@@ -213,11 +213,12 @@ static struct snd_soc_jack_pin mic_jack_pins[] = {static int wm1133_ev1_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, wm1133_ev1_widgets, +snd_soc_dapm_new_controls (dapm, wm1133_ev1_widgets,ARRAY_SIZE (wm1133_ev1_widgets)); -snd_soc_dapm_add_routes (codec, wm1133_ev1_map, +snd_soc_dapm_add_routes (dapm, wm1133_ev1_map,ARRAY_SIZE (wm1133_ev1_map));/* Headphone jack detection */
@@ -234,7 +235,7 @@ static int wm1133_ev1_init(struct snd_soc_pcm_runtime *rtd)wm8350_mic_jack_detect (codec, &mic_jack,SND_JACK_MICROPHONE ,SND_JACK_BTN_0 ); -snd_soc_dapm_force_enable_pin (codec,"Mic Bias" ); +snd_soc_dapm_force_enable_pin (dapm,"Mic Bias" );return 0 ; }
sound/soc/jz4740/qi_lb60.c +8 -5
@@ -59,10 +59,11 @@ static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;struct snd_soc_dai *cpu_dai = rtd->cpu_dai; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret; -snd_soc_dapm_nc_pin (codec,"LIN" ); -snd_soc_dapm_nc_pin (codec,"RIN" ); +snd_soc_dapm_nc_pin (dapm,"LIN" ); +snd_soc_dapm_nc_pin (dapm,"RIN" ); ret =snd_soc_dai_set_fmt (cpu_dai,QI_LB60_DAIFMT );if (ret <0 ) {
@@ -70,9 +71,11 @@ static int qi_lb60_codec_init(struct snd_soc_pcm_runtime *rtd)return ret; } -snd_soc_dapm_new_controls (codec, qi_lb60_widgets,ARRAY_SIZE (qi_lb60_widgets)); -snd_soc_dapm_add_routes (codec, qi_lb60_routes,ARRAY_SIZE (qi_lb60_routes)); -snd_soc_dapm_sync (codec); +snd_soc_dapm_new_controls (dapm, qi_lb60_widgets, +ARRAY_SIZE (qi_lb60_widgets)); +snd_soc_dapm_add_routes (dapm, qi_lb60_routes, +ARRAY_SIZE (qi_lb60_routes)); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/kirkwood/kirkwood-t5325.c +7 -6
@@ -69,17 +69,18 @@ static const struct snd_soc_dapm_route t5325_route[] = {static int t5325_dai_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm; -snd_soc_dapm_new_controls (codec, t5325_dapm_widgets, +snd_soc_dapm_new_controls (dapm, t5325_dapm_widgets,ARRAY_SIZE (t5325_dapm_widgets)); -snd_soc_dapm_add_routes (codec, t5325_route,ARRAY_SIZE (t5325_route)); +snd_soc_dapm_add_routes (dapm, t5325_route,ARRAY_SIZE (t5325_route)); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Speaker" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Speaker" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/am3517evm.c +7 -6
@@ -114,20 +114,21 @@ static const struct snd_soc_dapm_route audio_map[] = {static int am3517evm_aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add am3517-evm specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up davinci-evm specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* always connected */ -snd_soc_dapm_enable_pin (codec,"Line Out" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic In" ); +snd_soc_dapm_enable_pin (dapm,"Line Out" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic In" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/ams-delta.c +43 -39
190 lines not on this page · raw message
sound/soc/omap/n810.c +22 -20
83 lines not on this page · raw message
sound/soc/omap/omap3pandora.c +23 -21
74 lines not on this page · raw message
sound/soc/omap/osk5912.c +7 -6
@@ -116,19 +116,20 @@ static const struct snd_soc_dapm_route audio_map[] = {static int osk_tlv320aic23_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;/* Add osk5912 specific widgets */ -snd_soc_dapm_new_controls (codec, tlv320aic23_dapm_widgets, +snd_soc_dapm_new_controls (dapm, tlv320aic23_dapm_widgets,ARRAY_SIZE (tlv320aic23_dapm_widgets));/* Set up osk5912 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_enable_pin (codec,"Headphone Jack" ); -snd_soc_dapm_enable_pin (codec,"Line In" ); -snd_soc_dapm_enable_pin (codec,"Mic Jack" ); +snd_soc_dapm_enable_pin (dapm,"Headphone Jack" ); +snd_soc_dapm_enable_pin (dapm,"Line In" ); +snd_soc_dapm_enable_pin (dapm,"Mic Jack" ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);return 0 ; }
sound/soc/omap/rx51.c +14 -11
@@ -58,19 +58,21 @@ static int rx51_jack_func;static void rx51_ext_control (struct snd_soc_codec *codec) { +struct snd_soc_dapm_context *dapm = &codec->dapm; +if (rx51_spk_func) -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" );else -snd_soc_dapm_disable_pin (codec,"Ext Spk" ); +snd_soc_dapm_disable_pin (dapm,"Ext Spk" );if (rx51_dmic_func) -snd_soc_dapm_enable_pin (codec,"DMic" ); +snd_soc_dapm_enable_pin (dapm,"DMic" );else -snd_soc_dapm_disable_pin (codec,"DMic" ); +snd_soc_dapm_disable_pin (dapm,"DMic" );gpio_set_value (RX51_TVOUT_SEL_GPIO , rx51_jack_func ==RX51_JACK_TVOUT ); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm); }static int rx51_startup (struct snd_pcm_substream *substream)
@@ -244,12 +246,13 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {static int rx51_aic34_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int err;/* Set up NC codec pins */ -snd_soc_dapm_nc_pin (codec,"MIC3L" ); -snd_soc_dapm_nc_pin (codec,"MIC3R" ); -snd_soc_dapm_nc_pin (codec,"LINE1R" ); +snd_soc_dapm_nc_pin (dapm,"MIC3L" ); +snd_soc_dapm_nc_pin (dapm,"MIC3R" ); +snd_soc_dapm_nc_pin (dapm,"LINE1R" );/* Add RX-51 specific controls */ err = snd_soc_add_controls(codec, aic34_rx51_controls,
@@ -258,13 +261,13 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)return err;/* Add RX-51 specific widgets */ -snd_soc_dapm_new_controls (codec, aic34_dapm_widgets, +snd_soc_dapm_new_controls (dapm, aic34_dapm_widgets,ARRAY_SIZE (aic34_dapm_widgets));/* Set up RX-51 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map)); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (dapm);/* AV jack detection */ err = snd_soc_jack_new(codec, "AV Jack",
sound/soc/omap/sdp3430.c +22 -21
61 lines not on this page · raw message
sound/soc/omap/sdp4430.c +10 -9
@@ -129,6 +129,7 @@ static const struct snd_soc_dapm_route audio_map[] = {static int sdp4430_twl6040_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;/* Add SDP4430 specific controls */
@@ -138,25 +139,25 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd)return ret;/* Add SDP4430 specific widgets */ - ret =snd_soc_dapm_new_controls (codec, sdp4430_twl6040_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, sdp4430_twl6040_dapm_widgets,ARRAY_SIZE (sdp4430_twl6040_dapm_widgets));if (ret)return ret;/* Set up SDP4430 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* SDP4430 connected pins */ -snd_soc_dapm_enable_pin (codec,"Ext Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_enable_pin (codec,"Headset Mic" ); -snd_soc_dapm_enable_pin (codec,"Headset Stereophone" ); +snd_soc_dapm_enable_pin (dapm,"Ext Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Headset Mic" ); +snd_soc_dapm_enable_pin (dapm,"Headset Stereophone" );/* TWL6040 not connected pins */ -snd_soc_dapm_nc_pin (codec,"AFML" ); -snd_soc_dapm_nc_pin (codec,"AFMR" ); +snd_soc_dapm_nc_pin (dapm,"AFML" ); +snd_soc_dapm_nc_pin (dapm,"AFMR" ); - ret =snd_soc_dapm_sync (codec); + ret =snd_soc_dapm_sync (dapm);return ret; }
sound/soc/omap/zoom2.c +18 -17
@@ -162,35 +162,36 @@ static const struct snd_soc_dapm_route audio_map[] = {static int zoom2_twl4030_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec; +struct snd_soc_dapm_context *dapm = &codec->dapm;int ret;/* Add Zoom2 specific widgets */ - ret =snd_soc_dapm_new_controls (codec, zoom2_twl4030_dapm_widgets, + ret =snd_soc_dapm_new_controls (dapm, zoom2_twl4030_dapm_widgets,ARRAY_SIZE (zoom2_twl4030_dapm_widgets));if (ret)return ret;/* Set up Zoom2 specific audio path audio_map */ -snd_soc_dapm_add_routes (codec, audio_map,ARRAY_SIZE (audio_map)); +snd_soc_dapm_add_routes (dapm, audio_map,ARRAY_SIZE (audio_map));/* Zoom2 connected pins */ -snd_soc_dapm_enable_pin (codec,"Ext Mic" ); -snd_soc_dapm_enable_pin (codec,"Ext Spk" ); -snd_soc_dapm_enable_pin (codec,"Headset Mic" ); -snd_soc_dapm_enable_pin (codec,"Headset Stereophone" ); -snd_soc_dapm_enable_pin (codec,"Aux In" ); +snd_soc_dapm_enable_pin (dapm,"Ext Mic" ); +snd_soc_dapm_enable_pin (dapm,"Ext Spk" ); +snd_soc_dapm_enable_pin (dapm,"Headset Mic" ); +snd_soc_dapm_enable_pin (dapm,"Headset Stereophone" ); +snd_soc_dapm_enable_pin (dapm,"Aux In" );/* TWL4030 not connected pins */ -snd_soc_dapm_nc_pin (codec,"CARKITMIC" ); -snd_soc_dapm_nc_pin (codec,"DIGIMIC0" ); -snd_soc_dapm_nc_pin (codec,"DIGIMIC1" ); -snd_soc_dapm_nc_pin (codec,"EARPIECE" ); -snd_soc_dapm_nc_pin (codec,"PREDRIVEL" ); -snd_soc_dapm_nc_pin (codec,"PREDRIVER" ); -snd_soc_dapm_nc_pin (codec,"CARKITL" ); -snd_soc_dapm_nc_pin (codec,"CARKITR" ); - - ret =snd_soc_dapm_sync (codec); +snd_soc_dapm_nc_pin (dapm,"CARKITMIC" ); +snd_soc_dapm_nc_pin (dapm,"DIGIMIC0" ); +snd_soc_dapm_nc_pin (dapm,"DIGIMIC1" ); +snd_soc_dapm_nc_pin (dapm,"EARPIECE" ); +snd_soc_dapm_nc_pin (dapm,"PREDRIVEL" );
Lines of this file are not shown. View the raw message.
sound/soc/pxa/corgi.c +27 -24
51 lines not on this page · raw message
sound/soc/pxa/spitz.c +36 -33
69 lines not on this page · raw message
sound/soc/s3c24xx/neo1973_gta02_wm8753.c +21 -20
41 lines not on this page · raw message
sound/soc/s3c24xx/neo1973_wm8753.c +63 -60
123 lines not on this page · raw message
sound/soc/s3c24xx/s3c24xx_simtec_hermes.c +8 -7
Lines of this file are not shown. View the raw message.
sound/soc/s3c24xx/s3c24xx_simtec_tlv320aic23.c +8 -7
Lines of this file are not shown. View the raw message.
sound/soc/soc-dapm.c +187 -168
355 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.2.3
Part of the diff is not shown here. View the raw message.
Mark Brown
AppliedRe: [PATCH] ASoC: Decouple DAPM from CODECs
Quoted 5 lines · Jarkko Nikula
From: Liam Girdwood <[email protected]>
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths.
Applied, thanks.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [RFC_i/iv 2/3] ASoC: Decouple DAPM from CODECs. Part codecs (will be squashed)
Quoted 11 lines · On Fri, 29 Oct 2010 15:00:17 +0300 Jarkko Nikula <[email protected]> wrote:
Core implementation:
Signed-off-by Liam Girdwood <[email protected]>[[email protected]: Fixes and conversions to
88pm860x-codec.c, alc5623,max98088.c,twl4060.c,uda1380.c,wm8731.c,wm8741.c,wm8753.c, wm8804,wm8904.c,wm8962.c,wm8971.candwm8985.c.
Fieldidle_bias_offremoved from structsnd_soc_codec. Affected codecs fixed to usedapm->idle_bias_off]Signed-off-by Jarkko Nikula <[email protected]>---
Hmm.. have to squash a patch below for cx20442.c, stac9766.c, wm8350.c and wm8994.c too into next version.
Signature · 2 lines
Jarkko ---
sound/soc/codecs/cx20442.c +3 -3
@@ -263,7 +263,7 @@ static void v253_close(struct tty_struct *tty)/* Prevent the codec driver from further accessing the modem */ codec->hw_write =NULL ; cx20442->control_data =NULL ; - codec->pop_time =0 ; + codec->dapm->pop_time =0 ; }/* Line discipline .hangup() */
@@ -291,7 +291,7 @@ static void v253_receive(struct tty_struct *tty,/* Set up codec driver access to modem controls */ cx20442->control_data = tty; codec->hw_write = (hw_write_t )tty->ops->write; - codec->pop_time =1 ; + codec->dapm->pop_time =1 ; } }
@@ -348,7 +348,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec) cx20442->control_data =NULL ; codec->hw_write =NULL ; - codec->pop_time =0 ; + codec->dapm->pop_time =0 ;return 0 ; }
sound/soc/codecs/stac9766.c +1 -0
@@ -24,6 +24,7 @@#include <sound/initval.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-dapm.h> #include <sound/tlv.h> #include "stac9766.h"
sound/soc/codecs/wm8350.c +10 -9
@@ -230,8 +230,9 @@ static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec)*/ static void wm8350_pga_work (struct work_struct *work) { -struct snd_soc_codec *codec = - container_of(work, struct snd_soc_codec, delayed_work.work); +struct snd_soc_dapm_context *dapm = + container_of(work, struct snd_soc_dapm_context, delayed_work.work); +struct snd_soc_codec *codec = dapm->codec;struct wm8350_data *wm8350_data =snd_soc_codec_get_drvdata (codec);struct wm8350_output *out1 = &wm8350_data->out1, *out2 = &wm8350_data->out2;
@@ -302,8 +303,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_UP ; out->active =1 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm->delayed_work)) +schedule_delayed_work (&codec->dapm->delayed_work,msecs_to_jiffies (1 ));break ;
@@ -311,8 +312,8 @@ static int pga_event(struct snd_soc_dapm_widget *w, out->ramp =WM8350_RAMP_DOWN ; out->active =0 ; -if (!delayed_work_pending (&codec->delayed_work)) -schedule_delayed_work (&codec->delayed_work, +if (!delayed_work_pending (&codec->dapm->delayed_work)) +schedule_delayed_work (&codec->dapm->delayed_work,msecs_to_jiffies (1 ));break ; }
@@ -1550,7 +1551,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)/* Put the codec into reset if it wasn't already */ wm8350_clear_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA ); -INIT_DELAYED_WORK (&codec->delayed_work, wm8350_pga_work); +INIT_DELAYED_WORK (&codec->dapm->delayed_work, wm8350_pga_work);/* Enable the codec */ wm8350_set_bits (wm8350,WM8350_POWER_MGMT_5 ,WM8350_CODEC_ENA );
@@ -1635,12 +1636,12 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) priv->mic.jack =NULL ;/* cancel any work waiting to be queued. */ - ret =cancel_delayed_work (&codec->delayed_work); + ret =cancel_delayed_work (&codec->dapm->delayed_work);/* if there was any work waiting then we run it now and * wait for its completion */ if (ret) { -schedule_delayed_work (&codec->delayed_work,0 ); +schedule_delayed_work (&codec->dapm->delayed_work,0 );flush_scheduled_work (); }
sound/soc/codecs/wm8994.c +1 -1
@@ -1837,7 +1837,7 @@ static int configure_clock(struct snd_soc_codec *codec)snd_soc_update_bits (codec,WM8994_CLOCKING_1 ,WM8994_SYSCLK_SRC , new); -snd_soc_dapm_sync (codec); +snd_soc_dapm_sync (codec->dapm);return 0 ; }
Re: [RFC_i/iv 2/3] ASoC: Decouple DAPM from CODECs. Part codecs (will be squashed)
In reply to a message not in the archiveQuoted 6 lines · Jarkko Nikula
Core implementation:
Signed-off-by Liam Girdwood <[email protected]>[[email protected]: Fixes and conversions to
88pm860x-codec.c, alc5623,max98088.c,twl4060.c,uda1380.c,wm8731.c,wm8741.c,wm8753.c, wm8804,wm8904.c,wm8962.c,wm8971.candwm8985.c.
This really needs a description of what the patch actually does. Most of this is a change to handle the code motion in patch 1 which needs to be squashed in with that to avoid bisection issues.
Quoted 2 lines
Field
idle_bias_offremoved from structsnd_soc_codec. Affected codecs fixed to usedapm->idle_bias_off]
This too. If there's other changes in here I probably missed them.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [RFC_i/iv 3/3] ASoC: Decouple DAPM from CODECs. Part platforms (will be squashed)
Quoted 4 lines · Jarkko Nikula
This patch de-couples DAPM from the CODEC in order for other components to have DAPM widgets.
Signed-off-by Jarkko Nikula <[email protected]>
I suspect this also needs squashing in with the previous patch. If we're going to split the series it'd be better to split things to move field by field rather than introduce bisection issues like this.
Re: [RFC_i/iv 3/3] ASoC: Decouple DAPM from CODECs. Part platforms (will be squashed)
Quoted 9 lines · On Fri, 29 Oct 2010 13:47:26 -0700 Mark Brown…
Quoted 4 lines · Jarkko Nikula
This patch de-couples DAPM from the CODEC in order for other components to have DAPM widgets.
Signed-off-by Jarkko Nikula <[email protected]>I suspect this also needs squashing in with the previous patch. If we're going to split the series it'd be better to split things to move field by field rather than introduce bisection issues like this.
Yep, the first RFC_i/iv was splitted mainly by the author to show what parts were from Liam and what from me. Sorry not being verbose enough that these were not meant to be independent patches like the patches in later sets.
I'd expect when the RFC_i/iv is ready, Liam will send it out so that kudos go to the right person who made the core implementation :-)
Signature · 1 line
Jarkko
Re: [RFC_i/iv 3/3] ASoC: Decouple DAPM from CODECs. Part platforms (will be squashed)
Quoted 2 lines · Jarkko Nikula
I'd expect when the RFC_i/iv is ready, Liam will send it out so that kudos go to the right person who made the core implementation :-)
Send it out with a From: at the top and git will DTRT :)