[alsa-devel] [PATCHv3 1/3] ASoC: codec: Simplify ASoC probe code.

Mark Brown broonie at kernel.org
Mon Mar 3 05:59:52 CET 2014


On Mon, Mar 03, 2014 at 10:42:22AM +0800, Xiubo Li wrote:

>  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);

Are you sure that the set_bias_level() call doesn't do anything with
I/O?  Can I suggest sending a patch that just does the drivers that only
do set_cache_io() and nothing else in probe - that would be really quick
and simple to fix.

> -	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;
> -	}
> -
>  	/* Default to using ALC auto offset calibration mode. */
>  	snd_soc_update_bits(codec, DA7213_ALC_CTRL1,
>  			    DA7213_ALC_CALIB_MODE_MAN, 0);

This one will fail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140303/537fbcea/attachment-0001.sig>


More information about the Alsa-devel mailing list