Unverified Commit e86a53fb authored by Viorel Suman's avatar Viorel Suman Committed by Mark Brown
Browse files

ASoC: ak4458: check reset control status

parent d63f2a88
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ static int ak4458_hw_params(struct snd_pcm_substream *substream,
	struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
	int pcm_width = max(params_physical_width(params), ak4458->slot_width);
	u8 format, dsdsel0, dsdsel1;
	int nfs1, dsd_bclk;
	int nfs1, dsd_bclk, ret;

	nfs1 = params_rate(params);
	ak4458->fs = nfs1;
@@ -419,8 +419,13 @@ static int ak4458_hw_params(struct snd_pcm_substream *substream,
	snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
			    AK4458_DIF_MASK, format);

	ak4458_rstn_control(component, 0);
	ak4458_rstn_control(component, 1);
	ret = ak4458_rstn_control(component, 0);
	if (ret)
		return ret;

	ret = ak4458_rstn_control(component, 1);
	if (ret)
		return ret;

	return 0;
}
@@ -429,6 +434,7 @@ static int ak4458_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
	struct snd_soc_component *component = dai->component;
	struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
	int ret;

	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
	case SND_SOC_DAIFMT_CBS_CFS: /* Slave Mode */
@@ -461,8 +467,13 @@ static int ak4458_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
				      ak4458->fmt == SND_SOC_DAIFMT_PDM ?
				      AK4458_DP_MASK : 0);

	ak4458_rstn_control(component, 0);
	ak4458_rstn_control(component, 1);
	ret = ak4458_rstn_control(component, 0);
	if (ret)
		return ret;

	ret = ak4458_rstn_control(component, 1);
	if (ret)
		return ret;

	return 0;
}