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

Commit 5d6be5aa authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown
Browse files

ASoC: codec: Simplify ASoC probe code.



For some CODEC drivers like who act as the MFDs children are ignored
by this patch.

Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent db5a5ee7
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -322,14 +322,6 @@ static struct snd_soc_dai_driver ad193x_dai = {
static int ad193x_codec_probe(struct snd_soc_codec *codec)
{
	struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = ad193x->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
		return ret;
	}

	/* default setting for ad193x */

@@ -347,7 +339,7 @@ static int ad193x_codec_probe(struct snd_soc_codec *codec)
	regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL0, 0x99); /* mclk=24.576Mhz: 0x9D; mclk=12.288Mhz: 0x99 */
	regmap_write(ad193x->regmap, AD193X_PLL_CLK_CTRL1, 0x04);

	return ret;
	return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_ad193x = {
+0 −7
Original line number Diff line number Diff line
@@ -1376,15 +1376,8 @@ static int adau1373_probe(struct snd_soc_codec *codec)
	struct adau1373_platform_data *pdata = codec->dev->platform_data;
	bool lineout_differential = false;
	unsigned int val;
	int ret;
	int i;

	ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
	if (ret) {
		dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
		return ret;
	}

	if (pdata) {
		if (pdata->num_drc > ARRAY_SIZE(pdata->drc_setting))
			return -EINVAL;
+0 −7
Original line number Diff line number Diff line
@@ -798,15 +798,8 @@ static struct snd_soc_dai_driver adav80x_dais[] = {

static int adav80x_probe(struct snd_soc_codec *codec)
{
	int ret;
	struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);

	ret = snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);
	if (ret) {
		dev_err(codec->dev, "failed to set cache I/O: %d\n", ret);
		return ret;
	}

	/* Force PLLs on for SYSCLK output */
	snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1");
	snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2");
+0 −9
Original line number Diff line number Diff line
@@ -388,15 +388,6 @@ static int ak4535_resume(struct snd_soc_codec *codec)

static int ak4535_probe(struct snd_soc_codec *codec)
{
	struct ak4535_priv *ak4535 = snd_soc_codec_get_drvdata(codec);
	int ret;

	codec->control_data = ak4535->regmap;
	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}
	/* power on device */
	ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

+0 −8
Original line number Diff line number Diff line
@@ -519,14 +519,6 @@ static int ak4641_resume(struct snd_soc_codec *codec)

static int ak4641_probe(struct snd_soc_codec *codec)
{
	int ret;

	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
	if (ret != 0) {
		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
		return ret;
	}

	/* power on device */
	ak4641_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

Loading