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

Commit 38cbf959 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: core: Try to use regmap if the driver doesn't set up any I/O



Since most new drivers are expected to use regmap and since frequently the
only thing we need to do in the CODEC probe function is configure the I/O
try to initialise the register I/O using regmap if the driver hasn't done
so after probe().

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 081413f2
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1095,6 +1095,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
		}
		}
	}
	}


	/* If the driver didn't set I/O up try regmap */
	if (!codec->control_data)
		snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP);

	if (driver->controls)
	if (driver->controls)
		snd_soc_add_codec_controls(codec, driver->controls,
		snd_soc_add_codec_controls(codec, driver->controls,
				     driver->num_controls);
				     driver->num_controls);