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

Commit fe3e78e0 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Factor out snd_soc_init_card()



snd_soc_init_card() is always called as the last part of the CODEC probe
function so we can factor it out into the core card setup rather than
have each CODEC replicate the code to do the initialiastation. This will
be required to support multiple CODECs per card.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 2624d5fa
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -226,7 +226,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
/* pcm <-> DAI connect */
void snd_soc_free_pcms(struct snd_soc_device *socdev);
int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
int snd_soc_init_card(struct snd_soc_device *socdev);

/* set runtime hw params */
int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
+0 −3
Original line number Diff line number Diff line
@@ -117,9 +117,6 @@ static int ac97_soc_probe(struct platform_device *pdev)
	if (ret < 0)
		goto bus_err;

	ret = snd_soc_init_card(socdev);
	if (ret < 0)
		goto bus_err;
	return 0;

bus_err:
+0 −6
Original line number Diff line number Diff line
@@ -387,12 +387,6 @@ static int ad1836_probe(struct platform_device *pdev)
	snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths));
	snd_soc_dapm_new_widgets(codec);

	ret = snd_soc_init_card(socdev);
	if (ret < 0) {
		dev_err(codec->dev, "failed to register card: %d\n", ret);
		goto card_err;
	}

	return ret;

card_err:
+0 −6
Original line number Diff line number Diff line
@@ -596,12 +596,6 @@ static int ad1938_probe(struct platform_device *pdev)

	ad1938_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

	ret = snd_soc_init_card(socdev);
	if (ret < 0) {
		dev_err(codec->dev, "failed to register card: %d\n", ret);
		goto card_err;
	}

	return ret;

card_err:
+0 −5
Original line number Diff line number Diff line
@@ -257,11 +257,6 @@ static int ad1980_soc_probe(struct platform_device *pdev)

	snd_soc_add_controls(codec, ad1980_snd_ac97_controls,
				ARRAY_SIZE(ad1980_snd_ac97_controls));
	ret = snd_soc_init_card(socdev);
	if (ret < 0) {
		printk(KERN_ERR "ad1980: failed to register card\n");
		goto reset_err;
	}

	return 0;

Loading