diff options
Diffstat (limited to 'sound/soc/intel/boards')
| -rw-r--r-- | sound/soc/intel/boards/bytcr_wm5102.c | 13 | ||||
| -rw-r--r-- | sound/soc/intel/boards/sof_rt5682.c | 10 | ||||
| -rw-r--r-- | sound/soc/intel/boards/sof_sdw.c | 51 | 
3 files changed, 43 insertions, 31 deletions
| diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c index 00384c6fbcaa..330c0ace1638 100644 --- a/sound/soc/intel/boards/bytcr_wm5102.c +++ b/sound/soc/intel/boards/bytcr_wm5102.c @@ -421,8 +421,17 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)  	priv->spkvdd_en_gpio = gpiod_get(codec_dev, "wlf,spkvdd-ena", GPIOD_OUT_LOW);  	put_device(codec_dev); -	if (IS_ERR(priv->spkvdd_en_gpio)) -		return dev_err_probe(dev, PTR_ERR(priv->spkvdd_en_gpio), "getting spkvdd-GPIO\n"); +	if (IS_ERR(priv->spkvdd_en_gpio)) { +		ret = PTR_ERR(priv->spkvdd_en_gpio); +		/* +		 * The spkvdd gpio-lookup is registered by: drivers/mfd/arizona-spi.c, +		 * so -ENOENT means that arizona-spi hasn't probed yet. +		 */ +		if (ret == -ENOENT) +			ret = -EPROBE_DEFER; + +		return dev_err_probe(dev, ret, "getting spkvdd-GPIO\n"); +	}  	/* override platform name, if required */  	byt_wm5102_card.dev = dev; diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 5d67a2c87a1d..4a90a0a5d831 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -69,11 +69,10 @@ static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |  static int is_legacy_cpu; -static struct snd_soc_jack sof_hdmi[3]; -  struct sof_hdmi_pcm {  	struct list_head head;  	struct snd_soc_dai *codec_dai; +	struct snd_soc_jack hdmi_jack;  	int device;  }; @@ -434,7 +433,6 @@ static int sof_card_late_probe(struct snd_soc_card *card)  	char jack_name[NAME_SIZE];  	struct sof_hdmi_pcm *pcm;  	int err; -	int i = 0;  	/* HDMI is not supported by SOF on Baytrail/CherryTrail */  	if (is_legacy_cpu || !ctx->idisp_codec) @@ -455,17 +453,15 @@ static int sof_card_late_probe(struct snd_soc_card *card)  		snprintf(jack_name, sizeof(jack_name),  			 "HDMI/DP, pcm=%d Jack", pcm->device);  		err = snd_soc_card_jack_new(card, jack_name, -					    SND_JACK_AVOUT, &sof_hdmi[i]); +					    SND_JACK_AVOUT, &pcm->hdmi_jack);  		if (err)  			return err;  		err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, -					  &sof_hdmi[i]); +					  &pcm->hdmi_jack);  		if (err < 0)  			return err; - -		i++;  	}  	if (sof_rt5682_quirk & SOF_MAX98373_SPEAKER_AMP_PRESENT) { diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 1f00679b4240..ad826ad82d51 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1398,6 +1398,33 @@ static struct snd_soc_card card_sof_sdw = {  	.late_probe = sof_sdw_card_late_probe,  }; +static void mc_dailink_exit_loop(struct snd_soc_card *card) +{ +	struct snd_soc_dai_link *link; +	int ret; +	int i, j; + +	for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { +		if (!codec_info_list[i].exit) +			continue; +		/* +		 * We don't need to call .exit function if there is no matched +		 * dai link found. +		 */ +		for_each_card_prelinks(card, j, link) { +			if (!strcmp(link->codecs[0].dai_name, +				    codec_info_list[i].dai_name)) { +				ret = codec_info_list[i].exit(card, link); +				if (ret) +					dev_warn(card->dev, +						 "codec exit failed %d\n", +						 ret); +				break; +			} +		} +	} +} +  static int mc_probe(struct platform_device *pdev)  {  	struct snd_soc_card *card = &card_sof_sdw; @@ -1462,6 +1489,7 @@ static int mc_probe(struct platform_device *pdev)  	ret = devm_snd_soc_register_card(&pdev->dev, card);  	if (ret) {  		dev_err(card->dev, "snd_soc_register_card failed %d\n", ret); +		mc_dailink_exit_loop(card);  		return ret;  	} @@ -1473,29 +1501,8 @@ static int mc_probe(struct platform_device *pdev)  static int mc_remove(struct platform_device *pdev)  {  	struct snd_soc_card *card = platform_get_drvdata(pdev); -	struct snd_soc_dai_link *link; -	int ret; -	int i, j; -	for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { -		if (!codec_info_list[i].exit) -			continue; -		/* -		 * We don't need to call .exit function if there is no matched -		 * dai link found. -		 */ -		for_each_card_prelinks(card, j, link) { -			if (!strcmp(link->codecs[0].dai_name, -				    codec_info_list[i].dai_name)) { -				ret = codec_info_list[i].exit(card, link); -				if (ret) -					dev_warn(&pdev->dev, -						 "codec exit failed %d\n", -						 ret); -				break; -			} -		} -	} +	mc_dailink_exit_loop(card);  	return 0;  } |