Skip to content

Commit

Permalink
ASoC: Pass component instead of DAPM context to AUX dev init callback
Browse files Browse the repository at this point in the history
Given that the component is the containing structure it makes more sense to pass
the component rather than the DAPM context to the AUX dev init callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Aug 19, 2014
1 parent 65d9361 commit 57bf772
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ struct snd_soc_aux_dev {
const struct device_node *codec_of_node;

/* codec/machine specific init - e.g. add machine controls */
int (*init)(struct snd_soc_dapm_context *dapm);
int (*init)(struct snd_soc_component *component);
};

/* SoC card */
Expand Down
6 changes: 4 additions & 2 deletions sound/soc/samsung/speyside.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ static struct snd_soc_dai_link speyside_dai[] = {
},
};

static int speyside_wm9081_init(struct snd_soc_dapm_context *dapm)
static int speyside_wm9081_init(struct snd_soc_component *component)
{
struct snd_soc_codec *codec = snd_soc_component_to_codec(component);

/* At any time the WM9081 is active it will have this clock */
return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK, 0,
return snd_soc_codec_set_sysclk(codec, WM9081_SYSCLK_MCLK, 0,
MCLK_AUDIO_RATE, 0);
}

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num)

/* do machine specific initialization */
if (aux_dev->init) {
ret = aux_dev->init(snd_soc_component_get_dapm(rtd->component));
ret = aux_dev->init(rtd->component);
if (ret < 0) {
dev_err(card->dev, "ASoC: failed to init %s: %d\n",
aux_dev->name, ret);
Expand Down

0 comments on commit 57bf772

Please sign in to comment.