Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00200107 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: Move card field form platform/codec to component



Both the snd_soc_codec and snd_soc_platform struct do have a pointer to the
parent card and both handle this pointer in mostly the same way. This patch
moves the card field to the component level which will allow further code
consolidation between platforms and CODECS.

Since there are only a handful of users of the snd_soc_codec struct's card field
(and none of the snd_soc_platform's) these are update in this patch as well,
which allows it to be removed from the snd_soc_codec struct.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 093c4e5c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -691,6 +691,7 @@ struct snd_soc_component {
	int id;
	const char *name_prefix;
	struct device *dev;
	struct snd_soc_card *card;

	unsigned int active;

@@ -725,7 +726,6 @@ struct snd_soc_codec {
	const struct snd_soc_codec_driver *driver;

	struct mutex mutex;
	struct snd_soc_card *card;
	struct list_head list;
	struct list_head card_list;

@@ -863,7 +863,6 @@ struct snd_soc_platform {
	unsigned int suspended:1; /* platform is suspended */
	unsigned int probed:1;

	struct snd_soc_card *card;
	struct list_head list;

	struct snd_soc_component component;
+2 −2
Original line number Diff line number Diff line
@@ -89,8 +89,8 @@ static int ac97_soc_probe(struct snd_soc_codec *codec)
	int ret;

	/* add codec as bus device for standard ac97 */
	ret = snd_ac97_bus(codec->card->snd_card, 0, soc_ac97_ops, NULL,
			   &ac97_bus);
	ret = snd_ac97_bus(codec->component.card->snd_card, 0, soc_ac97_ops,
			   NULL, &ac97_bus);
	if (ret < 0)
		return ret;

+3 −3
Original line number Diff line number Diff line
@@ -253,7 +253,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->card->pop_time = 0;
	codec->component.card->pop_time = 0;
}

/* Line discipline .hangup() */
@@ -281,7 +281,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->card->pop_time = 1;
		codec->component.card->pop_time = 1;
	}
}

@@ -372,7 +372,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec)

	snd_soc_codec_set_drvdata(codec, cx20442);
	codec->hw_write = NULL;
	codec->card->pop_time = 0;
	codec->component.card->pop_time = 0;

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ static struct snd_soc_dai_driver uda134x_dai = {
static int uda134x_soc_probe(struct snd_soc_codec *codec)
{
	struct uda134x_priv *uda134x;
	struct uda134x_platform_data *pd = codec->card->dev->platform_data;
	struct uda134x_platform_data *pd = codec->component.card->dev->platform_data;
	const struct snd_soc_dapm_widget *widgets;
	unsigned num_widgets;

+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,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->card->widgets, list) {
	list_for_each_entry(w, &codec->component.card->widgets, list) {
		if (w->dapm != &codec->dapm)
			continue;
		if (strcmp(w->name, "LOUT1 PGA") == 0)
Loading