ASoC: dapm: Handle SND_SOC_DAPM_REG() generically

Commit commit de9ba98b6d ("ASoC: dapm: Make widget power register settings more
flexible") added generic support for on_val/off_val in the DAPM core. With this
in place there is no need anymore for having a special event callback for
SND_SOC_DAPM_REG() widgets.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Lars-Peter Clausen 2014-05-11 19:27:47 +02:00 committed by Mark Brown
parent 0f9bd7b194
commit 94986198f5
2 changed files with 2 additions and 25 deletions

View File

@ -256,9 +256,8 @@ struct device;
/* generic widgets */ /* generic widgets */
#define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \
{ .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ { .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \
.reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ .reg = wreg, .shift = wshift, .mask = wmask, \
.on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ .on_val = won_val, .off_val = woff_val, }
.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
{ .id = snd_soc_dapm_supply, .name = wname, \ { .id = snd_soc_dapm_supply, .name = wname, \
SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
@ -362,8 +361,6 @@ struct regulator;
struct snd_soc_dapm_widget_list; struct snd_soc_dapm_widget_list;
struct snd_soc_dapm_update; struct snd_soc_dapm_update;
int dapm_reg_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event);
int dapm_regulator_event(struct snd_soc_dapm_widget *w, int dapm_regulator_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event); struct snd_kcontrol *kcontrol, int event);
int dapm_clock_event(struct snd_soc_dapm_widget *w, int dapm_clock_event(struct snd_soc_dapm_widget *w,

View File

@ -1058,26 +1058,6 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
return paths; return paths;
} }
/*
* Handler for generic register modifier widget.
*/
int dapm_reg_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
unsigned int val;
if (SND_SOC_DAPM_EVENT_ON(event))
val = w->on_val;
else
val = w->off_val;
soc_widget_update_bits(w, -(w->reg + 1),
w->mask << w->shift, val << w->shift);
return 0;
}
EXPORT_SYMBOL_GPL(dapm_reg_event);
/* /*
* Handler for regulator supply widget. * Handler for regulator supply widget.
*/ */